23#define DASTOMLC17_RELEASE_AFTER "260618"
43#define DASTOML_EXTERN extern "C"
45#define DASTOML_EXTERN extern
91 int16_t hour, minute, second;
114#define DASTOML_FLAG_INLINED \
116#define DASTOML_FLAG_STDEXPR 2
117#define DASTOML_FLAG_EXPLICIT 4
216 const char *multipart_key);
273 void *(*mem_realloc)(
void *ptr,
Minimal definitions for das2 utilities that can safely be run without calling das_init().
Represents a single piece of TOML data.
Definition toml.h:73
int * len
Array of key lengths.
Definition toml.h:102
const char * ptr
NUL terminated string pointer.
Definition toml.h:83
double fp64
64-bit floating point value
Definition toml.h:87
int colno
1-based source column number, 0 if synthesized
Definition toml.h:77
int64_t int64
64-bit integer value
Definition toml.h:86
int lineno
1-based source line number, 0 if synthesized
Definition toml.h:76
bool boolean
Boolean value.
Definition toml.h:88
uint32_t flag
Internal flag, do not use.
Definition toml.h:75
int16_t tz
Timezone offset in minutes.
Definition toml.h:93
dastoml_type_t type
Type of the datum.
Definition toml.h:74
const char * s
Shorthand for str.ptr.
Definition toml.h:81
dastoml_datum_t * value
Array of values corresponding to keys.
Definition toml.h:103
int16_t year
< Date and time components
Definition toml.h:90
const char * source
Source name (e.g.
Definition toml.h:78
dastoml_datum_t * elem
Array of elements.
Definition toml.h:97
const char ** key
Array of keys.
Definition toml.h:101
int32_t size
< Array data
Definition toml.h:96
int len
Length of the string excluding the terminating NUL.
Definition toml.h:84
Global options for the TOML parser.
Definition toml.h:270
void(* mem_free)(void *ptr)
Custom free function.
Definition toml.h:276
bool check_utf8
If true, check if all characters are valid UTF-8.
Definition toml.h:271
Result of a TOML parsing operation.
Definition toml.h:123
bool ok
True if parsing was successful.
Definition toml.h:124
char errmsg[200]
Error message (valid if ok is false)
Definition toml.h:126
void * __internal
Internal state, do not use.
Definition toml.h:127
dastoml_datum_t toptab
The top-level table (valid if ok is true)
Definition toml.h:125
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_parse_file_ex(const char *fname)
Parse a TOML document from a file path.
DASTOML_EXTERN DAS_API dastoml_datum_t dastoml_seek(dastoml_datum_t table, const char *multipart_key)
Locate a value using a multipart-key (e.g., "a.b.c").
DASTOML_EXTERN DAS_API void dastoml_set_option(dastoml_option_t opt)
Set the global parser options.
dastoml_type_t
Enumeration of TOML data types.
Definition toml.h:51
@ DASTOML_BOOLEAN
Boolean type.
Definition toml.h:56
@ DASTOML_STRING
String type.
Definition toml.h:53
@ DASTOML_DATETIMETZ
Offset datetime type.
Definition toml.h:60
@ DASTOML_TABLE
Table type.
Definition toml.h:62
@ DASTOML_TIME
Local time type.
Definition toml.h:58
@ DASTOML_ARRAY
Array type.
Definition toml.h:61
@ DASTOML_INT64
64-bit integer type
Definition toml.h:54
@ DASTOML_DATETIME
Local datetime type.
Definition toml.h:59
@ DASTOML_UNKNOWN
Unknown or invalid type.
Definition toml.h:52
@ DASTOML_DATE
Local date type.
Definition toml.h:57
@ DASTOML_FP64
64-bit floating point type
Definition toml.h:55
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_parse(const char *src, int len)
Parse a TOML document from a string.
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_parse_file(FILE *fp)
Parse a TOML document from a file pointer.
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_parse_named(const char *src, int len, const char *name)
Parse a TOML document, tagging every datum with a source name.
DASTOML_EXTERN DAS_API dastoml_option_t dastoml_default_option(void)
Get the default parser options.
DASTOML_EXTERN DAS_API void dastoml_free(dastoml_result_t result)
Release resources allocated for a TOML result.
DASTOML_EXTERN DAS_API bool dastoml_equiv(const dastoml_result_t *r1, const dastoml_result_t *r2)
Compare two TOML results for equality.
DASTOML_EXTERN DAS_API dastoml_datum_t dastoml_get(dastoml_datum_t table, const char *key)
Find a value for a specific key in a TOML table.
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_parse_file_named(FILE *fp, const char *name)
Parse a TOML document from a file pointer, tagging datums with a name.
DASTOML_EXTERN DAS_API dastoml_result_t dastoml_merge(const dastoml_result_t *r1, const dastoml_result_t *r2)
Merge two TOML results.