IDZEBRA  2.2.7
Functions
insert.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "dict-p.h"

Go to the source code of this file.

Functions

static int dict_ins (Dict dict, const Dict_char *str, Dict_ptr back_ptr, int userlen, void *userinfo)
 
static void clean_page (Dict dict, Dict_ptr ptr, void *p, Dict_char *out, Dict_ptr subptr, char *userinfo)
 
static void checkPage (Dict dict, void *p)
 
static Dict_ptr new_page (Dict dict, Dict_ptr back_ptr, void **pp)
 
static int split_page (Dict dict, Dict_ptr ptr, void *p)
 
int dict_insert (Dict dict, const char *str, int userlen, void *userinfo)
 insert item into dictionary More...
 

Function Documentation

◆ checkPage()

static void checkPage ( Dict  dict,
void *  p 
)
static

Definition at line 233 of file insert.c.

References DICT_bsize, DICT_nodir, and DICT_size.

Referenced by clean_page(), and split_page().

◆ clean_page()

static void clean_page ( Dict  dict,
Dict_ptr  ptr,
void *  p,
Dict_char out,
Dict_ptr  subptr,
char *  userinfo 
)
static

◆ dict_ins()

static int dict_ins ( Dict  dict,
const Dict_char str,
Dict_ptr  back_ptr,
int  userlen,
void *  userinfo 
)
static

◆ dict_insert()

int dict_insert ( Dict  dict,
const char *  p,
int  userlen,
void *  userinfo 
)

insert item into dictionary

Parameters
dictdictionary handle
pstring-z with lookup string
userlenlength of user data (associated with p)
userinfouserdata (of size userlen)
Return values
0p is new and inserted OK
1p is updated (already exists) and userinfo is modified
2p already exists and userinfo is unmodified (same as before)
-1error

Definition at line 439 of file insert.c.

References dict, dict_ins(), Dict_struct::head, new_page(), Dict_struct::no_insert, Dict_head::root, and Dict_struct::rw.

Referenced by dict_insert_ord(), dirs_add(), dirs_mkdir(), heap_inpb(), heap_inpc(), heap_inps(), index_block_flush(), main(), and tst().

◆ new_page()

static Dict_ptr new_page ( Dict  dict,
Dict_ptr  back_ptr,
void **  pp 
)
static

◆ split_page()

static int split_page ( Dict  dict,
Dict_ptr  ptr,
void *  p 
)
static