1 /* 2 ** NetNews Reading Protocol server. 3 */ 4 5 typedef enum _HEADERTYPE 6 { 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 field. */ 18 char *Body; /* Where actual body begins. */ 19 int Len; /* Body length excluding trailing white spaces. */ 20 } HEADER; 21 22 extern HEADER Table[]; 23 extern HEADER *EndOfTable; 24 extern char **OtherHeaders; 25 extern size_t OtherCount; 26 27 #define HDR(_x) (Table[(_x)].Body) 28 #define HDR_SET(_x, _y) \ 29 do { \ 30 Table[(_x)].Body = _y; \ 31 Table[(_x)].Value = _y; \ 32 if (_y == NULL) { \ 33 Table[(_x)].Len = 0; \ 34 } else { \ 35 Table[(_x)].Len = strlen(_y); \ 36 } \ 37 } while (0) 38 #define HDR_CLEAR(_x) \ 39 do { \ 40 Table[(_x)].Body = NULL; \ 41 Table[(_x)].Value = NULL; \ 42 Table[(_x)].Len = 0; \ 43 } while (0) 44 45 #define HDR__PATH 0 46 #define HDR__FROM 1 47 #define HDR__NEWSGROUPS 2 48 #define HDR__SUBJECT 3 49 #define HDR__CONTROL 4 50 #define HDR__FOLLOWUPTO 6 51 #define HDR__DATE 7 52 #define HDR__ORGANIZATION 8 53 #define HDR__LINES 9 54 #define HDR__SENDER 10 55 #define HDR__APPROVED 11 56 #define HDR__DISTRIBUTION 13 57 #define HDR__EXPIRES 14 58 #define HDR__MESSAGEID 15 59 #define HDR__INJECTION_DATE 26 60 #define HDR__INJECTION_INFO 27 61 #define HDR__CC 34 62 #define HDR__BCC 35 63 #define HDR__TO 36 64