IDZEBRA  2.1.2
Data Structures | Macros | Typedefs | Functions
dict-p.h File Reference
#include <yaz/log.h>
#include <yaz/xmalloc.h>
#include <idzebra/dict.h>

Go to the source code of this file.

Data Structures

struct  Dict_head
struct  Dict_file_block
struct  Dict_file_struct
struct  Dict_struct


#define DICT_MAGIC   "dict01"
#define DICT_EOS   0
#define DICT_type(x)   0[(Dict_ptr*) x]
#define DICT_backptr(x)   1[(Dict_ptr*) x]
#define DICT_bsize(x)   2[(short*)((char*)(x)+2*sizeof(Dict_ptr))]
#define DICT_nodir(x)   0[(short*)((char*)(x)+2*sizeof(Dict_ptr))]
#define DICT_size(x)   1[(short*)((char*)(x)+2*sizeof(Dict_ptr))]
#define DICT_infoffset   (2*sizeof(Dict_ptr)+3*sizeof(short))
#define DICT_xxxxpagesize(x)   ((x)->head.page_size)
#define DICT_to_str(x)   sizeof(Dict_info)+sizeof(Dict_ptr)


typedef unsigned char Dict_char
typedef unsigned Dict_ptr
typedef struct Dict_file_structDict_BFile


int dict_bf_readp (Dict_BFile bf, int no, void **bufp)
int dict_bf_newp (Dict_BFile bf, int no, void **bufp, int nbytes)
int dict_bf_touch (Dict_BFile bf, int no)
void dict_bf_flush_blocks (Dict_BFile bf, int no_to_flush)
Dict_BFile dict_bf_open (BFiles bfs, const char *name, int block_size, int cache, int rw)
int dict_bf_close (Dict_BFile dbf)
void dict_bf_compact (Dict_BFile dbf)
int dict_strcmp (const Dict_char *s1, const Dict_char *s2)
int dict_strncmp (const Dict_char *s1, const Dict_char *s2, size_t n)
int dict_strlen (const Dict_char *s)

Macro Definition Documentation

#define DICT_backptr (   x)    1[(Dict_ptr*) x]

Definition at line 104 of file dict-p.h.

Referenced by dict_copy_compact(), dict_del_string(), dict_del_subtree(), and new_page().

#define DICT_bsize (   x)    2[(short*)((char*)(x)+2*sizeof(Dict_ptr))]

Definition at line 31 of file dict-p.h.

Referenced by dict_open().

#define DICT_EOS   0
#define DICT_infoffset   (2*sizeof(Dict_ptr)+3*sizeof(short))

Definition at line 108 of file dict-p.h.

Referenced by clean_page(), dict_copy_page(), and new_page().

#define DICT_MAGIC   "dict01"

Definition at line 29 of file dict-p.h.

Referenced by dict_clean(), and dict_open().

#define DICT_nodir (   x)    0[(short*)((char*)(x)+2*sizeof(Dict_ptr))]
#define DICT_size (   x)    1[(short*)((char*)(x)+2*sizeof(Dict_ptr))]

Definition at line 107 of file dict-p.h.

Referenced by clean_page(), dict_copy_compact(), dict_copy_page(), dict_ins(), and new_page().

#define DICT_to_str (   x)    sizeof(Dict_info)+sizeof(Dict_ptr)

Definition at line 111 of file dict-p.h.

#define DICT_type (   x)    0[(Dict_ptr*) x]
#define DICT_xxxxpagesize (   x)    ((x)->head.page_size)

Definition at line 109 of file dict-p.h.

Typedef Documentation

typedef struct Dict_file_struct * Dict_BFile
typedef unsigned char Dict_char

Definition at line 33 of file dict-p.h.

typedef unsigned Dict_ptr

Definition at line 34 of file dict-p.h.

Function Documentation

int dict_bf_close ( Dict_BFile  dbf)
void dict_bf_compact ( Dict_BFile  dbf)

Definition at line 91 of file dopen.c.

References Dict_file_struct::compact_flag.

Referenced by dict_open().

void dict_bf_flush_blocks ( Dict_BFile  bf,
int  no_to_flush 
int dict_bf_newp ( Dict_BFile  bf,
int  no,
void **  bufp,
int  nbytes 
Dict_BFile dict_bf_open ( BFiles  bfs,
const char *  name,
int  block_size,
int  cache,
int  rw 

Definition at line 75 of file dopen.c.

References Dict_file_struct::bf, bf_open(), and common_init().

Referenced by dict_open().

int dict_bf_readp ( Dict_BFile  bf,
int  no,
void **  bufp 
int dict_bf_touch ( Dict_BFile  bf,
int  no 

Definition at line 244 of file drdwr.c.

References Dict_file_block::dirty, and find_block().

Referenced by clean_page(), dict_close(), dict_del_string(), dict_del_subtree(), and dict_ins().

int dict_strcmp ( const Dict_char s1,
const Dict_char s2 

Definition at line 108 of file open.c.

Referenced by dict_del_string(), dict_ins(), dict_look(), and dict_scan_r().

int dict_strlen ( const Dict_char s)
int dict_strncmp ( const Dict_char s1,
const Dict_char s2,
size_t  n 

Definition at line 113 of file open.c.

Referenced by dict_del_string().