aboutsummaryrefslogtreecommitdiff
path: root/cordhelpers.h
blob: 9a72e93cec8cba428ba8d056c892e664fc8abccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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