Writing API for configuration.
More...
Writing API for configuration.
◆ cfg_set_bool()
CT_CONFIG_API void cfg_set_bool |
( |
cfg_field_t * |
field, |
|
|
bool |
value |
|
) |
| |
set the current value of a bool field
- Parameters
-
field | the field to set the value of |
value | the new value |
Definition at line 27 of file update.c.
◆ cfg_set_enum()
CT_CONFIG_API bool cfg_set_enum |
( |
cfg_field_t * |
field, |
|
|
const char * |
choice |
|
) |
| |
set the current value of an enum field set the value via a string name
- Parameters
-
field | the field to set the value of |
choice | the name of the choice to set |
- Return values
-
true | if the choice was valid and the field was updated, |
false | otherwise |
Definition at line 51 of file update.c.
◆ cfg_set_enum_value()
CT_CONFIG_API void cfg_set_enum_value |
( |
cfg_field_t * |
field, |
|
|
size_t |
value |
|
) |
| |
set the current value of an enum field set the value via an integer value
- Precondition
value
must be a valid value from the enum choices
- Warning
- this will assert if
value
is not a valid value from the flags choices
- Parameters
-
field | the field to set the value of |
value | the value to set |
Definition at line 91 of file update.c.
◆ cfg_set_flag()
set the current value of a flags field set the value via a string name
- Parameters
-
field | the field to set the value of |
choice | the name of the choice to set |
set | true to set the flag, false to clear it |
- Return values
-
true | if the choice was valid and the field was updated |
false | otherwise |
Definition at line 112 of file update.c.
◆ cfg_set_flag_value()
CT_CONFIG_API void cfg_set_flag_value |
( |
cfg_field_t * |
field, |
|
|
size_t |
value |
|
) |
| |
set the current value of a flags field set the value via an integer value
- Precondition
value
must be a valid value from the flags choices
- Warning
- this will assert if
value
is not a valid value from the flags choices
- Parameters
-
field | the field to set the value of |
value | the value to set |
Definition at line 155 of file update.c.
◆ cfg_set_int()
set the current value of an int field
- Parameters
-
field | the field to set the value of |
value | the new value |
- Returns
- true if the value was valid, false otherwise
Definition at line 9 of file update.c.
◆ cfg_set_string()
CT_CONFIG_API void cfg_set_string |
( |
cfg_field_t * |
field, |
|
|
char * |
value |
|
) |
| |
set the current value of a string field
- Parameters
-
field | the field to set the value of |
value | the new value |
Definition at line 35 of file update.c.
◆ cfg_vector_push()
CT_CONFIG_API void cfg_vector_push |
( |
cfg_field_t * |
field, |
|
|
char * |
value |
|
) |
| |
push a new value onto an array field
- Parameters
-
field | the field to push the value onto |
value | the new value |
Definition at line 43 of file update.c.