IDZEBRA  2.1.2
Macros | 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.


#define CHECK   0


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

Macro Definition Documentation

#define CHECK   0

Definition at line 32 of file insert.c.

Function Documentation

static void clean_page ( Dict  dict,
Dict_ptr  ptr,
void *  p,
Dict_char out,
Dict_ptr  subptr,
char *  userinfo 
static int dict_ins ( Dict  dict,
const Dict_char str,
Dict_ptr  back_ptr,
int  userlen,
void *  userinfo 
int dict_insert ( Dict  dict,
const char *  p,
int  userlen,
void *  userinfo 

insert item into dictionary

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)

Definition at line 438 of file insert.c.

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

static Dict_ptr new_page ( Dict  dict,
Dict_ptr  back_ptr,
void **  pp 
static int split_page ( Dict  dict,
Dict_ptr  ptr,
void *  p