Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Functions | Variables
sdbm.h File Reference
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  DBM
 
struct  datum
 

Macros

#define DBLKSIZ   4096
 
#define PBLKSIZ   1024
 
#define PAIRMAX   1008 /* arbitrary on PBLKSIZ-N */
 
#define SPLTMAX   10 /* maximum allowed splits */
 
#define DIRFEXT   ".dir"
 
#define PAGFEXT   ".pag"
 
#define DBM_RDONLY   0x1 /* data base open read-only */
 
#define DBM_IOERR   0x2 /* data base I/O error */
 
#define sdbm_rdonly(db)   ((db)->flags & DBM_RDONLY)
 
#define sdbm_error(db)   ((db)->flags & DBM_IOERR)
 
#define sdbm_clearerr(db)   ((db)->flags &= ~DBM_IOERR) /* ouch */
 
#define sdbm_dirfno(db)   ((db)->dirf)
 
#define sdbm_pagfno(db)   ((db)->pagf)
 
#define proto(p)   ()
 
#define DBM_INSERT   0
 
#define DBM_REPLACE   1
 

Functions

DBM *sdbm_open proto ((char *, int, int))
 
void sdbm_close proto ((DBM *))
 
datum sdbm_fetch proto ((DBM *, datum))
 
int sdbm_store proto ((DBM *, datum, datum, int))
 
DBM *sdbm_prep proto ((char *, char *, int, int))
 
long sdbm_hash proto ((char *, int))
 

Variables

datum nullitem
 

Macro Definition Documentation

◆ DBLKSIZ

#define DBLKSIZ   4096

Definition at line 12 of file sdbm.h.

◆ DBM_INSERT

#define DBM_INSERT   0

Definition at line 66 of file sdbm.h.

◆ DBM_IOERR

#define DBM_IOERR   0x2 /* data base I/O error */

Definition at line 37 of file sdbm.h.

◆ DBM_RDONLY

#define DBM_RDONLY   0x1 /* data base open read-only */

Definition at line 36 of file sdbm.h.

Referenced by sdbm_prep().

◆ DBM_REPLACE

#define DBM_REPLACE   1

Definition at line 67 of file sdbm.h.

◆ DIRFEXT

#define DIRFEXT   ".dir"

Definition at line 17 of file sdbm.h.

Referenced by sdbm_open().

◆ PAGFEXT

#define PAGFEXT   ".pag"

Definition at line 18 of file sdbm.h.

Referenced by sdbm_open().

◆ PAIRMAX

#define PAIRMAX   1008 /* arbitrary on PBLKSIZ-N */

Definition at line 14 of file sdbm.h.

◆ PBLKSIZ

#define PBLKSIZ   1024

Definition at line 13 of file sdbm.h.

Referenced by sdbm_firstkey().

◆ proto

#define proto (   p)    ()

Definition at line 60 of file sdbm.h.

◆ sdbm_clearerr

#define sdbm_clearerr (   db)    ((db)->flags &= ~DBM_IOERR) /* ouch */

Definition at line 45 of file sdbm.h.

◆ sdbm_dirfno

#define sdbm_dirfno (   db)    ((db)->dirf)

Definition at line 47 of file sdbm.h.

◆ sdbm_error

#define sdbm_error (   db)    ((db)->flags & DBM_IOERR)

Definition at line 43 of file sdbm.h.

◆ sdbm_pagfno

#define sdbm_pagfno (   db)    ((db)->pagf)

Definition at line 48 of file sdbm.h.

◆ sdbm_rdonly

#define sdbm_rdonly (   db)    ((db)->flags & DBM_RDONLY)

Definition at line 42 of file sdbm.h.

Referenced by sdbm_delete().

◆ SPLTMAX

#define SPLTMAX   10 /* maximum allowed splits */

Definition at line 15 of file sdbm.h.

Function Documentation

◆ proto() [1/6]

DBM* sdbm_open proto ( (char *, int, int)  )

◆ proto() [2/6]

datum sdbm_nextkey proto ( (DBM *)  )

◆ proto() [3/6]

int sdbm_delete proto ( (DBM *, datum )

◆ proto() [4/6]

int sdbm_store proto ( (DBM *, datum, datum, int)  )

◆ proto() [5/6]

DBM* sdbm_prep proto ( (char *, char *, int, int)  )

◆ proto() [6/6]

long sdbm_hash proto ( (char *, int)  )

Variable Documentation

◆ nullitem

datum nullitem

Definition at line 145 of file _sdbm.c.

Referenced by sdbm_fetch(), sdbm_firstkey(), and sdbm_nextkey().