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
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),
320 
326 typedef struct cyaml_strval {
327  const char *str;
328  int64_t val;
330 
336 typedef struct cyaml_bitdef {
337  const char *name;
338  uint8_t offset;
339  uint8_t bits;
341 
362 typedef struct cyaml_schema_value {
366  enum cyaml_type type;
368  enum cyaml_flag flags;
376  uint32_t data_size;
378  union {
380  struct {
386  uint32_t min;
394  uint32_t max;
397  struct {
405  const struct cyaml_schema_field *fields;
408  struct {
410  const struct cyaml_bitdef *bitdefs;
412  uint32_t count;
418  struct {
429  const struct cyaml_schema_value *entry;
436  uint32_t min;
443  uint32_t max;
449  struct {
453  uint32_t count;
455  };
457 
470 typedef struct cyaml_schema_field {
476  const char *key;
481  uint32_t data_offset;
486  uint32_t count_offset;
491  uint8_t count_size;
495  struct cyaml_schema_value value;
497 
503 typedef enum cyaml_cfg_flags {
566  CYAML_CFG_NO_ALIAS = (1 << 5),
568 
575 typedef enum cyaml_err {
612 
619 #define CYAML_VALUE_INT( \
620  _flags, _type) \
621  .type = CYAML_INT, \
622  .flags = (enum cyaml_flag)(_flags), \
623  .data_size = sizeof(_type)
624 
635 #define CYAML_FIELD_INT( \
636  _key, _flags, _structure, _member) \
637 { \
638  .key = _key, \
639  .data_offset = offsetof(_structure, _member), \
640  .value = { \
641  CYAML_VALUE_INT(((_flags) & (~CYAML_FLAG_POINTER)), \
642  (((_structure *)NULL)->_member)), \
643  }, \
644 }
645 
656 #define CYAML_FIELD_INT_PTR( \
657  _key, _flags, _structure, _member) \
658 { \
659  .key = _key, \
660  .data_offset = offsetof(_structure, _member), \
661  .value = { \
662  CYAML_VALUE_INT(((_flags) | CYAML_FLAG_POINTER), \
663  (*(((_structure *)NULL)->_member))), \
664  }, \
665 }
666 
673 #define CYAML_VALUE_UINT( \
674  _flags, _type) \
675  .type = CYAML_UINT, \
676  .flags = (enum cyaml_flag)(_flags), \
677  .data_size = sizeof(_type)
678 
689 #define CYAML_FIELD_UINT( \
690  _key, _flags, _structure, _member) \
691 { \
692  .key = _key, \
693  .data_offset = offsetof(_structure, _member), \
694  .value = { \
695  CYAML_VALUE_UINT(((_flags) & (~CYAML_FLAG_POINTER)), \
696  (((_structure *)NULL)->_member)), \
697  }, \
698 }
699 
710 #define CYAML_FIELD_UINT_PTR( \
711  _key, _flags, _structure, _member) \
712 { \
713  .key = _key, \
714  .data_offset = offsetof(_structure, _member), \
715  .value = { \
716  CYAML_VALUE_UINT(((_flags) | CYAML_FLAG_POINTER), \
717  (*(((_structure *)NULL)->_member))), \
718  }, \
719 }
720 
727 #define CYAML_VALUE_BOOL( \
728  _flags, _type) \
729  .type = CYAML_BOOL, \
730  .flags = (enum cyaml_flag)(_flags), \
731  .data_size = sizeof(_type)
732 
743 #define CYAML_FIELD_BOOL( \
744  _key, _flags, _structure, _member) \
745 { \
746  .key = _key, \
747  .data_offset = offsetof(_structure, _member), \
748  .value = { \
749  CYAML_VALUE_BOOL(((_flags) & (~CYAML_FLAG_POINTER)), \
750  (((_structure *)NULL)->_member)), \
751  }, \
752 }
753 
764 #define CYAML_FIELD_BOOL_PTR( \
765  _key, _flags, _structure, _member) \
766 { \
767  .key = _key, \
768  .data_offset = offsetof(_structure, _member), \
769  .value = { \
770  CYAML_VALUE_BOOL(((_flags) | CYAML_FLAG_POINTER), \
771  (*(((_structure *)NULL)->_member))), \
772  }, \
773 }
774 
783 #define CYAML_VALUE_ENUM( \
784  _flags, _type, _strings, _strings_count) \
785  .type = CYAML_ENUM, \
786  .flags = (enum cyaml_flag)(_flags), \
787  .data_size = sizeof(_type), \
788  .enumeration = { \
789  .strings = _strings, \
790  .count = _strings_count, \
791  }
792 
805 #define CYAML_FIELD_ENUM( \
806  _key, _flags, _structure, _member, _strings, _strings_count) \
807 { \
808  .key = _key, \
809  .data_offset = offsetof(_structure, _member), \
810  .value = { \
811  CYAML_VALUE_ENUM(((_flags) & (~CYAML_FLAG_POINTER)), \
812  (((_structure *)NULL)->_member), \
813  _strings, _strings_count), \
814  }, \
815 }
816 
829 #define CYAML_FIELD_ENUM_PTR( \
830  _key, _flags, _structure, _member, _strings, _strings_count) \
831 { \
832  .key = _key, \
833  .data_offset = offsetof(_structure, _member), \
834  .value = { \
835  CYAML_VALUE_ENUM(((_flags) | CYAML_FLAG_POINTER), \
836  (*(((_structure *)NULL)->_member)), \
837  _strings, _strings_count), \
838  }, \
839 }
840 
849 #define CYAML_VALUE_FLAGS( \
850  _flags, _type, _strings, _strings_count) \
851  .type = CYAML_FLAGS, \
852  .flags = (enum cyaml_flag)(_flags), \
853  .data_size = sizeof(_type), \
854  .enumeration = { \
855  .strings = _strings, \
856  .count = _strings_count, \
857  }
858 
871 #define CYAML_FIELD_FLAGS( \
872  _key, _flags, _structure, _member, _strings, _strings_count) \
873 { \
874  .key = _key, \
875  .data_offset = offsetof(_structure, _member), \
876  .value = { \
877  CYAML_VALUE_FLAGS(((_flags) & (~CYAML_FLAG_POINTER)), \
878  (((_structure *)NULL)->_member), \
879  _strings, _strings_count), \
880  }, \
881 }
882 
895 #define CYAML_FIELD_FLAGS_PTR( \
896  _key, _flags, _structure, _member, _strings, _strings_count) \
897 { \
898  .key = _key, \
899  .data_offset = offsetof(_structure, _member), \
900  .value = { \
901  CYAML_VALUE_FLAGS(((_flags) | CYAML_FLAG_POINTER), \
902  (*(((_structure *)NULL)->_member)), \
903  _strings, _strings_count), \
904  }, \
905 }
906 
915 #define CYAML_VALUE_BITFIELD( \
916  _flags, _type, _bitvals, _bitvals_count) \
917  .type = CYAML_BITFIELD, \
918  .flags = (enum cyaml_flag)(_flags), \
919  .data_size = sizeof(_type), \
920  .bitfield = { \
921  .bitdefs = _bitvals, \
922  .count = _bitvals_count, \
923  }
924 
937 #define CYAML_FIELD_BITFIELD( \
938  _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
939 { \
940  .key = _key, \
941  .data_offset = offsetof(_structure, _member), \
942  .value = { \
943  CYAML_VALUE_BITFIELD(((_flags) & (~CYAML_FLAG_POINTER)), \
944  (((_structure *)NULL)->_member), \
945  _bitvals, _bitvals_count), \
946  }, \
947 }
948 
961 #define CYAML_FIELD_BITFIELD_PTR( \
962  _key, _flags, _structure, _member, _bitvals, _bitvals_count) \
963 { \
964  .key = _key, \
965  .data_offset = offsetof(_structure, _member), \
966  .value = { \
967  CYAML_VALUE_BITFIELD(((_flags) | CYAML_FLAG_POINTER), \
968  (*(((_structure *)NULL)->_member)), \
969  _bitvals, _bitvals_count), \
970  }, \
971 }
972 
979 #define CYAML_VALUE_FLOAT( \
980  _flags, _type) \
981  .type = CYAML_FLOAT, \
982  .flags = (enum cyaml_flag)(_flags), \
983  .data_size = sizeof(_type)
984 
995 #define CYAML_FIELD_FLOAT( \
996  _key, _flags, _structure, _member) \
997 { \
998  .key = _key, \
999  .data_offset = offsetof(_structure, _member), \
1000  .value = { \
1001  CYAML_VALUE_FLOAT(((_flags) & (~CYAML_FLAG_POINTER)), \
1002  (((_structure *)NULL)->_member)), \
1003  }, \
1004 }
1005 
1016 #define CYAML_FIELD_FLOAT_PTR( \
1017  _key, _flags, _structure, _member) \
1018 { \
1019  .key = _key, \
1020  .data_offset = offsetof(_structure, _member), \
1021  .value = { \
1022  CYAML_VALUE_FLOAT(((_flags) | CYAML_FLAG_POINTER), \
1023  (*(((_structure *)NULL)->_member))), \
1024  }, \
1025 }
1026 
1044 #define CYAML_VALUE_STRING( \
1045  _flags, _type, _min, _max) \
1046  .type = CYAML_STRING, \
1047  .flags = (enum cyaml_flag)(_flags), \
1048  .data_size = sizeof(_type), \
1049  .string = { \
1050  .min = _min, \
1051  .max = _max, \
1052  }
1053 
1066 #define CYAML_FIELD_STRING( \
1067  _key, _flags, _structure, _member, _min) \
1068 { \
1069  .key = _key, \
1070  .data_offset = offsetof(_structure, _member), \
1071  .value = { \
1072  CYAML_VALUE_STRING(((_flags) & (~CYAML_FLAG_POINTER)), \
1073  (((_structure *)NULL)->_member), _min, \
1074  sizeof(((_structure *)NULL)->_member) - 1), \
1075  }, \
1076 }
1077 
1094 #define CYAML_FIELD_STRING_PTR( \
1095  _key, _flags, _structure, _member, _min, _max) \
1096 { \
1097  .key = _key, \
1098  .data_offset = offsetof(_structure, _member), \
1099  .value = { \
1100  CYAML_VALUE_STRING(((_flags) | CYAML_FLAG_POINTER), \
1101  (((_structure *)NULL)->_member), \
1102  _min, _max), \
1103  }, \
1104 }
1105 
1113 #define CYAML_VALUE_MAPPING( \
1114  _flags, _type, _fields) \
1115  .type = CYAML_MAPPING, \
1116  .flags = (enum cyaml_flag)(_flags), \
1117  .data_size = sizeof(_type), \
1118  .mapping = { \
1119  .fields = _fields, \
1120  }
1121 
1133 #define CYAML_FIELD_MAPPING( \
1134  _key, _flags, _structure, _member, _fields) \
1135 { \
1136  .key = _key, \
1137  .data_offset = offsetof(_structure, _member), \
1138  .value = { \
1139  CYAML_VALUE_MAPPING(((_flags) & (~CYAML_FLAG_POINTER)), \
1140  (((_structure *)NULL)->_member), _fields), \
1141  }, \
1142 }
1143 
1155 #define CYAML_FIELD_MAPPING_PTR( \
1156  _key, _flags, _structure, _member, _fields) \
1157 { \
1158  .key = _key, \
1159  .data_offset = offsetof(_structure, _member), \
1160  .value = { \
1161  CYAML_VALUE_MAPPING(((_flags) | CYAML_FLAG_POINTER), \
1162  (*(((_structure *)NULL)->_member)), _fields), \
1163  }, \
1164 }
1165 
1175 #define CYAML_VALUE_SEQUENCE( \
1176  _flags, _type, _entry, _min, _max) \
1177  .type = CYAML_SEQUENCE, \
1178  .flags = (enum cyaml_flag)(_flags), \
1179  .data_size = sizeof(_type), \
1180  .sequence = { \
1181  .entry = _entry, \
1182  .min = _min, \
1183  .max = _max, \
1184  }
1185 
1219 #define CYAML_FIELD_SEQUENCE( \
1220  _key, _flags, _structure, _member, _entry, _min, _max) \
1221 { \
1222  .key = _key, \
1223  .data_offset = offsetof(_structure, _member), \
1224  .count_offset = offsetof(_structure, _member ## _count), \
1225  .count_size = sizeof(((_structure *)NULL)->_member ## _count), \
1226  .value = { \
1227  CYAML_VALUE_SEQUENCE((_flags), \
1228  (*(((_structure *)NULL)->_member)), \
1229  _entry, _min, _max), \
1230  }, \
1231 }
1232 
1267 #define CYAML_FIELD_SEQUENCE_COUNT( \
1268  _key, _flags, _structure, _member, _count, _entry, _min, _max) \
1269 { \
1270  .key = _key, \
1271  .data_offset = offsetof(_structure, _member), \
1272  .count_offset = offsetof(_structure, _count), \
1273  .count_size = sizeof(((_structure *)NULL)->_count), \
1274  .value = { \
1275  CYAML_VALUE_SEQUENCE((_flags), \
1276  (*(((_structure *)NULL)->_member)), \
1277  _entry, _min, _max), \
1278  }, \
1279 }
1280 
1289 #define CYAML_VALUE_SEQUENCE_FIXED( \
1290  _flags, _type, _entry, _count) \
1291  .type = CYAML_SEQUENCE_FIXED, \
1292  .flags = (enum cyaml_flag)(_flags), \
1293  .data_size = sizeof(_type), \
1294  .sequence = { \
1295  .entry = _entry, \
1296  .min = _count, \
1297  .max = _count, \
1298  }
1299 
1310 #define CYAML_FIELD_SEQUENCE_FIXED( \
1311  _key, _flags, _structure, _member, _entry, _count) \
1312 { \
1313  .key = _key, \
1314  .data_offset = offsetof(_structure, _member), \
1315  .value = { \
1316  CYAML_VALUE_SEQUENCE_FIXED((_flags), \
1317  (*(((_structure *)NULL)->_member)), \
1318  _entry, _count), \
1319  }, \
1320 }
1321 
1328 #define CYAML_FIELD_IGNORE( \
1329  _key, _flags) \
1330 { \
1331  .key = _key, \
1332  .value = { \
1333  .type = CYAML_IGNORE, \
1334  .flags = (_flags), \
1335  }, \
1336 }
1337 
1344 #define CYAML_FIELD_END { .key = NULL }
1345 
1350 #define CYAML_UNLIMITED 0xffffffff
1351 
1360 #define CYAML_ARRAY_LEN(_a) ((sizeof(_a)) / (sizeof(_a[0])))
1361 
1366 typedef void cyaml_data_t;
1367 
1369 typedef enum cyaml_log_e {
1376 
1388 typedef void (*cyaml_log_fn_t)(
1389  cyaml_log_t level,
1390  void *ctx,
1391  const char *fmt,
1392  va_list args);
1393 
1408 typedef void * (*cyaml_mem_fn_t)(
1409  void *ctx,
1410  void *ptr,
1411  size_t size);
1412 
1419 typedef struct cyaml_config {
1444  void *log_ctx;
1465  void *mem_ctx;
1476 
1496 extern void cyaml_log(
1497  cyaml_log_t level,
1498  void *ctx,
1499  const char *fmt,
1500  va_list args);
1501 
1519 extern void * cyaml_mem(
1520  void *ctx,
1521  void *ptr,
1522  size_t size);
1523 
1543  const char *path,
1544  const cyaml_config_t *config,
1545  const cyaml_schema_value_t *schema,
1546  cyaml_data_t **data_out,
1547  unsigned *seq_count_out);
1548 
1569  const uint8_t *input,
1570  size_t input_len,
1571  const cyaml_config_t *config,
1572  const cyaml_schema_value_t *schema,
1573  cyaml_data_t **data_out,
1574  unsigned *seq_count_out);
1575 
1588  const char *path,
1589  const cyaml_config_t *config,
1590  const cyaml_schema_value_t *schema,
1591  const cyaml_data_t *data,
1592  unsigned seq_count);
1593 
1631  char **output,
1632  size_t *len,
1633  const cyaml_config_t *config,
1634  const cyaml_schema_value_t *schema,
1635  const cyaml_data_t *data,
1636  unsigned seq_count);
1637 
1656 extern cyaml_err_t cyaml_free(
1657  const cyaml_config_t *config,
1658  const cyaml_schema_value_t *schema,
1659  cyaml_data_t *data,
1660  unsigned seq_count);
1661 
1669 extern const char * cyaml_strerror(
1670  cyaml_err_t err);
1671 
1672 #ifdef __cplusplus
1673 }
1674 #endif
1675 
1676 #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
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:2686
struct cyaml_schema_field cyaml_schema_field_t
enum cyaml_err cyaml_err_t
void cyaml_data_t
Definition: cyaml.h:1366
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:2644
void * cyaml_mem(void *ctx, void *ptr, size_t size)
Definition: mem.c:22
void(* cyaml_log_fn_t)(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
Definition: cyaml.h:1388
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:575
@ CYAML_ERR_BAD_PARAM_NULL_SCHEMA
Definition: cyaml.h:601
@ CYAML_ERR_LIBYAML_PARSER_INIT
Definition: cyaml.h:603
@ CYAML_ERR_BAD_PARAM_NULL_CONFIG
Definition: cyaml.h:600
@ CYAML_ERR_BAD_PARAM_NULL_DATA
Definition: cyaml.h:592
@ CYAML_ERR_BAD_BITVAL_IN_SCHEMA
Definition: cyaml.h:593
@ CYAML_ERR_LIBYAML_EMITTER
Definition: cyaml.h:605
@ CYAML_ERR_FILE_OPEN
Definition: cyaml.h:579
@ CYAML_ERR_TOP_LEVEL_NON_PTR
Definition: cyaml.h:588
@ CYAML_ERR_BAD_CONFIG_NULL_MEMFN
Definition: cyaml.h:599
@ CYAML_ERR_STRING_LENGTH_MAX
Definition: cyaml.h:586
@ CYAML_ERR_INVALID_DATA_SIZE
Definition: cyaml.h:587
@ CYAML_ERR_BAD_TYPE_IN_SCHEMA
Definition: cyaml.h:589
@ CYAML_ERR_SEQUENCE_ENTRIES_MAX
Definition: cyaml.h:595
@ CYAML_ERR_STRING_LENGTH_MIN
Definition: cyaml.h:585
@ CYAML_ERR_BAD_MIN_MAX_SCHEMA
Definition: cyaml.h:590
@ CYAML_ERR_MAPPING_FIELD_MISSING
Definition: cyaml.h:598
@ CYAML_ERR_UNEXPECTED_EVENT
Definition: cyaml.h:584
@ CYAML_ERR_INVALID_VALUE
Definition: cyaml.h:581
@ CYAML_ERR_OOM
Definition: cyaml.h:577
@ CYAML_ERR_INVALID_ALIAS
Definition: cyaml.h:582
@ CYAML_ERR_INVALID_KEY
Definition: cyaml.h:580
@ CYAML_ERR_INTERNAL_ERROR
Definition: cyaml.h:583
@ CYAML_ERR_SEQUENCE_ENTRIES_MIN
Definition: cyaml.h:594
@ CYAML_ERR_LIBYAML_EVENT_INIT
Definition: cyaml.h:604
@ CYAML_ERR_SEQUENCE_IN_SEQUENCE
Definition: cyaml.h:597
@ CYAML_OK
Definition: cyaml.h:576
@ CYAML_ERR_LIBYAML_PARSER
Definition: cyaml.h:606
@ CYAML_ERR_BAD_PARAM_SEQ_COUNT
Definition: cyaml.h:591
@ CYAML_ERR__COUNT
Definition: cyaml.h:607
@ CYAML_ERR_SEQUENCE_FIXED_COUNT
Definition: cyaml.h:596
@ CYAML_ERR_LIBYAML_EMITTER_INIT
Definition: cyaml.h:602
@ CYAML_ERR_ALIAS
Definition: cyaml.h:578
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
void *(* cyaml_mem_fn_t)(void *ctx, void *ptr, size_t size)
Definition: cyaml.h:1408
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
Definition: util.c:57
struct cyaml_config cyaml_config_t
struct cyaml_strval cyaml_strval_t
cyaml_flag
Definition: cyaml.h:132
@ CYAML_FLAG_SCALAR_LITERAL
Definition: cyaml.h:304
@ CYAML_FLAG_SCALAR_QUOTE_SINGLE
Definition: cyaml.h:311
@ 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_SCALAR_QUOTE_DOUBLE
Definition: cyaml.h:318
@ CYAML_FLAG_SCALAR_PLAIN
Definition: cyaml.h:278
@ 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_SCALAR_FOLDED
Definition: cyaml.h:291
@ 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:503
@ CYAML_CFG_IGNORE_UNKNOWN_KEYS
Definition: cyaml.h:513
@ CYAML_CFG_DEFAULT
Definition: cyaml.h:507
@ CYAML_CFG_CASE_INSENSITIVE
Definition: cyaml.h:554
@ CYAML_CFG_DOCUMENT_DELIM
Definition: cyaml.h:548
@ CYAML_CFG_NO_ALIAS
Definition: cyaml.h:566
@ CYAML_CFG_STYLE_FLOW
Definition: cyaml.h:541
@ CYAML_CFG_STYLE_BLOCK
Definition: cyaml.h:527
enum cyaml_type cyaml_type_e
const char * cyaml_strerror(cyaml_err_t err)
Definition: util.c:81
void cyaml_log(cyaml_log_t level, void *ctx, const char *fmt, va_list args)
Definition: util.c:60
cyaml_log_e
Definition: cyaml.h:1369
@ CYAML_LOG_NOTICE
Definition: cyaml.h:1372
@ CYAML_LOG_DEBUG
Definition: cyaml.h:1370
@ CYAML_LOG_ERROR
Definition: cyaml.h:1374
@ CYAML_LOG_WARNING
Definition: cyaml.h:1373
@ CYAML_LOG_INFO
Definition: cyaml.h:1371
Definition: cyaml.h:336
uint8_t bits
Definition: cyaml.h:339
const char * name
Definition: cyaml.h:337
uint8_t offset
Definition: cyaml.h:338
Definition: cyaml.h:1419
cyaml_log_fn_t log_fn
Definition: cyaml.h:1434
cyaml_cfg_flags_t flags
Definition: cyaml.h:1474
void * log_ctx
Definition: cyaml.h:1444
cyaml_log_t log_level
Definition: cyaml.h:1472
void * mem_ctx
Definition: cyaml.h:1465
cyaml_mem_fn_t mem_fn
Definition: cyaml.h:1455
Definition: cyaml.h:470
uint32_t data_offset
Definition: cyaml.h:481
uint32_t count_offset
Definition: cyaml.h:486
uint8_t count_size
Definition: cyaml.h:491
const char * key
Definition: cyaml.h:476
struct cyaml_schema_value value
Definition: cyaml.h:495
Definition: cyaml.h:362
enum cyaml_type type
Definition: cyaml.h:366
uint32_t max
Definition: cyaml.h:394
struct cyaml_schema_value::@0::@2 string
uint32_t count
Definition: cyaml.h:412
struct cyaml_schema_value::@0::@3 mapping
const struct cyaml_schema_field * fields
Definition: cyaml.h:405
uint32_t data_size
Definition: cyaml.h:376
struct cyaml_schema_value::@0::@6 enumeration
enum cyaml_flag flags
Definition: cyaml.h:368
uint32_t min
Definition: cyaml.h:386
const cyaml_strval_t * strings
Definition: cyaml.h:451
struct cyaml_schema_value::@0::@5 sequence
struct cyaml_schema_value::@0::@4 bitfield
const struct cyaml_schema_value * entry
Definition: cyaml.h:429
const struct cyaml_bitdef * bitdefs
Definition: cyaml.h:410
Definition: cyaml.h:326
const char * str
Definition: cyaml.h:327
int64_t val
Definition: cyaml.h:328