Defines | |
| #define | D_VALUE(v) d_value_copy_oneshot(v) |
| #define | D_STRING(s) d_value_from_string_oneshot(s) |
| #define | D_INT(i) d_value_from_int_oneshot(i) |
| #define | D_UINT(i) d_value_from_uint_oneshot(i) |
| #define | D_DOUBLE(i) d_value_from_double_oneshot(i) |
| #define | D_POINTER(i) d_value_from_pointer_oneshot(i) |
| #define | D_DATA(d, t) d_value_from_data_oneshot(d, sizeof(t)) |
| #define | D_TOSTRING(v) d_value_get_string(v) |
| #define | D_TOINT(v) d_value_get_int(v) |
| #define | D_TOUINT(v) d_value_get_uint(v) |
| #define | D_TODOUBLE(v) d_value_get_double(v) |
| #define | D_TOPOINTER(v) d_value_get_pointer(v) |
| #define | D_TODATA(v) d_value_get_data(v) |
Typedefs | |
| typedef d_value | d_value |
Enumerations | |
| enum | d_value_type { D_VALUE_INVALID = 0, D_VALUE_STRING = 1, D_VALUE_DATA, D_VALUE_INT, D_VALUE_UINT, D_VALUE_DOUBLE, D_VALUE_POINTER, D_VALUE_FILE, D_VALUE_UNKOWN } |
Functions | |
| d_value * | d_value_create () |
| void | d_value_free (d_value *value) |
| d_value * | d_value_copy (const d_value *value) |
| d_value * | d_value_copy_oneshot (const d_value *value) |
| int | d_value_compare (const d_value *left, const d_value *right) |
| d_value_type | d_value_get_type (const d_value *value) |
| unsigned int | d_value_get_length (const d_value *value) |
| unsigned int | d_value_get_id (const d_value *value) |
| d_value * | d_value_from_string (const char *s) |
| d_value * | d_value_from_string_oneshot (const char *s) |
| const char * | d_value_get_string (const d_value *v) |
| d_value * | d_value_from_int (int i) |
| d_value * | d_value_from_int_oneshot (int i) |
| int | d_value_get_int (const d_value *v) |
| d_value * | d_value_from_uint (unsigned int i) |
| d_value * | d_value_from_uint_oneshot (unsigned int i) |
| unsigned int | d_value_get_uint (const d_value *v) |
| d_value * | d_value_from_double (double d) |
| d_value * | d_value_from_double_oneshot (double d) |
| double | d_value_get_double (const d_value *v) |
| d_value * | d_value_from_pointer (void *p) |
| d_value * | d_value_from_pointer_oneshot (void *p) |
| void * | d_value_get_pointer (const d_value *v) |
| d_value * | d_value_from_data (unsigned int length, const void *d) |
| d_value * | d_value_from_data_oneshot (unsigned int length, const void *d) |
| const void * | d_value_get_data (const d_value *v) |
| #define D_VALUE | ( | v | ) | d_value_copy_oneshot(v) |
copy a oneshot copy of a d_value
| #define D_STRING | ( | s | ) | d_value_from_string_oneshot(s) |
create a oneshot string d_value
| #define D_INT | ( | i | ) | d_value_from_int_oneshot(i) |
create a oneshot int d_value
| #define D_UINT | ( | i | ) | d_value_from_uint_oneshot(i) |
create a oneshot uint d_value
| #define D_DOUBLE | ( | i | ) | d_value_from_double_oneshot(i) |
create a oneshot double d_value
| #define D_POINTER | ( | i | ) | d_value_from_pointer_oneshot(i) |
create a oneshot pointer d_value
| #define D_DATA | ( | d, | |||
| t | ) | d_value_from_data_oneshot(d, sizeof(t)) |
create a oneshot data d_value
| #define D_TOSTRING | ( | v | ) | d_value_get_string(v) |
get the string part of the d_value, same as d_value_get_string
| #define D_TOINT | ( | v | ) | d_value_get_int(v) |
get the int part of the d_value, same as d_value_get_int()
| #define D_TOUINT | ( | v | ) | d_value_get_uint(v) |
get the uint part of the d_value, same as d_value_get_uint()
| #define D_TODOUBLE | ( | v | ) | d_value_get_double(v) |
get the double part of the d_value, same as d_value_get_double()
| #define D_TOPOINTER | ( | v | ) | d_value_get_pointer(v) |
get the pointer part of the d_value, same as d_value_get_pointer()
| #define D_TODATA | ( | v | ) | d_value_get_data(v) |
get the data part of the d_value, same as d_value_get_data()
A value, it has a type d_value_type and you can get its data using d_value_get_string() and others.
| enum d_value_type |
The type a value can have
| d_value* d_value_create | ( | ) |
Create a new empty (D_VALUE_INVALID) value.
| void d_value_free | ( | d_value * | value | ) |
Free a value. Notice only to free values you have yourself created using d_value_create() or d_value_from_string() or d_value_copy(). Never when you used the D_STRING or other macros (unless you never actually used the value).
| value | the value to free |
Copy a existing value. Free this value when you are done with it.
| value | to copy |
Copy an existing value and mark it as oneshot.
| value | to copy |
Compare two values, returns 0 if equal 1 or -1 if unequal
| left | the left value | |
| right | the right value |
| d_value_type d_value_get_type | ( | const d_value * | value | ) |
Get the type of a value.
| value | the value from which to get the type |
| unsigned int d_value_get_length | ( | const d_value * | value | ) |
Get the length of a value. If length is not relevant, it will be 0, if length of a string it will be strlen, otherwise it will be the length of bytes allocated for the data the value represents.
| value | the value from which to get the length |
1.5.1