utils/yaml.h file

Contents

YAML utils.

Functions

void yaml_cyaml_log_func(cyaml_log_t level, void* ctxt, const char* format, va_list args)
Custom logging function for libcyaml.

Defines

#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
#define YAML_FIELD_MAPPING_PTR(owner, member, schema)
Mapping pointer to a struct.
#define YAML_FIELD_MAPPING_PTR_OPTIONAL(owner, member, schema)
Mapping pointer to a struct.
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Fixed-width array of pointers with variable count.
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY(owner, member, schema, size)
Fixed-width array of pointers with fixed count.
#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count.
#define YAML_FIELD_DYN_ARRAY_VAR_COUNT(owner, member, schema)
Dynamic-width (reallocated) array of structs with variable count.
#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT_OPT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count, nullable.
#define YAML_FIELD_DYN_ARRAY_VAR_COUNT_PRIMITIVES(owner, member, schema)
Dynamic-width (reallocated) array of primitives with variable count.
#define YAML_FIELD_SEQUENCE_FIXED(owner, member, schema, size)
Fixed sequence of pointers.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
#define YAML_VALUE_PTR_NULLABLE(cc, fields_schema)
Schema to be used as a pointer that can be NULL.
#define YAML_VALUE_DEFAULT(cc, fields_schema)
Schema to be used for arrays of structs directly (not as pointers).
#define SERIALIZE_INC(camelcase, lowercase)
Serializes to XML.

Define documentation

#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY_VAR_COUNT(owner, member, schema)

Fixed-width array of pointers with variable count.

 @
MyStruct * my_structs[MAX_STRUCTS];
int        num_my_structs;

@

#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY(owner, member, schema, size)

Fixed-width array of pointers with fixed count.

 @
MyStruct * my_structs[MAX_STRUCTS_CONST];

@

#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT(owner, member, schema)

Dynamic-width (reallocated) array of pointers with variable count.

 @
AutomationTrack ** ats;
int                num_ats;
int                ats_size;

@

#define YAML_FIELD_DYN_ARRAY_VAR_COUNT(owner, member, schema)

Dynamic-width (reallocated) array of structs with variable count.

 @
RegionIdentifier * ids;
int                num_ids;
int                ids_size;

@

#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT_OPT(owner, member, schema)

Dynamic-width (reallocated) array of pointers with variable count, nullable.

 @
AutomationTrack ** ats;
int                num_ats;
int                ats_size;

@

#define YAML_FIELD_DYN_ARRAY_VAR_COUNT_PRIMITIVES(owner, member, schema)

Dynamic-width (reallocated) array of primitives with variable count.

 @
int * ids;
int   num_ids;
int   ids_size;

@

#define YAML_VALUE_DEFAULT(cc, fields_schema)

Schema to be used for arrays of structs directly (not as pointers).

For every other case, use the PTR above.

#define SERIALIZE_INC(camelcase, lowercase)

Serializes to XML.

MUST be free'd.