File: xlwrap.h

package info (click to toggle)
xlispstat 3.52.14-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,560 kB
  • ctags: 12,676
  • sloc: ansic: 91,357; lisp: 21,759; sh: 1,525; makefile: 521; csh: 1
file content (20 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
LVAL xlw_lookup_type(char *tname);
LVAL xlgacptr(LVAL type, int null_ok);
LVAL cvcptr(LVAL type, void *v, LVAL data);
LVAL xlw_make_cptr(LVAL type, size_t elsize);
LVAL xlw_cast_cptr(LVAL type);
LVAL xlw_offset_cptr(LVAL type, size_t elsize);

#define DECLARE_CPTR_TYPE(t) static LVAL xlw_##t##_type_tag=NULL;
#define CPTR_TYPE(t) \
  (xlw_##t##_type_tag == NULL ? \
   xlw_##t##_type_tag = xlw_lookup_type(#t) : xlw_##t##_type_tag)
#define cptrp(x) (consp(x)&&stringp(car(x))&&natptrp(cdr(x)))
#define getcptype(x) car(x)
#define getcpptr(x) cdr(x)
#define getcpaddr(x) getnpaddr(getcpptr(x))
#define getcpprot(x) getnpprot(getcpptr(x))
#define newcptr(x,y) cons(x,y)
#define cptr_type_p(p,t) \
  (cptrp(p) && \
   (getcptype(p) == (t) || getcptype(p) == CPTR_TYPE(void)))