IDZEBRA 2.2.11
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
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

Function Documentation

◆ dict_del_string()

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

◆ dict_del_subtree()

void dict_del_subtree ( Dict dict,
Dict_ptr ptr,
void * client,
int(* f )(const char *, void *) )
static

◆ dict_delete()

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, and dict_del_string().

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

◆ dict_delete_subtree()

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

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, and dict_del_string().

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