GVM User Suite
User tools for the GVM open source project.
Data Structures | Macros | Typedefs | Functions
toml.h File Reference
#include <stdint.h>
#include <stdio.h>
Include dependency graph for toml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  toml_timestamp_t
 
struct  toml_datum_t
 

Macros

#define TOML_EXTERN   extern
 

Typedefs

typedef struct toml_timestamp_t toml_timestamp_t
 
typedef struct toml_table_t toml_table_t
 
typedef struct toml_array_t toml_array_t
 
typedef struct toml_datum_t toml_datum_t
 
typedef const char * toml_raw_t
 

Functions

TOML_EXTERN toml_table_ttoml_parse_file (FILE *fp, char *errbuf, int errbufsz)
 
TOML_EXTERN toml_table_ttoml_parse (char *conf, char *errbuf, int errbufsz)
 
TOML_EXTERN void toml_free (toml_table_t *tab)
 
TOML_EXTERN int toml_array_nelem (const toml_array_t *arr)
 
TOML_EXTERN toml_datum_t toml_string_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_datum_t toml_bool_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_datum_t toml_int_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_datum_t toml_double_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_datum_t toml_timestamp_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_array_ttoml_array_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN toml_table_ttoml_table_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN const char * toml_key_in (const toml_table_t *tab, int keyidx)
 
TOML_EXTERN int toml_key_exists (const toml_table_t *tab, const char *key)
 
TOML_EXTERN toml_datum_t toml_string_in (const toml_table_t *arr, const char *key)
 
TOML_EXTERN toml_datum_t toml_bool_in (const toml_table_t *arr, const char *key)
 
TOML_EXTERN toml_datum_t toml_int_in (const toml_table_t *arr, const char *key)
 
TOML_EXTERN toml_datum_t toml_double_in (const toml_table_t *arr, const char *key)
 
TOML_EXTERN toml_datum_t toml_timestamp_in (const toml_table_t *arr, const char *key)
 
TOML_EXTERN toml_array_ttoml_array_in (const toml_table_t *tab, const char *key)
 
TOML_EXTERN toml_table_ttoml_table_in (const toml_table_t *tab, const char *key)
 
TOML_EXTERN char toml_array_kind (const toml_array_t *arr)
 
TOML_EXTERN char toml_array_type (const toml_array_t *arr)
 
TOML_EXTERN const char * toml_array_key (const toml_array_t *arr)
 
TOML_EXTERN int toml_table_nkval (const toml_table_t *tab)
 
TOML_EXTERN int toml_table_narr (const toml_table_t *tab)
 
TOML_EXTERN int toml_table_ntab (const toml_table_t *tab)
 
TOML_EXTERN const char * toml_table_key (const toml_table_t *tab)
 
TOML_EXTERN int toml_utf8_to_ucs (const char *orig, int len, int64_t *ret)
 
TOML_EXTERN int toml_ucs_to_utf8 (int64_t code, char buf[6])
 
TOML_EXTERN void toml_set_memutil (void *(*xxmalloc)(size_t), void(*xxfree)(void *))
 
TOML_EXTERN toml_raw_t toml_raw_in (const toml_table_t *tab, const char *key)
 
TOML_EXTERN toml_raw_t toml_raw_at (const toml_array_t *arr, int idx)
 
TOML_EXTERN int toml_rtos (toml_raw_t s, char **ret)
 
TOML_EXTERN int toml_rtob (toml_raw_t s, int *ret)
 
TOML_EXTERN int toml_rtoi (toml_raw_t s, int64_t *ret)
 
TOML_EXTERN int toml_rtod (toml_raw_t s, double *ret)
 
TOML_EXTERN int toml_rtod_ex (toml_raw_t s, double *ret, char *buf, int buflen)
 
TOML_EXTERN int toml_rtots (toml_raw_t s, toml_timestamp_t *ret)
 

Macro Definition Documentation

◆ TOML_EXTERN

#define TOML_EXTERN   extern

Definition at line 38 of file toml.h.

Typedef Documentation

◆ toml_array_t

typedef struct toml_array_t toml_array_t

Definition at line 1 of file toml.h.

◆ toml_datum_t

typedef struct toml_datum_t toml_datum_t

Definition at line 1 of file toml.h.

◆ toml_raw_t

typedef const char* toml_raw_t

Definition at line 165 of file toml.h.

◆ toml_table_t

typedef struct toml_table_t toml_table_t

Definition at line 1 of file toml.h.

◆ toml_timestamp_t

Definition at line 1 of file toml.h.

Function Documentation

◆ toml_array_at()

TOML_EXTERN toml_array_t* toml_array_at ( const toml_array_t arr,
int  idx 
)

Definition at line 1951 of file toml.c.

◆ toml_array_in()

TOML_EXTERN toml_array_t* toml_array_in ( const toml_table_t tab,
const char *  key 
)

Definition at line 1901 of file toml.c.

Here is the caller graph for this function:

◆ toml_array_key()

TOML_EXTERN const char* toml_array_key ( const toml_array_t arr)

Definition at line 1937 of file toml.c.

◆ toml_array_kind()

TOML_EXTERN char toml_array_kind ( const toml_array_t arr)

Definition at line 1923 of file toml.c.

◆ toml_array_nelem()

TOML_EXTERN int toml_array_nelem ( const toml_array_t arr)

Definition at line 1935 of file toml.c.

◆ toml_array_type()

TOML_EXTERN char toml_array_type ( const toml_array_t arr)

Definition at line 1925 of file toml.c.

◆ toml_bool_at()

TOML_EXTERN toml_datum_t toml_bool_at ( const toml_array_t arr,
int  idx 
)

Definition at line 2259 of file toml.c.

Here is the call graph for this function:

◆ toml_bool_in()

TOML_EXTERN toml_datum_t toml_bool_in ( const toml_table_t arr,
const char *  key 
)

Definition at line 2320 of file toml.c.

Here is the call graph for this function:

◆ toml_double_at()

TOML_EXTERN toml_datum_t toml_double_at ( const toml_array_t arr,
int  idx 
)

Definition at line 2273 of file toml.c.

Here is the call graph for this function:

◆ toml_double_in()

TOML_EXTERN toml_datum_t toml_double_in ( const toml_table_t arr,
const char *  key 
)

Definition at line 2334 of file toml.c.

Here is the call graph for this function:

◆ toml_free()

TOML_EXTERN void toml_free ( toml_table_t tab)

Definition at line 1578 of file toml.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toml_int_at()

TOML_EXTERN toml_datum_t toml_int_at ( const toml_array_t arr,
int  idx 
)

Definition at line 2266 of file toml.c.

Here is the call graph for this function:

◆ toml_int_in()

TOML_EXTERN toml_datum_t toml_int_in ( const toml_table_t arr,
const char *  key 
)

Definition at line 2327 of file toml.c.

Here is the call graph for this function:

◆ toml_key_exists()

TOML_EXTERN int toml_key_exists ( const toml_table_t tab,
const char *  key 
)

Definition at line 1875 of file toml.c.

◆ toml_key_in()

TOML_EXTERN const char* toml_key_in ( const toml_table_t tab,
int  keyidx 
)

Definition at line 1860 of file toml.c.

◆ toml_parse()

TOML_EXTERN toml_table_t* toml_parse ( char *  conf,
char *  errbuf,
int  errbufsz 
)

Definition at line 1397 of file toml.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toml_parse_file()

TOML_EXTERN toml_table_t* toml_parse_file ( FILE *  fp,
char *  errbuf,
int  errbufsz 
)

Definition at line 1475 of file toml.c.

Here is the call graph for this function:

◆ toml_raw_at()

TOML_EXTERN toml_raw_t toml_raw_at ( const toml_array_t arr,
int  idx 
)

Definition at line 1919 of file toml.c.

Here is the caller graph for this function:

◆ toml_raw_in()

TOML_EXTERN toml_raw_t toml_raw_in ( const toml_table_t tab,
const char *  key 
)

Definition at line 1892 of file toml.c.

Here is the caller graph for this function:

◆ toml_rtob()

TOML_EXTERN int toml_rtob ( toml_raw_t  s,
int *  ret 
)

Definition at line 2050 of file toml.c.

Here is the caller graph for this function:

◆ toml_rtod()

TOML_EXTERN int toml_rtod ( toml_raw_t  s,
double *  ret 
)

Definition at line 2200 of file toml.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toml_rtod_ex()

TOML_EXTERN int toml_rtod_ex ( toml_raw_t  s,
double *  ret,
char *  buf,
int  buflen 
)

Definition at line 2141 of file toml.c.

Here is the caller graph for this function:

◆ toml_rtoi()

TOML_EXTERN int toml_rtoi ( toml_raw_t  s,
int64_t *  ret 
)

Definition at line 2068 of file toml.c.

Here is the caller graph for this function:

◆ toml_rtos()

TOML_EXTERN int toml_rtos ( toml_raw_t  s,
char **  ret 
)

Definition at line 2205 of file toml.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toml_rtots()

TOML_EXTERN int toml_rtots ( toml_raw_t  s,
toml_timestamp_t ret 
)

Definition at line 1961 of file toml.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toml_set_memutil()

TOML_EXTERN void toml_set_memutil ( void *(*)(size_t)  xxmalloc,
void(*)(void *)  xxfree 
)

Definition at line 41 of file toml.c.

◆ toml_string_at()

TOML_EXTERN toml_datum_t toml_string_at ( const toml_array_t arr,
int  idx 
)

Definition at line 2252 of file toml.c.

Here is the call graph for this function:

◆ toml_string_in()

TOML_EXTERN toml_datum_t toml_string_in ( const toml_table_t arr,
const char *  key 
)

Definition at line 2310 of file toml.c.

Here is the call graph for this function:

◆ toml_table_at()

TOML_EXTERN toml_table_t* toml_table_at ( const toml_array_t arr,
int  idx 
)

Definition at line 1955 of file toml.c.

◆ toml_table_in()

TOML_EXTERN toml_table_t* toml_table_in ( const toml_table_t tab,
const char *  key 
)

Definition at line 1910 of file toml.c.

Here is the caller graph for this function:

◆ toml_table_key()

TOML_EXTERN const char* toml_table_key ( const toml_table_t tab)

Definition at line 1947 of file toml.c.

◆ toml_table_narr()

TOML_EXTERN int toml_table_narr ( const toml_table_t tab)

Definition at line 1943 of file toml.c.

◆ toml_table_nkval()

TOML_EXTERN int toml_table_nkval ( const toml_table_t tab)

Definition at line 1941 of file toml.c.

◆ toml_table_ntab()

TOML_EXTERN int toml_table_ntab ( const toml_table_t tab)

Definition at line 1945 of file toml.c.

◆ toml_timestamp_at()

TOML_EXTERN toml_datum_t toml_timestamp_at ( const toml_array_t arr,
int  idx 
)

Definition at line 2280 of file toml.c.

Here is the call graph for this function:

◆ toml_timestamp_in()

TOML_EXTERN toml_datum_t toml_timestamp_in ( const toml_table_t arr,
const char *  key 
)

Definition at line 2341 of file toml.c.

Here is the call graph for this function:

◆ toml_ucs_to_utf8()

TOML_EXTERN 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 197 of file toml.c.

Here is the caller graph for this function:

◆ toml_utf8_to_ucs()

TOML_EXTERN int toml_utf8_to_ucs ( const char *  orig,
int  len,
int64_t *  ret 
)

Convert a char in utf8 into UCS, and store it in *ret. Return #bytes consumed or -1 on failure.

Definition at line 96 of file toml.c.