libamxc
1.10.3
C Generic Data Containers
|
Modules | |
variant type ids | |
variant flags | |
variant utils | |
variant type helper functions | |
Variant type specific helper functions. | |
Data Structures | |
struct | _amxc_var |
The variant struct definition. More... | |
Macros | |
#define | amxc_var_set(type, var, data) amxc_var_set_ ## type(var, data) |
Convenience macro for setting a value in a variant. More... | |
#define | amxc_var_add(type, var, data) amxc_var_add_new_ ## type(var, data) |
Convenience macro for adding a variant to composite variant type. More... | |
#define | amxc_var_add_key(type, var, key, data) amxc_var_add_new_key_ ## type(var, key, data) |
Convenience macro for adding a variant to composite variant type. More... | |
#define | amxc_var_dyncast(type, var) amxc_var_get_ ## type(var) |
Dynamic cast a variant to a certain type. More... | |
#define | amxc_var_constcast(type, var) amxc_var_get_const_ ## type(var) |
Takes the content from a variant. More... | |
#define | amxc_var_take(type, var) amxc_var_take_ ## type(var) |
Takes the content from a variant. More... | |
#define | amxc_var_push(type, var, val) amxc_var_push_ ## type(var, val) |
Pushes a value into the variant. More... | |
#define | amxc_var_for_each(var, var_list) |
When the variant is a htable or list variant, iterates over the variants in the htable or list. More... | |
#define | amxc_var_for_each_reverse(var, var_list) |
When the variant is a htable or list variant, iterates over the variants in reverse order. More... | |
Typedefs | |
typedef struct _amxc_var | amxc_var_t |
The variant struct definition. More... | |
Functions | |
int | amxc_var_new (amxc_var_t **var) |
Allocates a variant and initializes it to the null variant type. More... | |
void | amxc_var_delete (amxc_var_t **var) |
Frees the previously allocated variant. More... | |
int | amxc_var_init (amxc_var_t *const var) |
Initializes a variant. More... | |
void | amxc_var_clean (amxc_var_t *const var) |
Clean-up and reset variant. More... | |
int | amxc_var_set_type (amxc_var_t *const var, const uint32_t type) |
Change the variant data type. More... | |
int | amxc_var_copy (amxc_var_t *const dest, const amxc_var_t *const src) |
Copy the type and data from one variant (source) in another variant (destination). More... | |
int | amxc_var_move (amxc_var_t *const dest, amxc_var_t *const src) |
Moves the type and data from one variant (source) in another variant (destination). More... | |
int | amxc_var_convert (amxc_var_t *const dest, const amxc_var_t *src, const uint32_t type_id) |
Converts one variant (source) to another variant(destination) using the specified variant type id. More... | |
int | amxc_var_cast (amxc_var_t *const var, const uint32_t type_id) |
Casts the variant to another variant type id. More... | |
int | amxc_var_compare (const amxc_var_t *const var1, const amxc_var_t *const var2, int *const result) |
Compares two variants. More... | |
AMXC_INLINE void | amxc_var_take_it (amxc_var_t *const var) |
Removes the variant for a llist and/or a htable. More... | |
amxc_var_t * | amxc_var_get_key (const amxc_var_t *const var, const char *const key, const int flags) |
Get a reference to a part of composed variant using a key. More... | |
int | amxc_var_set_key (amxc_var_t *const var, const char *const key, amxc_var_t *data, const int flags) |
Sets a part of composed variant using a key. More... | |
AMXC_INLINE amxc_var_t * | amxc_var_take_key (amxc_var_t *const var, const char *const key) |
Get a reference to a part of composed variant using a key and removes it from the composed variant. More... | |
amxc_var_t * | amxc_var_get_index (const amxc_var_t *const var, const int64_t index, const int flags) |
Get a reference to a part of composed variant using an index. More... | |
int | amxc_var_set_index (amxc_var_t *const var, const int64_t index, amxc_var_t *data, const int flags) |
Set a part of composed variant using an index. More... | |
AMXC_INLINE amxc_var_t * | amxc_var_take_index (amxc_var_t *const var, const int64_t index) |
Get a reference to a part of composed variant using an index and removes it from the composed variant. More... | |
amxc_var_t * | amxc_var_add_new_key (amxc_var_t *const var, const char *key) |
Adds a new variant with a key to a composite variant. More... | |
amxc_var_t * | amxc_var_add_new (amxc_var_t *const var) |
Adds a new variant to a composite variant. More... | |
amxc_var_t * | amxc_var_get_path (const amxc_var_t *const var, const char *const path, const int flags) |
Retrieves the variant at the given path of a composite variant. More... | |
amxc_var_t * | amxc_var_get_pathf (const amxc_var_t *const var, const int flags, const char *const fmt,...) __attribute__((format(printf |
Retrieves the variant at the given path of a composite variant. More... | |
amxc_var_t int | amxc_var_set_path (amxc_var_t *const var, const char *const path, amxc_var_t *data, const int flags) |
Sets the variant at the given path of a composite variant. More... | |
int | amxc_var_set_pathf (amxc_var_t *const var, amxc_var_t *data, const int flags, const char *const fmt,...) __attribute__((format(printf |
Sets the variant at the given path of a composite variant. More... | |
int amxc_var_t * | amxc_var_get_first (const amxc_var_t *const var) |
Gets the first variant in a htable or list variant. More... | |
amxc_var_t * | amxc_var_get_last (const amxc_var_t *const var) |
Gets the last variant in a htable or list variant. More... | |
amxc_var_t * | amxc_var_get_next (const amxc_var_t *const var) |
Gets the next variant. More... | |
amxc_var_t * | amxc_var_get_previous (const amxc_var_t *const var) |
Gets the previous variant. More... | |
amxc_var_t * | amxc_var_get_parent (const amxc_var_t *const var) |
Gets the containing variant. More... | |
const char * | amxc_var_key (const amxc_var_t *const var) |
Gets the key, with which the variant is stored in a htable variant. More... | |
uint32_t | amxc_var_type_of (const amxc_var_t *const var) |
Gets the variant type id of a variant. More... | |
const char * | amxc_var_type_name_of (const amxc_var_t *const var) |
Gets the variant type name of a variant. More... | |
AMXC_INLINE bool | amxc_var_is_null (const amxc_var_t *const var) |
Checks if the given variant is of the "null" type. More... | |
A variant is a generic data container and can contain primitive types or composite types.
Convenience macro for adding a variant to composite variant type.
Macro expands to amxc_var_add_new_<TYPE>>(var, data)
Definition at line 618 of file amxc_variant.h.
Convenience macro for adding a variant to composite variant type.
Macro expands to amxc_var_add_new_key_<TYPE>>(var, key, data)
Definition at line 627 of file amxc_variant.h.
Takes the content from a variant.
If the given variant is not of the type specified, it will return a default value, NULL for pointers, 0 for integers or double, false for boolean. Only works on variants containing pointer types.
The type of the variant can be queried using amxc_var_type_of
Custom variant type implementations may implement a amxc_var_get_const_<CUSTOM_TYPE> function, see the documentation of the custom types for more information.
Definition at line 722 of file amxc_variant.h.
Dynamic cast a variant to a certain type.
Conversion is applied and a copy is given. If a pointer is returned, the allocated memory must be freed. If a value is returned, there is no memory allocation.
When the requested type is not the same type as the type of the variant the value in the variant is converted to the requested type. If the conversion is not possible or fails, a default value is returned.
It is possible that memory is allocated to be able to store the requested type, this is only the case when a pointer is returned. For primitive types like uint32_t, bool, double, ... no memory is allocated, the value is returned.
When a pointer is returned it must be freed.
Custom variant type implementations may implement a amxc_var_get_<CUSTOM_TYPE> function, see the documentation of the custom types for more information.
Definition at line 678 of file amxc_variant.h.
#define amxc_var_for_each | ( | var, | |
var_list | |||
) |
When the variant is a htable or list variant, iterates over the variants in the htable or list.
When the variant is not of a htable or list type, this macro will do nothing
It is save to delete the current variant in the loop.
Definition at line 819 of file amxc_variant.h.
#define amxc_var_for_each_reverse | ( | var, | |
var_list | |||
) |
When the variant is a htable or list variant, iterates over the variants in reverse order.
When the variant is not of a htable or list type, this macro will do nothing
It is save to delete the current variant in the loop.
Definition at line 843 of file amxc_variant.h.
Pushes a value into the variant.
Only works on variants containing pointer types.
No conversions are applied, no copies are done. The ownership of the pointer is transferred to the variant.
Custom variant type implementations may implement a amxc_var_push_<CUSTOM_TYPE> function, see the documentation of the custom types for more information.
Definition at line 780 of file amxc_variant.h.
Convenience macro for setting a value in a variant.
Macro expands to amxc_var_set_<TYPE>>(var, data)
Definition at line 609 of file amxc_variant.h.
Takes the content from a variant.
If the given variant is not of the type specified, it will return NULL. Only works on variants containing pointer types.
No conversions are applied, no copies are done. The pointer returned is the pointer in the variant. The variant is reset to the "null" variant.
Ownership of the pointer is transferred to the caller. When not needed anymore the memory must be freed.
Custom variant type implementations may implement a amxc_var_take_<CUSTOM_TYPE> function, see the documentation of the custom types for more information.
Definition at line 757 of file amxc_variant.h.
typedef struct _amxc_var amxc_var_t |
The variant struct definition.
A variant is a tagged union, which can be added to a linked list or to a hash table as value.
Which field of the union is valid is depending of the type id field in the struct.
amxc_var_t* amxc_var_add_new | ( | amxc_var_t *const | var | ) |
Adds a new variant to a composite variant.
The type of the given variant must be of a composite type and must at least support the get_index and set_index functions. A new variant object is added to the composite variant. The new variant is of the null-type.
var | pointer to a variant struct |
Definition at line 551 of file amxc_variant.c.
amxc_var_t* amxc_var_add_new_key | ( | amxc_var_t *const | var, |
const char * | key | ||
) |
Adds a new variant with a key to a composite variant.
The type of the given variant must be of a composite type and must at least support the get_key and set_key functions. A new variant object is added to the composite variant. The new variant is of the null-type.
var | pointer to a variant struct to which a new variant will be added. |
key | the new key that needs to be added |
Definition at line 526 of file amxc_variant.c.
int amxc_var_cast | ( | amxc_var_t *const | var, |
const uint32_t | type_id | ||
) |
Casts the variant to another variant type id.
The content of the variant is converted to the requested type. If AMXC_VAR_ID_ANY is given, automatic conversion is applied. Not all types support automatic type conversion.
If no type is found with the given type id, the conversion fails. If no conversion methods are available the conversion fails.
If type conversion fails or is not supported the variant is unchanged
var | pointer to a variant struct |
type_id | the variant type id to which the variant must be converted |
Definition at line 372 of file amxc_variant.c.
void amxc_var_clean | ( | amxc_var_t *const | var | ) |
Clean-up and reset variant.
If memory was allocated to contain the data for the variant, it will be freed. The variant is reset to the null variant.
var | pointer to a variant structure. |
Definition at line 237 of file amxc_variant.c.
int amxc_var_compare | ( | const amxc_var_t *const | var1, |
const amxc_var_t *const | var2, | ||
int *const | result | ||
) |
Compares two variants.
Tries to compare the data of two variants. If it is not possible to compare the two variants, the function fails and returns a non 0 value.
The comparison result is put in result:
var1 | pointer to variant structure, the left value |
var2 | pointer to variant structure, the right value |
result | pointer to integer, will contain comparison result |
Definition at line 397 of file amxc_variant.c.
int amxc_var_convert | ( | amxc_var_t *const | dest, |
const amxc_var_t * | src, | ||
const uint32_t | type_id | ||
) |
Converts one variant (source) to another variant(destination) using the specified variant type id.
If no type is found with the given type id, the conversion fails. If no conversion methods are available the conversion fails.
If the source variant type has a convert to method, this is called first. If that function fails to convert, the convert from method of the destination variant type is called.
If conversion fails or is not supported the destination variant is reset to the null variant.
dest | pointer to a variant struct, the destination |
src | pointer to a variant struct, the source |
type_id | the variant type id to which the source data needs to be converted to |
Definition at line 333 of file amxc_variant.c.
int amxc_var_copy | ( | amxc_var_t *const | dest, |
const amxc_var_t *const | src | ||
) |
Copy the type and data from one variant (source) in another variant (destination).
The destination variant is first set to the same type as the source variant using amxc_var_set_type and then the data is copied.
The content of both variants after a copy is identical. If the copy fails, the destination variant is a null variant.
The list and htable iterators are not copied.
dest | pointer to variant struct, the destination |
src | pointer to variant struct, the source |
Definition at line 285 of file amxc_variant.c.
void amxc_var_delete | ( | amxc_var_t ** | var | ) |
Frees the previously allocated variant.
Frees the allocated memory and sets the pointer to NULL.
var | a pointer to the location where the pointer to the variant is stored |
Definition at line 207 of file amxc_variant.c.
int amxc_var_t* amxc_var_get_first | ( | const amxc_var_t *const | var | ) |
Gets the first variant in a htable or list variant.
Returns the first variant contained in composite htable or list variant.
If the provided variant pointer is not of a htable or list type, this function will return NULL.
If the provided htable or list variant is empty a NULL pointer is returned.
var | pointer to a variant struct |
Definition at line 712 of file amxc_variant.c.
amxc_var_t* amxc_var_get_index | ( | const amxc_var_t *const | var, |
const int64_t | index, | ||
const int | flags | ||
) |
Get a reference to a part of composed variant using an index.
If the data contained in the variant is composed of different parts and some or all parts can be identified with an index, a reference to such part can be retrieved with this function.
var | pointer to variant structure, containing the composed data |
index | the index |
flags | can be one of AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY |
Definition at line 489 of file amxc_variant.c.
amxc_var_t* amxc_var_get_key | ( | const amxc_var_t *const | var, |
const char *const | key, | ||
const int | flags | ||
) |
Get a reference to a part of composed variant using a key.
If the data contained in the variant is composed of different parts and some or all parts can be identified with a key, a reference to such part can be retrieved with this function.
var | pointer to variant structure, containing the composed data |
key | string containing the key |
flags | can be one of AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY |
Definition at line 449 of file amxc_variant.c.
amxc_var_t* amxc_var_get_last | ( | const amxc_var_t *const | var | ) |
Gets the last variant in a htable or list variant.
Returns the last variant contained in composite htable or list variant.
If the provided variant pointer is not of a htable or list type, this function will return NULL.
If the provided htable or list variant is empty a NULL pointer is returned.
var | pointer to a variant struct |
Definition at line 738 of file amxc_variant.c.
amxc_var_t* amxc_var_get_next | ( | const amxc_var_t *const | var | ) |
Gets the next variant.
If the variant is contained in a htable or list variant fetches the pointer to the next variant.
If the provided variant pointer is not in a htable or list variant, this function will return NULL.
If the provided variant is the last in the htable or list a NULL pointer is returned.
If the provided variant is in a list and in a htable, the next variant in the htable will be returned.
var | pointer to a variant struct |
Definition at line 764 of file amxc_variant.c.
amxc_var_t* amxc_var_get_parent | ( | const amxc_var_t *const | var | ) |
Gets the containing variant.
If the variant is contained in a htable or list variant fetches the pointer to the container variant.
If the provided variant pointer is not in a htable or list variant, this function will return NULL.
If the provided variant is contained in a htable and in a list variant, the pointer to the containing htable variant is returned.
var | pointer to a variant struct |
Definition at line 802 of file amxc_variant.c.
amxc_var_t* amxc_var_get_path | ( | const amxc_var_t *const | var, |
const char *const | path, | ||
const int | flags | ||
) |
Retrieves the variant at the given path of a composite variant.
The type of the given variant is a composite type and some of the parts are composite variants as well, this function makes it easy to retrieve a variant deep down in the composite variant structure. The path consists of a sequence of keys and/or indexes separated by a '.'. If the path exists, the pointer to the variant at that position is returned.
When a key contains a '.' the key should be put between quotes (single or double)
var | pointer to a variant struct, the variant type should be a composite type |
path | path to a variant in the composite variant structure, a path is a sequence of indexes and/or keys separated by a '.' |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_NO_INDEX |
Definition at line 573 of file amxc_variant.c.
amxc_var_t* amxc_var_get_pathf | ( | const amxc_var_t *const | var, |
const int | flags, | ||
const char *const | fmt, | ||
... | |||
) |
Retrieves the variant at the given path of a composite variant.
The type of the given variant is a composite type and some of the parts are composite variants as well, this function makes it easy to retrieve a variant deep down in the composite variant structure. The path consists of a sequence of keys and/or indexes separated by a '.'. If the path exists, the pointer to the variant at that position is returned.
When a key contains a '.' the key should be put between quotes (single or double)
var | pointer to a variant struct, the variant type should be a composite type |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_UPDATE |
fmt | path to a variant in the composite variant structure, a path is a sequence of indexes and/or keys seperated by a '.'. Does support printf format. |
amxc_var_t* amxc_var_get_previous | ( | const amxc_var_t *const | var | ) |
Gets the previous variant.
If the variant is contained in a htable or list variant fetches the pointer to the previous variant.
If the provided variant pointer is not in a htable or list variant, this function will return NULL.
If the provided variant is the first in the htable or list a NULL pointer is returned.
If the provided variant is in a list and in a htable, the previous variant in the htable will be returned.
var | pointer to a variant struct |
Definition at line 783 of file amxc_variant.c.
int amxc_var_init | ( | amxc_var_t *const | var | ) |
Initializes a variant.
Call this to initialize variants structures (amxc_var_t) allocated on the stack.
When the variant is not needed anymore call amxc_var_clean to make sure that all allocated memory to store the data is freed. Failing to do so could lead to a memory leak.
The variant will be initialized as a null variant. To change the variant type use amxc_var_set_type.
Do not re-initialize an already initialized or used variant. The data contained in the variant is lost, no memory is freed if needed. To reset the variant back to a null variant use amxc_var_clean.
var | pointer to a variant structure. |
Definition at line 223 of file amxc_variant.c.
AMXC_INLINE bool amxc_var_is_null | ( | const amxc_var_t *const | var | ) |
Checks if the given variant is of the "null" type.
var | pointer to a variant struct |
Definition at line 1594 of file amxc_variant.h.
const char* amxc_var_key | ( | const amxc_var_t *const | var | ) |
Gets the key, with which the variant is stored in a htable variant.
If the variant is contained in a htable variant fetches the key with which the variant is stored in the htable
If the provided variant pointer is not in a htable, this function will return NULL.
var | pointer to a variant struct |
Definition at line 821 of file amxc_variant.c.
int amxc_var_move | ( | amxc_var_t *const | dest, |
amxc_var_t *const | src | ||
) |
Moves the type and data from one variant (source) in another variant (destination).
The destination variant is first set to the same type as the source variant using amxc_var_set_type and then the data is moved.
After the move the destination variant is identical to the source variant and the source variant is reset to the null variant type.
The iterators (linked list and htable) of the source variant are not moved.
dest | pointer to variant struct, the destination |
src | pointer to variant struct, the source |
Definition at line 308 of file amxc_variant.c.
int amxc_var_new | ( | amxc_var_t ** | var | ) |
Allocates a variant and initializes it to the null variant type.
A variant is a container that can hold any type.
var | pointer to a pointer that points to the new allocated variant |
Definition at line 194 of file amxc_variant.c.
int amxc_var_set_index | ( | amxc_var_t *const | var, |
const int64_t | index, | ||
amxc_var_t * | data, | ||
const int | flags | ||
) |
Set a part of composed variant using an index.
If the data contained in the variant is composed of different parts and some or all parts can be identified with an index, the data of such a part can be changed with this function.
As a convention, when using as the index -1, the data is added to the end.
Example: if the variant is containing a list of variants, adding a new data variant using index -1, will add it to the end of the list.
var | pointer to variant structure, containing the composed data |
index | the index |
data | a variant containing the data the will be set |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_UPDATE |
Definition at line 507 of file amxc_variant.c.
int amxc_var_set_key | ( | amxc_var_t *const | var, |
const char *const | key, | ||
amxc_var_t * | data, | ||
const int | flags | ||
) |
Sets a part of composed variant using a key.
If the data contained in the variant is composed of different parts and some or all parts can be identified with a key, the data of such a part can be changed with this function.
The default behaviour is not to copy anything, just store the given variant. Using AMXC_VAR_FLAG_COPY this behavior can be changed into copy the variant and the variant data.
var | pointer to variant structure, containing the composed data |
key | string containing the key |
data | a variant containing the data the will be set |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_UPDATE |
Definition at line 468 of file amxc_variant.c.
amxc_var_t int amxc_var_set_path | ( | amxc_var_t *const | var, |
const char *const | path, | ||
amxc_var_t * | data, | ||
const int | flags | ||
) |
Sets the variant at the given path of a composite variant.
The type of the given variant is a composite type and some of the parts are composite variants as well, this function makes it easy to set a variant deep down in the composite variant structure. The path consists of a sequence of keys and/or indexes separated by a '.'.
If the path exists, the value of the variant at that position is changed.
If the path doesn't exist and the flag AMXC_VAR_FLAG_AUTO_ADD is set the variants on that path are added.
When a key contains a '.' the key should be put between quotes (single or double)
var | pointer to a variant struct, the variant type should be a composite type |
path | path to a variant in the composite variant structure, a path is a sequence of indexes and/or keys separated by a '.' |
data | the new value |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_NO_INDEX, AMXC_VAR_FLAG_AUTO_ADD |
Definition at line 623 of file amxc_variant.c.
int amxc_var_set_pathf | ( | amxc_var_t *const | var, |
amxc_var_t * | data, | ||
const int | flags, | ||
const char *const | fmt, | ||
... | |||
) |
Sets the variant at the given path of a composite variant.
The type of the given variant is a composite type and some of the parts are composite variants as well, this function makes it easy to set a variant deep down in the composite variant structure. The path consists of a sequence of keys and/or indexes separated by a '.'.
If the path exists, the value of the variant at that position is changed.
If the path doesn't exist and the flag AMXC_VAR_FLAG_AUTO_ADD is set the variants on that path are added.
When a key contains a '.' the key should be put between quotes (single or double)
var | pointer to a variant struct, the variant type should be a composite type |
data | the new value |
flags | bitmap, see AMXC_VAR_FLAG_DEFAULT, AMXC_VAR_FLAG_COPY, AMXC_VAR_FLAG_NO_INDEX, AMXC_VAR_FLAG_AUTO_ADD |
fmt | path to a variant in the composite variant structure, a path is a sequence of indexes and/or keys separated by a '.'. Does support printf format. |
int amxc_var_set_type | ( | amxc_var_t *const | var, |
const uint32_t | type | ||
) |
Change the variant data type.
If the variant was already containing data, this will be cleaned up. The type is changed and the data part reset to default value. (0, NULL, false, ...)
var | pointer to variant struct |
type | the variant type id |
Definition at line 261 of file amxc_variant.c.
AMXC_INLINE amxc_var_t* amxc_var_take_index | ( | amxc_var_t *const | var, |
const int64_t | index | ||
) |
Get a reference to a part of composed variant using an index and removes it from the composed variant.
If the data contained in the variant is composed of different parts and some or all parts can be identified with an index, a reference to such part can be retrieved with this function.
The variant referenced by the index is removed from the composed variant.
The returned variant must be freed using amxc_var_delete
var | pointer to variant structure, containing the composed data |
index | the index |
Definition at line 1268 of file amxc_variant.h.
AMXC_INLINE void amxc_var_take_it | ( | amxc_var_t *const | var | ) |
Removes the variant for a llist and/or a htable.
When the variant is stored in a linked list and/or a hash table, it is removed from these. The variant itself is not deleted.
var | pointer to a variant struct |
Definition at line 1107 of file amxc_variant.h.
AMXC_INLINE amxc_var_t* amxc_var_take_key | ( | amxc_var_t *const | var, |
const char *const | key | ||
) |
Get a reference to a part of composed variant using a key and removes it from the composed variant.
If the data contained in the variant is composed of different parts and some or all parts can be identified with a key, a reference to such part can be retrieved with this function.
The variant referenced by the key is removed from the composed variant.
The returned variant must be freed using amxc_var_delete
var | pointer to variant structure, containing the composed data |
key | string containing the key |
Definition at line 1189 of file amxc_variant.h.
const char* amxc_var_type_name_of | ( | const amxc_var_t *const | var | ) |
Gets the variant type name of a variant.
var | pointer to a variant struct |
Definition at line 672 of file amxc_variant.c.
uint32_t amxc_var_type_of | ( | const amxc_var_t *const | var | ) |
Gets the variant type id of a variant.
var | pointer to a variant struct |
Definition at line 668 of file amxc_variant.c.