blob: eebf055f13dac7bf54c4bf57633e562886686b41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#pragma once
#include "util/membuf.h"
#include <stdint.h>
struct varbuf {
struct membuf buf;
size_t offset;
};
void
varbuf_begin(struct varbuf *var);
void
varbuf_reset(struct varbuf *var);
void
varbuf_remove_last(struct varbuf *var);
struct stack {
struct varbuf var;
union {
struct fspec_mem str;
uint64_t num;
};
enum stack_type {
STACK_STR,
STACK_NUM,
} type;
};
void
stack_num(struct stack *stack, const uint8_t base);
const struct fspec_mem*
stack_get_str(const struct stack *stack);
uint64_t
stack_get_num(const struct stack *stack);
|