home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume28 / yapp / part01 / struct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-29  |  3.8 KB  |  111 lines

  1. /* STRUCT.H: @(#)struct.h 1.14 93/06/06 Copyright (c)1993 thalerd */
  2. #include <stdio.h>
  3. #include <sys/types.h>
  4.  
  5. /* Flag type */
  6. typedef unsigned long flag_t; /* expand type when we need > 16 option flags */
  7.  
  8. /* Command line option flag */
  9. typedef struct {
  10.     char   *name;     /* name used with define, change */
  11.     flag_t  mask;     /* bitmask */
  12.     char    deflt;
  13. } option_t;
  14.  
  15. /* Macros */
  16. typedef struct {
  17.    char          *name;
  18.    unsigned short mask;
  19.    char          *value;
  20. } macro_t;
  21.  
  22. /* Error */
  23. typedef struct {
  24.     int     severity; /* severity level, 0 informational */
  25.     char   *message;  /* Format string for printing error */
  26. } error_t;
  27.  
  28. typedef struct {
  29.    char  *name;
  30.    int   token_type;
  31. } keyword_t;
  32.  
  33. typedef struct {
  34.    char *name;
  35.    char *location;
  36. } assoc_t;
  37.  
  38. typedef struct {
  39.    short  flags,nr;
  40.    time_t last,first;
  41. /* char  *subj;  Subj must be separate so sum.c can block dump sum file */
  42. } sumentry_t;
  43.  
  44. typedef struct {
  45.    short nr;
  46.    long  last;
  47. } partentry_t;
  48.  
  49. typedef struct {
  50.    char *name;
  51.    int (*func)PROTO((int,char **));
  52. } dispatch_t;
  53.  
  54. /* Global status structure */
  55. typedef struct {
  56. unsigned char c_security;          /* cf security type */
  57. #ifdef NEWS
  58.    long   c_article;               /* highest article # seen */
  59. #endif
  60.    short  c_status,                /* cf status flags */
  61.           i_first,                 /* first item in conference */
  62.           i_last,                  /* last item in conference */
  63.           i_current,               /* current item */
  64.       i_newresp,               /* # of old items with new responses */
  65.       i_brandnew,              /* # of brand new items */
  66.       i_unseen,                /* # of unseen items */
  67.           i_numitems,              /* total # of items */
  68.           r_first,                 /* first resp to process */
  69.           r_last,                  /* last resp to process */
  70.           r_current,               /* current response */
  71.           r_max,                   /* highest response # of current item */
  72.           r_lastseen,              /* highest response # seen */
  73.           l_current;               /* current line # of response */
  74.    char   fullname[MAX_LINE_LENGTH]; /* fullname in current cf */
  75.  
  76.    /* Range specifiers */
  77.    char   string[MAX_LINE_LENGTH]; /* "string" range           */
  78.    char   author[MAX_LINE_LENGTH]; /* author (login) specified */
  79.    short  rng_flags;               /* item status flags for range */
  80.    time_t since,                   /* since <date> range */
  81.           before;                  /* before <date> range */
  82.  
  83.    off_t  mailsize;                /* last size of mailbox */
  84.    time_t listtime,                /* lastmod of .cflist */
  85.           sumtime,                 /* lastmod of sum file */
  86.           parttime;                /* lastmod of participation file */
  87.    FILE  *outp;                    /* output stream (pager) pointer */
  88.    FILE  *inp;                     /* input stream pointer */
  89.    short  opt_flags,               /* option flags */
  90.           count;                   /* count of something */
  91. } status_t;
  92.  
  93. /* Response */
  94. typedef struct {
  95.    char  *fullname; /* Author's full name                   */
  96.    char  *login;    /* Author's login                       */
  97.    uid_t  uid;      /* Author's UID                         */
  98.    short  flags;
  99.    char **text;     /* The actual text lines                */
  100.    short  numchars; /* How many characters in the response? */
  101.    time_t date;     /* Timestamp of entry                   */
  102.    long   offset,   /* Offset to start of ,R line           */
  103.           textoff,  /* Offset to start of actual text       */
  104.           endoff;   /* Offset to start of next response     */
  105.    short  parent;   /* This is a response to what # (+1)?   */
  106. #ifdef NEWS
  107.    char  *mid;      /* Message ID string (for Usenet)       */
  108.    long   article;  /* Article number    (for Usenet)       */
  109. #endif
  110. } response_t;
  111.