Go to the source code of this file.
|
| struct | item_t |
| | A queue comprised of an extendable circular buffer. More...
|
| struct | SELF |
| | An allocator that prints to stdout when it allocates or frees memory. More...
|
◆ ITEM
◆ ITEM_CLONE
| #define ITEM_CLONE item_clone |
◆ ITEM_DEBUG
| #define ITEM_DEBUG item_debug |
◆ ITEM_DELETE
| #define ITEM_DELETE item_delete |
◆ ITEM_EQ
◆ clone()
Definition at line 53 of file template.h.
53 {
55 if (self->present) {
57 }
59}
static bool empty(ITER const *iter)
#define DC_ASSUME(expr,...)
static SELF from(ITEM value)
◆ debug()
Definition at line 119 of file template.h.
119 {
128 } else {
130 }
131}
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)
static FILE * stream(SELF *self)
Opens a file for.
◆ delete()
| void delete |
( |
SELF * | self | ) |
|
|
static |
◆ empty()
Definition at line 51 of file template.h.
51{
return (
SELF){.present =
false}; }
◆ from()
Definition at line 49 of file template.h.
49{
return (
SELF){.item = value, .present =
true}; }
◆ get()
Definition at line 61 of file template.h.
61 {
65 }
66 return NULL;
67}
◆ get_const()
| ITEM const * get_const |
( |
SELF const * | self | ) |
|
|
static |
Definition at line 69 of file template.h.
69 {
71 if (self->present) {
72 return &self->item;
73 }
74 return NULL;
75}
◆ get_const_or()
| ITEM const * get_const_or |
( |
SELF const * | self, |
|
|
ITEM const * | default_value ) |
|
static |
Definition at line 77 of file template.h.
77 {
79 if (self->present) {
80 return &self->item;
81 }
82 return default_value;
83}
◆ get_value_or()
| ITEM get_value_or |
( |
SELF const * | self, |
|
|
ITEM const | default_value ) |
|
static |
Definition at line 85 of file template.h.
85 {
87 if (self->present) {
88 return self->item;
89 }
90 return default_value;
91}
◆ is_present()
| bool is_present |
( |
SELF const * | self | ) |
|
|
static |
Definition at line 93 of file template.h.
93 {
95 return self->present;
96}
◆ ITEM_CLONE()
◆ ITEM_DEBUG()
◆ ITEM_DELETE()
| void ITEM_DELETE |
( |
item_t * | self | ) |
|
|
static |
◆ ITEM_EQ()
◆ replace()
| bool replace |
( |
SELF * | self, |
|
|
ITEM | value ) |
|
static |
Definition at line 105 of file template.h.
105 {
107 bool was_present;
110 was_present = true;
111 } else {
112 was_present = false;
113 }
116 return was_present;
117}