# 2.11BSD#431 - /usr/src/new/nntp/server/common.h

##### Macros

    ALLBUT            X
    ARTICLE           X
    BODY              X
    HEAD              X
    MAXBUFLEN         X
    MAXHOSTNAMELEN    X
    MAXPATHLEN        X
    NULL              X
    STAT              X
    putline           X
    valid_art         X

       1: /*
       2:  * Common declarations, includes, and other goodies.
       3:  *
       4:  * @(#)common.h	1.26.1	(2.11BSD) 12/31/93
       5:  */
       6:
       7:
       8: #include <stdio.h>
       9: #include <sys/types.h>
      10: #include <sys/stat.h>
      11: #include <errno.h>
      12: #include <ctype.h>
      13: #include <pwd.h>
      14: #include <sys/file.h>
      15: #include <sys/param.h>
      16:
      17: #include "../common/nntp.h"
      18: #include "../common/conf.h"
      19:
      20: #ifdef SYSLOG
      21: # ifdef FAKESYSLOG
      22: #  include "fakesyslog.h"
      23: # else
      24: #  include <syslog.h>
      25: # endif
      26: #endif
      27:
      28: #ifdef USG
      29: extern struct passwd *getpwent(), *getpwuid(), *getpwnam();
      30: # include <string.h>
      31: #else not USG
      32: # include <strings.h>
      33: # include <sys/wait.h>
      34: #endif not USG
      35:
      36: #ifdef NDIR
      37: # include <ndir.h>
      38: #else not NDIR
      39: # include <sys/dir.h>
      40: #endif not NDIR
      41:
      42: #ifdef FCNTL
      43: # include <fcntl.h>
      44: #endif FCNTL
      45:
      46: /*
      47:  * <dbm.h> stupidly defines NULL, which is why the following
      48:  * brain death is necessary.
      49:  */
      50:
      51: #ifdef DBM
      52: # undef NULL
      53: # include <dbm.h>
      54: # undef NULL
      55: # define NULL   0
      56: #endif DBM
      57:
      58: #ifdef NDBM
      59: # include <ndbm.h>
      60: #endif
      61:
      62: /*
      63:  * Some generic maximums.
      64:  */
      65:
      66: #ifndef MAXPATHLEN
      67: #define MAXPATHLEN  1024
      68: #endif not MAXPATHLEN
      69:
      70: #ifndef MAXHOSTNAMELEN
      71: #define MAXHOSTNAMELEN  256
      72: #endif not MAXHOSTNAMELEN
      73:
      74: #define MAXBUFLEN   1024
      75:
      76: /*
      77:  * For "spew()"
      78:  */
      79:
      80: #define ARTICLE 0
      81: #define HEAD    1
      82: #define BODY    2
      83: #define STAT    3
      84:
      85: /*
      86:  * For "ngmatch()"
      87:  */
      88:
      89: #define ALLBUT  1
      90:
      91: #define valid_art(s)    (atoi(s) != 0)
      92:
      93: #define putline(s)  fputs((s), stdout); putchar('\r'); putchar('\n');
      94:
      95: extern  int errno;
      96:
      97: extern  char    *gets(), *fgets();
      98: extern  char    *mktemp();
      99: extern  FILE    *open_valid_art();
     100: extern  FILE    *openartbyid();
     101: extern  char    *gethistent();
     102: extern  int restreql();
     103: extern  int s1strneql();    /* for ngmatch */
     104:
     105: extern  char    spooldir[];
     106: extern  char    activefile[];
     107: extern  char    accessfile[];
     108: extern  char    historyfile[];
     109: extern  char    ngdatefile[];
     110: extern  char    inews[];
     111: extern  char    rnews[];
     112:
     113: extern  char    **group_array;
     114: extern  int num_groups;
     115: extern  char    *homedir;
     116: extern  int ingroup;
     117: extern  int maxgroups;
     118: extern  int art_array[];
     119: extern  int art_ptr;
     120: extern  FILE    *art_fp;
     121: extern  int num_arts;
     122: extern  int uid_poster, gid_poster;
     123: extern  int canread, canpost, canxfer;
     124: extern  char    **ngpermlist;
     125: extern  int ngpermcount;
     126:
     127: extern  char    nntp_version[];
     128:
     129: #ifdef LOG
     130: extern  int grps_acsd, arts_acsd;
     131: extern  char    hostname[];
     132:
     133: extern  int ih_accepted;
     134: extern  int ih_rejected;
     135: extern  int ih_failed;
     136:
     137: extern  int nn_told;
     138: extern  int nn_took;
     139: #endif

#### Defined macros

ALLBUT defined in line 89; used 3 times

- in /usr/src/new/nntp/server/group.c line 55
- in /usr/src/new/nntp/server/list.c line 44
- in /usr/src/new/nntp/server/misc.c line 300

ARTICLE defined in line 80; used 2 times

- in /usr/src/new/nntp/server/ahbs.c line 38
- in /usr/src/new/nntp/server/misc.c line 362

BODY defined in line 82; used 2 times

- in /usr/src/new/nntp/server/ahbs.c line 42
- in /usr/src/new/nntp/server/misc.c line 339

HEAD defined in line 81; used 2 times

- in /usr/src/new/nntp/server/ahbs.c line 42
- in /usr/src/new/nntp/server/misc.c line 356

MAXBUFLEN defined in line 74; used 14 times

- in /usr/src/new/nntp/server/access.c line 61-64(4)
- in /usr/src/new/nntp/server/active.c line 148
- in /usr/src/new/nntp/server/ahbs.c line 25
- in /usr/src/new/nntp/server/misc.c line 31, 100, 269, 406
- in /usr/src/new/nntp/server/newnews.c line 29, 399
- in /usr/src/new/nntp/server/nextlast.c line 20
- in /usr/src/new/nntp/server/serve.c line 69

MAXHOSTNAMELEN defined in line 71; used 1 times

- in line 70

MAXPATHLEN defined in line 67; used 1 times

- in line 66

NULL defined in line 55; used 2 times

- in line 52-54(2)

STAT defined in line 83; used 2 times

- in /usr/src/new/nntp/server/ahbs.c line 40
- in /usr/src/new/nntp/server/misc.c line 333

putline defined in line 93; used 8 times

- in /usr/src/new/nntp/server/list.c line 48-52(2)
- in /usr/src/new/nntp/server/misc.c line 346, 373
- in /usr/src/new/nntp/server/newgroups.c line 94, 104
- in /usr/src/new/nntp/server/newnews.c line 215, 234

valid_art defined in line 91; used 2 times

- in /usr/src/new/nntp/server/ahbs.c line 97
- in /usr/src/new/nntp/server/nextlast.c line 63

#### Usage of this include

common.h used 23 times

- in /usr/src/new/nntp/server/access.c line 5
- in /usr/src/new/nntp/server/access_dnet.c line 5
- in /usr/src/new/nntp/server/access_inet.c line 5
- in /usr/src/new/nntp/server/active.c line 5
- in /usr/src/new/nntp/server/ahbs.c line 5
- in /usr/src/new/nntp/server/globals.c line 9
- in /usr/src/new/nntp/server/group.c line 5
- in /usr/src/new/nntp/server/help.c line 5
- in /usr/src/new/nntp/server/ihave.c line 5
- in /usr/src/new/nntp/server/list.c line 5
- in /usr/src/new/nntp/server/main.c line 16
- in /usr/src/new/nntp/server/misc.c line 7
- in /usr/src/new/nntp/server/netaux.c line 10
- in /usr/src/new/nntp/server/newgroups.c line 5
- in /usr/src/new/nntp/server/newnews.c line 5
- in /usr/src/new/nntp/server/nextlast.c line 5
- in /usr/src/new/nntp/server/ngmatch.c line 5
- in /usr/src/new/nntp/server/post.c line 5
- in /usr/src/new/nntp/server/scandir.c line 5
- in /usr/src/new/nntp/server/serve.c line 9
- in /usr/src/new/nntp/server/slave.c line 5
- in /usr/src/new/nntp/server/spawn.c line 7
- in /usr/src/new/nntp/server/xhdr.c line 5

Last modified: 1994-01-01 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1529 |