CYAML Internals
cyaml.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: ISC
3 *
4 * Copyright (c) 2017-2021 Michael Drake <tlsa@netsurf-browser.org>
5 */
6
14#ifndef CYAML_H
15#define CYAML_H
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
22#include <stdarg.h>
23#include <stdint.h>
24#include <stddef.h>
25
29extern const char *cyaml_version_str;
30
44extern const uint32_t cyaml_version;
45
53typedef enum cyaml_type {
132
138typedef enum cyaml_flag {
231 CYAML_FLAG_FLOW = (1 << 6),
326
332typedef struct cyaml_strval {
333 const char *str;
334 int64_t val;
336
342typedef struct cyaml_bitdef {
343 const char *name;
344 uint8_t offset;
345 uint8_t bits;
347
368typedef struct cyaml_schema_value {
382 uint32_t data_size;
384 union {
386 struct {
392 uint32_t min;
400 uint32_t max;
403 struct {
414 struct {
416 const struct cyaml_bitdef *bitdefs;
418 uint32_t count;
424 struct {
442 uint32_t min;
449 uint32_t max;
455 struct {
459 uint32_t count;
461 };
463
476typedef struct cyaml_schema_field {
482 const char *key;
487 uint32_t data_offset;
492 uint32_t count_offset;
497 uint8_t count_size;
503
509typedef enum cyaml_cfg_flags {
578
585typedef enum cyaml_err {
622
629#define CYAML_VALUE_INT( \
630 _flags, _type) \
631 .type = CYAML_INT, \
632 .flags = (enum cyaml_flag)(_flags), \
633 .data_size = sizeof(_type)
634
645#define CYAML_FIELD_INT( \
646 _key, _flags, _structure, _member) \
647{ \
648 .key = _key, \
649 .data_offset = offsetof(_structure, _member), \
650 .value = { \
651 CYAML_VALUE_INT(((_flags) & (~CYAML_FLAG_POINTER)), \
652 (((_structure *)NULL)->_member)), \
653 }, \
654}
655
666#define CYAML_FIELD_INT_PTR( \
667 _key, _flags, _structure, _member) \
668{ \
669 .key = _key, \
670 .data_offset = offsetof(_structure, _member), \
671 .value = { \
672 CYAML_VALUE_INT(((_flags) | CYAML_FLAG_POINTER), \
673 (*(((_structure *)NULL)->_member))), \
674 }, \
675}
676
683#define CYAML_VALUE_UINT( \
684 _flags, _type) \
685 .type = CYAML_UINT, \
686 .flags = (enum cyaml_flag)(_flags), \
687 .data_size = sizeof(_type)
688
699#define CYAML_FIELD_UINT( \
700 _key, _flags, _structure, _member) \
701{ \
702 .key = _key, \
703 .data_offset = offsetof(_structure, _member), \
704 .value = { \
705 CYAML_VALUE_UINT(((_flags) & (~CYAML_FLAG_POINTER)), \
706 (((_structure *)NULL)->_member)), \
707 }, \
708}
709
720#define CYAML_FIELD_UINT_PTR( \
721 _key, _flags, _structure, _member) \
722{ \
723 .key = _key, \
724 .data_offset = offsetof(_structure, _member), \
725 .value = { \
726 CYAML_VALUE_UINT(((_flags) | CYAML_FLAG_POINTER), \
727 (*(((_structure *)NULL)->_member))), \
728 }, \
729}
730
737#define CYAML_VALUE_BOOL( \
738 _flags, _type) \
739 .type = CYAML_BOOL, \
740 .flags = (enum cyaml_flag)(_flags), \
741 .data_size = sizeof(_type)
742
753#define CYAML_FIELD_BOOL( \
754 _key, _flags, _structure, _member) \
755{ \
756 .key = _key, \
757 .data_offset = offsetof(_structure, _member), \
758 .value = { \
759 CYAML_VALUE_BOOL(((_flags) & (~CYAML_FLAG_POINTER)), \
760 (((_structure *)NULL)->_member)), \
761 }, \
762}
763
774#define CYAML_FIELD_BOOL_PTR( \
775 _key, _flags, _structure, _member) \
776{ \
777 .key = _key, \
778 .data_offset = offsetof(_structure, _member), \
779 .value = { \
780 CYAML_VALUE_BOOL(((_flags) | CYAML_FLAG_POINTER), \
781 (*(((_structure *)NULL)->_member))), \
782 }, \
783}
784
793#define CYAML_VALUE_ENUM( \
794 _flags, _type, _strings, _strings_count) \
795 .type = CYAML_ENUM, \
796 .flags = (enum cyaml_flag)(_flags), \
797 .data_size = sizeof(_type), \
798 .enumeration = { \
799 .strings = _strings, \
800 .count = _strings_count, \
801 }
802
815#define CYAML_FIELD_ENUM( \
816 _key, _flags, _structure, _member, _strings, _strings_count) \
817{ \
818 .key = _key, \
819 .data_offset = offsetof(_structure, _member), \
820 .value = { \
821 CYAML_VALUE_ENUM(((_flags) & (~CYAML_FLAG_POINTER)), \
822 (((_structure *)NULL)->_member), \
823 _strings, _strings_count), \
824 }, \
825}
826
839#define CYAML_FIELD_ENUM_PTR( \
840 _key, _flags, _structure, _member, _strings, _strings_count) \
841{ \
842 .key = _key, \
843 .data_offset = offsetof(_structure, _member), \
844 .value = { \
845 CYAML_VALUE_ENUM(((_flags) | CYAML_FLAG_POINTER), \
846 (*(((_structure *)NULL)->_member)), \
847 _strings, _strings_count), \
848 }, \
849}
850
859#define CYAML_VALUE_FLAGS( \
860 _flags, _type, _strings, _strings_count) \
861 .type = CYAML_FLAGS, \
862 .flags = (enum cyaml_flag)(_flags), \
863 .data_size = sizeof(_type), \
864 .enumeration = { \
865 .strings = _strings, \
866 .count = _strings_count, \
867 }
868
881#define CYAML_FIELD_FLAGS( \
882 _key, _flags, _structure, _member, _strings, _strings_count) \
883{ \
884 .key = _key, \
885 .data_offset = offsetof(_structure, _member), \
886 .value = { \
887 CYAML_VALUE_FLAGS(((_flags) & (~CYAML_FLAG_POINTER)), \
888 (((_structure *)NULL)->_member), \
889 _strings, _strings_count), \
890 }, \
891}
892
905#define CYAML_FIELD_FLAGS_PTR( \
906 _key, _flags, _structure, _member, _strings, _strings_count) \
907{ \
908 .key = _key, \
909 .data_offset = offsetof(_structure, _member), \
910 .value = { \
911 CYAML_VALUE_FLAGS(((_flags) | CYAML_FLAG_POINTER), \
912 (*(((_structure *)NULL)->_member)), \
913 _strings, _strings_count), \
914 }, \
915}
916
925#define CYAML_VALUE_BITFIELD( \
926 _flags, _type, _bitvals, _bitvals_count) \
927 .type = CYAML_BITFIELD, \
928 .flags = (enum cyaml_flag)(_flags), \
929 .data_size = sizeof(_type), \
930 .bitfield = { \
931 .bitdefs = _bitvals, \
932 .count = _bitvals_count, \
933 }
934
947#define CYAML_FIELD_BITFIELD( \
948 _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
949{ \
950 .key = _key, \
951 .data_offset = offsetof(_structure, _member), \
952 .value = { \
953 CYAML_VALUE_BITFIELD(((_flags) & (~CYAML_FLAG_POINTER)), \
954 (((_structure *)NULL)->_member), \
955 _bitvals, _bitvals_count), \
956 }, \
957}
958
971#define CYAML_FIELD_BITFIELD_PTR( \
972 _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
973{ \
974 .key = _key, \
975 .data_offset = offsetof(_structure, _member), \
976 .value = { \
977 CYAML_VALUE_BITFIELD(((_flags) | CYAML_FLAG_POINTER), \
978 (*(((_structure *)NULL)->_member)), \
979 _bitvals, _bitvals_count), \
980 }, \
981}
982
989#define CYAML_VALUE_FLOAT( \
990 _flags, _type) \
991 .type = CYAML_FLOAT, \
992 .flags = (enum cyaml_flag)(_flags), \
993 .data_size = sizeof(_type)
994
1005#define CYAML_FIELD_FLOAT( \
1006 _key, _flags, _structure, _member) \
1007{ \
1008 .key = _key, \
1009 .data_offset = offsetof(_structure, _member), \
1010 .value = { \
1011 CYAML_VALUE_FLOAT(((_flags) & (~CYAML_FLAG_POINTER)), \
1012 (((_structure *)NULL)->_member)), \
1013 }, \
1014}
1015
1026#define CYAML_FIELD_FLOAT_PTR( \
1027 _key, _flags, _structure, _member) \
1028{ \
1029 .key = _key, \
1030 .data_offset = offsetof(_structure, _member), \
1031 .value = { \
1032 CYAML_VALUE_FLOAT(((_flags) | CYAML_FLAG_POINTER), \
1033 (*(((_structure *)NULL)->_member))), \
1034 }, \
1035}
1036
1054#define CYAML_VALUE_STRING( \
1055 _flags, _type, _min, _max) \
1056 .type = CYAML_STRING, \
1057 .flags = (enum cyaml_flag)(_flags), \
1058 .data_size = sizeof(_type), \
1059 .string = { \
1060 .min = _min, \
1061 .max = _max, \
1062 }
1063
1076#define CYAML_FIELD_STRING( \
1077 _key, _flags, _structure, _member, _min) \
1078{ \
1079 .key = _key, \
1080 .data_offset = offsetof(_structure, _member), \
1081 .value = { \
1082 CYAML_VALUE_STRING(((_flags) & (~CYAML_FLAG_POINTER)), \
1083 (((_structure *)NULL)->_member), _min, \
1084 sizeof(((_structure *)NULL)->_member) - 1), \
1085 }, \
1086}
1087
1104#define CYAML_FIELD_STRING_PTR( \
1105 _key, _flags, _structure, _member, _min, _max) \
1106{ \
1107 .key = _key, \
1108 .data_offset = offsetof(_structure, _member), \
1109 .value = { \
1110 CYAML_VALUE_STRING(((_flags) | CYAML_FLAG_POINTER), \
1111 (((_structure *)NULL)->_member), \
1112 _min, _max), \
1113 }, \
1114}
1115
1123#define CYAML_VALUE_MAPPING( \
1124 _flags, _type, _fields) \
1125 .type = CYAML_MAPPING, \
1126 .flags = (enum cyaml_flag)(_flags), \
1127 .data_size = sizeof(_type), \
1128 .mapping = { \
1129 .fields = _fields, \
1130 }
1131
1143#define CYAML_FIELD_MAPPING( \
1144 _key, _flags, _structure, _member, _fields) \
1145{ \
1146 .key = _key, \
1147 .data_offset = offsetof(_structure, _member), \
1148 .value = { \
1149 CYAML_VALUE_MAPPING(((_flags) & (~CYAML_FLAG_POINTER)), \
1150 (((_structure *)NULL)->_member), _fields), \
1151 }, \
1152}
1153
1165#define CYAML_FIELD_MAPPING_PTR( \
1166 _key, _flags, _structure, _member, _fields) \
1167{ \
1168 .key = _key, \
1169 .data_offset = offsetof(_structure, _member), \
1170 .value = { \
1171 CYAML_VALUE_MAPPING(((_flags) | CYAML_FLAG_POINTER), \
1172 (*(((_structure *)NULL)->_member)), _fields), \
1173 }, \
1174}
1175
1185#define CYAML_VALUE_SEQUENCE( \
1186 _flags, _type, _entry, _min, _max) \
1187 .type = CYAML_SEQUENCE, \
1188 .flags = (enum cyaml_flag)(_flags), \
1189 .data_size = sizeof(_type), \
1190 .sequence = { \
1191 .entry = _entry, \
1192 .min = _min, \
1193 .max = _max, \
1194 }
1195
1229#define CYAML_FIELD_SEQUENCE( \
1230 _key, _flags, _structure, _member, _entry, _min, _max) \
1231{ \
1232 .key = _key, \
1233 .data_offset = offsetof(_structure, _member), \
1234 .count_offset = offsetof(_structure, _member ## _count), \
1235 .count_size = sizeof(((_structure *)NULL)->_member ## _count), \
1236 .value = { \
1237 CYAML_VALUE_SEQUENCE((_flags), \
1238 (*(((_structure *)NULL)->_member)), \
1239 _entry, _min, _max), \
1240 }, \
1241}
1242
1277#define CYAML_FIELD_SEQUENCE_COUNT( \
1278 _key, _flags, _structure, _member, _count, _entry, _min, _max) \
1279{ \
1280 .key = _key, \
1281 .data_offset = offsetof(_structure, _member), \
1282 .count_offset = offsetof(_structure, _count), \
1283 .count_size = sizeof(((_structure *)NULL)->_count), \
1284 .value = { \
1285 CYAML_VALUE_SEQUENCE((_flags), \
1286 (*(((_structure *)NULL)->_member)), \
1287 _entry, _min, _max), \
1288 }, \
1289}
1290
1304#define CYAML_VALUE_SEQUENCE_FIXED( \
1305 _flags, _type, _entry, _count) \
1306 .type = CYAML_SEQUENCE_FIXED, \
1307 .flags = (enum cyaml_flag)(_flags), \
1308 .data_size = sizeof(_type), \
1309 .sequence = { \
1310 .entry = _entry, \
1311 .min = _count, \
1312 .max = _count, \
1313 }
1314
1330#define CYAML_FIELD_SEQUENCE_FIXED( \
1331 _key, _flags, _structure, _member, _entry, _count) \
1332{ \
1333 .key = _key, \
1334 .data_offset = offsetof(_structure, _member), \
1335 .value = { \
1336 CYAML_VALUE_SEQUENCE_FIXED((_flags), \
1337 (*(((_structure *)NULL)->_member)), \
1338 _entry, _count), \
1339 }, \
1340}
1341
1348#define CYAML_FIELD_IGNORE( \
1349 _key, _flags) \
1350{ \
1351 .key = _key, \
1352 .value = { \
1353 .type = CYAML_IGNORE, \
1354 .flags = (_flags), \
1355 }, \
1356}
1357
1364#define CYAML_FIELD_END { .key = NULL }
1365
1370#define CYAML_UNLIMITED 0xffffffff
1371
1380#define CYAML_ARRAY_LEN(_a) ((sizeof(_a)) / (sizeof(_a[0])))
1381
1386typedef void cyaml_data_t;
1387
1389typedef enum cyaml_log_e {
1396
1408typedef void (*cyaml_log_fn_t)(
1409 cyaml_log_t level,
1410 void *ctx,
1411 const char *fmt,
1412 va_list args);
1413
1428typedef void * (*cyaml_mem_fn_t)(
1429 void *ctx,
1430 void *ptr,
1431 size_t size);
1432
1439typedef struct cyaml_config {
1464 void *log_ctx;
1485 void *mem_ctx;
1496
1516extern void cyaml_log(
1517 cyaml_log_t level,
1518 void *ctx,
1519 const char *fmt,
1520 va_list args);
1521
1539extern void * cyaml_mem(
1540 void *ctx,
1541 void *ptr,
1542 size_t size);
1543
1563 const char *path,
1564 const cyaml_config_t *config,
1565 const cyaml_schema_value_t *schema,
1566 cyaml_data_t **data_out,
1567 unsigned *seq_count_out);
1568
1589 const uint8_t *input,
1590 size_t input_len,
1591 const cyaml_config_t *config,
1592 const cyaml_schema_value_t *schema,
1593 cyaml_data_t **data_out,
1594 unsigned *seq_count_out);
1595
1608 const char *path,
1609 const cyaml_config_t *config,
1610 const cyaml_schema_value_t *schema,
1611 const cyaml_data_t *data,
1612 unsigned seq_count);
1613
1651 char **output,
1652 size_t *len,
1653 const cyaml_config_t *config,
1654 const cyaml_schema_value_t *schema,
1655 const cyaml_data_t *data,
1656 unsigned seq_count);
1657
1676extern cyaml_err_t cyaml_free(
1677 const cyaml_config_t *config,
1678 const cyaml_schema_value_t *schema,
1679 cyaml_data_t *data,
1680 unsigned seq_count);
1681
1689extern const char * cyaml_strerror(
1690 cyaml_err_t err);
1691
1692#ifdef __cplusplus
1693}
1694#endif
1695
1696#endif
struct cyaml_schema_value cyaml_schema_value_t
cyaml_err_t cyaml_save_file(const char *path, const cyaml_config_t *config, const cyaml_schema_value_t *schema, const cyaml_data_t *data, unsigned seq_count)
Definition: save.c:1375
void *(* cyaml_mem_fn_t)(void *ctx, void *ptr, size_t size)
Definition: cyaml.h:1428
const uint32_t cyaml_version
Definition: util.c:49
struct cyaml_bitdef cyaml_bitdef_t
cyaml_err_t cyaml_load_data(const uint8_t *input, size_t input_len, const cyaml_config_t *config, const cyaml_schema_value_t *schema, cyaml_data_t **data_out, unsigned *seq_count_out)
Definition: load.c:2721
struct cyaml_schema_field cyaml_schema_field_t
enum cyaml_err cyaml_err_t
void cyaml_data_t
Definition: cyaml.h:1386
enum cyaml_flag cyaml_flag_e
cyaml_err_t cyaml_load_file(const char *path, const cyaml_config_t *config, const cyaml_schema_value_t *schema, cyaml_data_t **data_out, unsigned *seq_count_out)
Definition: load.c:2679
void(* cyaml_log_fn_t)(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
Definition: cyaml.h:1408
cyaml_err_t cyaml_free(const cyaml_config_t *config, const cyaml_schema_value_t *schema, cyaml_data_t *data, unsigned seq_count)
Definition: free.c:143
cyaml_err
Definition: cyaml.h:585
@ CYAML_ERR_BAD_PARAM_NULL_SCHEMA
Definition: cyaml.h:611
@ CYAML_ERR_LIBYAML_PARSER_INIT
Definition: cyaml.h:613
@ CYAML_ERR_BAD_PARAM_NULL_CONFIG
Definition: cyaml.h:610
@ CYAML_ERR_BAD_PARAM_NULL_DATA
Definition: cyaml.h:602
@ CYAML_ERR_BAD_BITVAL_IN_SCHEMA
Definition: cyaml.h:603
@ CYAML_ERR_LIBYAML_EMITTER
Definition: cyaml.h:615
@ CYAML_ERR_FILE_OPEN
Definition: cyaml.h:589
@ CYAML_ERR_TOP_LEVEL_NON_PTR
Definition: cyaml.h:598
@ CYAML_ERR_BAD_CONFIG_NULL_MEMFN
Definition: cyaml.h:609
@ CYAML_ERR_STRING_LENGTH_MAX
Definition: cyaml.h:596
@ CYAML_ERR_INVALID_DATA_SIZE
Definition: cyaml.h:597
@ CYAML_ERR_BAD_TYPE_IN_SCHEMA
Definition: cyaml.h:599
@ CYAML_ERR_SEQUENCE_ENTRIES_MAX
Definition: cyaml.h:605
@ CYAML_ERR_STRING_LENGTH_MIN
Definition: cyaml.h:595
@ CYAML_ERR_BAD_MIN_MAX_SCHEMA
Definition: cyaml.h:600
@ CYAML_ERR_MAPPING_FIELD_MISSING
Definition: cyaml.h:608
@ CYAML_ERR_UNEXPECTED_EVENT
Definition: cyaml.h:594
@ CYAML_ERR_INVALID_VALUE
Definition: cyaml.h:591
@ CYAML_ERR_OOM
Definition: cyaml.h:587
@ CYAML_ERR_INVALID_ALIAS
Definition: cyaml.h:592
@ CYAML_ERR_INVALID_KEY
Definition: cyaml.h:590
@ CYAML_ERR_INTERNAL_ERROR
Definition: cyaml.h:593
@ CYAML_ERR_SEQUENCE_ENTRIES_MIN
Definition: cyaml.h:604
@ CYAML_ERR_LIBYAML_EVENT_INIT
Definition: cyaml.h:614
@ CYAML_ERR_SEQUENCE_IN_SEQUENCE
Definition: cyaml.h:607
@ CYAML_OK
Definition: cyaml.h:586
@ CYAML_ERR_LIBYAML_PARSER
Definition: cyaml.h:616
@ CYAML_ERR_BAD_PARAM_SEQ_COUNT
Definition: cyaml.h:601
@ CYAML_ERR__COUNT
Definition: cyaml.h:617
@ CYAML_ERR_SEQUENCE_FIXED_COUNT
Definition: cyaml.h:606
@ CYAML_ERR_LIBYAML_EMITTER_INIT
Definition: cyaml.h:612
@ CYAML_ERR_ALIAS
Definition: cyaml.h:588
enum cyaml_cfg_flags cyaml_cfg_flags_t
enum cyaml_log_e cyaml_log_t
cyaml_err_t cyaml_save_data(char **output, size_t *len, const cyaml_config_t *config, const cyaml_schema_value_t *schema, const cyaml_data_t *data, unsigned seq_count)
Definition: save.c:1473
cyaml_type
Definition: cyaml.h:53
@ CYAML_INT
Definition: cyaml.h:54
@ CYAML_UINT
Definition: cyaml.h:55
@ CYAML__TYPE_COUNT
Definition: cyaml.h:130
@ CYAML_SEQUENCE_FIXED
Definition: cyaml.h:119
@ CYAML_IGNORE
Definition: cyaml.h:125
@ CYAML_FLOAT
Definition: cyaml.h:73
@ CYAML_MAPPING
Definition: cyaml.h:79
@ CYAML_BITFIELD
Definition: cyaml.h:89
@ CYAML_ENUM
Definition: cyaml.h:62
@ CYAML_BOOL
Definition: cyaml.h:56
@ CYAML_SEQUENCE
Definition: cyaml.h:101
@ CYAML_STRING
Definition: cyaml.h:74
@ CYAML_FLAGS
Definition: cyaml.h:72
void * cyaml_mem(void *ctx, void *ptr, size_t size)
Definition: mem.c:22
const char * cyaml_version_str
Definition: util.c:57
struct cyaml_config cyaml_config_t
struct cyaml_strval cyaml_strval_t
cyaml_flag
Definition: cyaml.h:138
@ CYAML_FLAG_SCALAR_LITERAL
Definition: cyaml.h:310
@ CYAML_FLAG_SCALAR_QUOTE_SINGLE
Definition: cyaml.h:317
@ CYAML_FLAG_STRICT
Definition: cyaml.h:197
@ CYAML_FLAG_POINTER_NULL_STR
Definition: cyaml.h:181
@ CYAML_FLAG_POINTER
Definition: cyaml.h:148
@ CYAML_FLAG_SCALAR_QUOTE_DOUBLE
Definition: cyaml.h:324
@ CYAML_FLAG_SCALAR_PLAIN
Definition: cyaml.h:284
@ CYAML_FLAG_DEFAULT
Definition: cyaml.h:139
@ CYAML_FLAG_BLOCK
Definition: cyaml.h:214
@ CYAML_FLAG_FLOW
Definition: cyaml.h:231
@ CYAML_FLAG_OPTIONAL
Definition: cyaml.h:140
@ CYAML_FLAG_SCALAR_FOLDED
Definition: cyaml.h:297
@ CYAML_FLAG_CASE_SENSITIVE
Definition: cyaml.h:249
@ CYAML_FLAG_POINTER_NULL
Definition: cyaml.h:158
@ CYAML_FLAG_CASE_INSENSITIVE
Definition: cyaml.h:267
cyaml_cfg_flags
Definition: cyaml.h:509
@ CYAML_CFG_IGNORE_UNKNOWN_KEYS
Definition: cyaml.h:519
@ CYAML_CFG_IGNORED_KEY_WARNING
Definition: cyaml.h:576
@ CYAML_CFG_DEFAULT
Definition: cyaml.h:513
@ CYAML_CFG_CASE_INSENSITIVE
Definition: cyaml.h:560
@ CYAML_CFG_DOCUMENT_DELIM
Definition: cyaml.h:554
@ CYAML_CFG_NO_ALIAS
Definition: cyaml.h:572
@ CYAML_CFG_STYLE_FLOW
Definition: cyaml.h:547
@ CYAML_CFG_STYLE_BLOCK
Definition: cyaml.h:533
enum cyaml_type cyaml_type_e
void cyaml_log(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
Definition: util.c:60
const char * cyaml_strerror(cyaml_err_t err)
Definition: util.c:81
cyaml_log_e
Definition: cyaml.h:1389
@ CYAML_LOG_NOTICE
Definition: cyaml.h:1392
@ CYAML_LOG_DEBUG
Definition: cyaml.h:1390
@ CYAML_LOG_ERROR
Definition: cyaml.h:1394
@ CYAML_LOG_WARNING
Definition: cyaml.h:1393
@ CYAML_LOG_INFO
Definition: cyaml.h:1391
Definition: cyaml.h:342
uint8_t bits
Definition: cyaml.h:345
const char * name
Definition: cyaml.h:343
uint8_t offset
Definition: cyaml.h:344
Definition: cyaml.h:1439
cyaml_log_fn_t log_fn
Definition: cyaml.h:1454
cyaml_cfg_flags_t flags
Definition: cyaml.h:1494
void * log_ctx
Definition: cyaml.h:1464
cyaml_log_t log_level
Definition: cyaml.h:1492
void * mem_ctx
Definition: cyaml.h:1485
cyaml_mem_fn_t mem_fn
Definition: cyaml.h:1475
Definition: cyaml.h:476
uint32_t data_offset
Definition: cyaml.h:487
uint32_t count_offset
Definition: cyaml.h:492
uint8_t count_size
Definition: cyaml.h:497
const char * key
Definition: cyaml.h:482
struct cyaml_schema_value value
Definition: cyaml.h:501
Definition: cyaml.h:368
enum cyaml_type type
Definition: cyaml.h:372
uint32_t max
Definition: cyaml.h:400
struct cyaml_schema_value::@0::@2 string
uint32_t count
Definition: cyaml.h:418
struct cyaml_schema_value::@0::@3 mapping
const struct cyaml_schema_field * fields
Definition: cyaml.h:411
uint32_t data_size
Definition: cyaml.h:382
struct cyaml_schema_value::@0::@6 enumeration
enum cyaml_flag flags
Definition: cyaml.h:374
uint32_t min
Definition: cyaml.h:392
const cyaml_strval_t * strings
Definition: cyaml.h:457
struct cyaml_schema_value::@0::@5 sequence
struct cyaml_schema_value::@0::@4 bitfield
const struct cyaml_schema_value * entry
Definition: cyaml.h:435
const struct cyaml_bitdef * bitdefs
Definition: cyaml.h:416
Definition: cyaml.h:332
const char * str
Definition: cyaml.h:333
int64_t val
Definition: cyaml.h:334