NeoMutt  2025-01-09-81-g753ae0
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
has_been_set()

Is the config value different to its initial value? More...

+ Collaboration diagram for has_been_set():

Functions

static bool address_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool bool_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool enum_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool long_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool mbtable_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool number_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool path_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool quad_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool regex_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool slist_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool sort_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool string_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 
static bool expando_has_been_set (void *var, const struct ConfigDef *cdef)
 Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
 

Detailed Description

Is the config value different to its initial value?

Parameters
varVariable to check
cdefVariable definition
Return values
trueValue differs from its initial value
falseValue is the same as its initial value
Precondition
var is not NULL
cdef is not NULL

Function Documentation

◆ address_has_been_set()

static bool address_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 215 of file config_type.c.

216{
217 struct Buffer *value = buf_pool_get();
218 struct Address *a = *(struct Address **) var;
219 if (a)
220 mutt_addr_write(value, a, false);
221
222 const char *initial = (const char *) cdef->initial;
223
224 bool rc = !mutt_str_equal(initial, buf_string(value));
225 buf_pool_release(&value);
226 return rc;
227}
size_t mutt_addr_write(struct Buffer *buf, struct Address *addr, bool display)
Write a single Address to a buffer.
Definition: address.c:1050
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:661
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:96
An email address.
Definition: address.h:36
String manipulation buffer.
Definition: buffer.h:36
intptr_t initial
Initial value.
Definition: set.h:67
+ Here is the call graph for this function:

◆ bool_has_been_set()

static bool bool_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 166 of file bool.c.

167{
168 return (cdef->initial != (*(bool *) var));
169}

◆ enum_has_been_set()

static bool enum_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 161 of file enum.c.

162{
163 return (cdef->initial != (*(unsigned char *) var));
164}

◆ long_has_been_set()

static bool long_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 227 of file long.c.

228{
229 return (cdef->initial != (*(long *) var));
230}

◆ mbtable_has_been_set()

static bool mbtable_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 259 of file mbtable.c.

260{
261 const char *initial = (const char *) cdef->initial;
262
263 struct MbTable *table = *(struct MbTable **) var;
264 const char *table_str = table ? table->orig_str : NULL;
265
266 return !mutt_str_equal(initial, table_str);
267}
Multibyte character table.
Definition: mbtable.h:36
char * orig_str
Original string used to generate this object.
Definition: mbtable.h:37
+ Here is the call graph for this function:

◆ number_has_been_set()

static bool number_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 272 of file number.c.

273{
274 return (cdef->initial != native_get(var));
275}
static intptr_t native_get(void *var)
Get an int from a Number config item.
Definition: number.c:51
+ Here is the call graph for this function:

◆ path_has_been_set()

static bool path_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 218 of file path.c.

219{
220 const char *initial = path_tidy((const char *) cdef->initial, cdef->type & D_PATH_DIR);
221 const char *value = *(const char **) var;
222
223 bool rc = !mutt_str_equal(initial, value);
224 FREE(&initial);
225 return rc;
226}
static char * path_tidy(const char *path, bool is_dir)
Tidy a path for storage.
Definition: path.c:58
#define FREE(x)
Definition: memory.h:55
uint32_t type
Variable type, e.g. DT_STRING.
Definition: set.h:66
#define D_PATH_DIR
Path is a directory.
Definition: types.h:102
+ Here is the call graph for this function:

◆ quad_has_been_set()

static bool quad_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 172 of file quad.c.

173{
174 return (cdef->initial != (*(char *) var));
175}

◆ regex_has_been_set()

static bool regex_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 284 of file regex.c.

285{
286 const char *initial = (const char *) cdef->initial;
287
288 struct Regex *currx = *(struct Regex **) var;
289 const char *curval = currx ? currx->pattern : NULL;
290
291 return !mutt_str_equal(initial, curval);
292}
Cached regular expression.
Definition: regex3.h:86
char * pattern
printable version
Definition: regex3.h:87
+ Here is the call graph for this function:

◆ slist_has_been_set()

static bool slist_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 273 of file slist.c.

274{
275 struct Slist *list = NULL;
276 const char *initial = (const char *) cdef->initial;
277
278 if (initial)
279 list = slist_parse(initial, cdef->type);
280
281 bool rc = !slist_equal(list, *(struct Slist **) var);
282 slist_free(&list);
283 return rc;
284}
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
Definition: slist.c:177
void slist_free(struct Slist **ptr)
Free an Slist object.
Definition: slist.c:124
bool slist_equal(const struct Slist *a, const struct Slist *b)
Compare two string lists.
Definition: slist.c:91
String list.
Definition: slist.h:37
+ Here is the call graph for this function:

◆ sort_has_been_set()

static bool sort_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 198 of file sort.c.

199{
200 return (cdef->initial != (*(short *) var));
201}

◆ string_has_been_set()

static bool string_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 228 of file string.c.

229{
230 const char *initial = (const char *) cdef->initial;
231 const char *value = *(const char **) var;
232
233 return !mutt_str_equal(initial, value);
234}
+ Here is the call graph for this function:

◆ expando_has_been_set()

static bool expando_has_been_set ( void *  var,
const struct ConfigDef cdef 
)
static

Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.

Definition at line 278 of file config_type.c.

279{
280 const char *initial = (const char *) cdef->initial;
281
282 struct Expando *exp = *(struct Expando **) var;
283 const char *exp_str = exp ? exp->string : NULL;
284
285 return !mutt_str_equal(initial, exp_str);
286}
Parsed Expando trees.
Definition: expando.h:41
const char * string
Pointer to the parsed string.
Definition: expando.h:42
+ Here is the call graph for this function: