CYAML Internals
|
CYAML common utility functions. More...
Go to the source code of this file.
Macros | |
#define | cyaml_static_assert(e) |
#define | CYAML_UNUSED(_x) ((void)(_x)) |
#define | CYAML_BITFIELD_BITS (sizeof(cyaml_bitfield_t) * CHAR_BIT) |
Typedefs | |
typedef uint32_t | cyaml_bitfield_t |
Enumerations | |
enum | cyaml_state_e { CYAML_STATE_START, CYAML_STATE_IN_STREAM, CYAML_STATE_IN_DOC, CYAML_STATE_IN_MAP_KEY, CYAML_STATE_IN_MAP_VALUE, CYAML_STATE_IN_SEQUENCE, CYAML_STATE__COUNT } |
Functions | |
static const char * | cyaml__state_to_str (enum cyaml_state_e state) |
static const char * | cyaml__type_to_str (cyaml_type_e type) |
static void | cyaml__log (const cyaml_config_t *cfg, cyaml_log_t level, char *fmt,...) |
static bool | cyaml__is_case_sensitive (const cyaml_config_t *config, const cyaml_schema_value_t *schema) |
static int | cyaml__strcmp (const cyaml_config_t *config, const cyaml_schema_value_t *schema, const void *const str1, const void *const str2) |
static bool | cyaml__flag_check_all (enum cyaml_flag flags, enum cyaml_flag mask) |
CYAML common utility functions.
#define CYAML_BITFIELD_BITS (sizeof(cyaml_bitfield_t) * CHAR_BIT) |
Number of bits in cyaml_bitfield_t.
#define cyaml_static_assert | ( | e | ) |
Compile time assertion macro.
#define CYAML_UNUSED | ( | _x | ) | ((void)(_x)) |
Macro to squash unused variable compiler warnings.
typedef uint32_t cyaml_bitfield_t |
CYAML bitfield type.
enum cyaml_state_e |
CYAML state machine states.
|
inlinestatic |
Check of all the bits of a mask are set in a cyaml value flag word.
[in] | flags | The value flags to test. |
[in] | mask | Mask of the bits to test for in flags. |
|
inlinestatic |
Check if comparason should be case sensitive.
As described in the API, schema flags take priority over config flags.
[in] | config | Client's CYAML configuration structure. |
[in] | schema | The CYAML schema for the value to be compared. |
|
inlinestatic |
Log to client's logging function, if provided.
[in] | cfg | CYAML client config structure. |
[in] | level | Log level of message to log. |
[in] | fmt | Format string for message to log. |
[in] | ... | Additional arguments used by fmt. |
|
inlinestatic |
Convert a CYAML state into a human readable string.
[in] | state | The state to convert. |
|
inlinestatic |
Compare two strings.
Depending on the client's configuration, and the value's schema, this will do either a case-sensitive or case-insensitive comparason.
[in] | config | Client's CYAML configuration structure. |
[in] | schema | The CYAML schema for the value to be compared. |
[in] | str1 | First string to be compared. |
[in] | str2 | Second string to be compared. |
|
inlinestatic |
Convert a CYAML type into a human readable string.
[in] | type | The state to convert. |