home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff319.lzh / CNewsSrc / cnews.orig.lzh / rna / defs.h < prev    next >
C/C++ Source or Header  |  1989-06-27  |  5KB  |  181 lines

  1. #include <sys/types.h>
  2. #include <sys/stat.h>
  3. #include <sys/dir.h>
  4. #include <stdio.h>
  5. #include <ctype.h>
  6. #include <time.h>
  7. #ifdef USG
  8. #include <fcntl.h>
  9. #endif
  10. #include <signal.h>
  11. #include <sgtty.h>
  12. #include "at.h"
  13.  
  14. #define NEWSVERSION     "B UNSW 1.1 19 Sep 1984"
  15.  
  16. /* Things that very well may require local configuration */
  17.  
  18. #define TIMEZONE    "EST"        /* name of time zone */
  19.  
  20. #define DFLTSUB "general,general.all"    /* default subscription list    */
  21. #define    ADMSUB    "general"        /* Mandatory subscription list */
  22. #define MODGROUPS "mod.all,all.mod,all.announce"    /* Moderated groups */
  23. #define DFLTGRP    "general"        /* default newsgroup (for postnews) */
  24. /* #define MANGRPS     1        /* if you have mandatory subscriptions
  25.                        tailored per-person (uses
  26.                        getclasses()) */
  27. /*#define OZ    1*/            /* if on Australian network, used
  28.                        in readnews to get correct return
  29.                        address */
  30. /*#define AUSAM    1*/            /* hashed passwd file, locked files */
  31. #if AUSAM
  32. #include <passwd.h>
  33. #else
  34. #include <pwd.h>
  35. #endif
  36.  
  37. #ifdef vax
  38. /* #define NETPATH    1        /* if you have path finding program
  39.                        /bin/netpath */
  40. #endif
  41. /*#define UNSWMAIL 1*/            /* if you have UNSW "mail" which
  42.                        allows "-s subject -i include_file"
  43.                        arguments */
  44. #define NETID "utzoo"
  45. #ifndef NETID
  46. #define NETID "utstat"            /* else define it here */
  47. #endif
  48.  
  49. #ifndef NETID
  50. #include <table.h>            /* UNSW only */
  51. #endif
  52.  
  53. /* #define MC "/usr/bin/p"            /* pager */
  54. #define UUNAME "/usr/bin/uuname"
  55. #define RNEWS    "exec rnews"        /* rnews for uurec to fork */
  56. #define POSTNEWS "/usr/bin/inews"
  57. #define CHOWN    "/etc/chown"        /* pathname of chown command */
  58. #define SHELL    "/bin/sh"        /* if not bourne shell see postnews.c */
  59. #define MKDIR    "/bin/mkdir"
  60. #define MAIL    "/bin/mail"
  61. #if UNSWMAIL
  62. #define FASTMAIL    "/bin/mail"
  63. #else
  64. #define FASTMAIL    MAIL
  65. #endif
  66.  
  67. #define HELP    "/usr/lib/news/help.readnews"        /* Help text */
  68. #define SEQ    "/usr/lib/news/seq"        /* Next sequence number */
  69. #define SYS    "/usr/lib/news/sys"        /* System subscription lists */
  70. #define ACTIVE    "/usr/lib/news/active"        /* Active newsgroups */
  71. #define HISTORY "/usr/lib/news/history"        /* Current articles */
  72.  
  73. #define MYDOMAIN "uucp"            /* Local domain */
  74. #define MYORG    "U of Toronto Zoology" /* My organization */
  75. #define NEWSROOT "news"            /* news editor */
  76.  
  77. /* Things you might want to change */
  78.  
  79. #define NEWSRC  ".newsrc"        /* name of .newsrc file */
  80. #define    PAGESIZE 24            /* lines on screen */
  81. #define ARTICLES "articles"        /* default place to save articles */
  82. #define NEGCHAR    '!'            /* newsgroup negation character    */
  83. #define NEGS    "!"            /* ditto (string) */
  84. #define BADGRPCHARS "/#!"        /* illegal chars in group name */
  85. #define BUFLEN    256            /* standard buffer size */
  86. #define ED    "/bin/ed"        /* default, if $EDITOR not set */
  87.  
  88. /* Things you probably won't want to change */
  89.  
  90. #define    NGSEPCHAR ','    /* delimit character in news group line        */
  91. #define NGSEPS    ","    /* ditto */
  92. #define PSEPS "!"    /* separator in Path: */
  93. #define PSEPCHAR '!'    /* ditto */
  94. #define PATHPREF "..!"    /* prefix for addresses worked out from Path: */
  95. #define TRUE    1
  96. #define FALSE    0
  97.  
  98. #ifndef F_SETFD
  99. #ifdef F_SETFL
  100. #define F_SETFD F_SETFL        /* SETFL becomes SETFD (close on exec arg
  101.                    to fcntl) */
  102. #endif
  103. #endif
  104.  
  105. typedef enum booltype { false = 0, true } bool;
  106. typedef enum applytype { stop, next, nextgroup, searchgroup } applycom;
  107. typedef applycom (*apcmfunc)();
  108. typedef enum pheadtype { printing, passing, making } pheadcom;
  109.  
  110. /*
  111.  * header structure
  112.  */
  113. typedef struct header {
  114.     /* mandatory fields */
  115.     char    *h_relayversion;
  116.     char    *h_postversion;
  117.     char    *h_from;
  118.     char    *h_date;
  119.     char    *h_newsgroups;
  120.     char    *h_subject;
  121.     char    *h_messageid;
  122.     char    *h_path;
  123.     /* optional fields */
  124.     char    *h_replyto;
  125.     char    *h_sender;
  126.     char    *h_followupto;
  127.     char    *h_datereceived;
  128.     char    *h_expires;
  129.     char    *h_references;
  130.     char    *h_control;
  131.     char    *h_distribution;
  132.     char    *h_organisation;
  133.     char    *h_lines;
  134.     /* any we don't recognise */
  135.     char    *h_others;
  136. } header;
  137.  
  138. /*
  139.  * internal structure for active file
  140.  */
  141. typedef struct active active;
  142. struct active {
  143.     char    *a_name;
  144.     short    a_seq;
  145.     short    a_low;
  146.     active    *a_next;
  147. };
  148.  
  149. /*
  150.  * internal struct for newsrc file
  151.  */
  152. typedef struct newsrc newsrc;
  153. struct newsrc {
  154.     char    *n_name;
  155.     bool    n_subscribe;
  156.     short    n_last;
  157.     newsrc    *n_next;
  158. };
  159.  
  160. char    *strrchr(), *strchr(), *strcat(), *strcpy(), *strpbrk();
  161. char    *itoa(), *convg(), *ngsquash(), *ttoa(), *mgets(), *rconvg();
  162. char    *newstr(), *newstr2(), *newstr3(), *newstr4(), *newstr5(), *catstr();
  163. char    *catstr2(), *bsearch(), *mtempnam(), *newstr6();
  164. char    *getunique(), *getretaddr(), *getsubject();
  165. FILE    *fopenl(), *fopenf();
  166. char    *memset(), *myalloc(), *myrealloc();
  167. long    time(), atol(), atot();
  168. int    strpcmp();
  169. active    *readactive();
  170. char *getenv();
  171.  
  172. #define NIL(type)    ((type *) 0)
  173. #define NEW(type)    ((type *) myalloc(sizeof(type)))
  174. #define CMP(a, b)    (*(a) != *(b) ? *(a) - *(b) : strcmp(a, b))
  175. #define CMPN(a, b, n)    (*(a) != *(b) ? *(a) - *(b) : strncmp(a, b, n))
  176.  
  177. /* bw 9/15/84 */
  178. #define uid_t int
  179. #define index strchr
  180. #define rindex strrchr
  181.