NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Hash Data Free API

Prototype for Hash Destructor callback function. More...

Functions

static void group_hash_free (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 
static void cs_hashelem_free (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 
static void tags_deleter (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 
static void thread_hash_destructor (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 
static void idxfmt_hashelem_free (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 
void nntp_hashelem_free (int type, void *obj, intptr_t data)
 Free our hash table data - Implements hash_hdata_free_t -.
 

Detailed Description

Prototype for Hash Destructor callback function.

Parameters
typeHash Type
objObject to free
dataData associated with the Hash
Precondition
obj is not NULL

Function Documentation

◆ group_hash_free()

static void group_hash_free ( int type,
void * obj,
intptr_t data )
static

Free our hash table data - Implements hash_hdata_free_t -.

Definition at line 77 of file group.c.

78{
79 struct Group *g = obj;
80 group_free(&g);
81}
static void group_free(struct Group **ptr)
Free an Address Group.
Definition group.c:42
A set of email addresses.
Definition group.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cs_hashelem_free()

static void cs_hashelem_free ( int type,
void * obj,
intptr_t data )
static

Free our hash table data - Implements hash_hdata_free_t -.

Parameters
typeObject type, e.g. DT_STRING
objObject to destroy
dataConfigSet associated with the object

Definition at line 47 of file set.c.

48{
49 if (data == 0)
50 return; /* LCOV_EXCL_LINE */
51
52 struct ConfigSet *cs = (struct ConfigSet *) data;
53
54 const struct ConfigSetType *cst = NULL;
55
57 {
58 struct Inheritance *i = obj;
59
60 struct HashElem *he_base = cs_get_base(i->parent);
61 struct ConfigDef *cdef = he_base->data;
62
63 if (!cdef)
64 return; // LCOV_EXCL_LINE
65
66 cst = cs_get_type_def(cs, he_base->type);
67 if (cst && cst->destroy)
68 cst->destroy((void **) &i->var, cdef);
69
70 FREE(&i->name);
71 FREE(&i);
72 }
73 else
74 {
75 struct ConfigDef *cdef = obj;
76
77 cst = cs_get_type_def(cs, type);
78 if (cst && cst->destroy)
79 cst->destroy(&cdef->var, cdef);
80
81 /* If we allocated the initial value, clean it up */
82 if (cdef->type & D_INTERNAL_INITIAL_SET)
83 FREE(&cdef->initial);
85 {
86 FREE(&cdef->name);
87 FREE(&cdef->docs);
88 FREE(&cdef);
89 }
90 }
91}
const struct ConfigSetType * cs_get_type_def(const struct ConfigSet *cs, unsigned int type)
Get the definition for a type.
Definition set.c:199
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
Definition set.c:161
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
const char * name
User-visible name.
Definition set.h:66
intptr_t var
Storage for the variable.
Definition set.h:85
intptr_t initial
Initial value.
Definition set.h:68
uint32_t type
Variable type, e.g. DT_STRING.
Definition set.h:67
const char * docs
One-liner description.
Definition set.h:84
int type
Data type, e.g. DT_STRING.
Definition set.h:97
void(* destroy)(void *var, const struct ConfigDef *cdef)
Definition set.h:239
Container for lots of config items.
Definition set.h:251
The item stored in a Hash Table.
Definition hash.h:44
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition hash.h:45
void * data
User-supplied data.
Definition hash.h:47
An inherited config item.
Definition inheritance.h:32
struct HashElem * parent
HashElem of parent config item.
Definition inheritance.h:33
const char * name
Name of this config item.
Definition inheritance.h:34
intptr_t var
(Pointer to) value, of config item
Definition inheritance.h:35
#define D_INTERNAL_INHERITED
Config item is inherited.
Definition types.h:89
#define D_INTERNAL_FREE_CONFIGDEF
Config item must have its ConfigDef freed.
Definition types.h:87
#define D_INTERNAL_INITIAL_SET
Config item must have its initial value freed.
Definition types.h:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tags_deleter()

static void tags_deleter ( int type,
void * obj,
intptr_t data )
static

Free our hash table data - Implements hash_hdata_free_t -.

Definition at line 226 of file tags.c.

227{
228 FREE(&obj);
229}
+ Here is the caller graph for this function:

◆ thread_hash_destructor()

static void thread_hash_destructor ( int type,
void * obj,
intptr_t data )
static

Free our hash table data - Implements hash_hdata_free_t -.

Definition at line 1100 of file thread.c.

1101{
1102 FREE(&obj);
1103}
+ Here is the caller graph for this function:

◆ idxfmt_hashelem_free()

static void idxfmt_hashelem_free ( int type,
void * obj,
intptr_t data )
static

Free our hash table data - Implements hash_hdata_free_t -.

Definition at line 1037 of file parse.c.

1038{
1039 struct HookList *hl = obj;
1040 struct Hook *h = NULL;
1041 struct Hook *tmp = NULL;
1042
1043 TAILQ_FOREACH_SAFE(h, hl, entries, tmp)
1044 {
1045 TAILQ_REMOVE(hl, h, entries);
1046 hook_free(&h);
1047 }
1048
1049 FREE(&hl);
1050}
void hook_free(struct Hook **ptr)
Free a Hook.
Definition hook.c:47
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition queue.h:792
#define TAILQ_REMOVE(head, elm, field)
Definition queue.h:901
A list of user hooks.
Definition hook.h:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nntp_hashelem_free()

void nntp_hashelem_free ( int type,
void * obj,
intptr_t data )

Free our hash table data - Implements hash_hdata_free_t -.

Definition at line 114 of file nntp.c.

115{
116 nntp_mdata_free(&obj);
117}
void nntp_mdata_free(void **ptr)
Free the private Mailbox data - Implements Mailbox::mdata_free() -.
Definition mdata.c:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function: