Initial revision
[mmh] / zotnet / bboards / bboards.h
1
2 /*
3  * bboards.h -- definition of a BBoard structure
4  *
5  * $Id$
6  */
7
8 #define BBOARDS "bboards"       /* name in /etc/passwd               */
9 #define BBDB    "BBoards"       /* file in BBOARDS' home directory   */
10 #define BBMODE  0644            /* default BBoards mode              */
11 #define DISTADR "dist-"         /* prefix for distribution addresses */
12
13 #ifdef POP
14 # define POPUID "pop"           /* name in /etc/passwd                  */
15 # define POPDB  "POP"           /* file in POPUID's home directory      */
16 # define POMODE 0600            /* default POP subscriber maildrop mode */
17 #endif /* POP */
18
19 #define BB_NULL    0x0000
20 #define BB_ARCH    0x0007       /* archive policy              */
21 #define BB_ASAV    0x0001       /* save in archives/ directory */
22 #define BB_AREM    0x0002       /* remove without saving       */
23 #define BB_INVIS   0x0010       /* invisible to bbc            */
24 #define BB_REMOTE  0x0020       /* remote to bbc               */
25 #define BB_SEEN    0x0040       /* seen by bbc                 */
26 #define BBITS      "\020\01ARCHIVE\02REMOVE\05INVIS\06REMOTE\07SEEN"
27
28 struct bboard {
29     char  *bb_name;             /* name of the bboard      */
30     char **bb_aka;              /* aliases for the bboards */
31
32     char  *bb_file;             /* file it resides in            */
33     char  *bb_archive;          /* file where archives reside    */
34     char  *bb_info;             /* file where maxima resides     */
35     char  *bb_map;              /* file where binary map resides */
36
37     char  *bb_passwd;           /* password for it       */
38     char **bb_leader;           /* list of local leaders */
39
40     char  *bb_addr;             /* network address                      */
41     char  *bb_request;          /* network address for requests         */
42     char  *bb_relay;            /* host acting as relay in local domain */
43     char **bb_dist;             /* distribution list                    */
44
45     unsigned int bb_flags;      /* various flags */
46
47     union {                     /* unassigned    */
48         unsigned int un_count;
49         long         un_mtime;
50     } bb_un;
51     
52     unsigned int bb_maxima;     /* highest BBoard-Id in it      */
53     char *bb_date;              /* date that maxima was written */
54
55     struct bboard *bb_next;     /* unassigned */
56     struct bboard *bb_link;     /* unassigned */
57     struct bboard *bb_chain;    /* unassigned */
58 };
59
60 #define bb_count bb_un.un_count
61 #define bb_mtime bb_un.un_mtime
62
63 /* flags for setbbent() */
64 #define SB_NULL 0x0000
65 #define SB_STAY 0x0001          /* stay open between calls */
66 #define SB_FAST 0x0002          /* fast parse of file      */
67
68
69 /*
70  * prototypes
71  */
72 int setbbfile (char *, int);
73 int setbbinfo (char *, char *, int);
74 int setpwinfo (struct passwd *, char *, int);
75 int setbbent (int);
76 int endbbent (void);
77 long getbbtime (void);
78 struct bboard *getbbent (void);
79 struct bboard *getbbnam (char *);
80 struct bboard *getbbaka (char *);
81 static void BBread (void);
82 int ldrbb (struct bboard *);
83 int ldrchk (struct bboard *);
84 struct bboard *getbbcpy (struct bboard *);
85 int getbbdist (struct bboard  *, int (*)());
86 char *getbberr (void);
87 void make_lower (char *, char *);
88