home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / NNTP-1.000 / NNTP-1 / nntp.1.5.11t / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  3.3 KB  |  208 lines

  1. /*
  2.  * Common declarations, includes, and other goodies.
  3.  *
  4.  * @(#)$Header: common.h,v 1.38 91/02/02 15:55:21 sob Exp $
  5.  */
  6.  
  7.  
  8. #include "../common/conf.h"
  9. #include <stdio.h>
  10. #ifndef BSD_42
  11. #include <sys/types.h>
  12. #endif /* BSD_42 */
  13. #include <sys/param.h>
  14. #include <sys/stat.h>
  15. #include <errno.h>
  16. #include <ctype.h>
  17. #include <pwd.h>
  18. #include <sys/file.h>
  19. #ifdef BSD2_10
  20. #include <short_names.h>
  21. #endif /* BSD2_10 */
  22.  
  23. #include "../common/nntp.h"
  24.  
  25. #ifdef SYSLOG
  26. # ifdef FAKESYSLOG
  27. #  include "fakesyslog.h"
  28. # else
  29. #  include <syslog.h>
  30. # endif
  31. #endif
  32.  
  33. #ifdef USG
  34. extern struct passwd *getpwent(), *getpwuid(), *getpwnam();
  35. #define iolen_t unsigned
  36. # include <string.h>
  37. #else /* not USG */
  38. # include <strings.h>
  39. # include <sys/wait.h>
  40. #define iolen_t int
  41. #endif /* not USG */
  42.  
  43. #ifdef NDIR
  44. #ifdef M_XENIX
  45. # include <sys/ndir.h>
  46. #else
  47. # include <ndir.h>
  48. #endif
  49. #else /* not NDIR */
  50. # include <sys/dir.h>
  51. #endif /* not NDIR */
  52.  
  53. #ifdef FCNTL
  54. # include <fcntl.h>
  55. #endif /* FCNTL */
  56.  
  57. #ifdef ultrix
  58. extern char * index();
  59. extern char * rindex();
  60. #endif
  61.  
  62. /*
  63.  * <dbm.h> stupidly defines NULL, which is why the following
  64.  * brain death is necessary.
  65.  */
  66.  
  67. #ifdef DBM
  68. # ifdef DBZ
  69. #  include <dbz.h>
  70. # else /* DBZ */
  71. #  undef NULL
  72. #  include <dbm.h>
  73. #  undef NULL
  74. #  define NULL    0
  75. # endif /* DBZ */
  76. #else
  77. # ifdef NDBM
  78. #  include <ndbm.h>
  79. # endif /* NDBM */
  80. #endif /* DBM */
  81.  
  82. #ifdef TIMEOUT
  83. #ifndef TIMERS
  84. #define TIMERS
  85. #endif
  86. #endif
  87.  
  88. #ifdef LOGINCHECK
  89. #ifndef TIMERS
  90. #define TIMERS
  91. #endif
  92. #endif
  93.  
  94. #ifdef BATCHCHECK
  95. #ifndef TIMERS
  96. #define TIMERS
  97. #endif
  98. #endif
  99.  
  100. /*
  101.  * Some generic maximums.
  102.  */
  103.  
  104. #ifndef MAXPATHLEN
  105. #define    MAXPATHLEN    1024
  106. #endif
  107.  
  108. #ifndef MAXHOSTNAMELEN
  109. #define    MAXHOSTNAMELEN    256
  110. #endif
  111.  
  112. #ifndef MINFREE
  113. #define MINFREE         0
  114. #endif
  115.  
  116. #ifndef POSTBUFFER
  117. #define POSTBUFFER      0
  118. #endif
  119.  
  120. #define    MAXBUFLEN    1024
  121.  
  122. /*
  123.  * For "spew()"
  124.  */
  125.  
  126. #define    ARTICLE    0
  127. #define    HEAD    1
  128. #define    BODY    2
  129. #define    STAT    3
  130.  
  131. /*
  132.  * For "ngmatch()"
  133.  */
  134.  
  135. #define    ALLBUT    1
  136.  
  137. #define    valid_art(s)    (atoi(s) != 0)
  138.  
  139. #define    putline(s)    fputs((s), stdout); putchar('\r'); putchar('\n');
  140.  
  141. extern    int    errno;
  142.  
  143. extern    char    *gets(), *fgets();
  144. extern    char    *mktemp();
  145. extern    FILE    *open_valid_art();
  146. extern    FILE    *openartbyid();
  147. extern    char    *gethistent();
  148. extern    int    restreql();
  149. extern    int    s1strneql();    /* for ngmatch */
  150. #ifdef DEBUG
  151. void debugup(), debugdown();
  152. #endif
  153. #ifdef SETPROCTITLE
  154. void setproctitle();
  155. #endif
  156.  
  157. extern    char    spooldir[];
  158. extern    char    activefile[];
  159. extern    char    distributionsfile[];
  160. extern    char    newsgroupsfile[];
  161. extern    char    accessfile[];
  162. extern    char    historyfile[];
  163. extern    char    ngdatefile[];
  164. extern    char    inews[];
  165. extern    char    rnews[];
  166.  
  167. #ifdef    XTHREAD
  168. extern    char    *threaddir;
  169. extern    char    *threadfile;
  170. #endif
  171.  
  172. extern    char    **group_array;
  173. extern    char    *actbuf;
  174. extern    int    num_groups;
  175. extern    char    *homedir;
  176. extern    int    ingroup;
  177. extern    int    maxgroups;
  178. #ifdef DYNAMIC_ART_ARRAY
  179. extern    int    *art_array;
  180. extern    unsigned int size_art_array;
  181. #else
  182. extern    int    art_array[];
  183. #endif
  184. extern    int    art_ptr;
  185. extern    FILE    *art_fp;
  186. extern    int    num_arts;
  187. extern    int    uid_poster, gid_poster;
  188. extern    char    *home_poster;
  189. extern    int    canread, canpost, canxfer;
  190. extern    char    **ngpermlist;
  191. extern    int    ngpermcount;
  192.  
  193. extern    char    nntp_version[];
  194.  
  195. extern    char    hostname[];
  196. extern    int    debug;
  197.  
  198. #ifdef LOG
  199. extern    int    grps_acsd, arts_acsd;
  200.  
  201. extern    int    ih_accepted;
  202. extern    int    ih_rejected;
  203. extern    int    ih_failed;
  204.  
  205. extern    int    nn_told;
  206. extern    int    nn_took;
  207. #endif
  208.