145{
146 const char *param = lua_tostring(l, -2);
148
151 if (!he)
152 {
153
155 {
157 my_cdef.
name = param;
160 if (!he)
161 return -1;
162 }
163 else
164 {
165 luaL_error(l, "NeoMutt parameter not found %s", param);
166 return -1;
167 }
168 }
169
171
172 int rc = 0;
173
175 {
186 {
187 const char *value = lua_tostring(l, -1);
188 size_t val_size = lua_rawlen(l, -1);
193
197 rc = -1;
198 break;
199 }
203 {
204 const intptr_t value = lua_tointeger(l, -1);
207 rc = -1;
208 break;
209 }
211 {
212 const intptr_t value = lua_toboolean(l, -1);
215 rc = -1;
216 break;
217 }
218 default:
219 luaL_error(l, "Unsupported NeoMutt parameter type %d for %s",
221 rc = -1;
222 break;
223 }
224
226 return rc;
227}
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