home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / relay / headers.h < prev    next >
C/C++ Source or Header  |  1993-01-13  |  2KB  |  45 lines

  1. /*
  2.  * All the article header values worth retaining.
  3.  * (strictly from headers in input.)
  4.  *
  5.  * All members of struct headers must point at malloced memory so that
  6.  * freeheaders() can free it without having to keep track of what's
  7.  * malloced and what's static.
  8.  *
  9.  * Furthermore, each member of headers must point at its own private copy
  10.  * of its value string, for the above reason, and no code outside hdr*.c
  11.  * may copy any member nor a modified copy of any member, though it may
  12.  * copy the string pointed to by a (possibly modified) member.
  13.  *
  14.  * Perhaps C++ would allow this to be enforced by a strings class; too bad
  15.  * it's picked up so much Simula baggage (refs, ptui!).  (See section 6.9
  16.  * of The C++ Programming Language for a candidate class.)
  17.  */
  18. struct headers {
  19.     char *h_subj;    /* subject: only needed for controls, -> h_ctlcmd */
  20.     char *h_ngs;    /* newsgroups: used in filing, sys matching */
  21.     char *h_distr;    /* distribution for transmit */
  22.     char *h_ctlcmd;    /* control command (NCMP) */
  23.     char *h_etctlcmd;    /* also-control command (NCMP) */
  24.     char *h_approved;    /* acceptance in moderated groups */
  25.     char *h_msgid;    /* history & rejection */
  26.     char *h_artid;    /* history & rejection (obs.) */
  27.     char *h_expiry;    /* history */
  28.     char *h_path;    /* transmit - must munge */
  29.     char *h_sender;    /* transmit in case of moderation */
  30.     char *h_date;    /* reject stale articles */
  31.     char *h_from;    /* merely required */
  32.     char *h_xref;    /* incoming Xref: for -b only; delete on contact */
  33. };
  34.  
  35. /* common */
  36. extern void hdrdebug(), hdrinit(), freeheaders();
  37.  
  38. /* munge */
  39. extern void emitxref(), hdrdump(), hdrdigest();
  40.  
  41. /* parse */
  42. extern void hdrdeflt();
  43. extern boolean ishdr(), contin();
  44. extern char *hdrreq();
  45.