CYAML
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
18 extern "C"
19 {
20 #endif
21 
22 #include <stdarg.h>
23 #include <stdint.h>
24 #include <stddef.h>
25 
29 extern const char *cyaml_version_str;
30 
44 extern const uint32_t cyaml_version;
45 
53 typedef enum cyaml_type {
126 
132 typedef enum cyaml_flag {
134  CYAML_FLAG_OPTIONAL = (1 << 0),
142  CYAML_FLAG_POINTER = (1 << 1),
191  CYAML_FLAG_STRICT = (1 << 4),
208  CYAML_FLAG_BLOCK = (1 << 5),
225  CYAML_FLAG_FLOW = (1 << 6),
263 
269 typedef struct cyaml_strval {
270  const char *str;
271  int64_t val;
273 
279 typedef struct cyaml_bitdef {
280  const char *name;
281  uint8_t offset;
282  uint8_t bits;
284 
305 typedef struct cyaml_schema_value {
309  enum cyaml_type type;
311  enum cyaml_flag flags;
319  uint32_t data_size;
321  union {
323  struct {
329  uint32_t min;
337  uint32_t max;
340  struct {
348  const struct cyaml_schema_field *fields;
351  struct {
353  const struct cyaml_bitdef *bitdefs;
355  uint32_t count;
361  struct {
372  const struct cyaml_schema_value *entry;
379  uint32_t min;
386  uint32_t max;
392  struct {
396  uint32_t count;
398  };
400 
413 typedef struct cyaml_schema_field {
419  const char *key;
424  uint32_t data_offset;
429  uint32_t count_offset;
434  uint8_t count_size;
438  struct cyaml_schema_value value;
440 
446 typedef enum cyaml_cfg_flags {
509  CYAML_CFG_NO_ALIAS = (1 << 5),
511 
518 typedef enum cyaml_err {
555 
562 #define CYAML_VALUE_INT( \
563  _flags, _type) \
564  .type = CYAML_INT, \
565  .flags = (enum cyaml_flag)(_flags), \
566  .data_size = sizeof(_type)
567 
578 #define CYAML_FIELD_INT( \
579  _key, _flags, _structure, _member) \
580 { \
581  .key = _key, \
582  .value = { \
583  CYAML_VALUE_INT(((_flags) & (~CYAML_FLAG_POINTER)), \
584  (((_structure *)NULL)->_member)), \
585  }, \
586  .data_offset = offsetof(_structure, _member) \
587 }
588 
599 #define CYAML_FIELD_INT_PTR( \
600  _key, _flags, _structure, _member) \
601 { \
602  .key = _key, \
603  .data_offset = offsetof(_structure, _member), \
604  .value = { \
605  CYAML_VALUE_INT(((_flags) | CYAML_FLAG_POINTER), \
606  (*(((_structure *)NULL)->_member))), \
607  }, \
608 }
609 
616 #define CYAML_VALUE_UINT( \
617  _flags, _type) \
618  .type = CYAML_UINT, \
619  .flags = (enum cyaml_flag)(_flags), \
620  .data_size = sizeof(_type)
621 
632 #define CYAML_FIELD_UINT( \
633  _key, _flags, _structure, _member) \
634 { \
635  .key = _key, \
636  .data_offset = offsetof(_structure, _member), \
637  .value = { \
638  CYAML_VALUE_UINT(((_flags) & (~CYAML_FLAG_POINTER)), \
639  (((_structure *)NULL)->_member)), \
640  }, \
641 }
642 
653 #define CYAML_FIELD_UINT_PTR( \
654  _key, _flags, _structure, _member) \
655 { \
656  .key = _key, \
657  .data_offset = offsetof(_structure, _member), \
658  .value = { \
659  CYAML_VALUE_UINT(((_flags) | CYAML_FLAG_POINTER), \
660  (*(((_structure *)NULL)->_member))), \
661  }, \
662 }
663 
670 #define CYAML_VALUE_BOOL( \
671  _flags, _type) \
672  .type = CYAML_BOOL, \
673  .flags = (enum cyaml_flag)(_flags), \
674  .data_size = sizeof(_type)
675 
686 #define CYAML_FIELD_BOOL( \
687  _key, _flags, _structure, _member) \
688 { \
689  .key = _key, \
690  .data_offset = offsetof(_structure, _member), \
691  .value = { \
692  CYAML_VALUE_BOOL(((_flags) & (~CYAML_FLAG_POINTER)), \
693  (((_structure *)NULL)->_member)), \
694  }, \
695 }
696 
707 #define CYAML_FIELD_BOOL_PTR( \
708  _key, _flags, _structure, _member) \
709 { \
710  .key = _key, \
711  .data_offset = offsetof(_structure, _member), \
712  .value = { \
713  CYAML_VALUE_BOOL(((_flags) | CYAML_FLAG_POINTER), \
714  (*(((_structure *)NULL)->_member))), \
715  }, \
716 }
717 
726 #define CYAML_VALUE_ENUM( \
727  _flags, _type, _strings, _strings_count) \
728  .type = CYAML_ENUM, \
729  .flags = (enum cyaml_flag)(_flags), \
730  .data_size = sizeof(_type), \
731  .enumeration = { \
732  .strings = _strings, \
733  .count = _strings_count, \
734  }
735 
748 #define CYAML_FIELD_ENUM( \
749  _key, _flags, _structure, _member, _strings, _strings_count) \
750 { \
751  .key = _key, \
752  .data_offset = offsetof(_structure, _member), \
753  .value = { \
754  CYAML_VALUE_ENUM(((_flags) & (~CYAML_FLAG_POINTER)), \
755  (((_structure *)NULL)->_member), \
756  _strings, _strings_count), \
757  }, \
758 }
759 
772 #define CYAML_FIELD_ENUM_PTR( \
773  _key, _flags, _structure, _member, _strings, _strings_count) \
774 { \
775  .key = _key, \
776  .data_offset = offsetof(_structure, _member), \
777  .value = { \
778  CYAML_VALUE_ENUM(((_flags) | CYAML_FLAG_POINTER), \
779  (*(((_structure *)NULL)->_member)), \
780  _strings, _strings_count), \
781  }, \
782 }
783 
792 #define CYAML_VALUE_FLAGS( \
793  _flags, _type, _strings, _strings_count) \
794  .type = CYAML_FLAGS, \
795  .flags = (enum cyaml_flag)(_flags), \
796  .data_size = sizeof(_type), \
797  .enumeration = { \
798  .strings = _strings, \
799  .count = _strings_count, \
800  }
801 
814 #define CYAML_FIELD_FLAGS( \
815  _key, _flags, _structure, _member, _strings, _strings_count) \
816 { \
817  .key = _key, \
818  .data_offset = offsetof(_structure, _member), \
819  .value = { \
820  CYAML_VALUE_FLAGS(((_flags) & (~CYAML_FLAG_POINTER)), \
821  (((_structure *)NULL)->_member), \
822  _strings, _strings_count), \
823  }, \
824 }
825 
838 #define CYAML_FIELD_FLAGS_PTR( \
839  _key, _flags, _structure, _member, _strings, _strings_count) \
840 { \
841  .key = _key, \
842  .data_offset = offsetof(_structure, _member), \
843  .value = { \
844  CYAML_VALUE_FLAGS(((_flags) | CYAML_FLAG_POINTER), \
845  (*(((_structure *)NULL)->_member)), \
846  _strings, _strings_count), \
847  }, \
848 }
849 
858 #define CYAML_VALUE_BITFIELD( \
859  _flags, _type, _bitvals, _bitvals_count) \
860  .type = CYAML_BITFIELD, \
861  .flags = (enum cyaml_flag)(_flags), \
862  .data_size = sizeof(_type), \
863  .bitfield = { \
864  .bitdefs = _bitvals, \
865  .count = _bitvals_count, \
866  }
867 
880 #define CYAML_FIELD_BITFIELD( \
881  _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
882 { \
883  .key = _key, \
884  .data_offset = offsetof(_structure, _member), \
885  .value = { \
886  CYAML_VALUE_BITFIELD(((_flags) & (~CYAML_FLAG_POINTER)), \
887  (((_structure *)NULL)->_member), \
888  _bitvals, _bitvals_count), \
889  }, \
890 }
891 
904 #define CYAML_FIELD_BITFIELD_PTR( \
905  _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
906 { \
907  .key = _key, \
908  .data_offset = offsetof(_structure, _member), \
909  .value = { \
910  CYAML_VALUE_BITFIELD(((_flags) | CYAML_FLAG_POINTER), \
911  (*(((_structure *)NULL)->_member)), \
912  _bitvals, _bitvals_count), \
913  }, \
914 }
915 
922 #define CYAML_VALUE_FLOAT( \
923  _flags, _type) \
924  .type = CYAML_FLOAT, \
925  .flags = (enum cyaml_flag)(_flags), \
926  .data_size = sizeof(_type)
927 
938 #define CYAML_FIELD_FLOAT( \
939  _key, _flags, _structure, _member) \
940 { \
941  .key = _key, \
942  .data_offset = offsetof(_structure, _member), \
943  .value = { \
944  CYAML_VALUE_FLOAT(((_flags) & (~CYAML_FLAG_POINTER)), \
945  (((_structure *)NULL)->_member)), \
946  }, \
947 }
948 
959 #define CYAML_FIELD_FLOAT_PTR( \
960  _key, _flags, _structure, _member) \
961 { \
962  .key = _key, \
963  .data_offset = offsetof(_structure, _member), \
964  .value = { \
965  CYAML_VALUE_FLOAT(((_flags) | CYAML_FLAG_POINTER), \
966  (*(((_structure *)NULL)->_member))), \
967  }, \
968 }
969 
987 #define CYAML_VALUE_STRING( \
988  _flags, _type, _min, _max) \
989  .type = CYAML_STRING, \
990  .flags = (enum cyaml_flag)(_flags), \
991  .data_size = sizeof(_type), \
992  .string = { \
993  .min = _min, \
994  .max = _max, \
995  }
996 
1009 #define CYAML_FIELD_STRING( \
1010  _key, _flags, _structure, _member, _min) \
1011 { \
1012  .key = _key, \
1013  .data_offset = offsetof(_structure, _member), \
1014  .value = { \
1015  CYAML_VALUE_STRING(((_flags) & (~CYAML_FLAG_POINTER)), \
1016  (((_structure *)NULL)->_member), _min, \
1017  sizeof(((_structure *)NULL)->_member) - 1), \
1018  }, \
1019 }
1020 
1037 #define CYAML_FIELD_STRING_PTR( \
1038  _key, _flags, _structure, _member, _min, _max) \
1039 { \
1040  .key = _key, \
1041  .data_offset = offsetof(_structure, _member), \
1042  .value = { \
1043  CYAML_VALUE_STRING(((_flags) | CYAML_FLAG_POINTER), \
1044  (((_structure *)NULL)->_member), \
1045  _min, _max), \
1046  }, \
1047 }
1048 
1056 #define CYAML_VALUE_MAPPING( \
1057  _flags, _type, _fields) \
1058  .type = CYAML_MAPPING, \
1059  .flags = (enum cyaml_flag)(_flags), \
1060  .data_size = sizeof(_type), \
1061  .mapping = { \
1062  .fields = _fields, \
1063  }
1064 
1076 #define CYAML_FIELD_MAPPING( \
1077  _key, _flags, _structure, _member, _fields) \
1078 { \
1079  .key = _key, \
1080  .data_offset = offsetof(_structure, _member), \
1081  .value = { \
1082  CYAML_VALUE_MAPPING(((_flags) & (~CYAML_FLAG_POINTER)), \
1083  (((_structure *)NULL)->_member), _fields), \
1084  }, \
1085 }
1086 
1098 #define CYAML_FIELD_MAPPING_PTR( \
1099  _key, _flags, _structure, _member, _fields) \
1100 { \
1101  .key = _key, \
1102  .value = { \
1103  CYAML_VALUE_MAPPING(((_flags) | CYAML_FLAG_POINTER), \
1104  (*(((_structure *)NULL)->_member)), _fields), \
1105  }, \
1106  .data_offset = offsetof(_structure, _member) \
1107 }
1108 
1118 #define CYAML_VALUE_SEQUENCE( \
1119  _flags, _type, _entry, _min, _max) \
1120  .type = CYAML_SEQUENCE, \
1121  .flags = (enum cyaml_flag)(_flags), \
1122  .data_size = sizeof(_type), \
1123  .sequence = { \
1124  .entry = _entry, \
1125  .min = _min, \
1126  .max = _max, \
1127  }
1128 
1162 #define CYAML_FIELD_SEQUENCE( \
1163  _key, _flags, _structure, _member, _entry, _min, _max) \
1164 { \
1165  .key = _key, \
1166  .value = { \
1167  CYAML_VALUE_SEQUENCE((_flags), \
1168  (*(((_structure *)NULL)->_member)), \
1169  _entry, _min, _max), \
1170  }, \
1171  .data_offset = offsetof(_structure, _member), \
1172  .count_size = sizeof(((_structure *)NULL)->_member ## _count), \
1173  .count_offset = offsetof(_structure, _member ## _count), \
1174 }
1175 
1210 #define CYAML_FIELD_SEQUENCE_COUNT( \
1211  _key, _flags, _structure, _member, _count, _entry, _min, _max) \
1212 { \
1213  .key = _key, \
1214  .value = { \
1215  CYAML_VALUE_SEQUENCE((_flags), \
1216  (*(((_structure *)NULL)->_member)), \
1217  _entry, _min, _max), \
1218  }, \
1219  .data_offset = offsetof(_structure, _member), \
1220  .count_size = sizeof(((_structure *)NULL)->_count), \
1221  .count_offset = offsetof(_structure, _count), \
1222 }
1223 
1232 #define CYAML_VALUE_SEQUENCE_FIXED( \
1233  _flags, _type, _entry, _count) \
1234  .type = CYAML_SEQUENCE_FIXED, \
1235  .flags = (enum cyaml_flag)(_flags), \
1236  .data_size = sizeof(_type), \
1237  .sequence = { \
1238  .entry = _entry, \
1239  .min = _count, \
1240  .max = _count, \
1241  }
1242 
1253 #define CYAML_FIELD_SEQUENCE_FIXED( \
1254  _key, _flags, _structure, _member, _entry, _count) \
1255 { \
1256  .key = _key, \
1257  .data_offset = offsetof(_structure, _member), \
1258  .value = { \
1259  CYAML_VALUE_SEQUENCE_FIXED((_flags), \
1260  (*(((_structure *)NULL)->_member)), \
1261  _entry, _count), \
1262  }, \
1263 }
1264 
1271 #define CYAML_FIELD_IGNORE( \
1272  _key, _flags) \
1273 { \
1274  .key = _key, \
1275  .value = { \
1276  .type = CYAML_IGNORE, \
1277  .flags = (_flags), \
1278  }, \
1279 }
1280 
1287 #define CYAML_FIELD_END { .key = NULL }
1288 
1293 #define CYAML_UNLIMITED 0xffffffff
1294 
1303 #define CYAML_ARRAY_LEN(_a) ((sizeof(_a)) / (sizeof(_a[0])))
1304 
1309 typedef void cyaml_data_t;
1310 
1312 typedef enum cyaml_log_e {
1319 
1331 typedef void (*cyaml_log_fn_t)(
1332  cyaml_log_t level,
1333  void *ctx,
1334  const char *fmt,
1335  va_list args);
1336 
1351 typedef void * (*cyaml_mem_fn_t)(
1352  void *ctx,
1353  void *ptr,
1354  size_t size);
1355 
1362 typedef struct cyaml_config {
1387  void *log_ctx;
1408  void *mem_ctx;
1419 
1439 extern void cyaml_log(
1440  cyaml_log_t level,
1441  void *ctx,
1442  const char *fmt,
1443  va_list args);
1444 
1462 extern void * cyaml_mem(
1463  void *ctx,
1464  void *ptr,
1465  size_t size);
1466 
1486  const char *path,
1487  const cyaml_config_t *config,
1488  const cyaml_schema_value_t *schema,
1489  cyaml_data_t **data_out,
1490  unsigned *seq_count_out);
1491 
1512  const uint8_t *input,
1513  size_t input_len,
1514  const cyaml_config_t *config,
1515  const cyaml_schema_value_t *schema,
1516  cyaml_data_t **data_out,
1517  unsigned *seq_count_out);
1518 
1531  const char *path,
1532  const cyaml_config_t *config,
1533  const cyaml_schema_value_t *schema,
1534  const cyaml_data_t *data,
1535  unsigned seq_count);
1536 
1574  char **output,
1575  size_t *len,
1576  const cyaml_config_t *config,
1577  const cyaml_schema_value_t *schema,
1578  const cyaml_data_t *data,
1579  unsigned seq_count);
1580 
1600  const cyaml_config_t *config,
1601  const cyaml_schema_value_t *schema,
1602  cyaml_data_t *data,
1603  unsigned seq_count);
1604 
1612 extern const char * cyaml_strerror(
1613  cyaml_err_t err);
1614 
1615 #ifdef __cplusplus
1616 }
1617 #endif
1618 
1619 #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)
const uint32_t cyaml_version
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)
struct cyaml_schema_field cyaml_schema_field_t
enum cyaml_err cyaml_err_t
void cyaml_data_t
Definition: cyaml.h:1309
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)
void * cyaml_mem(void *ctx, void *ptr, size_t size)
void(* cyaml_log_fn_t)(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
Definition: cyaml.h:1331
cyaml_err_t cyaml_free(const cyaml_config_t *config, const cyaml_schema_value_t *schema, cyaml_data_t *data, unsigned seq_count)
cyaml_err
Definition: cyaml.h:518
@ CYAML_ERR_BAD_PARAM_NULL_SCHEMA
Definition: cyaml.h:544
@ CYAML_ERR_LIBYAML_PARSER_INIT
Definition: cyaml.h:546
@ CYAML_ERR_BAD_PARAM_NULL_CONFIG
Definition: cyaml.h:543
@ CYAML_ERR_BAD_PARAM_NULL_DATA
Definition: cyaml.h:535
@ CYAML_ERR_BAD_BITVAL_IN_SCHEMA
Definition: cyaml.h:536
@ CYAML_ERR_LIBYAML_EMITTER
Definition: cyaml.h:548
@ CYAML_ERR_FILE_OPEN
Definition: cyaml.h:522
@ CYAML_ERR_TOP_LEVEL_NON_PTR
Definition: cyaml.h:531
@ CYAML_ERR_BAD_CONFIG_NULL_MEMFN
Definition: cyaml.h:542
@ CYAML_ERR_STRING_LENGTH_MAX
Definition: cyaml.h:529
@ CYAML_ERR_INVALID_DATA_SIZE
Definition: cyaml.h:530
@ CYAML_ERR_BAD_TYPE_IN_SCHEMA
Definition: cyaml.h:532
@ CYAML_ERR_SEQUENCE_ENTRIES_MAX
Definition: cyaml.h:538
@ CYAML_ERR_STRING_LENGTH_MIN
Definition: cyaml.h:528
@ CYAML_ERR_BAD_MIN_MAX_SCHEMA
Definition: cyaml.h:533
@ CYAML_ERR_MAPPING_FIELD_MISSING
Definition: cyaml.h:541
@ CYAML_ERR_UNEXPECTED_EVENT
Definition: cyaml.h:527
@ CYAML_ERR_INVALID_VALUE
Definition: cyaml.h:524
@ CYAML_ERR_OOM
Definition: cyaml.h:520
@ CYAML_ERR_INVALID_ALIAS
Definition: cyaml.h:525
@ CYAML_ERR_INVALID_KEY
Definition: cyaml.h:523
@ CYAML_ERR_INTERNAL_ERROR
Definition: cyaml.h:526
@ CYAML_ERR_SEQUENCE_ENTRIES_MIN
Definition: cyaml.h:537
@ CYAML_ERR_LIBYAML_EVENT_INIT
Definition: cyaml.h:547
@ CYAML_ERR_SEQUENCE_IN_SEQUENCE
Definition: cyaml.h:540
@ CYAML_OK
Definition: cyaml.h:519
@ CYAML_ERR_LIBYAML_PARSER
Definition: cyaml.h:549
@ CYAML_ERR_BAD_PARAM_SEQ_COUNT
Definition: cyaml.h:534
@ CYAML_ERR__COUNT
Definition: cyaml.h:550
@ CYAML_ERR_SEQUENCE_FIXED_COUNT
Definition: cyaml.h:539
@ CYAML_ERR_LIBYAML_EMITTER_INIT
Definition: cyaml.h:545
@ CYAML_ERR_ALIAS
Definition: cyaml.h:521
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)
void *(* cyaml_mem_fn_t)(void *ctx, void *ptr, size_t size)
Definition: cyaml.h:1351
cyaml_type
Definition: cyaml.h:53
@ CYAML_INT
Definition: cyaml.h:54
@ CYAML_UINT
Definition: cyaml.h:55
@ CYAML__TYPE_COUNT
Definition: cyaml.h:124
@ CYAML_SEQUENCE_FIXED
Definition: cyaml.h:113
@ CYAML_IGNORE
Definition: cyaml.h:119
@ 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
const char * cyaml_version_str
struct cyaml_config cyaml_config_t
struct cyaml_strval cyaml_strval_t
cyaml_flag
Definition: cyaml.h:132
@ CYAML_FLAG_STRICT
Definition: cyaml.h:191
@ CYAML_FLAG_POINTER_NULL_STR
Definition: cyaml.h:175
@ CYAML_FLAG_POINTER
Definition: cyaml.h:142
@ CYAML_FLAG_DEFAULT
Definition: cyaml.h:133
@ CYAML_FLAG_BLOCK
Definition: cyaml.h:208
@ CYAML_FLAG_FLOW
Definition: cyaml.h:225
@ CYAML_FLAG_OPTIONAL
Definition: cyaml.h:134
@ CYAML_FLAG_CASE_SENSITIVE
Definition: cyaml.h:243
@ CYAML_FLAG_POINTER_NULL
Definition: cyaml.h:152
@ CYAML_FLAG_CASE_INSENSITIVE
Definition: cyaml.h:261
cyaml_cfg_flags
Definition: cyaml.h:446
@ CYAML_CFG_IGNORE_UNKNOWN_KEYS
Definition: cyaml.h:456
@ CYAML_CFG_DEFAULT
Definition: cyaml.h:450
@ CYAML_CFG_CASE_INSENSITIVE
Definition: cyaml.h:497
@ CYAML_CFG_DOCUMENT_DELIM
Definition: cyaml.h:491
@ CYAML_CFG_NO_ALIAS
Definition: cyaml.h:509
@ CYAML_CFG_STYLE_FLOW
Definition: cyaml.h:484
@ CYAML_CFG_STYLE_BLOCK
Definition: cyaml.h:470
enum cyaml_type cyaml_type_e
const char * cyaml_strerror(cyaml_err_t err)
void cyaml_log(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
cyaml_log_e
Definition: cyaml.h:1312
@ CYAML_LOG_NOTICE
Definition: cyaml.h:1315
@ CYAML_LOG_DEBUG
Definition: cyaml.h:1313
@ CYAML_LOG_ERROR
Definition: cyaml.h:1317
@ CYAML_LOG_WARNING
Definition: cyaml.h:1316
@ CYAML_LOG_INFO
Definition: cyaml.h:1314
Definition: cyaml.h:279
uint8_t bits
Definition: cyaml.h:282
const char * name
Definition: cyaml.h:280
uint8_t offset
Definition: cyaml.h:281
Definition: cyaml.h:1362
cyaml_log_fn_t log_fn
Definition: cyaml.h:1377
cyaml_cfg_flags_t flags
Definition: cyaml.h:1417
void * log_ctx
Definition: cyaml.h:1387
cyaml_log_t log_level
Definition: cyaml.h:1415
void * mem_ctx
Definition: cyaml.h:1408
cyaml_mem_fn_t mem_fn
Definition: cyaml.h:1398
Definition: cyaml.h:413
uint32_t data_offset
Definition: cyaml.h:424
uint32_t count_offset
Definition: cyaml.h:429
uint8_t count_size
Definition: cyaml.h:434
const char * key
Definition: cyaml.h:419
struct cyaml_schema_value value
Definition: cyaml.h:438
Definition: cyaml.h:305
enum cyaml_type type
Definition: cyaml.h:309
uint32_t max
Definition: cyaml.h:337
struct cyaml_schema_value::@0::@2 string
uint32_t count
Definition: cyaml.h:355
struct cyaml_schema_value::@0::@3 mapping
const struct cyaml_schema_field * fields
Definition: cyaml.h:348
uint32_t data_size
Definition: cyaml.h:319
struct cyaml_schema_value::@0::@6 enumeration
enum cyaml_flag flags
Definition: cyaml.h:311
uint32_t min
Definition: cyaml.h:329
const cyaml_strval_t * strings
Definition: cyaml.h:394
struct cyaml_schema_value::@0::@5 sequence
struct cyaml_schema_value::@0::@4 bitfield
const struct cyaml_schema_value * entry
Definition: cyaml.h:372
const struct cyaml_bitdef * bitdefs
Definition: cyaml.h:353
Definition: cyaml.h:269
const char * str
Definition: cyaml.h:270
int64_t val
Definition: cyaml.h:271