Manipulating the Structure of an adr_data_t
Type
The primary interface for accessing the adr_data_t
structure is adr_struct_get:
adr_data_t *adr_struct_get(adr_data_t
*struct, const char *field);
adr_struct_get returns the value of the field named field. If the field is nullable and has no value or if the field hasn't been given a value (that is the structure was incompletely initialized), adr_struct_get returns NULL
. The adr_data_t
returned by adr_struct_get is valid as long as the caller retains its reference to struct
. If it is needed longer the caller should take a hold on the adr_data_t
. If struct
does not have a field named field, the behavior of adr_struct_get is undefined.
The primary interface for writing to an adr_data_t
structure is adr_struct_set:
void adr_struct_set(adr_data_t *struct, const char *field, adr_data_t *value);
adr_struct_set writes value to the field named field. If field previously had a value, the reference on that value held by the structure is released. If struct
does not have a field named field, or if the type of value does not match that of the specified field the behavior of adr_struct_set
is undefined.