Adaptive Framework
0.9.0
|
Files | |
file | afw_flag.h |
Adaptive Framework Software Flag Header. | |
Data Structures | |
struct | afw_flag_s |
Struct used for a registered flag. More... | |
Macros | |
#define | AFW_FLAG_INITIAL_ALLOCATED_COUNT 64 |
#define | afw_flag_is_active(flag_index, xctx) ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) |
Determine if flag for flag index is set in xctx. More... | |
Functions | |
afw_boolean_t | afw_flag_by_id_is_active (const afw_utf8_t *flag_id, afw_xctx_t *xctx) |
Determine if flag for flag id is set in xctx. More... | |
const afw_flag_t * | afw_flag_get_by_index (afw_size_t flag_index, afw_xctx_t *xctx) |
Get flag by index. More... | |
afw_size_t | afw_flag_get_index (const afw_utf8_t *flag_id, afw_xctx_t *xctx) |
Get the flag index for a flag id. More... | |
void | afw_flag_set_default (const afw_utf8_t *flag_id, afw_boolean_t set_to, afw_xctx_t *xctx) |
Set the default value of a flag. More... | |
void | afw_flag_set_default_flag_ids (const afw_list_t *default_flag_ids, afw_xctx_t *xctx) |
Set a new default flags list. More... | |
void | afw_flag_set (const afw_utf8_t *flag_id, afw_boolean_t set_to, afw_xctx_t *xctx) |
Set a flag in xctx. More... | |
void | afw_flag_set_to_defaults_plus_array (const afw_utf8_t *const *flag_ids, afw_xctx_t *xctx) |
Set xctx default flags plus one or more additional flags. More... | |
void | afw_flag_environment_register_flag (const afw_utf8_t *flag_id, const afw_utf8_t *brief, const afw_utf8_t *description, const afw_utf8_t *included_by_flag_id, afw_xctx_t *xctx) |
Register a flag definition. More... | |
void | afw_flag_add_included_by (const afw_utf8_t *flag_id, const afw_utf8_t *included_by_flag_id, afw_xctx_t *xctx) |
Add another include_by flag to a registered flag. More... | |
afw_flag_internal_early_register_core (afw_xctx_t *xctx) | |
Software flags.
#define afw_flag_is_active | ( | flag_index, | |
xctx | |||
) | ((flag_index) < (xctx)->flags_count && (xctx)->flags[flag_index]) |
Determine if flag for flag index is set in xctx.
flag_index | |
xctx | of caller |
Definition at line 84 of file afw_flag.h.
void afw_flag_add_included_by | ( | const afw_utf8_t * | flag_id, |
const afw_utf8_t * | included_by_flag_id, | ||
afw_xctx_t * | xctx | ||
) |
Add another include_by flag to a registered flag.
flag_id | of a registered flag. |
included_by_flag_id | of a registered flag. |
xctx | of caller. |
Definition at line 688 of file afw_flag.c.
afw_boolean_t afw_flag_by_id_is_active | ( | const afw_utf8_t * | flag_id, |
afw_xctx_t * | xctx | ||
) |
Determine if flag for flag id is set in xctx.
flag_id | |
xctx | of caller |
Definition at line 565 of file afw_flag.c.
void afw_flag_environment_register_flag | ( | const afw_utf8_t * | flag_id, |
const afw_utf8_t * | brief, | ||
const afw_utf8_t * | description, | ||
const afw_utf8_t * | included_by_flag_id, | ||
afw_xctx_t * | xctx | ||
) |
Register a flag definition.
flag_id. | |
brief. | |
description. | |
included_by_flag_id | |
log_priority | to be used if this flag triggers a log message. |
xctx | of caller. |
Definition at line 579 of file afw_flag.c.
const afw_flag_t* afw_flag_get_by_index | ( | afw_size_t | flag_index, |
afw_xctx_t * | xctx | ||
) |
Get flag by index.
flag_index | |
xctx | of caller |
Definition at line 534 of file afw_flag.c.
afw_size_t afw_flag_get_index | ( | const afw_utf8_t * | flag_id, |
afw_xctx_t * | xctx | ||
) |
Get the flag index for a flag id.
flag_id | |
xctx | of caller |
Definition at line 546 of file afw_flag.c.
void afw_flag_set | ( | const afw_utf8_t * | flag_id, |
afw_boolean_t | set_to, | ||
afw_xctx_t * | xctx | ||
) |
Set a flag in xctx.
flag_index | |
set_to | true to set or false to unset |
xctx | of caller |
Definition at line 780 of file afw_flag.c.
void afw_flag_set_default | ( | const afw_utf8_t * | flag_id, |
afw_boolean_t | set_to, | ||
afw_xctx_t * | xctx | ||
) |
Set the default value of a flag.
flag_id | of flag to set as default. The flag must already be registered. |
set_to | true to set or false to unset |
xctx | of caller. |
This function only sets the flag as a default until the environment is refreshed. Add this flag to the defaultFlags property of the application conf to make it permanent.
Definition at line 717 of file afw_flag.c.
void afw_flag_set_default_flag_ids | ( | const afw_list_t * | default_flag_ids, |
afw_xctx_t * | xctx | ||
) |
Set a new default flags list.
default_flag_ids | list. |
xctx | of caller |
The is normally called when the application conf is processed based on the defaultFlags parameter. The flagIds in the list do not have to already be defined. When a flag is registered this list is checked to determine flags that should be set.
Definition at line 823 of file afw_flag.c.
void afw_flag_set_to_defaults_plus_array | ( | const afw_utf8_t *const * | flag_ids, |
afw_xctx_t * | xctx | ||
) |
Set xctx default flags plus one or more additional flags.
flag_ids | is NULL terminated array of flag ids. |
xctx | of caller |
Definition at line 797 of file afw_flag.c.