libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
src
util
dynstr.h
Go to the documentation of this file.
1
8
#pragma once
9
10
#include "
def.h
"
11
#include "
dynarr.h
"
12
13
struct
ps_dynstr
ps_dynarr
(char);
14
#define ps_dynstr_new() \
15
({ \
16
auto_t dstr = ps_dynarr_new(struct ps_dynstr); \
17
ps_push(&dstr, 0); \
18
dstr; \
19
})
20
#define ps_dynstr_free(arr) ps_dynarr_free(arr)
21
26
#define ps_dynstr_append(dstrptr, str) \
27
do { \
28
(*dstrptr)->length--;
/* overwrite ending null terminator */
\
29
STR _str = str; \
30
while (*_str) { \
31
ps_push(dstrptr, *(_str++)); \
32
}; \
33
ps_push(dstrptr, 0); \
34
} while (0)
def.h
Base definitions.
dynarr.h
Defines a dynamically-allocated array template.
ps_dynarr
#define ps_dynarr(T)
Definition
dynarr.h:28
Generated by
1.9.8