151{
152 const char *param = lua_tostring(l, -2);
154
157 if (!he)
158 {
159
161 {
163 my_cdef.
name = param;
166 if (!he)
167 return -1;
168 }
169 else
170 {
171 luaL_error(l, "NeoMutt parameter not found %s", param);
172 return -1;
173 }
174 }
175
177
178 int rc = 0;
179
181 {
192 {
193 const char *value = lua_tostring(l, -1);
194 size_t val_size = lua_rawlen(l, -1);
199
203 rc = -1;
204 break;
205 }
209 {
210 const intptr_t value = lua_tointeger(l, -1);
213 rc = -1;
214 break;
215 }
217 {
218 const intptr_t value = lua_toboolean(l, -1);
221 rc = -1;
222 break;
223 }
224 default:
225 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s",
227 rc = -1;
228 break;
229 }
230
232 return rc;
233}
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_RESULT(x)
Extract the result code from CSR_* flags.
#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 expand_path(struct Buffer *buf, bool regex)
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.
#define CONFIG_TYPE(t)
Extract the type from the flags.
@ 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