#ifndef cudl_h_INCLUDED #define cudl_h_INCLUDED struct cudl_array_value { struct cudl_value *values; size_t length; }; struct cudl_map_value { struct cudl_map_field *fields; size_t length; }; struct cudl_value { union { char *string; double number; int boolean; struct cudl_array_value array; struct cudl_map_value map; } data; int tag; }; struct cudl_map_field { char *key; struct cudl_value value; }; enum { CUDL_TAG_NULL, CUDL_TAG_BOOL, CUDL_TAG_ARRAY, }; enum { CUDL_OK = 0, CUDL_ERR_OUT_OF_MEMORY, CUDL_ERR_EXPECTED_VALUE, CUDL_ERR_READING, CUDL_ERR_EXPECTED_BOOL_OR_NULL, CUDL_ERR_UNMATCHED_BRACK, CUDL_ERR_UNRECOGNISED_VALUE, }; extern int cudl_err; void cudl_debug(struct cudl_value value); void cudl_deinit_value(struct cudl_value value); void cudl_parse_from_file(FILE *file, struct cudl_value *value); size_t cudl_parse(char *input, struct cudl_value *value); #endif // cudl_h_INCLUDED