11#ifndef LOADERS_DATA_STORAGE_H
12#define LOADERS_DATA_STORAGE_H
40typedef struct gp_storage gp_storage;
41typedef struct gp_data_dict gp_data_dict;
173 const char *
id,
long i);
187 const char *
id,
const char *str);
201 const char *
id,
double d);
216 const char *
id,
long num,
long den);
gp_data_node * gp_storage_add_string(gp_storage *self, gp_data_node *node, const char *id, const char *str)
Adds a string to a storage.
const char * gp_data_type_name(enum gp_data_type type)
Returns a data type name.
static void gp_storage_print(gp_storage *self)
Prints a content of a storage into the stdout.
void gp_data_print(const gp_data_node *node)
Prints a data node into a stdout.
gp_data_node * gp_storage_add_rational(gp_storage *self, gp_data_node *node, const char *id, long num, long den)
Adds a rational number to a storage.
void gp_storage_clear(gp_storage *self)
Clears all data in storage.
struct gp_data_node gp_data_node
A data node.
gp_data_node * gp_storage_root(gp_storage *self)
Returns storage root node.
gp_storage * gp_storage_create(void)
Creates an empty data storage.
void gp_storage_destroy(gp_storage *self)
Destroys a data storage and frees all its data.
gp_data_node * gp_storage_add_dict(gp_storage *self, gp_data_node *node, const char *id)
Adds a dictionary to a storage.
@ GP_DATA_RATIONAL
A rational number.
@ GP_DATA_INT
A long integer.
@ GP_DATA_DOUBLE
A double.
@ GP_DATA_DICT
A dictionary aka hash.
@ GP_DATA_STRING
A string.
gp_data_node * gp_storage_add_double(gp_storage *self, gp_data_node *node, const char *id, double d)
Adds a double floating point to a storage.
gp_data_node * gp_storage_add_int(gp_storage *self, gp_data_node *node, const char *id, long i)
Adds a long integer to a storage.
enum gp_data_type type
A data type.
union gp_data_value value
A data value.
const char * id
A data id.