1: /*	db.h	4.3	86/06/04	*/
   2: 
   3: /*
   4:  * Copyright (c) 1985 Regents of the University of California
   5:  *	All Rights Reserved
   6:  */
   7: 
   8: /*
   9:  * Global structures and variables for data base routines.
  10:  */
  11: 
  12: #define INVBLKSZ    7   /* # of namebuf pointers per block */
  13: #define INVHASHSZ   919 /* size of inverse hash table */
  14: 
  15:     /* max length of data in RR data field */
  16: #define MAXDATA     256
  17: 
  18: /*
  19:  * Hash table structures.
  20:  */
  21: struct databuf {
  22:     struct  databuf *d_next;    /* linked list */
  23:     short   d_refcount;     /* reference count */
  24:     short   d_zone;         /* zone number */
  25:     short   d_class;        /* class number */
  26:     short   d_type;         /* type number */
  27:     u_long  d_ttl;          /* time to live */
  28:     int d_size;         /* size of data area */
  29:     char    d_data[MAXDATA];    /* malloc'ed as needed */
  30: };
  31: #define DATASIZE(n) (sizeof(struct databuf) - MAXDATA + n)
  32: 
  33: struct namebuf {
  34:     char    *n_dname;       /* domain name */
  35:     struct  namebuf *n_next;    /* linked list */
  36:     struct  databuf *n_data;    /* data records */
  37:     struct  namebuf *n_parent;  /* parent domain */
  38:     struct  hashbuf *n_hash;    /* hash table for children */
  39: };
  40: 
  41: struct invbuf {
  42:     struct  invbuf *i_next;     /* linked list */
  43:     struct  namebuf *i_dname[INVBLKSZ]; /* domain name */
  44: };
  45: 
  46: struct hashbuf {
  47:     int h_size;         /* size of hash table */
  48:     int h_cnt;          /* number of entries */
  49:     struct  namebuf *h_tab[1];  /* malloc'ed as needed */
  50: };
  51: #define HASHSIZE(s) (s*sizeof(struct namebuf *) + 2*sizeof(int))
  52: 
  53: #define HASHSHIFT   3
  54: #define HASHMASK    0x1f
  55: 
  56: /*
  57:  * Flags to updatedb
  58:  */
  59: #define DB_NODATA   0x1     /* data should not exist */
  60: #define DB_MEXIST   0x2     /* data must exist */
  61: #define DB_DELETE   0x4     /* delete data if it exists */
  62: 
  63: /*
  64:  * Error return codes
  65:  */
  66: #define OK      0
  67: #define NONAME      -1
  68: #define NOCLASS     -2
  69: #define NOTYPE      -3
  70: #define NODATA      -4
  71: #define DATAEXISTS  -5
  72: #define NODBFILE        -6
  73: #define TOOMANYZONES    -7
  74: #define GOODDB      -8
  75: #define NEWDB       -9
  76: 
  77: extern struct hashbuf *hashtab;     /* root hash table */
  78: extern struct invbuf *invtab[];     /* inverse hash table */
  79: 
  80: extern struct namebuf *nlookup();
  81: extern struct namebuf *savename();
  82: extern struct databuf *savedata();
  83: extern struct hashbuf *savehash();
  84: extern struct invbuf *saveinv();
  85: extern char *savestr();

Defined struct's

databuf defined in line 21; used 70 times
invbuf defined in line 41; used 24 times
namebuf defined in line 33; used 62 times

Defined macros

DATASIZE defined in line 31; used 1 times
DB_DELETE defined in line 61; used 3 times
DB_MEXIST defined in line 60; used 2 times
GOODDB defined in line 74; never used
HASHMASK defined in line 54; used 3 times
HASHSHIFT defined in line 53; used 2 times
HASHSIZE defined in line 51; used 1 times
INVHASHSZ defined in line 13; used 3 times
MAXDATA defined in line 16; used 3 times
NEWDB defined in line 75; never used
NOCLASS defined in line 68; never used
NODATA defined in line 70; used 1 times
NODBFILE defined in line 72; used 1 times
NONAME defined in line 67; used 1 times
NOTYPE defined in line 69; never used
OK defined in line 66; used 5 times
TOOMANYZONES defined in line 73; never used

Usage of this include

Last modified: 1986-06-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1335
Valid CSS Valid XHTML 1.0 Strict