156{
157 const char *param = lua_tostring(l, -2);
159
162 if (!he)
163 {
164
166 {
168 my_cdef.
name = param;
171 if (!he)
172 return -1;
173 }
174 else
175 {
176 luaL_error(l, "NeoMutt parameter not found %s", param);
177 return -1;
178 }
179 }
180
182
183 int rc = 0;
184
186 {
196 {
197 const char *value = lua_tostring(l, -1);
198 size_t val_size = lua_rawlen(l, -1);
203
207 rc = -1;
208 break;
209 }
212 {
213 const intptr_t value = lua_tointeger(l, -1);
216 rc = -1;
217 break;
218 }
220 {
221 const intptr_t value = lua_toboolean(l, -1);
224 rc = -1;
225 break;
226 }
227 default:
228 luaL_error(l,
"Unsupported NeoMutt parameter type %d for %s",
DTYPE(cdef->
type), param);
229 rc = -1;
230 break;
231 }
232
234 return rc;
235}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
struct HashElem * cs_create_variable(const struct ConfigSet *cs, struct ConfigDef *cdef, struct Buffer *err)
Create and register one config item.
#define CSR_SUCCESS
Action completed successfully.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
const char * name
User-visible name.
uint32_t type
Variable type, e.g. DT_STRING.
struct ConfigSet * cs
Parent ConfigSet.
The item stored in a Hash Table.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
void * data
User-supplied data.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
int cs_subset_he_native_set(const struct ConfigSubset *sub, struct HashElem *he, intptr_t value, struct Buffer *err)
Natively set the value of a HashElem config item.
int cs_subset_he_string_set(const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err)
Set a config item by string.
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
#define DT_SORT
sorting methods
#define DTYPE(x)
Mask for the Data Type.
#define DT_SLIST
a list of strings
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
#define DT_BOOL
boolean option
#define DT_MYVAR
a user-defined variable (my_foo)
#define DT_PATH
a path to a file/directory
#define DT_STRING
a string
#define DT_ENUM
an enumeration
#define DT_ADDRESS
e-mail address
#define DT_REGEX
regular expressions
#define DT_MBTABLE
multibyte char table
#define DT_NUMBER
a number