194{
195 long num = 0;
196 if (!mutt_str_atol_full(value, &num))
197 {
200 }
201
202 long result = *((long *) var) - num;
204 {
207 }
208
209 if (result == (*(long *) var))
211
214
216 {
217 int rc = cdef->
validator(cs, cdef, (intptr_t) result, err);
218
221 }
222
223 *(long *) var = result;
225}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
static bool startup_only(const struct ConfigDef *cdef, struct Buffer *err)
Validator function for D_ON_STARTUP.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_INV_TYPE
Value is not valid for the type.
#define CSR_INV_VALIDATOR
Value was rejected by the validator.
#define CSR_SUC_NO_CHANGE
The value hasn't changed.
#define CSR_SUCCESS
Action completed successfully.
const char * name
User-visible name.
int(* validator)(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
uint32_t type
Variable type, e.g. DT_STRING.
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.