1f6091940c6ee31da1bff23ae36a62633b307ae1
[mmh] / h / mf.h
1
2 /*
3  * mf.h -- include file for mailbox filters
4  *
5  * $Id$
6  */
7
8 #include <h/nmh.h>
9
10 #ifndef TRUE
11 # define TRUE 1
12 #endif
13
14 #ifndef FALSE
15 # define FALSE 0
16 #endif
17
18 #ifndef NOTOK
19 # define NOTOK (-1)
20 #endif
21
22 #ifndef OK
23 # define OK 0
24 #endif
25
26 #ifndef DONE
27 # define DONE 1
28 #endif
29
30 #define LINESIZ 512
31
32 #define MBXMODE 0600
33 #define TMPMODE 0600
34
35 #define OWIDTH  75              /* length of a header line */
36
37 #define HFROM   1               /* header has From: component    */
38 #define HSNDR   2               /* header has Sender: component  */
39 #define HADDR   3               /* header has address component  */
40 #define HDATE   4               /* header has Date: component    */
41 #define HOTHR   5               /* header is unimportant         */
42
43
44 struct adrx {
45     char *text;
46     char *pers;
47     char *mbox;
48     char *host;
49     char *path;
50     char *grp;
51     int ingrp;
52     char *note;
53     char *err;
54 };
55
56
57 /* 
58  *    Codes returned by uucp2mmdf(), mmdf2uucp()
59  */
60
61 #define MFOK    0               /* all went well                 */
62  /* remaining codes must > DONE  */
63 #define MFPRM   2               /* bad parameter                 */
64 #define MFSIO   3               /* stdio package went screwy     */
65 #define MFROM   4               /* from line was bad             */
66 #define MFHDR   5               /* headers were bad              */
67 #define MFTXT   6               /* text was bad                  */
68 #define MFERR   7               /* I/O or system error           */
69 #define MFDLM   8               /* Bad delimiter in MMDF file    */
70
71
72 /*
73  * prototypes
74  */
75 int isfrom(char *);
76 int lequal (unsigned char *, unsigned char *);
77 int mfgets (FILE *, char **);
78 char *legal_person (char *);
79 struct adrx *seekadrx (char *);
80 struct adrx *getadrx (char *);
81 struct adrx *uucpadrx (char *);
82