Derive-C
Loading...
Searching...
No Matches
def.h
Go to the documentation of this file.
1#if defined INDEX_TYPE
2 #define INDEX NS(SELF, index_t)
3
4// INVARIANT: < CAPACITY_EXCLUSIVE_UPPER
5typedef struct {
6 INDEX_TYPE index;
7} INDEX;
8
9static bool NS(INDEX, eq)(INDEX const* idx_1, INDEX const* idx_2) {
10 return idx_1->index == idx_2->index;
11}
12
13static void NS(INDEX, debug)(INDEX const* idx, dc_debug_fmt fmt, FILE* stream) {
14 (void)fmt;
15 fprintf(stream, EXPAND_STRING(INDEX) " { %lu }", (size_t)idx->index);
16}
17#endif
static void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
Definition template.h:62
#define INDEX_TYPE
Definition template.h:74
#define EXPAND_STRING(NAME)
Definition namespace.h:8
#define NS(pre, post)
Definition namespace.h:4
Debug format helpers for debug printin data structures.
Definition fmt.h:10
static FILE * stream(SELF *self)
Opens a file for.
Definition template.h:107