home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume22 / nn6.4 / part21 / news.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  2.2 KB  |  87 lines

  1. /*
  2.  *    (c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
  3.  *
  4.  *    Interface for decoding article headers.
  5.  */
  6.  
  7. struct news_header {
  8.  
  9.     int    ng_flag;    /* flags:            */
  10. #      define N_DIGEST 1    /*   article is part of a digest*/
  11. #      define N_MODERATED 2    /*   group is moderated        */
  12.  
  13.     off_t    ng_fpos;    /* position of article text    */
  14.     off_t    ng_lpos;    /* last text offset
  15.                 /* header lines:        */
  16.     char    *ng_from;    /*   from            */
  17.     char    *ng_name;    /*   senders name        */
  18.     char    *ng_subj;    /*   subject            */
  19.     char    *ng_groups;    /*   newsgroups            */
  20.     char    *ng_path;    /*   path            */
  21.     char    *ng_reply;    /*   reply-to            */
  22.     char    *ng_ident;    /*   message id            */
  23.     char    *ng_follow;    /*   followup to        */
  24.     char    *ng_ref;    /*   references            */
  25.     char    *ng_keyw;    /*   keywords            */
  26.     char    *ng_dist;    /*   distibution        */
  27.     char    *ng_org;    /*   organization        */
  28.     char    *ng_appr;    /*   approved            */
  29.     char    *ng_summ;    /*   summary            */
  30.  
  31.     char    *ng_date;    /*   date            */
  32.  
  33.     char    *ng_rdate;    /*   date-received (News 3)    */
  34.     char    *ng_bref;    /*   back-references (News 3)    */
  35.  
  36.     char    *ng_xlines;    /*   lines (from header)    */
  37.     int    ng_lines;    /*   lines (decoded)        */
  38. } news;
  39.  
  40.  
  41. /*
  42.  * digest article subheader
  43.  */
  44.  
  45. struct digest_header {
  46.     off_t    dg_hpos;    /* position of article header    */
  47.     off_t    dg_fpos;    /* position of article text    */
  48.     off_t    dg_lpos;    /* last text position        */
  49.                 /* header lines:        */
  50.     char    *dg_date;    /*   date            */
  51.     char    *dg_from;    /*   from            */
  52.     char    *dg_subj;    /*   subject            */
  53.     char    *dg_to;        /*   to                */
  54.  
  55.     int    dg_lines;    /*   lines (pseudo field)    */
  56. } digest;
  57.  
  58.  
  59. #define    NEWS_HEADER_BUFFER    2048
  60.  
  61. typedef char    news_header_buffer[NEWS_HEADER_BUFFER];
  62.  
  63.  
  64. FILE *open_news_article(/* header, modes [, buffer1 [, buffer2]] */);
  65.  
  66. /* modes */
  67.  
  68. #define    FILL_NEWS_HEADER    0x0001    /* parse first header -> buffer1 */
  69. #define    FILL_DIGEST_HEADER    0x0002    /* parse second header -> buffer[12] */
  70.  
  71.  
  72. #define    GET_ALL_FIELDS        0x0010    /* get all fields (otherwise only   */
  73.                     /* name, subj, groups, lines        */
  74.  
  75. #define    GET_DATE_ONLY        0x0020    /* get Date field            */
  76.  
  77. #define    FILL_OFFSETS        0x0080    /* fill ng_[hfl]pos */
  78.  
  79.  
  80. #define    DIGEST_CHECK        0x0100    /* set N_DIGEST if "digest" in subj */
  81.                     /* only valid with FILL_NEWS_HEADER */
  82. #define LAZY_BODY        0x0200    /* nntp: get body only for digests */
  83.  
  84.  
  85. #define    SKIP_HEADER        0x1000    /* position after (sub) header */
  86.  
  87.