chiark / gitweb /
Merge branch 'running' of login.chiark.greenend.org.uk:public-git/inn-innduct
[innduct.git] / nnrpd / post.h
1 /*  $Id: post.h 6474 2003-09-15 07:32:56Z rra $
2 **
3 **  Net News Reading Protocol server.
4 */
5
6 typedef enum _HEADERTYPE {
7     HTobs,
8     HTreq,
9     HTstd
10 } HEADERTYPE;
11
12 typedef struct _HEADER {
13     const char * Name;
14     bool         CanSet;
15     HEADERTYPE   Type;
16     int          Size;
17     char *       Value; /* just after ':' in header */
18     char *       Body;  /* where actual body begins */
19     int          Len;   /* body length excluding trailing white spaces */
20 } HEADER;
21
22 #define HDR(_x) (Table[(_x)].Body)
23 #define HDR_SET(_x, _y) do { \
24     Table[(_x)].Body = Table[(_x)].Value = _y; \
25     if (_y == NULL) { \
26         Table[(_x)].Len = 0; \
27     } else { \
28         Table[(_x)].Len = strlen(_y); \
29     } \
30 } while (0)
31
32 #define HDR__PATH             0
33 #define HDR__FROM             1
34 #define HDR__NEWSGROUPS       2
35 #define HDR__SUBJECT          3
36 #define HDR__CONTROL          4
37 #define HDR__FOLLOWUPTO       6
38 #define HDR__DATE             7
39 #define HDR__ORGANIZATION     8
40 #define HDR__LINES            9
41 #define HDR__SENDER          10
42 #define HDR__APPROVED        11
43 #define HDR__DISTRIBUTION    12
44 #define HDR__EXPIRES         13
45 #define HDR__MESSAGEID       14
46 #define HDR__NNTPPOSTINGHOST 17
47 #define HDR__XTRACE          21
48 #define HDR__XCOMPLAINTSTO   22
49 #define HDR__NNTPPOSTINGDATE 23
50 #define HDR__CC              33
51 #define HDR__BCC             34
52 #define HDR__TO              35