IDZEBRA  2.2.7
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
 

Macros

#define DICT_MAGIC   "dict01"
 
#define DICT_DEFAULT_PAGESIZE   4096
 
#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)
 

Typedefs

typedef unsigned char Dict_char
 
typedef unsigned Dict_ptr
 
typedef struct Dict_file_structDict_BFile
 

Functions

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

◆ DICT_backptr

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

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

◆ DICT_bsize

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

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

◆ DICT_DEFAULT_PAGESIZE

#define DICT_DEFAULT_PAGESIZE   4096

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

◆ DICT_EOS

#define DICT_EOS   0

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

◆ DICT_infoffset

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

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

◆ DICT_MAGIC

#define DICT_MAGIC   "dict01"

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

◆ DICT_nodir

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

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

◆ DICT_size

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

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

◆ DICT_to_str

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

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

◆ DICT_type

#define DICT_type (   x)    0[(Dict_ptr*) x]

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

◆ DICT_xxxxpagesize

#define DICT_xxxxpagesize (   x)    ((x)->head.page_size)

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

Typedef Documentation

◆ Dict_BFile

typedef struct Dict_file_struct * Dict_BFile

◆ Dict_char

typedef unsigned char Dict_char

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

◆ Dict_ptr

typedef unsigned Dict_ptr

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

Function Documentation

◆ dict_bf_close()

int dict_bf_close ( Dict_BFile  dbf)

◆ dict_bf_compact()

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().

◆ dict_bf_flush_blocks()

void dict_bf_flush_blocks ( Dict_BFile  bf,
int  no_to_flush 
)

◆ dict_bf_newp()

int dict_bf_newp ( Dict_BFile  bf,
int  no,
void **  bufp,
int  nbytes 
)

◆ dict_bf_open()

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().

◆ dict_bf_readp()

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

◆ dict_bf_touch()

int dict_bf_touch ( Dict_BFile  bf,
int  no 
)

◆ dict_strcmp()

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().

◆ dict_strlen()

int dict_strlen ( const Dict_char s)

◆ dict_strncmp()

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().