6#if !defined(SKIP_INCLUDES)
13 #if !defined DC_PLACEHOLDERS
23 #define OK_DELETE DC_NO_DELETE
27 #define OK_EQ DC_MEM_EQ
31 #define OK_CLONE DC_COPY_CLONE
35 #define OK_DEBUG DC_DEFAULT_DEBUG
39 #if !defined DC_PLACEHOLDERS
48#if !defined ERROR_THROW
49 #define ERROR_THROW(_) DC_PANIC("Unexpected error in " DC_EXPAND_STRING(SELF))
52#if !defined ERROR_DELETE
53 #define ERROR_DELETE DC_NO_DELETE
57 #define ERROR_EQ DC_MEM_EQ
60#if !defined ERROR_CLONE
61 #define ERROR_CLONE DC_COPY_CLONE
64#if !defined ERROR_DEBUG
65 #define ERROR_DEBUG DC_DEFAULT_DEBUG
103 return &self->result.ok;
108 return &self->result.ok;
114 if (!self->success) {
115 return &self->result.error;
static DC_PUBLIC void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
#define TEMPLATE_ERROR(...)
With the user provided name, even in nested templates.
static DC_PUBLIC void dc_debug_fmt_print(dc_debug_fmt fmt, FILE *stream, const char *format,...)
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_scope_end(dc_debug_fmt fmt)
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_scope_begin(dc_debug_fmt fmt)
#define DC_EXPAND_STRING(NAME)
#define DC_UNREACHABLE(...)
Debug format helpers for debug printin data structures.
static DC_PUBLIC OK const * strict_get_const(SELF const *self)
static DC_PUBLIC SELF from_error(ERROR value)
static DC_PUBLIC bool is_error(SELF const *self)
static DC_PUBLIC OK const * get_okay(SELF const *self)
#define OK
A simple result type, using the (already) optional pointer type.
static DC_PUBLIC SELF from_ok(OK value)
static DC_PUBLIC ERROR const * get_error(SELF const *self)
static DC_PUBLIC FILE * stream(SELF *self)