30#include "_sexp-types.h"
31#include "../../../common/util.h"
34typedef uint8_t SEXP_valtype_t;
36#define SEXP_VALTYPE_EMPTY 0
37#define SEXP_VALTYPE_STRING 1
38#define SEXP_VALTYPE_NUMBER 2
39#define SEXP_VALTYPE_LIST 3
53#define SEXP_VALP_ALIGN (4 > sizeof(void *) ? 4 : sizeof(void *))
54#define SEXP_VALP_MASK (UINTPTR_MAX << 2)
55#define SEXP_VALT_MASK 3
56#define SEXP_VALP_HDR(p) ((SEXP_valhdr_t *)(((uintptr_t)(p)) & SEXP_VALP_MASK))
58int SEXP_val_new (
SEXP_val_t *dst,
size_t vmemsize, SEXP_valtype_t type);
59void SEXP_val_dsc (
SEXP_val_t *dst, uintptr_t ptr);
62uintptr_t SEXP_rawval_incref (uintptr_t valp);
63int SEXP_rawval_decref (uintptr_t valp);
65#define SEXP_DEFNUM(s,T) struct SEXP_val_num_##s { T n; SEXP_numtype_t t; }
66#define SEXP_NCASTP(s,p) ((struct SEXP_val_num_##s *)(p))
67#define SEXP_NTYPEP(sz,p) *((SEXP_numtype_t *)(((uint8_t *)(p)) + (sz) - sizeof (SEXP_numtype_t)))
69SEXP_numtype_t SEXP_rawval_number_type (
SEXP_val_t *dsc);
72SEXP_DEFNUM(f,
double);
73SEXP_DEFNUM(i8, int8_t);
74SEXP_DEFNUM(u8, uint8_t);
75SEXP_DEFNUM(i16, int16_t);
76SEXP_DEFNUM(u16, uint16_t);
77SEXP_DEFNUM(i32, int32_t);
78SEXP_DEFNUM(u32, uint32_t);
79SEXP_DEFNUM(i64, int64_t);
80SEXP_DEFNUM(u64, uint64_t);
91#define SEXP_LCASTP(p) ((struct SEXP_val_list *)(p))
101uintptr_t SEXP_rawval_list_copy (uintptr_t s_valp);
103uintptr_t SEXP_rawval_lblk_copy (uintptr_t lblkp, uint16_t n_skip);
104uintptr_t SEXP_rawval_lblk_new (uint8_t sz);
105uintptr_t SEXP_rawval_lblk_incref (uintptr_t lblkp);
106int SEXP_rawval_lblk_decref (uintptr_t lblkp);
108uintptr_t SEXP_rawval_lblk_fill (uintptr_t lblkp,
SEXP_t *s_exp[], uint16_t s_exp_count);
109uintptr_t SEXP_rawval_lblk_add (uintptr_t lblkp,
const SEXP_t *s_exp);
110uintptr_t SEXP_rawval_lblk_add1 (uintptr_t lblkp,
const SEXP_t *s_exp);
111uintptr_t SEXP_rawval_lblk_last (uintptr_t lblkp);
112SEXP_t *SEXP_rawval_lblk_nth (uintptr_t lblkp, uint32_t n);
113uintptr_t SEXP_rawval_lblk_replace (uintptr_t lblkp, uint32_t n,
const SEXP_t *n_val,
SEXP_t **o_val);
114int SEXP_rawval_lblk_cb (uintptr_t lblkp,
int (*func) (
SEXP_t *,
void *),
void *arg, uint32_t n);
115void SEXP_rawval_lblk_free (uintptr_t lblkp,
void (*func) (
SEXP_t *));
116void SEXP_rawval_lblk_free1 (uintptr_t lblkp,
void (*func) (
SEXP_t *));
118#define SEXP_LBLK_ALIGN (16 > sizeof(void *) ? 16 : sizeof(void *))
119#define SEXP_LBLKP_MASK (UINTPTR_MAX << 4)
120#define SEXP_LBLKS_MASK 0x0f
122#define SEXP_VALP_LBLK(valp) ((struct SEXP_val_lblk *)((uintptr_t)(valp) & SEXP_LBLKP_MASK))
124uintptr_t SEXP_rawval_copy(uintptr_t s_valp);
Definition _sexp-value.h:93
Definition _sexp-value.h:86
Definition _sexp-value.h:46
Definition _sexp-value.h:41
Definition sexp-types.h:82