NeoMutt  2023-11-03-107-g582dc1
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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() -.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 
static intptr_t myvar_native_get (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
 Get a string from a MyVar config item - Implements ConfigSetType::native_get() -.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 

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 198 of file config_type.c.

200{
201 struct Address *addr = *(struct Address **) var;
202
203 return (intptr_t) addr;
204}
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 158 of file bool.c.

160{
161 return *(bool *) var;
162}

◆ 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 160 of file enum.c.

162{
163 if (!cs || !var || !cdef)
164 return INT_MIN; /* LCOV_EXCL_LINE */
165
166 return *(unsigned char *) var;
167}

◆ 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 141 of file long.c.

143{
144 return *(long *) var;
145}

◆ 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 250 of file mbtable.c.

252{
253 struct MbTable *table = *(struct MbTable **) var;
254
255 return (intptr_t) table;
256}
Multibyte character table.
Definition: mbtable.h:36

◆ myvar_native_get()

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

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

Definition at line 138 of file myvar.c.

140{
141 const char *str = *(const char **) var;
142
143 return (intptr_t) str;
144}

◆ 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 155 of file number.c.

157{
158 return *(short *) var;
159}

◆ 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 206 of file path.c.

208{
209 const char *str = *(const char **) var;
210
211 return (intptr_t) str;
212}

◆ 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 160 of file quad.c.

162{
163 return *(char *) var;
164}

◆ 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 273 of file regex.c.

275{
276 struct Regex *r = *(struct Regex **) var;
277
278 return (intptr_t) r;
279}
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 190 of file slist.c.

192{
193 if (!cs || !var || !cdef)
194 return INT_MIN; /* LCOV_EXCL_LINE */
195
196 struct Slist *list = *(struct Slist **) var;
197
198 return (intptr_t) list;
199}
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 189 of file sort.c.

191{
192 return *(short *) var;
193}

◆ 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 177 of file string.c.

179{
180 const char *str = *(const char **) var;
181
182 return (intptr_t) str;
183}