x-engine-c v0.2.31
The C engine for x-lang
Loading...
Searching...
No Matches
x-vector.h
Go to the documentation of this file.
1#ifndef X_VECTOR_H
2#define X_VECTOR_H
3
37/*
38 * ., .,
39 * {O,O}
40 * ( )
41 * " "
42 */
43
44#include "x-obj.h"
45
52#define X_VECTOR_UNITS_LENGTH 1
53
55#define x_vector_units(N) (X_VECTOR_UNITS_LENGTH + (N))
56
68#define X_VECTOR_LENGTH_STATIC_LEN 9
69
72
74#define x_vector_length_obj(N) ((x_obj_t *)x_vector_length_objs[(N)])
75
84#define x_vectorlengthobj(V) x_obj(x_obj_data_i((V), 0))
85
87#define x_vectorlength(V) x_atomint(x_vectorlengthobj((V)))
88
90#define x_vector_i(V,I) x_obj_data_i((V), X_VECTOR_UNITS_LENGTH + (I))
91
93#define x_vectorobj(V,I) x_obj(x_vector_i((V), (I)))
94
96#define x_vectorfn(V,I) x_fn(x_vector_i((V), (I)))
97
110#define x_mksvector(B,N,...) \
111 x_vector_make((B), NULL, X_OBJ_FLAG_NONE, (N), __VA_ARGS__)
112
114x_obj_t *x_vector_make(x_obj_t *p_base, x_obj_t *p_type, x_obj_flag_t flags,
115 x_int_t length, ...);
116
119#endif /* X_VECTOR_H */
Definition x-obj.h:214
The x-expr object system – atoms, pairs, flags, and type dispatch.
enum x_obj_flag_enum x_obj_flag_t
x_obj_t x_satom_t[X_OBJ_META_LEN+X_OBJ_UNITS_ATOM]
Definition x-obj.h:285
x_obj_t * x_vector_make(x_obj_t *p_base, x_obj_t *p_type, x_obj_flag_t flags, x_int_t length,...)
Definition x-vector.c:52
#define X_VECTOR_LENGTH_STATIC_LEN
Definition x-vector.h:68
x_satom_t x_vector_length_objs[X_VECTOR_LENGTH_STATIC_LEN]
Definition x-vector.c:25
long x_int_t
Definition x.h:129