Go to the documentation of this file.
18 #ifndef LBM_FLAT_VALUE_H_
19 #define LBM_FLAT_VALUE_H_
31 #define S_CONS 0x01 // 2 car, cdr
32 #define S_SYM_VALUE 0x02 // 1 value
33 #define S_SYM_STRING 0x03
34 #define S_BYTE_VALUE 0x04
35 #define S_I28_VALUE 0x05
36 #define S_U28_VALUE 0x06
37 #define S_I32_VALUE 0x07
38 #define S_U32_VALUE 0x08
39 #define S_FLOAT_VALUE 0x09
40 #define S_I64_VALUE 0x0A
41 #define S_U64_VALUE 0x0B
42 #define S_DOUBLE_VALUE 0x0C
43 #define S_LBM_ARRAY 0x0D
44 #define S_I56_VALUE 0x0E
45 #define S_U56_VALUE 0x0F
46 #define S_LBM_LISP_ARRAY 0x1F
49 #define FLATTEN_VALUE_MAXIMUM_DEPTH 2000
51 #define FLATTEN_VALUE_OK 0
52 #define FLATTEN_VALUE_ERROR_CANNOT_BE_FLATTENED -1
53 #define FLATTEN_VALUE_ERROR_BUFFER_TOO_SMALL -2
54 #define FLATTEN_VALUE_ERROR_ARRAY -3
55 #define FLATTEN_VALUE_ERROR_CIRCULAR -4
56 #define FLATTEN_VALUE_ERROR_MAXIMUM_DEPTH -5
57 #define FLATTEN_VALUE_ERROR_NOT_ENOUGH_MEMORY -6
58 #define FLATTEN_VALUE_ERROR_FATAL -7
60 #define UNFLATTEN_MALFORMED -2
61 #define UNFLATTEN_GC_RETRY -1
62 #define UNFLATTEN_OK 0
bool lbm_unflatten_value(lbm_flat_value_t *v, lbm_value *res)
Definition: lbm_flat_value.c:773
bool f_i(lbm_flat_value_t *v, lbm_int i)
Definition: lbm_flat_value.c:162
uint32_t lbm_uint
Definition: lbm_types.h:48
int flatten_value_size(lbm_value v, int depth)
Definition: lbm_flat_value.c:326
bool f_u(lbm_flat_value_t *v, lbm_uint u)
Definition: lbm_flat_value.c:174
bool f_u64(lbm_flat_value_t *v, uint64_t w)
Definition: lbm_flat_value.c:232
uint8_t * buf
Definition: lbm_flat_value.h:26
int flatten_value_c(lbm_flat_value_t *fv, lbm_value v)
Definition: lbm_flat_value.c:335
bool f_i64(lbm_flat_value_t *v, int64_t w)
Definition: lbm_flat_value.c:225
bool f_cons(lbm_flat_value_t *v)
Definition: lbm_flat_value.c:106
bool f_lisp_array(lbm_flat_value_t *v, uint32_t num_elt)
Definition: lbm_flat_value.c:115
bool lbm_start_flatten(lbm_flat_value_t *v, size_t buffer_size)
Definition: lbm_flat_value.c:33
Definition: lbm_flat_value.h:25
lbm_uint buf_pos
Definition: lbm_flat_value.h:28
bool f_sym_string(lbm_flat_value_t *v, char *str)
Definition: lbm_flat_value.c:134
lbm_uint buf_size
Definition: lbm_flat_value.h:27
void lbm_set_max_flatten_depth(int depth)
Definition: lbm_flat_value.c:249
uint32_t lbm_value
Definition: lbm_types.h:44
int32_t lbm_int
Definition: lbm_types.h:49
bool f_sym(lbm_flat_value_t *v, lbm_uint sym_id)
Definition: lbm_flat_value.c:123
bool lbm_finish_flatten(lbm_flat_value_t *v)
Definition: lbm_flat_value.c:45
bool f_lbm_array(lbm_flat_value_t *v, uint32_t num_bytes, uint8_t *data)
Definition: lbm_flat_value.c:240
lbm_value flatten_value(lbm_value v)
Definition: lbm_flat_value.c:454
bool f_b(lbm_flat_value_t *v, uint8_t b)
Definition: lbm_flat_value.c:186
bool f_i32(lbm_flat_value_t *v, int32_t w)
Definition: lbm_flat_value.c:193
bool f_u32(lbm_flat_value_t *v, uint32_t w)
Definition: lbm_flat_value.c:200
bool f_float(lbm_flat_value_t *v, float f)
Definition: lbm_flat_value.c:207