5405531ef94c7de04ccffcd0aa301528b4c5ec9f
[mmh] / h / aliasbr.h
1 /*
2 ** aliasbr.h -- definitions for the aliasing system
3 */
4
5 extern char *AliasFile;         /* mh-alias(5)             */
6 #define PASSWD "/etc/passwd"    /* passwd(5)               */
7 #define GROUP   "/etc/group"    /* group(5)                */
8 #define EVERYONE 200            /* lowest uid for everyone */
9
10 struct aka {
11         char *ak_name;          /* name to match against             */
12         struct adr *ak_addr;    /* list of addresses that it maps to */
13         struct aka *ak_next;    /* next aka in list                  */
14         char ak_visible;        /* should be visible in headers      */
15 };
16
17 struct adr {
18         char *ad_text;          /* text of this address in list        */
19         struct adr *ad_next;    /* next adr in list                    */
20         char ad_local;          /* text is local (check for expansion) */
21 };
22
23 /*
24 ** incore version of /etc/passwd
25 */
26 struct home {
27         char *h_name;           /* user name                             */
28         uid_t h_uid;            /* user id                               */
29         gid_t h_gid;            /* user's group                          */
30         char *h_home;           /* user's home directory                 */
31         char *h_shell;          /* user's shell                          */
32         int h_ngrps;            /* number of groups this user belongs to */
33         struct home *h_next;    /* next home in list                     */
34 };
35
36 struct home *seek_home (char *);
37
38 /*
39 ** prototypes
40 */
41 int alias (char *);
42 int akvisible (void);
43 void init_pw (void);
44 char *akresult (struct aka *);
45 char *akvalue (char *);
46 char *akerror (int);
47
48 /* codes returned by alias() */
49
50 #define AK_OK       0   /* file parsed ok        */
51 #define AK_NOFILE   1   /* couldn't read file    */
52 #define AK_ERROR    2   /* error parsing file    */
53 #define AK_LIMIT    3   /* memory limit exceeded */
54 #define AK_NOGROUP  4   /* no such group         */
55
56 /* should live here, not in mts.c */
57
58 extern int Everyone;
59 extern char *NoShell;