home *** CD-ROM | disk | FTP | other *** search
- /*
- * Header for uqwk
- */
-
- #define PATH_LEN (128) /* Length for file names, etc. */
- #define BUF_LEN (1024) /* Length of general purpose buffer */
-
- #define QWK_EOL (227) /* QWK end-of-line */
- #define QWK_ACT_FLAG (225) /* Active message flag */
- #define QWK_PUBLIC ' ' /* Public message flags */
- #define QWK_PUBLIC2 '-'
- #define QWK_PRIVATE '+' /* Private message flags */
- #define QWK_PRIVATE2 '*'
-
- #define MAILER_PATH "mail" /* Where to find mailer */
- #define INEWS_PATH "/usr/lib/news/inews" /* Where to find inews */
-
- #define MAIL_CONF_NAME "Email"
-
- /* Defaults */
- #define DEF_MAIL_DIR "/usr/spool/mail"
- #define DEF_DO_MAIL (1)
- #define DEF_DO_NEWS (0)
- #define DEF_INC_HDRS (1)
- #define DEF_PRT_OPTS (0)
- #define DEF_READ_ONLY (0)
- #define DEF_MAX_BLKS (4000) /* That's half a megabyte */
- #define DEF_HOME_DIR "."
- #define DEF_USER_NAME "unknown"
- #define DEF_MAIL_FILE "unknown"
- #define DEF_BBS_NAME "unknown BBS"
- #define DEF_BBS_CITY "Anytown, USA"
- #define DEF_BBS_PHONE "555-1212"
- #define DEF_BBS_SYSOP "Joe Sysop"
- #define DEF_BBS_ID "0,SOMEBBS"
- #define DEF_ACT_FILE "/usr/lib/news/active"
- #define DEF_NRC_FILE "unknown"
- #define DEF_NEWS_DIR "/usr/spool/news"
- #define DEF_REP_FILE "none"
-
- /* Runtime options */
- int do_mail; /* Process mail? */
- int do_news; /* Process news? */
- int inc_hdrs; /* Include headers in messages? */
- int prt_opts; /* Just display options; no processing */
- int read_only; /* Don't rewrite mail spool and .newsrc */
- int max_blks; /* Maximum blocks per QWK packet */
-
- char mail_file[PATH_LEN]; /* mail spool */
- char mail_dir[PATH_LEN]; /* dir for mail spool */
- char home_dir[PATH_LEN]; /* home directory */
- char user_name[PATH_LEN]; /* user's login name */
- char bbs_name[PATH_LEN]; /* BBS name */
- char bbs_city[PATH_LEN]; /* BBS city */
- char bbs_phone[PATH_LEN]; /* BBS phone number */
- char bbs_sysop[PATH_LEN]; /* BBS sysop name */
- char bbs_id[PATH_LEN]; /* BBS ID */
- char act_file[PATH_LEN]; /* Active file */
- char nrc_file[PATH_LEN]; /* .newsrc file */
- char news_dir[PATH_LEN]; /* News spool dir */
- char rep_file[PATH_LEN]; /* Reply packet file name */
-
- char *getenv();
- char *Fgets();
- struct act_ent *FindActive();
-
- /* Various globals */
- char *progname; /* Program name */
- int msg_cnt; /* Total number of messages */
- int conf_cnt; /* Total number of conferences */
- FILE *msg_fd; /* MESSAGES.DAT file desc */
- FILE *ctl_fd; /* CONTROL.DAT file desc */
- FILE *ndx_fd; /* xxx.NDX file desc */
- FILE *act_fd; /* Active file file desc */
- FILE *nrc_fd; /* .newsrc file desc */
- FILE *rep_fd; /* Reply packet file desc */
- unsigned char buf[BUF_LEN]; /* General purpose buffer */
- int blk_cnt; /* Blocks written to messages.dat */
-
- /* This is the stuff we remember about each spooled mail message */
- struct mail_ent
- {
- long begin; /* Offset of start of header */
- long text; /* Offset to end of header, start of text */
- long end; /* Offset to start of next message */
- struct mail_ent *next; /* Pointer to next */
- } *mail_list;
-
- /* This is stuff we remember about each "conference" */
- struct conf_ent
- {
- char *name; /* Conference name */
- int number; /* Conference number */
- struct conf_ent *next; /* Pointer to next */
- } *conf_list, *last_conf;
-
- /* This is the QWK message header format */
- struct qwk_hdr
- {
- unsigned char status;
- unsigned char number[7];
- unsigned char date[8];
- unsigned char time[5];
- unsigned char to[25];
- unsigned char from[25];
- unsigned char subject[25];
- unsigned char password[12];
- unsigned char refer[8];
- unsigned char blocks[6];
- unsigned char flag;
- unsigned char conference[2];
- unsigned char msg_num[2];
- unsigned char tag;
- };
-
- struct qwk_hdr rep_hdr; /* Header for replies */
-
- /* Stuff we remember about each active newsgroup */
- struct act_ent
- {
- char *name; /* Newsgroup name */
- int hi; /* High article number */
- int lo; /* Low article number */
- struct act_ent *next; /* Pointer to next */
- } *act_list;
-
- /* Stuff we remember about the .newsrc file */
- struct nrc_ent
- {
- char *name; /* Newsgroup name */
- int subscribed; /* Subscribed flag */
- int hi; /* High article number */
- int conf; /* Corresponding conference number */
- struct nrc_ent *next; /* Pointer to next */
- } *nrc_list;
-
-