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 / server / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  3.3 KB  |  210 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. #if 0
  48. # include <ndir.h>
  49. #endif
  50. #endif
  51. #else /* not NDIR */
  52. # include <sys/dir.h>
  53. #endif /* not NDIR */
  54.  
  55. #ifdef FCNTL
  56. # include <fcntl.h>
  57. #endif /* FCNTL */
  58.  
  59. #ifdef ultrix
  60. extern char * index();
  61. extern char * rindex();
  62. #endif
  63.  
  64. /*
  65.  * <dbm.h> stupidly defines NULL, which is why the following
  66.  * brain death is necessary.
  67.  */
  68.  
  69. #ifdef DBM
  70. # ifdef DBZ
  71. #  include <dbz.h>
  72. # else /* DBZ */
  73. #  undef NULL
  74. #  include <dbm.h>
  75. #  undef NULL
  76. #  define NULL    0
  77. # endif /* DBZ */
  78. #else
  79. # ifdef NDBM
  80. #  include <ndbm.h>
  81. # endif /* NDBM */
  82. #endif /* DBM */
  83.  
  84. #ifdef TIMEOUT
  85. #ifndef TIMERS
  86. #define TIMERS
  87. #endif
  88. #endif
  89.  
  90. #ifdef LOGINCHECK
  91. #ifndef TIMERS
  92. #define TIMERS
  93. #endif
  94. #endif
  95.  
  96. #ifdef BATCHCHECK
  97. #ifndef TIMERS
  98. #define TIMERS
  99. #endif
  100. #endif
  101.  
  102. /*
  103.  * Some generic maximums.
  104.  */
  105.  
  106. #ifndef MAXPATHLEN
  107. #define    MAXPATHLEN    1024
  108. #endif
  109.  
  110. #ifndef MAXHOSTNAMELEN
  111. #define    MAXHOSTNAMELEN    256
  112. #endif
  113.  
  114. #ifndef MINFREE
  115. #define MINFREE         0
  116. #endif
  117.  
  118. #ifndef POSTBUFFER
  119. #define POSTBUFFER      0
  120. #endif
  121.  
  122. #define    MAXBUFLEN    1024
  123.  
  124. /*
  125.  * For "spew()"
  126.  */
  127.  
  128. #define    ARTICLE    0
  129. #define    HEAD    1
  130. #define    BODY    2
  131. #define    STAT    3
  132.  
  133. /*
  134.  * For "ngmatch()"
  135.  */
  136.  
  137. #define    ALLBUT    1
  138.  
  139. #define    valid_art(s)    (atoi(s) != 0)
  140.  
  141. #define    putline(s)    fputs((s), stdout); putchar('\r'); putchar('\n');
  142.  
  143. extern    int    errno;
  144.  
  145. extern    char    *gets(), *fgets();
  146. extern    char    *mktemp();
  147. extern    FILE    *open_valid_art();
  148. extern    FILE    *openartbyid();
  149. extern    char    *gethistent();
  150. extern    int    restreql();
  151. extern    int    s1strneql();    /* for ngmatch */
  152. #ifdef DEBUG
  153. void debugup(), debugdown();
  154. #endif
  155. #ifdef SETPROCTITLE
  156. void setproctitle();
  157. #endif
  158.  
  159. extern    char    spooldir[];
  160. extern    char    activefile[];
  161. extern    char    distributionsfile[];
  162. extern    char    newsgroupsfile[];
  163. extern    char    accessfile[];
  164. extern    char    historyfile[];
  165. extern    char    ngdatefile[];
  166. extern    char    inews[];
  167. extern    char    rnews[];
  168.  
  169. #ifdef    XTHREAD
  170. extern    char    *threaddir;
  171. extern    char    *threadfile;
  172. #endif
  173.  
  174. extern    char    **group_array;
  175. extern    char    *actbuf;
  176. extern    int    num_groups;
  177. extern    char    *homedir;
  178. extern    int    ingroup;
  179. extern    int    maxgroups;
  180. #ifdef DYNAMIC_ART_ARRAY
  181. extern    int    *art_array;
  182. extern    unsigned int size_art_array;
  183. #else
  184. extern    int    art_array[];
  185. #endif
  186. extern    int    art_ptr;
  187. extern    FILE    *art_fp;
  188. extern    int    num_arts;
  189. extern    int    uid_poster, gid_poster;
  190. extern    char    *home_poster;
  191. extern    int    canread, canpost, canxfer;
  192. extern    char    **ngpermlist;
  193. extern    int    ngpermcount;
  194.  
  195. extern    char    nntp_version[];
  196.  
  197. extern    char    hostname[];
  198. extern    int    debug;
  199.  
  200. #ifdef LOG
  201. extern    int    grps_acsd, arts_acsd;
  202.  
  203. extern    int    ih_accepted;
  204. extern    int    ih_rejected;
  205. extern    int    ih_failed;
  206.  
  207. extern    int    nn_told;
  208. extern    int    nn_took;
  209. #endif
  210.