-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbvalue.h
More file actions
35 lines (27 loc) · 786 Bytes
/
bvalue.h
File metadata and controls
35 lines (27 loc) · 786 Bytes
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
#ifndef BUILTIN_H
#define BUILTIN_H
#include "value.h"
typedef struct bvalue bvalue_t;
enum bvalue_type {
bvalue_type_string,
bvalue_type_number,
};
struct bvalue {
enum bvalue_type type;
union {
const char *string;
double number;
};
};
#define bv_nbr(n) \
{ \
.type = bvalue_type_number, \
.number = (n), \
}
#define bv_str(s) \
{ \
.type = bvalue_type_string, \
.string = (s), \
}
void bvalue_array_to_v(value_t *v, const bvalue_t *b, size_t length);
#endif /* BUILTIN_H */