Derive-C
Loading...
Searching...
No Matches
debug.h File Reference
#include <derive-c/alloc/std.h>
#include <stdio.h>
#include <derive-c/utils/string_builder/template.h>

Go to the source code of this file.

Macros

#define NAME   dc_debug_string_builder
#define DC_DEBUG_STRING(TYPE, INSTANCE)
#define DC_DEBUG_TRACE    fprintf(stdout, "[%s@%s:%d] entering function\n", __func__, __FILE__, __LINE__)

Macro Definition Documentation

◆ DC_DEBUG_STRING

#define DC_DEBUG_STRING ( TYPE,
INSTANCE )
Value:
({ \
dc_debug_string_builder builder = dc_debug_string_builder_new(stdalloc_get_ref()); \
NS(TYPE, debug)(INSTANCE, dc_debug_fmt_new(), dc_debug_string_builder_stream(&builder)); \
char* string = dc_debug_string_builder_release_string(&builder); \
dc_debug_string_builder_delete(&builder); \
string; \
})
static DC_PUBLIC void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
Definition template.h:212
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_new()
Definition fmt.h:15
static DC_PUBLIC char const * string(SELF const *self)
Gets access to the null terminated string.
Definition template.h:139

Definition at line 8 of file debug.h.

8#define DC_DEBUG_STRING(TYPE, INSTANCE) \
9 ({ \
10 dc_debug_string_builder builder = dc_debug_string_builder_new(stdalloc_get_ref()); \
11 NS(TYPE, debug)(INSTANCE, dc_debug_fmt_new(), dc_debug_string_builder_stream(&builder)); \
12 char* string = dc_debug_string_builder_release_string(&builder); \
13 dc_debug_string_builder_delete(&builder); \
14 string; \
15 })

◆ DC_DEBUG_TRACE

#define DC_DEBUG_TRACE    fprintf(stdout, "[%s@%s:%d] entering function\n", __func__, __FILE__, __LINE__)
Examples
container/arena.c, container/bitset.c, container/map.c, container/queue.c, container/set.c, container/vector.c, utils/option.c, utils/result.c, and utils/string_builder.c.

Definition at line 17 of file debug.h.

17#define DC_DEBUG_TRACE \
18 fprintf(stdout, "[%s@%s:%d] entering function\n", __func__, __FILE__, __LINE__)

◆ NAME

#define NAME   dc_debug_string_builder

Definition at line 5 of file debug.h.