NeoMutt  2021-02-05
Teaching an old dog new tricks
DOXYGEN
ConfigSetType Struct Reference

Type definition for a config item. More...

#include "set.h"

Data Fields

int type
 Data type, e.g. DT_STRING. More...
 
const char * name
 Name of the type, e.g. "String". More...
 
int(* string_set )(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
 Set a config item by string. More...
 
int(* string_get )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
 Get a config item as a string. More...
 
int(* native_set )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Set a config item by string. More...
 
intptr_t(* native_get )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a string from a config item. More...
 
int(* string_plus_equals )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
 Add to a config item by string. More...
 
int(* string_minus_equals )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
 Remove from a config item as a string. More...
 
int(* reset )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Reset a config item to its initial value. More...
 
void(* destroy )(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
 Destroy a config item. More...
 

Detailed Description

Type definition for a config item.

Each config item has a type which is defined by a set of callback functions.

Definition at line 88 of file set.h.

Field Documentation

◆ type

int ConfigSetType::type

Data type, e.g. DT_STRING.

Definition at line 90 of file set.h.

◆ name

const char* ConfigSetType::name

Name of the type, e.g. "String".

Definition at line 91 of file set.h.

◆ string_set

int(* ConfigSetType::string_set) (const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)

Set a config item by string.

Parameters
csConfig items
varVariable to set (may be NULL)
cdefVariable definition
valueValue to set (may be NULL)
errBuffer for error messages (may be NULL)
Return values
numResult, e.g. CSR_SUCCESS

If var is NULL, then the config item's initial value will be set.

Contract

  • cs is not NULL
  • cdef is not NULL

Definition at line 108 of file set.h.

◆ string_get

int(* ConfigSetType::string_get) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)

Get a config item as a string.

Parameters
csConfig items
varVariable to get (may be NULL)
cdefVariable definition
resultBuffer for results or error messages
Return values
numResult, e.g. CSR_SUCCESS

If var is NULL, then the config item's initial value will be returned.

Contract

  • cs is not NULL
  • cdef is not NULL
  • result is not NULL

Definition at line 125 of file set.h.

◆ native_set

int(* ConfigSetType::native_set) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)

Set a config item by string.

Parameters
csConfig items
varVariable to set
cdefVariable definition
valueNative pointer/value to set
errBuffer for error messages (may be NULL)
Return values
numResult, e.g. CSR_SUCCESS

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 141 of file set.h.

◆ native_get

intptr_t(* ConfigSetType::native_get) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)

Get a string from a config item.

Parameters
csConfig items
varVariable to get
cdefVariable definition
errBuffer for error messages (may be NULL)
Return values
intptr_tConfig item string
INT_MINError

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 157 of file set.h.

◆ string_plus_equals

int(* ConfigSetType::string_plus_equals) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)

Add to a config item by string.

Parameters
csConfig items
varVariable to set
cdefVariable definition
valueValue to set
errBuffer for error messages (may be NULL)
Return values
numResult, e.g. CSR_SUCCESS

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 173 of file set.h.

◆ string_minus_equals

int(* ConfigSetType::string_minus_equals) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)

Remove from a config item as a string.

Parameters
csConfig items
varVariable to set
cdefVariable definition
valueValue to set
errBuffer for error messages (may be NULL)
Return values
numResult, e.g. CSR_SUCCESS

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 189 of file set.h.

◆ reset

int(* ConfigSetType::reset) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)

Reset a config item to its initial value.

Parameters
csConfig items
varVariable to reset
cdefVariable definition
errBuffer for error messages (may be NULL)
Return values
numResult, e.g. CSR_SUCCESS

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 204 of file set.h.

◆ destroy

void(* ConfigSetType::destroy) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)

Destroy a config item.

Parameters
csConfig items
varVariable to destroy
cdefVariable definition

Contract

  • cs is not NULL
  • var is not NULL
  • cdef is not NULL

Definition at line 217 of file set.h.


The documentation for this struct was generated from the following file: