home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume36 / uqwk / part01 / uqwk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-11  |  4.1 KB  |  137 lines

  1. /*
  2.  *  Header for uqwk
  3.  */
  4.  
  5. #define    PATH_LEN    (128)    /* Length for file names, etc. */
  6. #define BUF_LEN        (1024)    /* Length of general purpose buffer */
  7.  
  8. #define QWK_EOL        (227)    /* QWK end-of-line */
  9. #define QWK_ACT_FLAG    (225)    /* Active message flag */
  10. #define QWK_PUBLIC    ' '    /* Public message flags */
  11. #define QWK_PUBLIC2    '-'
  12. #define QWK_PRIVATE    '+'    /* Private message flags */
  13. #define QWK_PRIVATE2    '*'
  14.  
  15. #define MAILER_PATH    "mail"    /* Where to find mailer */
  16. #define INEWS_PATH    "/usr/lib/news/inews"    /* Where to find inews */
  17.  
  18. #define MAIL_CONF_NAME  "Email"
  19.  
  20. /* Defaults */
  21. #define    DEF_MAIL_DIR    "/usr/spool/mail"
  22. #define DEF_DO_MAIL    (1)
  23. #define DEF_DO_NEWS    (0)
  24. #define DEF_INC_HDRS    (1)
  25. #define DEF_PRT_OPTS    (0)
  26. #define DEF_READ_ONLY    (0)
  27. #define DEF_MAX_BLKS    (4000)    /* That's half a megabyte */
  28. #define DEF_HOME_DIR    "."
  29. #define DEF_USER_NAME    "unknown"
  30. #define DEF_MAIL_FILE    "unknown"
  31. #define DEF_BBS_NAME    "unknown BBS"
  32. #define DEF_BBS_CITY    "Anytown, USA"
  33. #define DEF_BBS_PHONE    "555-1212"
  34. #define DEF_BBS_SYSOP    "Joe Sysop"
  35. #define DEF_BBS_ID    "0,SOMEBBS"
  36. #define DEF_ACT_FILE    "/usr/lib/news/active"
  37. #define DEF_NRC_FILE    "unknown"
  38. #define DEF_NEWS_DIR    "/usr/spool/news"
  39. #define DEF_REP_FILE    "none"
  40.  
  41. /* Runtime options */
  42. int do_mail;            /* Process mail? */
  43. int do_news;            /* Process news? */
  44. int inc_hdrs;            /* Include headers in messages? */
  45. int prt_opts;            /* Just display options; no processing */
  46. int read_only;            /* Don't rewrite mail spool and .newsrc */
  47. int max_blks;            /* Maximum blocks per QWK packet */
  48.  
  49. char mail_file[PATH_LEN];    /* mail spool */
  50. char mail_dir[PATH_LEN];    /* dir for mail spool */
  51. char home_dir[PATH_LEN];    /* home directory */
  52. char user_name[PATH_LEN];    /* user's login name */
  53. char bbs_name[PATH_LEN];    /* BBS name */
  54. char bbs_city[PATH_LEN];    /* BBS city */
  55. char bbs_phone[PATH_LEN];    /* BBS phone number */
  56. char bbs_sysop[PATH_LEN];    /* BBS sysop name */
  57. char bbs_id[PATH_LEN];        /* BBS ID */
  58. char act_file[PATH_LEN];    /* Active file */
  59. char nrc_file[PATH_LEN];    /* .newsrc file */
  60. char news_dir[PATH_LEN];    /* News spool dir */
  61. char rep_file[PATH_LEN];    /* Reply packet file name */
  62.  
  63. char *getenv();
  64. char *Fgets();
  65. struct act_ent *FindActive();
  66.  
  67. /* Various globals */
  68. char *progname;            /* Program name */
  69. int msg_cnt;            /* Total number of messages */
  70. int conf_cnt;            /* Total number of conferences */
  71. FILE *msg_fd;            /* MESSAGES.DAT file desc */
  72. FILE *ctl_fd;            /* CONTROL.DAT file desc */
  73. FILE *ndx_fd;            /* xxx.NDX file desc */
  74. FILE *act_fd;            /* Active file file desc */
  75. FILE *nrc_fd;            /* .newsrc file desc */
  76. FILE *rep_fd;            /* Reply packet file desc */
  77. unsigned char buf[BUF_LEN];    /* General purpose buffer */
  78. int blk_cnt;            /* Blocks written to messages.dat */
  79.  
  80. /* This is the stuff we remember about each spooled mail message */
  81. struct mail_ent
  82. {
  83.     long begin;        /* Offset of start of header */
  84.     long text;        /* Offset to end of header, start of text */
  85.     long end;        /* Offset to start of next message */
  86.     struct mail_ent *next;    /* Pointer to next */
  87. } *mail_list;
  88.  
  89. /* This is stuff we remember about each "conference" */
  90. struct conf_ent
  91. {
  92.     char *name;        /* Conference name */
  93.     int number;        /* Conference number */
  94.     struct conf_ent *next;    /* Pointer to next */
  95. } *conf_list, *last_conf;
  96.  
  97. /* This is the QWK message header format */
  98. struct qwk_hdr
  99. {
  100.     unsigned char status;
  101.     unsigned char number[7];
  102.     unsigned char date[8];
  103.     unsigned char time[5];
  104.     unsigned char to[25];
  105.     unsigned char from[25];
  106.     unsigned char subject[25];
  107.     unsigned char password[12];
  108.     unsigned char refer[8];
  109.     unsigned char blocks[6];
  110.     unsigned char flag;
  111.     unsigned char conference[2];
  112.     unsigned char msg_num[2];
  113.     unsigned char tag;
  114. };
  115.  
  116. struct qwk_hdr rep_hdr;        /* Header for replies */
  117.  
  118. /* Stuff we remember about each active newsgroup */
  119. struct act_ent
  120. {
  121.     char *name;        /* Newsgroup name */
  122.     int hi;            /* High article number */
  123.     int lo;            /* Low article number */
  124.     struct act_ent *next;    /* Pointer to next */
  125. } *act_list;
  126.  
  127. /* Stuff we remember about the .newsrc file */
  128. struct nrc_ent
  129. {
  130.     char *name;        /* Newsgroup name */
  131.     int subscribed;        /* Subscribed flag */
  132.     int hi;            /* High article number */
  133.     int conf;        /* Corresponding conference number */
  134.     struct nrc_ent *next;    /* Pointer to next */
  135. } *nrc_list;
  136.  
  137.