#include "param_bool.h"
#include "param_internal.h"
#include "utils_common.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
Go to the source code of this file.
|
| static enum yac_param_type | yac_param_bool_get_type (const struct yac_param *param) |
| |
| static int | yac_param_bool_is_default (const struct yac_param *param) |
| |
| static const char * | yac_param_bool_get_name (const struct yac_param *param) |
| |
| static int | yac_param_bool_set_scalar (struct yac_param *param, const char *value_str) |
| |
| static int | yac_param_bool_get_scalar (const struct yac_param *param, char *buf, size_t buflen) |
| |
| static int | yac_param_bool_get_scalar_kind (const struct yac_param *param, enum yac_param_scalar_kind *scalar_kind) |
| |
| static int | yac_param_bool_set_scalar_int (struct yac_param *param, int value) |
| |
| static int | yac_param_bool_get_scalar_int (const struct yac_param *param, int *value) |
| |
| static void | yac_param_bool_delete (struct yac_param *param) |
| |
| struct yac_param * | yac_param_bool_new (const char *name, int *value_ptr, int default_value, int has_default, int is_defined) |
| | Create a bool parameter (backed by int)
|
| |
◆ anonymous enum
◆ yac_param_bool_delete()
| static void yac_param_bool_delete |
( |
struct yac_param * | param | ) |
|
|
static |
◆ yac_param_bool_get_name()
| static const char * yac_param_bool_get_name |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_bool_get_scalar()
| static int yac_param_bool_get_scalar |
( |
const struct yac_param * | param, |
|
|
char * | buf, |
|
|
size_t | buflen ) |
|
static |
◆ yac_param_bool_get_scalar_int()
| static int yac_param_bool_get_scalar_int |
( |
const struct yac_param * | param, |
|
|
int * | value ) |
|
static |
◆ yac_param_bool_get_scalar_kind()
◆ yac_param_bool_get_type()
◆ yac_param_bool_is_default()
| static int yac_param_bool_is_default |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_bool_new()
| struct yac_param * yac_param_bool_new |
( |
const char * | name, |
|
|
int * | value_ptr, |
|
|
int | default_value, |
|
|
int | has_default, |
|
|
int | is_defined ) |
Create a bool parameter (backed by int)
- Parameters
-
| name | Name of the parameter (copied internally, may be NULL for unnamed) |
| value_ptr | Pointer to the int value (0 = false, 1 = true) |
| default_value | Default value (0 or 1, ignored if has_default is false) |
| has_default | If true, parameter has a default value; if false, value is undefined until set |
| is_defined | If true, initial value is considered defined (0 or 1); if false, initial value is considered undefined and user must set it before getting |
- Returns
- Pointer to new parameter handle
Definition at line 159 of file param_bool.c.
◆ yac_param_bool_set_scalar()
| static int yac_param_bool_set_scalar |
( |
struct yac_param * | param, |
|
|
const char * | value_str ) |
|
static |
◆ yac_param_bool_set_scalar_int()
| static int yac_param_bool_set_scalar_int |
( |
struct yac_param * | param, |
|
|
int | value ) |
|
static |
◆ bool_table
Initial value:= {
{"false", 0},
{"False", 0},
{"FALSE", 0},
{"no", 0},
{"NO", 0},
{"0", 0},
{"true", 1},
{"True", 1},
{"TRUE", 1},
{"yes", 1},
{"YES", 1},
{"1", 1},
}
Definition at line 13 of file param_bool.c.
◆ yac_param_bool_vtable
Initial value:= {
.get_sub_count = NULL,
.get_sub_by_name = NULL,
.get_sub_by_index = NULL,
.append = NULL,
.set_scalar_dble = NULL,
.get_scalar_dble = NULL
}
static int yac_param_bool_set_scalar(struct yac_param *param, const char *value_str)
static void yac_param_bool_delete(struct yac_param *param)
static int yac_param_bool_set_scalar_int(struct yac_param *param, int value)
static const char * yac_param_bool_get_name(const struct yac_param *param)
static int yac_param_bool_get_scalar_kind(const struct yac_param *param, enum yac_param_scalar_kind *scalar_kind)
static int yac_param_bool_get_scalar_int(const struct yac_param *param, int *value)
static enum yac_param_type yac_param_bool_get_type(const struct yac_param *param)
static int yac_param_bool_is_default(const struct yac_param *param)
static int yac_param_bool_get_scalar(const struct yac_param *param, char *buf, size_t buflen)
Definition at line 141 of file param_bool.c.