# 2.11BSD#431 - /usr/include/ndbm.h

##### Macros

    DBLKSIZ           X
    DBM_INSERT        X
    DBM_REPLACE       X
    PBLKSIZ           X
    _DBM_IOERR        X
    _DBM_RDONLY       X
    dbm_clearerr      X
    dbm_dirfno        X
    dbm_error         X
    dbm_pagfno        X
    dbm_rdonly        X

       1: /*
       2:  * Copyright (c) 1983 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  *
       6:  *	@(#)ndbm.h	5.1.1 (2.11BSD GTE) 12/31/93
       7:  */
       8:
       9: /*
      10:  * Hashed key data base library.
      11:  */
      12: #define PBLKSIZ 1024
      13: #ifdef pdp11
      14: #define DBLKSIZ 512
      15: #else
      16: #define DBLKSIZ 4096
      17: #endif
      18:
      19: typedef struct {
      20:     int dbm_dirf;       /* open directory file */
      21:     int dbm_pagf;       /* open page file */
      22:     int dbm_flags;      /* flags, see below */
      23:     long    dbm_maxbno;     /* last ``bit'' in dir file */
      24:     long    dbm_bitno;      /* current bit number */
      25:     long    dbm_hmask;      /* hash mask */
      26:     long    dbm_blkptr;     /* current block for dbm_nextkey */
      27:     int dbm_keyptr;     /* current key for dbm_nextkey */
      28:     long    dbm_blkno;      /* current page to read/write */
      29:     long    dbm_pagbno;     /* current page in pagbuf */
      30:     char    dbm_pagbuf[PBLKSIZ];    /* page file block buffer */
      31:     long    dbm_dirbno;     /* current block in dirbuf */
      32:     char    dbm_dirbuf[DBLKSIZ];    /* directory file block buffer */
      33: } DBM;
      34:
      35: #define _DBM_RDONLY 0x1 /* data base open read-only */
      36: #define _DBM_IOERR  0x2 /* data base I/O error */
      37:
      38: #define dbm_rdonly(db)  ((db)->dbm_flags & _DBM_RDONLY)
      39:
      40: #define dbm_error(db)   ((db)->dbm_flags & _DBM_IOERR)
      41:     /* use this one at your own risk! */
      42: #define dbm_clearerr(db)    ((db)->dbm_flags &= ~_DBM_IOERR)
      43:
      44: /* for flock(2) and fstat(2) */
      45: #define dbm_dirfno(db)  ((db)->dbm_dirf)
      46: #define dbm_pagfno(db)  ((db)->dbm_pagf)
      47:
      48: typedef struct {
      49:     char    *dptr;
      50:     int dsize;
      51: } datum;
      52:
      53: /*
      54:  * flags to dbm_store()
      55:  */
      56: #define DBM_INSERT  0
      57: #define DBM_REPLACE 1
      58:
      59: DBM *dbm_open();
      60: void    dbm_close();
      61: datum   dbm_fetch();
      62: datum   dbm_firstkey();
      63: datum   dbm_nextkey();
      64: long    dbm_forder();
      65: int dbm_delete();
      66: int dbm_store();

#### Defined macros

DBLKSIZ defined in line 16; used 16 times

- in line 32
- in /usr/src/lib/libc/gen/ndbm.c line 300-306(6), 322-333(9)

DBM_INSERT defined in line 56; used 2 times

- in /usr/src/sbin/mkpasswd/mkpasswd.c line 143-148(2)

DBM_REPLACE defined in line 57; used 5 times

- in /usr/src/usr.lib/libdbm/dbm.c line 81
- in /usr/src/usr.sbin/dev_mkdb/dev_mkdb.c line 130
- in /usr/src/usr.sbin/mkhosts/mkhosts.c line 104, 116, 124

PBLKSIZ defined in line 12; used 35 times

- in line 30
- in /usr/src/lib/libc/gen/ndbm.c line 130-131(3), 146, 167-168(3), 175-180(2), 202-208(6), 235-241(5), 278-280(4), 339, 351, 361, 368, 455, 468, 487, 494, 512, 518

_DBM_IOERR defined in line 36; used 13 times

- in line 40-42(2)
- in /usr/src/lib/libc/gen/ndbm.c line 133, 160, 169, 176, 189-194(2), 204-209(2), 244, 283, 334

_DBM_RDONLY defined in line 35; used 2 times

- in line 38
- in /usr/src/lib/libc/gen/ndbm.c line 38

dbm_clearerr defined in line 42; never used
dbm_dirfno defined in line 45; used 2 times

- in /usr/src/lib/libc/gen/getpwent.c line 225, 235

dbm_error defined in line 40; used 4 times

- in /usr/src/lib/libc/gen/ndbm.c line 97, 118, 148, 233

dbm_pagfno defined in line 46; never used
dbm_rdonly defined in line 38; used 4 times

- in /usr/src/lib/libc/gen/ndbm.c line 120, 150
- in /usr/src/usr.lib/libdbm/dbm.c line 66, 78

#### Usage of this include

ndbm.h used 12 times

- in /usr/include/dbm.h line 18
- in /usr/src/include/dbm.h line 18
- in /usr/src/lib/libc/gen/devname.c line 39
- in /usr/src/lib/libc/gen/getpwent.c line 28
- in /usr/src/lib/libc/gen/ndbm.c line 16
- in /usr/src/lib/libc/net/hosttable/gethnamadr.c line 15
- in /usr/src/lib/libc/net/hosttable/gethostent.c line 17
- in /usr/src/new/nntp/server/common.h line 59
- in /usr/src/sbin/mkpasswd/mkpasswd.c line 28
- in /usr/src/usr.lib/libdbm/dbm.h line 18
- in /usr/src/usr.sbin/dev_mkdb/dev_mkdb.c line 47
- in /usr/src/usr.sbin/mkhosts/mkhosts.c line 21

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