NeoMutt  2021-10-29-43-g6b8931
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 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

Contract

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 **addr)
Free an Address object.
Definition: address.c:249
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 95 of file mbtable.c.

96 {
97  struct MbTable **m = var;
98  if (!*m)
99  return;
100 
101  mbtable_free(m);
102 }
void mbtable_free(struct MbTable **table)
Free an MbTable object.
Definition: mbtable.c:281
Multibyte character table.
Definition: mbtable.h:34
+ Here is the call graph for this function:
+ 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 }
#define FREE(x)
Definition: memory.h:40
+ 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:90
+ 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: