NeoMutt  2023-03-22-27-g3cb248
Teaching an old dog new tricks
DOXYGEN
native_get()

Get a string from a config item. More...

+ Collaboration diagram for native_get():

Functions

static intptr_t address_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an Address object from an Address config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t bool_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a bool from a Bool config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t enum_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an int object from an Enumeration config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t long_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a long from a Long config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t mbtable_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an MbTable object from a MbTable config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t number_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an int from a Number config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t path_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a string from a Path config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t quad_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an int object from a Quad-option config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t regex_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a Regex object from a Regex config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t slist_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a Slist from a Slist config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t sort_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get an int from a Sort config item - Implements ConfigSetType::native_get() -. More...
 
static intptr_t string_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a string from a String config item - Implements ConfigSetType::native_get() -. More...
 

Detailed Description

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
Precondition
cs is not NULL
var is not NULL
cdef is not NULL

Function Documentation

◆ address_native_get()

static intptr_t address_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an Address object from an Address config item - Implements ConfigSetType::native_get() -.

Definition at line 185 of file address.c.

187{
188 struct Address *addr = *(struct Address **) var;
189
190 return (intptr_t) addr;
191}
An email address.
Definition: address.h:36

◆ bool_native_get()

static intptr_t bool_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a bool from a Bool config item - Implements ConfigSetType::native_get() -.

Definition at line 152 of file bool.c.

154{
155 return *(bool *) var;
156}

◆ enum_native_get()

static intptr_t enum_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an int object from an Enumeration config item - Implements ConfigSetType::native_get() -.

Definition at line 154 of file enum.c.

156{
157 if (!cs || !var || !cdef)
158 return INT_MIN; /* LCOV_EXCL_LINE */
159
160 return *(unsigned char *) var;
161}

◆ long_native_get()

static intptr_t long_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a long from a Long config item - Implements ConfigSetType::native_get() -.

Definition at line 135 of file long.c.

137{
138 return *(long *) var;
139}

◆ mbtable_native_get()

static intptr_t mbtable_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an MbTable object from a MbTable config item - Implements ConfigSetType::native_get() -.

Definition at line 226 of file mbtable.c.

228{
229 struct MbTable *table = *(struct MbTable **) var;
230
231 return (intptr_t) table;
232}
Multibyte character table.
Definition: mbtable.h:34

◆ number_native_get()

static intptr_t number_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an int from a Number config item - Implements ConfigSetType::native_get() -.

Definition at line 149 of file number.c.

151{
152 return *(short *) var;
153}

◆ path_native_get()

static intptr_t path_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a string from a Path config item - Implements ConfigSetType::native_get() -.

Definition at line 198 of file path.c.

200{
201 const char *str = *(const char **) var;
202
203 return (intptr_t) str;
204}

◆ quad_native_get()

static intptr_t quad_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an int object from a Quad-option config item - Implements ConfigSetType::native_get() -.

Definition at line 154 of file quad.c.

156{
157 return *(char *) var;
158}

◆ regex_native_get()

static intptr_t regex_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a Regex object from a Regex config item - Implements ConfigSetType::native_get() -.

Definition at line 244 of file regex.c.

246{
247 struct Regex *r = *(struct Regex **) var;
248
249 return (intptr_t) r;
250}
Cached regular expression.
Definition: regex3.h:89

◆ slist_native_get()

static intptr_t slist_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a Slist from a Slist config item - Implements ConfigSetType::native_get() -.

Definition at line 172 of file slist.c.

174{
175 if (!cs || !var || !cdef)
176 return INT_MIN; /* LCOV_EXCL_LINE */
177
178 struct Slist *list = *(struct Slist **) var;
179
180 return (intptr_t) list;
181}
String list.
Definition: slist.h:47

◆ sort_native_get()

static intptr_t sort_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get an int from a Sort config item - Implements ConfigSetType::native_get() -.

Definition at line 183 of file sort.c.

185{
186 return *(short *) var;
187}

◆ string_native_get()

static intptr_t string_native_get ( const struct ConfigSet cs,
void *  var,
const struct ConfigDef cdef,
struct Buffer err 
)
static

Get a string from a String config item - Implements ConfigSetType::native_get() -.

Definition at line 171 of file string.c.

173{
174 const char *str = *(const char **) var;
175
176 return (intptr_t) str;
177}