IDZEBRA 2.2.11
open.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "dict-p.h"

Go to the source code of this file.

Functions

void dict_clean (Dict dict)
 reset Dictionary (makes it empty)
Dict dict_open (BFiles bfs, const char *name, int cache, int rw, int compact_flag, int page_size)
 open dictionary
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)
zint dict_get_no_lookup (Dict dict)
 get number of lookup operations, since dict_open
zint dict_get_no_insert (Dict dict)
 get number of insert operations, since dict_open
zint dict_get_no_split (Dict dict)
 get number of page split operations, since dict_open

Function Documentation

◆ dict_clean()

void dict_clean ( Dict dict)

reset Dictionary (makes it empty)

Parameters
dictdictionary handle

Definition at line 31 of file open.c.

References dict, dict_bf_newp(), and DICT_MAGIC.

Referenced by dict_open(), and zebra_remove_file_match().

◆ dict_get_no_insert()

zint dict_get_no_insert ( Dict dict)

get number of insert operations, since dict_open

Parameters
dictdictionary handle
Returns
number of operatons

Definition at line 128 of file open.c.

References dict.

◆ dict_get_no_lookup()

zint dict_get_no_lookup ( Dict dict)

get number of lookup operations, since dict_open

Parameters
dictdictionary handle
Returns
number of operatons

Definition at line 123 of file open.c.

References dict.

◆ dict_get_no_split()

zint dict_get_no_split ( Dict dict)

get number of page split operations, since dict_open

Parameters
dictdictionary handle
Returns
number of operatons

Definition at line 133 of file open.c.

References dict.

Referenced by index_block_flush().

◆ dict_open()

Dict dict_open ( BFiles bfs,
const char * name,
int cache,
int rw,
int compact_flag,
int page_size )

open dictionary

Parameters
bfsblock file storage
namename of dictionary file
cachenumber of pages to cache
rw0=read-only, 1=read&write
compact_flag1=write with compact, 0=normal paged operation
page_sizepage size of disc block
Returns
dictionary handle

Definition at line 50 of file open.c.

References dict, dict_bf_close(), dict_bf_compact(), dict_bf_open(), dict_bf_readp(), dict_clean(), DICT_DEFAULT_PAGESIZE, and DICT_MAGIC.

Referenced by dict_copy_compact(), dict_open_res(), and main().

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

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