89 retval = write(log->
fd, line, length);
90 }
else if(log->
stream != NULL) {
91 retval = fwrite(line, 1, length, log->
stream);
95 syslog(LOG_DAEMON | LOG_DEBUG,
108 for(
int i = 0; i < indent; i++) {
126 if(type_name != NULL) {
133 snprintf(addr, 63,
"%p:",
var->
data.data);
225 const char* prev_key = NULL;
234 if((prev_key != NULL) && (key != NULL) && (strcmp(key, prev_key) == 0)) {
355 syslog(LOG_DAEMON | LOG_DEBUG,
"NULL");
Ambiorix ring buffer API header file.
Ambiorix string API header file.
#define cstring_t
Convenience macro.
#define amxc_var_from_htable_it(ht_it)
Get the variant pointer from an amxc htable iterator.
#define amxc_var_from_llist_it(ll_it)
Get the variant pointer from an amxc linked list iterator.
static int variant_dump_ts(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int amxc_var_dump_impl(const amxc_var_t *const var, int fd, FILE *stream)
static void amxc_var_log_init(amxc_log_var_t *log, int fd, FILE *stream, size_t msg_length)
static int variant_dump_type(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int variant_dump_null(UNUSED const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int variant_dump_default(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int variant_dump_list(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int variant_dump_htable(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int amxc_var_dump_internal(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static int variant_dump_fd(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
int(* amxc_var_dump_fn_t)(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
static void write_indentation(int indent, amxc_log_var_t *log)
static int amxc_var_write(amxc_log_var_t *log, const char *line, size_t length)
struct _amxc_log_var amxc_log_var_t
static int variant_dump_char(const amxc_var_t *const var, int indent, amxc_log_var_t *log)
Ambiorix ring buffer API header file.
AMXC_INLINE void * amxc_array_it_get_data(const amxc_array_it_t *const it)
Gets the data pointer of array iterator.
AMXC_INLINE size_t amxc_array_capacity(const amxc_array_t *const array)
Gets the capacity of the array.
amxc_array_it_t * amxc_array_get_at(const amxc_array_t *const array, const unsigned int index)
Gets the item iterator for the given index.
void amxc_array_delete(amxc_array_t **array, const amxc_array_it_delete_t func)
Frees the previously allocated array.
amxc_htable_it_t * amxc_htable_it_get_next_key(const amxc_htable_it_t *const reference)
Gets the next iterator in the hash table with the same key.
amxc_array_t * amxc_htable_get_sorted_keys(const amxc_htable_t *const htable)
Creates an array containing all keys of the hash table.
amxc_htable_it_t * amxc_htable_get(const amxc_htable_t *const htable, const char *const key)
Gets a hash table iterator from the hash table.
AMXC_INLINE amxc_llist_it_t * amxc_llist_it_get_next(const amxc_llist_it_t *const reference)
Gets the next iterator in the list.
#define amxc_llist_for_each(it, list)
Loops over the list from head to tail.
const char * amxc_string_get(const amxc_string_t *const string, const size_t offset)
Gets the content of the string buffer.
AMXC_INLINE int amxc_string_append(amxc_string_t *const string, const char *const text, const size_t length)
Appends text to the end of the current content of the string buffer.
void amxc_string_reset(amxc_string_t *const string)
Resets the buffer, reset the content to all 0.
AMXC_INLINE size_t amxc_string_text_length(const amxc_string_t *const string)
Gets the current size of the used string buffer.
int amxc_string_search(const amxc_string_t *const string, const char *needle, uint32_t start_pos)
Searches a sub-string in a string.
int amxc_string_init(amxc_string_t *const string, const size_t length)
Initializes a string.
AMXC_INLINE bool amxc_string_is_empty(const amxc_string_t *const string)
Checks if the string is empty.
void amxc_string_clean(amxc_string_t *const string)
Frees the string buffer and reset length attributes.
#define AMXC_VAR_ID_CUSTOM_BASE
Base variant id for custom variants.
#define AMXC_VAR_ID_ANY
Special variant id, typically used in cast or conversion functions.
#define AMXC_VAR_ID_LIST
Ambiorix Linked List variant id.
#define AMXC_VAR_ID_HTABLE
Ambiorix Hash Table variant id.
int amxc_var_dump(const amxc_var_t *const var, int fd)
Dumps the content of the variant in a human readable manner.
int amxc_var_log(const amxc_var_t *const var)
Logs the content of the variant in a human readable manner to syslog.
int amxc_var_dump_stream(const amxc_var_t *const var, FILE *stream)
Dumps the content of the variant in a human readable manner.
uint32_t amxc_var_type_of(const amxc_var_t *const var)
Gets the variant type id of a variant.
#define amxc_var_dyncast(type, var)
Dynamic cast a variant to a certain type.
#define amxc_var_constcast(type, var)
Takes the content from a variant.
const char * amxc_var_type_name_of(const amxc_var_t *const var)
Gets the variant type name of a variant.
The hash table iterator structure.
The hash table structure.
The linked list structure.
The variant struct definition.
static amxc_htable_it_t it[2000]
static amxc_htable_t * htable