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

Go to the source code of this file.

Functions

static void dict_del_subtree (Dict dict, Dict_ptr ptr, void *client, int(*f)(const char *, void *))
 
static int dict_del_string (Dict dict, const Dict_char *str, Dict_ptr ptr, int sub_flag, void *client, int(*f)(const char *, void *))
 
int dict_delete (Dict dict, const char *p)
 deletes item from dictionary More...
 
int dict_delete_subtree (Dict dict, const char *p, void *client, int(*f)(const char *info, void *client))
 delete items with a given prefix from dictionary More...
 

Function Documentation

static int dict_del_string ( Dict  dict,
const Dict_char str,
Dict_ptr  ptr,
int  sub_flag,
void *  client,
int(*)(const char *, void *)  f 
)
static
static void dict_del_subtree ( Dict  dict,
Dict_ptr  ptr,
void *  client,
int(*)(const char *, void *)  f 
)
static
int dict_delete ( Dict  dict,
const char *  p 
)

deletes item from dictionary

Parameters
dictdictionary handle
pstring-z with lookup string
Return values
0p not found
1p found and deleted
-1error

Definition at line 260 of file delete.c.

References dict_del_string(), Dict_struct::head, and Dict_head::root.

Referenced by dict_delete_ord(), dirs_del(), dirs_rmdir(), heap_inpb(), heap_inpc(), and main().

int dict_delete_subtree ( Dict  dict,
const char *  p,
void *  client,
int(*)(const char *info, void *client)  f 
)

delete items with a given prefix from dictionary

Parameters
dictdictionary handle
pstring-z with prefix
clientclient data to be supplied to function f
ffunction which gets called for each item in tree
Return values
0OK (0 or more entries deleted)
1OK (1 or more entries delete)
-1ERROR

Function f is called for each item to be deleted.

Definition at line 266 of file delete.c.

References dict_del_string(), Dict_struct::head, and Dict_head::root.

Referenced by delete_SU_handle(), dict_delete_subtree_ord(), and main().