5#if !defined(SKIP_INCLUDES)
12 #if !defined PLACEHOLDERS
22 #define OK_DELETE DC_NO_DELETE
26 #define OK_EQ DC_MEM_EQ
30 #define OK_CLONE DC_COPY_CLONE
34 #define OK_DEBUG DC_DEFAULT_DEBUG
38 #if !defined PLACEHOLDERS
47#if !defined ERROR_THROW
48 #define ERROR_THROW(_) DC_PANIC("Unexpected error in " EXPAND_STRING(SELF))
51#if !defined ERROR_DELETE
52 #define ERROR_DELETE DC_NO_DELETE
56 #define ERROR_EQ DC_MEM_EQ
59#if !defined ERROR_CLONE
60 #define ERROR_CLONE DC_COPY_CLONE
63#if !defined ERROR_DEBUG
64 #define ERROR_DEBUG DC_DEFAULT_DEBUG
101 return &self->result.ok;
106 return &self->result.ok;
112 if (!self->success) {
113 return &self->result.error;
static void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
dc_debug_fmt dc_debug_fmt_scope_end(dc_debug_fmt fmt)
dc_debug_fmt dc_debug_fmt_scope_begin(dc_debug_fmt fmt)
static void dc_debug_fmt_print(dc_debug_fmt fmt, FILE *stream, const char *format,...)
#define EXPAND_STRING(NAME)
#define TEMPLATE_ERROR(...)
With the user provided name, even in nested templates.
Debug format helpers for debug printin data structures.
static bool is_error(SELF const *self)
static SELF from_ok(OK value)
static ERROR const * get_error(SELF const *self)
static OK const * get_okay(SELF const *self)
static OK const * strict_get_const(SELF const *self)
static SELF from_error(ERROR value)
#define OK
A simple result type, using the (already) optional pointer type.
static FILE * stream(SELF *self)
Opens a file for.