NeoMutt  2023-05-17-56-ga67199
Teaching an old dog new tricks
DOXYGEN

Destroy a config item. More...

+ Collaboration diagram for destroy():

Functions

static void address_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy an Address object - Implements ConfigSetType::destroy() -. More...
 
static void mbtable_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy an MbTable object - Implements ConfigSetType::destroy() -. More...
 
static void myvar_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy a MyVar - Implements ConfigSetType::destroy() -. More...
 
static void path_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy a Path - Implements ConfigSetType::destroy() -. More...
 
static void regex_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy a Regex object - Implements ConfigSetType::destroy() -. More...
 
static void slist_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy an Slist object - Implements ConfigSetType::destroy() -. More...
 
static void string_destroy (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy a String - Implements ConfigSetType::destroy() -. More...
 

Detailed Description

Destroy a config item.

Parameters
csConfig items
varVariable to destroy
cdefVariable definition
Precondition
cs is not NULL
var is not NULL
cdef is not NULL

Function Documentation

◆ address_destroy()

static void address_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy an Address object - Implements ConfigSetType::destroy() -.

Definition at line 49 of file address.c.

50{
51 struct Address **a = var;
52 if (!*a)
53 return;
54
55 address_free(a);
56}
void address_free(struct Address **ptr)
Free an Address object.
Definition: address.c:243
An email address.
Definition: address.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mbtable_destroy()

static void mbtable_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy an MbTable object - Implements ConfigSetType::destroy() -.

Definition at line 93 of file mbtable.c.

94{
95 struct MbTable **m = var;
96 if (!*m)
97 return;
98
99 mbtable_free(m);
100}
void mbtable_free(struct MbTable **table)
Free an MbTable object.
Definition: mbtable.c:279
Multibyte character table.
Definition: mbtable.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ myvar_destroy()

static void myvar_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy a MyVar - Implements ConfigSetType::destroy() -.

Definition at line 41 of file myvar.c.

42{
43 const char **str = (const char **) var;
44 if (!*str)
45 return;
46
47 FREE(var);
48}
#define FREE(x)
Definition: memory.h:43
+ Here is the caller graph for this function:

◆ path_destroy()

static void path_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy a Path - Implements ConfigSetType::destroy() -.

Definition at line 73 of file path.c.

74{
75 const char **str = (const char **) var;
76 if (!*str)
77 return;
78
79 FREE(var);
80}
+ Here is the caller graph for this function:

◆ regex_destroy()

static void regex_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy a Regex object - Implements ConfigSetType::destroy() -.

Definition at line 63 of file regex.c.

64{
65 struct Regex **r = var;
66 if (!*r)
67 return;
68
69 regex_free(r);
70}
void regex_free(struct Regex **r)
Free a Regex object.
Definition: regex.c:48
Cached regular expression.
Definition: regex3.h:89
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slist_destroy()

static void slist_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy an Slist object - Implements ConfigSetType::destroy() -.

Definition at line 46 of file slist.c.

47{
48 if (!cs || !var || !cdef)
49 return; /* LCOV_EXCL_LINE */
50
51 struct Slist **l = (struct Slist **) var;
52 if (!*l)
53 return;
54
55 slist_free(l);
56}
void slist_free(struct Slist **list)
Free an Slist object.
Definition: slist.c:162
String list.
Definition: slist.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string_destroy()

static void string_destroy ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef 
)
static

Destroy a String - Implements ConfigSetType::destroy() -.

Definition at line 45 of file string.c.

46{
47 const char **str = (const char **) var;
48 if (!*str)
49 return;
50
51 FREE(var);
52}
+ Here is the caller graph for this function: