Skip to content

Commit

Permalink
Added: structarr.h -> Multi List Array.
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarouf committed Nov 2, 2023
1 parent 58942d7 commit 8d9e231
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/lib/structarr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef ZAKAROUF__Z__STRUCTARR_H
#define ZAKAROUF__Z__STRUCTARR_H

#include "prep/args.h"
#include "prep/map.h"
#include "std/primitives.h"

#define z__PRIV__Srr_apply_fields(x) zpp__PRIV__Args_get_1 x * zpp__PRIV__Args_get_2 x;
#define z__Srr(...)\
struct { \
union { \
void *_raw[zpp__Args_Count(__VA_ARGS__)]; \
struct { \
zpp__Args_map( \
z__PRIV__Srr_apply_fields \
, __VA_ARGS__); \
}; \
}; \
z__size len; \
z__size lenUsed; \
}

#define z__Srr_r(...)\
struct { \
union { \
void *_raw[zpp__Args_Count(__VA_ARGS__)]; \
struct { \
__VA_ARGS__; \
}; \
}; \
z__size len; \
z__size lenUsed; \
}

#endif

0 comments on commit 8d9e231

Please sign in to comment.