IDZEBRA  2.1.2
Functions
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) More...
 
Dict dict_open (BFiles bfs, const char *name, int cache, int rw, int compact_flag, int page_size)
 open dictionary More...
 
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 More...
 
zint dict_get_no_insert (Dict dict)
 get number of insert operations, since dict_open More...
 
zint dict_get_no_split (Dict dict)
 get number of page split operations, since dict_open More...
 

Function Documentation

void dict_clean ( Dict  dict)

reset Dictionary (makes it empty)

Parameters
dictdictionary handle

Definition at line 31 of file open.c.

References Dict_head::compact_flag, Dict_struct::dbf, dict_bf_newp(), DICT_MAGIC, Dict_head::freelist, Dict_struct::head, Dict_head::last, Dict_head::magic_str, Dict_head::page_size, Dict_head::root, and Dict_struct::rw.

Referenced by dict_open(), and zebra_remove_file_match().

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_struct::no_insert.

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_struct::no_lookup.

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_struct::no_split.

Referenced by index_block_flush().

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_head::compact_flag, Dict_struct::dbf, dict, dict_bf_close(), dict_bf_compact(), dict_bf_open(), dict_bf_readp(), dict_clean(), DICT_DEFAULT_PAGESIZE, DICT_MAGIC, Dict_struct::grep_cmap, Dict_struct::head, Dict_head::magic_str, Dict_struct::no_insert, Dict_struct::no_lookup, Dict_struct::no_split, Dict_head::page_size, and Dict_struct::rw.

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

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