Back to index

php5  5.3.10
Classes | Defines | Functions
cdb.h File Reference
#include "uint32.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cdb

Defines

#define CDB_HASHSTART   5381
#define cdb_datapos(c)   ((c)->dpos)
#define cdb_datalen(c)   ((c)->dlen)

Functions

uint32 cdb_hash (char *, unsigned int)
void cdb_free (struct cdb *TSRMLS_DC)
void cdb_init (struct cdb *, php_stream *fp TSRMLS_DC)
int cdb_read (struct cdb *, char *, unsigned int, uint32 TSRMLS_DC)
void cdb_findstart (struct cdb *TSRMLS_DC)
int cdb_findnext (struct cdb *, char *, unsigned int TSRMLS_DC)
int cdb_find (struct cdb *, char *, unsigned int TSRMLS_DC)
char * cdb_version ()

Class Documentation

struct cdb

Definition at line 30 of file cdb.h.

Class Members
uint32 dlen
uint32 dpos
php_stream * fp
uint32 hpos
uint32 hslots
uint32 khash
uint32 kpos
uint32 loop

Define Documentation

#define cdb_datalen (   c)    ((c)->dlen)

Definition at line 53 of file cdb.h.

#define cdb_datapos (   c)    ((c)->dpos)

Definition at line 52 of file cdb.h.

#define CDB_HASHSTART   5381

Definition at line 28 of file cdb.h.


Function Documentation

int cdb_find ( struct cdb ,
char *  ,
unsigned int  TSRMLS_DC 
)
int cdb_findnext ( struct cdb ,
char *  ,
unsigned int  TSRMLS_DC 
)
void cdb_findstart ( struct cdb TSRMLS_DC)
void cdb_free ( struct cdb TSRMLS_DC)
uint32 cdb_hash ( char *  ,
unsigned  int 
)

Definition at line 68 of file cdb.c.

{
       uint32 h;
       const unsigned char * b = (unsigned char *)buf;

       h = CDB_HASHSTART;
       while (len--) {
              h = ( h + (h << 5)) ^ (*b++);
       }
       return h;
}

Here is the caller graph for this function:

void cdb_init ( struct cdb ,
php_stream *fp  TSRMLS_DC 
)

Definition at line 95 of file cdb.c.

{
       cdb_free(c TSRMLS_CC);
       cdb_findstart(c TSRMLS_CC);
       c->fp = fp;
}

Here is the call graph for this function:

int cdb_read ( struct cdb ,
char *  ,
unsigned  int,
uint32  TSRMLS_DC 
)
char* cdb_version ( )

Definition at line 190 of file cdb.c.

{
       return "0.75, $Revision: 293036 $";
}