42 lines
981 B
C
42 lines
981 B
C
#ifndef CLAY_CLAY_PROPERTY_H
|
|
#define CLAY_CLAY_PROPERTY_H
|
|
|
|
#include <stddef.h>
|
|
#include <assert.h>
|
|
#include <malloc.h>
|
|
|
|
|
|
typedef enum {
|
|
CLAY_PROPERTY_NOT_SET,
|
|
CLAY_PROPERTY_INT,
|
|
CLAY_PROPERTY_FLOAT,
|
|
CLAY_PROPERTY_POINTER,
|
|
} clay_property_type;
|
|
|
|
struct clay_property_value {
|
|
clay_property_type type;
|
|
union {
|
|
int int_val;
|
|
double float_val;
|
|
void *pointer_val;
|
|
};
|
|
};
|
|
|
|
typedef const struct clay_property_value *clay_property_value;
|
|
|
|
typedef struct clay_property_set_t *clay_property_set;
|
|
|
|
|
|
clay_property_set clay_propset_create(void);
|
|
clay_property_set clay_propset_clone(clay_property_set);
|
|
void clay_propset_destroy(clay_property_set propset);
|
|
|
|
clay_property_value clay_property_get_by_tag(clay_property_set propset, int tag);
|
|
|
|
void clay_property_set_by_tag(clay_property_set propset, int tag, struct clay_property_value value);
|
|
|
|
void clay_property_delete_by_tag(clay_property_set propset, int tag);
|
|
|
|
|
|
#endif //CLAY_CLAY_PROPERTY_H
|