143{
144 const char *param = lua_tostring(l, -2);
146
149 if (!he)
150 {
151
153 {
155 my_cdef.
name = param;
158 if (!he)
159 return -1;
160 }
161 else
162 {
163 luaL_error(l, "NeoMutt parameter not found %s", param);
164 return -1;
165 }
166 }
167
169
170 int rc = 0;
171
173 {
184 {
185 const char *value = lua_tostring(l, -1);
186 size_t val_size = lua_rawlen(l, -1);
191
195 rc = -1;
196 break;
197 }
201 {
202 const intptr_t value = lua_tointeger(l, -1);
205 rc = -1;
206 break;
207 }
209 {
210 const intptr_t value = lua_toboolean(l, -1);
213 rc = -1;
214 break;
215 }
216 default:
217 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s",
219 rc = -1;
220 break;
221 }
222
224 return rc;
225}
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.
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.
@ DT_SLIST
a list of strings
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
@ DT_MYVAR
a user-defined variable (my_foo)
@ DT_MBTABLE
multibyte char table
@ DT_ADDRESS
e-mail address
@ DT_REGEX
regular expressions
@ DT_PATH
a path to a file/directory