|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
#include "toml.h"#include <assert.h>#include <ctype.h>#include <errno.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Classes | |
| struct | toml_keyval_t |
| struct | toml_arritem_t |
| struct | toml_array_t |
| struct | toml_table_t |
| struct | token_t |
| struct | context_t |
| struct | tabpath_t |
Macros | |
| #define | _POSIX_C_SOURCE 200809L |
| #define | ALIGN8(sz) |
| #define | MALLOC(a) |
| #define | FREE(a) |
| #define | malloc(x) |
| #define | free(x) |
| #define | calloc(x, y) |
| #define | strdup(x) |
| #define | strndup(x) |
| #define | STRINGIFY(x) |
| #define | TOSTRING(x) |
| #define | FLINE __FILE__ ":" TOSTRING(__LINE__) |
Typedefs | |
| typedef struct toml_keyval_t | toml_keyval_t |
| typedef struct toml_arritem_t | toml_arritem_t |
| typedef enum tokentype_t | tokentype_t |
| typedef struct token_t | token_t |
| typedef struct context_t | context_t |
| typedef struct tabpath_t | tabpath_t |
Enumerations | |
| enum | tokentype_t { INVALID , DOT , COMMA , EQUAL , LBRACE , RBRACE , NEWLINE , LBRACKET , RBRACKET , STRING } |
Functions | |
| void | toml_set_memutil (void *(*xxmalloc)(size_t), void(*xxfree)(void *)) |
| static void * | CALLOC (size_t nmemb, size_t sz) |
| static char * | STRDUP (const char *s) |
| static char * | STRNDUP (const char *s, size_t n) |
| int | toml_utf8_to_ucs (const char *orig, int len, int64_t *ret) |
| int | toml_ucs_to_utf8 (int64_t code, char buf[6]) |
| static void | xfree (const void *x) |
| static int | next_token (context_t *ctx, int dotisspecial) |
| static int | e_outofmemory (context_t *ctx, const char *fline) |
| static int | e_internal (context_t *ctx, const char *fline) |
| static int | e_syntax (context_t *ctx, int lineno, const char *msg) |
| static int | e_badkey (context_t *ctx, int lineno) |
| static int | e_keyexists (context_t *ctx, int lineno) |
| static int | e_forbid (context_t *ctx, int lineno, const char *msg) |
| static void * | expand (void *p, int sz, int newsz) |
| static void ** | expand_ptrarr (void **p, int n) |
| static toml_arritem_t * | expand_arritem (toml_arritem_t *p, int n) |
| static char * | norm_lit_str (const char *src, int srclen, int multiline, char *errbuf, int errbufsz) |
| static char * | norm_basic_str (const char *src, int srclen, int multiline, char *errbuf, int errbufsz) |
| static char * | normalize_key (context_t *ctx, token_t strtok) |
| static int | check_key (toml_table_t *tab, const char *key, toml_keyval_t **ret_val, toml_array_t **ret_arr, toml_table_t **ret_tab) |
| static int | key_kind (toml_table_t *tab, const char *key) |
| static toml_keyval_t * | create_keyval_in_table (context_t *ctx, toml_table_t *tab, token_t keytok) |
| static toml_table_t * | create_keytable_in_table (context_t *ctx, toml_table_t *tab, token_t keytok) |
| static toml_array_t * | create_keyarray_in_table (context_t *ctx, toml_table_t *tab, token_t keytok, char kind) |
| static toml_arritem_t * | create_value_in_array (context_t *ctx, toml_array_t *parent) |
| static toml_array_t * | create_array_in_array (context_t *ctx, toml_array_t *parent) |
| static toml_table_t * | create_table_in_array (context_t *ctx, toml_array_t *parent) |
| static int | skip_newlines (context_t *ctx, int isdotspecial) |
| static int | parse_keyval (context_t *ctx, toml_table_t *tab) |
| static int | eat_token (context_t *ctx, tokentype_t typ, int isdotspecial, const char *fline) |
| static int | parse_inline_table (context_t *ctx, toml_table_t *tab) |
| static int | valtype (const char *val) |
| static int | parse_array (context_t *ctx, toml_array_t *arr) |
| static int | fill_tabpath (context_t *ctx) |
| static int | walk_tabpath (context_t *ctx) |
| static int | parse_select (context_t *ctx) |
| toml_table_t * | toml_parse (char *conf, char *errbuf, int errbufsz) |
| toml_table_t * | toml_parse_file (FILE *fp, char *errbuf, int errbufsz) |
| static void | xfree_kval (toml_keyval_t *p) |
| static void | xfree_tab (toml_table_t *p) |
| static void | xfree_arr (toml_array_t *p) |
| void | toml_free (toml_table_t *tab) |
| static void | set_token (context_t *ctx, tokentype_t tok, int lineno, char *ptr, int len) |
| static void | set_eof (context_t *ctx, int lineno) |
| static int | scan_digits (const char *p, int n) |
| static int | scan_date (const char *p, int *YY, int *MM, int *DD) |
| static int | scan_time (const char *p, int *hh, int *mm, int *ss) |
| static int | scan_string (context_t *ctx, char *p, int lineno, int dotisspecial) |
| const char * | toml_key_in (const toml_table_t *tab, int keyidx) |
| int | toml_key_exists (const toml_table_t *tab, const char *key) |
| toml_raw_t | toml_raw_in (const toml_table_t *tab, const char *key) |
| toml_array_t * | toml_array_in (const toml_table_t *tab, const char *key) |
| toml_table_t * | toml_table_in (const toml_table_t *tab, const char *key) |
| toml_raw_t | toml_raw_at (const toml_array_t *arr, int idx) |
| char | toml_array_kind (const toml_array_t *arr) |
| char | toml_array_type (const toml_array_t *arr) |
| int | toml_array_nelem (const toml_array_t *arr) |
| const char * | toml_array_key (const toml_array_t *arr) |
| int | toml_table_nkval (const toml_table_t *tab) |
| int | toml_table_narr (const toml_table_t *tab) |
| int | toml_table_ntab (const toml_table_t *tab) |
| const char * | toml_table_key (const toml_table_t *tab) |
| toml_array_t * | toml_array_at (const toml_array_t *arr, int idx) |
| toml_table_t * | toml_table_at (const toml_array_t *arr, int idx) |
| static int | parse_millisec (const char *p, const char **endp) |
| int | toml_rtots (toml_raw_t src_, toml_timestamp_t *ret) |
| int | toml_rtob (toml_raw_t src, int *ret_) |
| int | toml_rtoi (toml_raw_t src, int64_t *ret_) |
| int | toml_rtod_ex (toml_raw_t src, double *ret_, char *buf, int buflen) |
| int | toml_rtod (toml_raw_t src, double *ret_) |
| int | toml_rtos (toml_raw_t src, char **ret) |
| toml_datum_t | toml_string_at (const toml_array_t *arr, int idx) |
| toml_datum_t | toml_bool_at (const toml_array_t *arr, int idx) |
| toml_datum_t | toml_int_at (const toml_array_t *arr, int idx) |
| toml_datum_t | toml_double_at (const toml_array_t *arr, int idx) |
| toml_datum_t | toml_timestamp_at (const toml_array_t *arr, int idx) |
| toml_datum_t | toml_string_in (const toml_table_t *arr, const char *key) |
| toml_datum_t | toml_bool_in (const toml_table_t *arr, const char *key) |
| toml_datum_t | toml_int_in (const toml_table_t *arr, const char *key) |
| toml_datum_t | toml_double_in (const toml_table_t *arr, const char *key) |
| toml_datum_t | toml_timestamp_in (const toml_table_t *arr, const char *key) |
Variables | |
| static void *(* | ppmalloc )(size_t) = malloc |
| static void(* | ppfree )(void *) = free |
| #define ALIGN8 | ( | sz | ) |
| #define calloc | ( | x, | |
| y ) |
Definition at line 54 of file toml.c.
Referenced by add_halfc(), clas_ctx_init(), decodefile(), decoderaw(), gen_strfile(), has_complete(), has_new(), init_rt17(), mrtk_context_new(), mrtk_ctx_create(), openserial(), readpreceph(), rtcm_lclblk(), rtksvrstart(), strconvnew(), udbiass(), update_clas(), update_stas(), and zeros().
| #define FLINE __FILE__ ":" TOSTRING(__LINE__) |
Definition at line 373 of file toml.c.
Referenced by create_array_in_array(), create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), create_table_in_array(), create_value_in_array(), normalize_key(), parse_array(), parse_inline_table(), parse_keyval(), parse_select(), toml_parse(), and walk_tabpath().
| #define FREE | ( | a | ) |
| #define free | ( | x | ) |
Definition at line 53 of file toml.c.
Referenced by add_eph(), add_eph(), add_geph(), add_geph(), add_seph(), add_seph(), addbia(), addisbdata(), addobsdata(), addobsdata(), addpcv(), addpeph(), addsol(), addsolstat(), addtec(), calc_3points_weight(), clas_ctx_free(), clas_get_grid_index(), clas_osr_zdres(), clas_ssr2osr(), clas_stec_grid_data(), clas_trop_grid_data(), closefile(), closeftp(), closemembuf(), closentrip(), closentripc(), closeserial(), closeses(), closetcpcli(), closetcpsvr(), closeudpcli(), closeudpsvr(), combpclk(), combtec(), convrnx_s(), ddres(), ddres(), ddres(), decodefile(), decoderaw(), estpos(), estvel(), execses(), execses_b(), execses_r(), filter(), filter2(), filter2(), filter2_(), filter2_(), filter_(), free_raw(), free_rnxctr(), free_rt17(), free_rtcm(), free_strfile(), freebia(), freenav(), freeobs(), freeobsnav(), freepreceph(), freesolbuf(), freesolstatbuf(), gen_strfile(), genudp(), has_complete(), has_free(), holdamb(), holdamb(), holdamb(), l6_file_service(), lambda(), lambda_reduction(), lambda_search(), LD(), loadopts_toml(), lsq(), ludcmp(), matinv(), mrtk_context_free(), mrtk_ctx_destroy(), openfile(), openmembuf(), openntrip(), openntripc(), openserial(), opentcpcli(), opentcpsvr(), pntpos(), postpos(), ppp_amb_ILS(), ppp_rtk_pos(), pppos(), raim_fde(), readbnxt(), readdcb(), readerp(), readfcb(), readisb(), readmsgs(), readpreceph(), readrnxc(), readrnxclk(), readrnxobs(), readrnxt(), readsap(), readsp3(), readtec(), relpos(), relposvrs(), resamb_LAMBDA(), resamb_LAMBDA(), resamb_LAMBDA(), residual_test(), residual_test(), rtkfree(), rtksvrfree(), rtksvrstart(), rtksvrthread(), sbsreadmsgt(), sddop(), sddop(), search(), set_init_pb(), set_init_pb(), smoother(), solve(), sort_solbuf(), sort_solstat(), strconvfree(), strconvnew(), strsvrstart(), strsvrthread(), toml_val_to_str(), udbias(), udbias_ppp(), udbias_ppp(), udbiass(), udpos(), udpos(), udpos_ppp(), udpos_ppp(), uniqeph(), uniqgeph(), uniqseph(), update_clas(), update_states(), write_trace_sd_amb(), zddop(), and zddop().
| #define MALLOC | ( | a | ) |
Definition at line 49 of file toml.c.
Referenced by CALLOC(), expand(), expand_ptrarr(), STRDUP(), STRNDUP(), toml_timestamp_at(), and toml_timestamp_in().
| #define malloc | ( | x | ) |
Definition at line 52 of file toml.c.
Referenced by addtec(), clas_osr_zdres(), convrnx_s(), execses(), execses_b(), execses_r(), genudp(), imat(), init_raw(), init_rnxctr(), init_rtcm(), initsolbuf(), l6_file_service(), mat(), openfile(), openftp(), openmembuf(), openntrip(), openntripc(), opentcpcli(), opentcpsvr(), postpos(), raim_fde(), readbnxt(), readdcb(), readfcb(), readisb(), readpreceph(), readrnxc(), readrnxobs(), readrnxt(), readsp3(), readtec(), rtksvrinit(), rtksvrstart(), rtksvrthread(), sbsreadmsgt(), and strsvrstart().
| #define strdup | ( | x | ) |
| #define strndup | ( | x | ) |
| #define TOSTRING | ( | x | ) |
| typedef enum tokentype_t tokentype_t |
| enum tokentype_t |
|
static |
Definition at line 56 of file toml.c.
References ALIGN8, and MALLOC.
Referenced by create_array_in_array(), create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), create_table_in_array(), toml_parse(), and walk_tabpath().
|
static |
Definition at line 692 of file toml.c.
References toml_table_t::arr, toml_array_t::key, toml_keyval_t::key, toml_table_t::key, toml_table_t::kval, toml_table_t::narr, toml_table_t::nkval, toml_table_t::ntab, and toml_table_t::tab.
Referenced by create_keytable_in_table(), key_kind(), and walk_tabpath().
|
static |
Definition at line 879 of file toml.c.
References toml_arritem_t::arr, CALLOC(), e_outofmemory(), expand_arritem(), FLINE, toml_array_t::item, and toml_array_t::nitem.
Referenced by parse_array().
|
static |
Definition at line 825 of file toml.c.
References toml_table_t::arr, CALLOC(), e_keyexists(), e_outofmemory(), expand_ptrarr(), FLINE, toml_array_t::key, key_kind(), toml_array_t::kind, token_t::lineno, toml_table_t::narr, normalize_key(), and xfree().
Referenced by parse_keyval(), and parse_select().
|
static |
Definition at line 777 of file toml.c.
References CALLOC(), check_key(), e_keyexists(), e_outofmemory(), expand_ptrarr(), FLINE, toml_table_t::implicit, toml_table_t::key, token_t::lineno, normalize_key(), toml_table_t::ntab, toml_table_t::tab, and xfree().
Referenced by parse_keyval(), and parse_select().
|
static |
Definition at line 736 of file toml.c.
References CALLOC(), e_keyexists(), e_outofmemory(), expand_ptrarr(), FLINE, toml_keyval_t::key, key_kind(), toml_table_t::kval, token_t::lineno, toml_table_t::nkval, normalize_key(), and xfree().
Referenced by parse_keyval().
|
static |
Definition at line 900 of file toml.c.
References CALLOC(), e_outofmemory(), expand_arritem(), FLINE, toml_array_t::item, toml_array_t::nitem, and toml_arritem_t::tab.
Referenced by parse_array(), and parse_select().
|
static |
Definition at line 864 of file toml.c.
References e_outofmemory(), expand_arritem(), FLINE, toml_array_t::item, and toml_array_t::nitem.
Referenced by parse_array().
|
static |
Definition at line 395 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by normalize_key().
|
static |
Definition at line 405 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by parse_keyval().
|
static |
Definition at line 385 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by eat_token(), and walk_tabpath().
|
static |
Definition at line 400 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), and walk_tabpath().
|
static |
Definition at line 380 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by create_array_in_array(), create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), create_table_in_array(), create_value_in_array(), normalize_key(), parse_array(), parse_keyval(), parse_select(), toml_parse(), and walk_tabpath().
|
static |
Definition at line 390 of file toml.c.
References context_t::errbuf, and context_t::errbufsz.
Referenced by fill_tabpath(), normalize_key(), parse_array(), parse_inline_table(), parse_keyval(), parse_select(), scan_string(), and toml_parse().
|
inlinestatic |
Definition at line 931 of file toml.c.
References e_internal(), next_token(), context_t::tok, and token_t::tok.
Referenced by parse_array(), parse_inline_table(), parse_keyval(), parse_select(), and toml_parse().
|
static |
Definition at line 410 of file toml.c.
Referenced by expand_arritem(), norm_basic_str(), norm_lit_str(), and toml_parse_file().
|
static |
Definition at line 435 of file toml.c.
References expand().
Referenced by create_array_in_array(), create_table_in_array(), and create_value_in_array().
|
static |
Definition at line 422 of file toml.c.
Referenced by create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), and walk_tabpath().
|
static |
Definition at line 1201 of file toml.c.
References DOT, e_syntax(), context_t::key, token_t::lineno, next_token(), normalize_key(), RBRACKET, STRING, context_t::tok, token_t::tok, context_t::top, context_t::tpath, and xfree().
Referenced by parse_select().
|
static |
Definition at line 730 of file toml.c.
References check_key().
Referenced by create_keyarray_in_table(), and create_keyval_in_table().
|
static |
Definition at line 1803 of file toml.c.
References COMMA, DOT, EQUAL, LBRACE, LBRACKET, token_t::len, token_t::lineno, NEWLINE, token_t::ptr, RBRACE, RBRACKET, scan_string(), set_eof(), set_token(), context_t::stop, and context_t::tok.
Referenced by eat_token(), fill_tabpath(), parse_keyval(), skip_newlines(), and toml_parse().
|
static |
Definition at line 493 of file toml.c.
References expand(), toml_ucs_to_utf8(), and xfree().
Referenced by normalize_key(), and toml_rtos().
|
static |
Definition at line 444 of file toml.c.
References expand(), and xfree().
Referenced by toml_rtos().
Definition at line 626 of file toml.c.
References e_badkey(), e_outofmemory(), e_syntax(), FLINE, token_t::len, token_t::lineno, norm_basic_str(), token_t::ptr, STRNDUP(), and xfree().
Referenced by create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), fill_tabpath(), parse_keyval(), and parse_select().
|
static |
Definition at line 1006 of file toml.c.
References COMMA, create_array_in_array(), create_table_in_array(), create_value_in_array(), e_outofmemory(), e_syntax(), eat_token(), FLINE, toml_array_t::kind, LBRACE, LBRACKET, token_t::len, token_t::lineno, toml_array_t::nitem, parse_array(), parse_inline_table(), token_t::ptr, RBRACKET, skip_newlines(), STRING, STRNDUP(), context_t::tok, token_t::tok, toml_array_t::type, toml_arritem_t::val, toml_arritem_t::valtype, and valtype().
Referenced by parse_array(), and parse_keyval().
|
static |
Definition at line 945 of file toml.c.
References COMMA, e_syntax(), eat_token(), FLINE, LBRACE, token_t::lineno, NEWLINE, parse_keyval(), RBRACE, toml_table_t::readonly, STRING, context_t::tok, and token_t::tok.
Referenced by parse_array(), and parse_keyval().
|
static |
Definition at line 1106 of file toml.c.
References create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), DOT, e_forbid(), e_outofmemory(), e_syntax(), eat_token(), EQUAL, FLINE, LBRACE, LBRACKET, token_t::len, token_t::lineno, next_token(), normalize_key(), parse_array(), parse_inline_table(), parse_keyval(), token_t::ptr, toml_table_t::readonly, STRING, STRNDUP(), context_t::tok, token_t::tok, toml_table_in(), toml_keyval_t::val, and xfree().
Referenced by parse_inline_table(), parse_keyval(), and toml_parse().
|
static |
Definition at line 2384 of file toml.c.
Referenced by toml_rtots().
|
static |
Definition at line 1312 of file toml.c.
References create_keyarray_in_table(), create_keytable_in_table(), create_table_in_array(), context_t::curtab, e_outofmemory(), e_syntax(), eat_token(), fill_tabpath(), FLINE, context_t::key, toml_table_t::key, toml_array_t::kind, LBRACKET, token_t::lineno, NEWLINE, normalize_key(), token_t::ptr, RBRACKET, context_t::stop, STRDUP(), context_t::tok, token_t::tok, toml_array_in(), context_t::top, context_t::tpath, walk_tabpath(), and xfree().
Referenced by toml_parse().
|
static |
Definition at line 1610 of file toml.c.
References scan_digits().
Referenced by scan_string(), and toml_rtots().
|
static |
Definition at line 1602 of file toml.c.
Referenced by scan_date(), and scan_time().
|
static |
Definition at line 1638 of file toml.c.
References e_syntax(), scan_date(), scan_time(), set_token(), and STRING.
Referenced by next_token().
|
static |
Definition at line 1624 of file toml.c.
References scan_digits().
Referenced by scan_string(), and toml_rtots().
|
static |
Definition at line 1596 of file toml.c.
References token_t::eof, NEWLINE, set_token(), context_t::stop, and context_t::tok.
Referenced by next_token().
|
static |
Definition at line 1585 of file toml.c.
References token_t::eof, token_t::len, token_t::lineno, token_t::ptr, context_t::tok, and token_t::tok.
Referenced by next_token(), scan_string(), and set_eof().
|
static |
Definition at line 919 of file toml.c.
References token_t::eof, NEWLINE, next_token(), context_t::tok, and token_t::tok.
Referenced by parse_array().
|
static |
Definition at line 69 of file toml.c.
References MALLOC.
Referenced by parse_select(), and walk_tabpath().
|
static |
Definition at line 83 of file toml.c.
References MALLOC.
Referenced by normalize_key(), parse_array(), and parse_keyval().
| toml_array_t * toml_array_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 1956 of file toml.c.
References toml_arritem_t::arr, toml_array_t::item, and nitem().
| toml_array_t * toml_array_in | ( | const toml_table_t * | tab, |
| const char * | key ) |
Definition at line 1906 of file toml.c.
References toml_table_t::arr, toml_array_t::key, and toml_table_t::narr.
Referenced by loadopts_toml(), parse_select(), and toml_val_to_str().
| const char * toml_array_key | ( | const toml_array_t * | arr | ) |
Definition at line 1942 of file toml.c.
References toml_array_t::key.
| char toml_array_kind | ( | const toml_array_t * | arr | ) |
Definition at line 1928 of file toml.c.
References toml_array_t::kind.
| int toml_array_nelem | ( | const toml_array_t * | arr | ) |
Definition at line 1940 of file toml.c.
References toml_array_t::nitem.
Referenced by loadopts_toml(), and toml_val_to_str().
| char toml_array_type | ( | const toml_array_t * | arr | ) |
Definition at line 1930 of file toml.c.
References toml_array_t::kind, toml_array_t::nitem, and toml_array_t::type.
| toml_datum_t toml_bool_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 2272 of file toml.c.
References toml_datum_t::b, toml_datum_t::ok, toml_raw_at(), toml_rtob(), and toml_datum_t::u.
| toml_datum_t toml_bool_in | ( | const toml_table_t * | arr, |
| const char * | key ) |
Definition at line 2333 of file toml.c.
References toml_datum_t::b, toml_datum_t::ok, toml_raw_in(), toml_rtob(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| toml_datum_t toml_double_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 2286 of file toml.c.
References toml_datum_t::d, toml_datum_t::ok, toml_raw_at(), toml_rtod(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| toml_datum_t toml_double_in | ( | const toml_table_t * | arr, |
| const char * | key ) |
Definition at line 2347 of file toml.c.
References toml_datum_t::d, toml_datum_t::ok, toml_raw_in(), toml_rtod(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| void toml_free | ( | toml_table_t * | tab | ) |
Definition at line 1583 of file toml.c.
References xfree_tab().
Referenced by loadopts_toml(), and toml_parse().
| toml_datum_t toml_int_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 2279 of file toml.c.
References toml_datum_t::i, toml_datum_t::ok, toml_raw_at(), toml_rtoi(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| toml_datum_t toml_int_in | ( | const toml_table_t * | arr, |
| const char * | key ) |
Definition at line 2340 of file toml.c.
References toml_datum_t::i, toml_datum_t::ok, toml_raw_in(), toml_rtoi(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| int toml_key_exists | ( | const toml_table_t * | tab, |
| const char * | key ) |
Definition at line 1880 of file toml.c.
References toml_table_t::arr, toml_array_t::key, toml_keyval_t::key, toml_table_t::key, toml_table_t::kval, toml_table_t::narr, toml_table_t::nkval, toml_table_t::ntab, and toml_table_t::tab.
Referenced by loadopts_toml().
| const char * toml_key_in | ( | const toml_table_t * | tab, |
| int | keyidx ) |
Definition at line 1865 of file toml.c.
References toml_table_t::arr, toml_array_t::key, toml_keyval_t::key, toml_table_t::key, toml_table_t::kval, toml_table_t::narr, toml_table_t::nkval, and toml_table_t::tab.
Referenced by check_unknown_keys().
| toml_table_t * toml_parse | ( | char * | conf, |
| char * | errbuf, | ||
| int | errbufsz ) |
Definition at line 1402 of file toml.c.
References CALLOC(), context_t::curtab, e_outofmemory(), e_syntax(), eat_token(), token_t::eof, context_t::errbuf, context_t::errbufsz, FLINE, context_t::key, LBRACKET, token_t::len, token_t::lineno, NEWLINE, next_token(), parse_keyval(), parse_select(), token_t::ptr, context_t::root, context_t::start, context_t::stop, STRING, context_t::tok, token_t::tok, toml_free(), context_t::top, context_t::tpath, and xfree().
Referenced by toml_parse_file().
| toml_table_t * toml_parse_file | ( | FILE * | fp, |
| char * | errbuf, | ||
| int | errbufsz ) |
Definition at line 1480 of file toml.c.
References expand(), toml_parse(), and xfree().
Referenced by loadopts_toml().
| toml_raw_t toml_raw_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 1924 of file toml.c.
References toml_array_t::item, nitem(), and toml_arritem_t::val.
Referenced by toml_bool_at(), toml_double_at(), toml_int_at(), toml_string_at(), and toml_timestamp_at().
| toml_raw_t toml_raw_in | ( | const toml_table_t * | tab, |
| const char * | key ) |
Definition at line 1897 of file toml.c.
References toml_keyval_t::key, toml_table_t::kval, toml_table_t::nkval, and toml_keyval_t::val.
Referenced by toml_bool_in(), toml_double_in(), toml_int_in(), toml_string_in(), and toml_timestamp_in().
| int toml_rtob | ( | toml_raw_t | src, |
| int * | ret_ ) |
Definition at line 2055 of file toml.c.
Referenced by toml_bool_at(), toml_bool_in(), and valtype().
| int toml_rtod | ( | toml_raw_t | src, |
| double * | ret_ ) |
Definition at line 2205 of file toml.c.
References toml_rtod_ex().
Referenced by toml_double_at(), toml_double_in(), and valtype().
| int toml_rtod_ex | ( | toml_raw_t | src, |
| double * | ret_, | ||
| char * | buf, | ||
| int | buflen ) |
Definition at line 2146 of file toml.c.
References dot().
Referenced by toml_rtod().
| int toml_rtoi | ( | toml_raw_t | src, |
| int64_t * | ret_ ) |
Definition at line 2073 of file toml.c.
Referenced by toml_int_at(), toml_int_in(), and valtype().
| int toml_rtos | ( | toml_raw_t | src, |
| char ** | ret ) |
Definition at line 2210 of file toml.c.
References norm_basic_str(), and norm_lit_str().
Referenced by toml_string_at(), and toml_string_in().
| int toml_rtots | ( | toml_raw_t | src_, |
| toml_timestamp_t * | ret ) |
Definition at line 1966 of file toml.c.
References toml_timestamp_t::__buffer, toml_timestamp_t::day, toml_timestamp_t::hour, toml_timestamp_t::millisec, toml_timestamp_t::minute, toml_timestamp_t::month, parse_millisec(), scan_date(), scan_time(), toml_timestamp_t::second, toml_timestamp_t::year, and toml_timestamp_t::z.
Referenced by toml_timestamp_at(), toml_timestamp_in(), and valtype().
| void toml_set_memutil | ( | void *(* | xxmalloc )(size_t), |
| void(* | xxfree )(void *) ) |
| toml_datum_t toml_string_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 2265 of file toml.c.
References toml_datum_t::ok, toml_datum_t::s, toml_raw_at(), toml_rtos(), and toml_datum_t::u.
Referenced by loadopts_toml(), and toml_val_to_str().
| toml_datum_t toml_string_in | ( | const toml_table_t * | arr, |
| const char * | key ) |
Definition at line 2323 of file toml.c.
References toml_datum_t::ok, toml_datum_t::s, toml_raw_in(), toml_rtos(), and toml_datum_t::u.
Referenced by toml_val_to_str().
| toml_table_t * toml_table_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 1960 of file toml.c.
References toml_array_t::item, nitem(), and toml_arritem_t::tab.
| toml_table_t * toml_table_in | ( | const toml_table_t * | tab, |
| const char * | key ) |
Definition at line 1915 of file toml.c.
References toml_table_t::key, toml_table_t::ntab, and toml_table_t::tab.
Referenced by check_unknown_keys(), navigate_table(), and parse_keyval().
| const char * toml_table_key | ( | const toml_table_t * | tab | ) |
Definition at line 1952 of file toml.c.
References toml_table_t::key.
| int toml_table_narr | ( | const toml_table_t * | tab | ) |
Definition at line 1948 of file toml.c.
References toml_table_t::narr.
Referenced by check_unknown_keys().
| int toml_table_nkval | ( | const toml_table_t * | tab | ) |
Definition at line 1946 of file toml.c.
References toml_table_t::nkval.
Referenced by check_unknown_keys().
| int toml_table_ntab | ( | const toml_table_t * | tab | ) |
Definition at line 1950 of file toml.c.
References toml_table_t::ntab.
Referenced by check_unknown_keys().
| toml_datum_t toml_timestamp_at | ( | const toml_array_t * | arr, |
| int | idx ) |
Definition at line 2293 of file toml.c.
References toml_timestamp_t::__buffer, toml_timestamp_t::day, toml_timestamp_t::hour, MALLOC, toml_timestamp_t::millisec, toml_timestamp_t::minute, toml_timestamp_t::month, toml_datum_t::ok, toml_timestamp_t::second, toml_raw_at(), toml_rtots(), toml_datum_t::ts, toml_datum_t::u, toml_timestamp_t::year, and toml_timestamp_t::z.
| toml_datum_t toml_timestamp_in | ( | const toml_table_t * | arr, |
| const char * | key ) |
Definition at line 2354 of file toml.c.
References toml_timestamp_t::__buffer, toml_timestamp_t::day, toml_timestamp_t::hour, MALLOC, toml_timestamp_t::millisec, toml_timestamp_t::minute, toml_timestamp_t::month, toml_datum_t::ok, toml_timestamp_t::second, toml_raw_in(), toml_rtots(), toml_datum_t::ts, toml_datum_t::u, toml_timestamp_t::year, and toml_timestamp_t::z.
| int toml_ucs_to_utf8 | ( | int64_t | code, |
| char | buf[6] ) |
Convert a UCS char to utf8 code, and return it in buf. Return #bytes used in buf to encode the char, or -1 on error.
Definition at line 198 of file toml.c.
Referenced by norm_basic_str().
| int toml_utf8_to_ucs | ( | const char * | orig, |
| int | len, | ||
| int64_t * | ret ) |
|
static |
Definition at line 985 of file toml.c.
References toml_timestamp_t::hour, toml_rtob(), toml_rtod(), toml_rtoi(), toml_rtots(), and toml_timestamp_t::year.
Referenced by parse_array().
|
static |
Definition at line 1250 of file toml.c.
References CALLOC(), check_key(), context_t::curtab, e_internal(), e_keyexists(), e_outofmemory(), expand_ptrarr(), FLINE, toml_table_t::implicit, toml_array_t::item, context_t::key, toml_array_t::kind, token_t::lineno, toml_array_t::nitem, toml_table_t::ntab, context_t::root, STRDUP(), toml_arritem_t::tab, toml_table_t::tab, context_t::tok, context_t::top, and context_t::tpath.
Referenced by parse_select().
|
inlinestatic |
Definition at line 325 of file toml.c.
References FREE.
Referenced by create_keyarray_in_table(), create_keytable_in_table(), create_keyval_in_table(), fill_tabpath(), norm_basic_str(), norm_lit_str(), normalize_key(), parse_keyval(), parse_select(), toml_parse(), toml_parse_file(), xfree_arr(), xfree_kval(), and xfree_tab().
|
static |
Definition at line 1541 of file toml.c.
References toml_arritem_t::arr, toml_array_t::item, toml_array_t::key, toml_array_t::nitem, toml_arritem_t::tab, toml_arritem_t::val, xfree(), xfree_arr(), and xfree_tab().
Referenced by xfree_arr(), and xfree_tab().
|
static |
Definition at line 1531 of file toml.c.
References toml_keyval_t::key, toml_keyval_t::val, and xfree().
Referenced by xfree_tab().
|
static |
Definition at line 1560 of file toml.c.
References toml_table_t::arr, toml_table_t::key, toml_table_t::kval, toml_table_t::narr, toml_table_t::nkval, toml_table_t::ntab, toml_table_t::tab, xfree(), xfree_arr(), xfree_kval(), and xfree_tab().
Referenced by toml_free(), xfree_arr(), and xfree_tab().
|
static |
Definition at line 39 of file toml.c.
Referenced by toml_set_memutil().
|
static |
Definition at line 38 of file toml.c.
Referenced by toml_set_memutil().