Type representing a number. More...
#include "config.h"
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "mutt/lib.h"
#include "number.h"
#include "set.h"
#include "subset.h"
#include "types.h"
Go to the source code of this file.
Macros | |
#define | TOGGLE_BIT ((SHRT_MAX + 1) << 1) |
Functions | |
static intptr_t | native_get (void *var) |
Get an int from a Number config item. | |
static void | native_set (void *var, intptr_t val) |
Set an int into a Number config item. | |
static void | native_toggle (void *var) |
Toggle a Number config item. | |
static int | number_string_set (void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) |
Set a Number by string - Implements ConfigSetType::string_set() -. | |
static int | number_string_get (void *var, const struct ConfigDef *cdef, struct Buffer *result) |
Get a Number as a string - Implements ConfigSetType::string_get() -. | |
static int | number_native_set (void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) |
Set a Number config item by int - Implements ConfigSetType::native_set() -. | |
static intptr_t | number_native_get (void *var, const struct ConfigDef *cdef, struct Buffer *err) |
Get an int from a Number config item - Implements ConfigSetType::native_get() -. | |
static int | number_string_plus_equals (void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err) |
Add to a Number by string - Implements ConfigSetType::string_plus_equals() -. | |
static int | number_string_minus_equals (void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err) |
Subtract from a Number by string - Implements ConfigSetType::string_minus_equals() -. | |
static bool | number_has_been_set (void *var, const struct ConfigDef *cdef) |
Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -. | |
static int | number_reset (void *var, const struct ConfigDef *cdef, struct Buffer *err) |
Reset a Number to its initial value - Implements ConfigSetType::reset() -. | |
int | number_he_toggle (struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err) |
Toggle the value of a number (value <-> 0) | |
Variables | |
const struct ConfigSetType | CstNumber |
Config type representing a number. | |
Type representing a number.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file number.c.
|
static |
|
static |
|
static |
int number_he_toggle | ( | struct ConfigSubset * | sub, |
struct HashElem * | he, | ||
struct Buffer * | err | ||
) |
Toggle the value of a number (value <-> 0)
num | Result, e.g. CSR_SUCCESS |
Definition at line 307 of file number.c.
const struct ConfigSetType CstNumber |
Config type representing a number.