diff options
Diffstat (limited to 'src/cordhelpers.h')
| -rw-r--r-- | src/cordhelpers.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cordhelpers.h b/src/cordhelpers.h new file mode 100644 index 00000000..9a72e93c --- /dev/null +++ b/src/cordhelpers.h @@ -0,0 +1,14 @@ +#pragma once +// Some helper functions for the GC Cord library + +#include <gc/cord.h> + +#define CORD_appendf(cord, fmt, ...) CORD_sprintf(cord, "%r" fmt, *(cord) __VA_OPT__(,) __VA_ARGS__) +#define CORD_all(...) CORD_catn(sizeof((CORD[]){__VA_ARGS__})/sizeof(CORD), __VA_ARGS__) + +__attribute__((format(printf, 1, 2))) +CORD CORD_asprintf(CORD fmt, ...); +CORD CORD_quoted(CORD str); +CORD CORD_replace(CORD c, CORD to_replace, CORD replacement); + +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
