Common functions for working with json-c. More...
Go to the source code of this file.
Functions | |
size_t | fr_json_from_pair (char *out, size_t outlen, VALUE_PAIR const *vp) |
Prints attribute as string, escaped suitably for use as JSON string. More... | |
int | fr_json_object_to_value_data (TALLOC_CTX *ctx, value_data_t *out, json_object *object, PW_TYPE dst_type, fr_dict_attr_t const *dst_enumv) |
Convert json object to value_data_t. More... | |
void | fr_json_version_print (void) |
Print JSON-C version. More... | |
Common functions for working with json-c.
Definition in file json.c.
size_t fr_json_from_pair | ( | char * | out, |
size_t | outlen, | ||
VALUE_PAIR const * | vp | ||
) |
Prints attribute as string, escaped suitably for use as JSON string.
Returns < 0 if the buffer may be (or have been) too small to write the encoded JSON value to.
out | Where to write the string. |
outlen | Lenth of output buffer. |
vp | to print. |
Definition at line 150 of file json.c.
int fr_json_object_to_value_data | ( | TALLOC_CTX * | ctx, |
value_data_t * | out, | ||
json_object * | object, | ||
PW_TYPE | dst_type, | ||
fr_dict_attr_t const * | dst_enumv | ||
) |
Convert json object to value_data_t.
ctx | to allocate any value buffers in (should usually be the same as out). |
out | Where to write value_data. |
object | to convert. |
dst_type | FreeRADIUS type to convert to. |
dst_enumv | Enumeration values to allow string to integer conversions. |
Definition at line 42 of file json.c.