Pretty printing of getdns dicts and lists

Functions

int getdns_pretty_snprint_dict (char *str, size_t size, const getdns_dict *dict)
 
char * getdns_pretty_print_list (const getdns_list *some_list)
 
int getdns_pretty_snprint_list (char *str, size_t size, const getdns_list *list)
 
char * getdns_print_json_dict (const getdns_dict *some_dict, int pretty)
 
int getdns_snprint_json_dict (char *str, size_t size, const getdns_dict *dict, int pretty)
 
char * getdns_print_json_list (const getdns_list *some_list, int pretty)
 
int getdns_snprint_json_list (char *str, size_t size, const getdns_list *list, int pretty)
 

Detailed Description

Function Documentation

int getdns_pretty_snprint_dict ( char *  str,
size_t  size,
const getdns_dict dict 
)

Pretty print the getdns_dict in a given buffer snprintf style.

Parameters
strpointer to the buffer to print to
sizesize of the given buffer. No more than size bytes (including the terminating null byte) will be written to str.
dictgetdns_dict to print
Returns
The number of characters written excluding the terminating null byte or the number of characters which would have been written if enough space had been available.
char* getdns_pretty_print_list ( const getdns_list some_list)

creates a string that describes the list in a human readable form.

Parameters
some_listlist to pretty print
Returns
character array (caller must free this) containing pretty string
int getdns_pretty_snprint_list ( char *  str,
size_t  size,
const getdns_list list 
)

Pretty print the getdns_list in a given buffer snprintf style.

Parameters
strpointer to the buffer to print to
sizesize of the given buffer. No more than size bytes (including the terminating null byte) will be written to str.
listgetdns_list to print
Returns
The number of characters written excluding the terminating null byte or the number of characters which would have been written if enough space had been available.
char* getdns_print_json_dict ( const getdns_dict some_dict,
int  pretty 
)

creates a string containing a json representation of some_dict. bindatas are converted to strings when possible, including bindatas for addresses, dnames and other printable data. All other bindatas are converted to lists of byte values.

Parameters
some_dictdict to represent as json data
prettywhen non-zero returns formatted json
Returns
character array (caller must free this) containing pretty string
int getdns_snprint_json_dict ( char *  str,
size_t  size,
const getdns_dict dict,
int  pretty 
)

Prints a json representation of dict in a given buffer snprintf style. bindatas are converted to strings when possible, including bindatas for addresses, dnames and other printable data. All other bindatas are converted to lists of byte values.

Parameters
strpointer to the buffer to print to
sizesize of the given buffer. No more than size bytes (including the terminating null byte) will be written to str.
dictdict to represent as json data
prettywhen non-zero returns formatted json
Returns
The number of characters written excluding the terminating null byte or the number of characters which would have been written if enough space had been available.
char* getdns_print_json_list ( const getdns_list some_list,
int  pretty 
)

creates a string containing a json representation of some_list. bindatas are converted to strings when possible, including bindatas for addresses, dnames and other printable data. All other bindatas are converted to lists of byte values.

Parameters
some_listlist to represent as json data
prettywhen non-zero returns formatted json
Returns
character array (caller must free this) containing pretty string
int getdns_snprint_json_list ( char *  str,
size_t  size,
const getdns_list list,
int  pretty 
)

Prints a json representation of list in a given buffer snprintf style. bindatas are converted to strings when possible, including bindatas for addresses, dnames and other printable data. All other bindatas are converted to lists of byte values.

Parameters
strpointer to the buffer to print to
sizesize of the given buffer. No more than size bytes (including the terminating null byte) will be written to str.
listlist to represent as json data
prettywhen non-zero returns formatted json
Returns
The number of characters written excluding the terminating null byte or the number of characters which would have been written if enough space had been available.