146{
147 const char *param = lua_tostring(l, -2);
149
152 if (!he)
153 {
154
156 {
158 my_cdef.
name = param;
161 if (!he)
162 return -1;
163 }
164 else
165 {
166 luaL_error(l, "NeoMutt parameter not found %s", param);
167 return -1;
168 }
169 }
170
172
173 int rc = 0;
174
176 {
187 {
188 const char *value = lua_tostring(l, -1);
189 size_t val_size = lua_rawlen(l, -1);
194
198 rc = -1;
199 break;
200 }
204 {
205 const intptr_t value = lua_tointeger(l, -1);
208 rc = -1;
209 break;
210 }
212 {
213 const intptr_t value = lua_toboolean(l, -1);
216 rc = -1;
217 break;
218 }
219 default:
220 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s",
222 rc = -1;
223 break;
224 }
225
227 return rc;
228}
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