Line | |
---|
1 | /* -*- mode: C; tab-width:8; c-basic-offset:8 -*- |
---|
2 | * vi:set ts=8: |
---|
3 | * |
---|
4 | * al_rctree.h |
---|
5 | * |
---|
6 | * Stuff related to the rctree data structure |
---|
7 | * |
---|
8 | */ |
---|
9 | #ifndef AL_RCTREE_H_ |
---|
10 | #define AL_RCTREE_H_ |
---|
11 | |
---|
12 | #define ALRC_MAXSTRLEN 90 |
---|
13 | |
---|
14 | #include "al_rcvar.h" |
---|
15 | |
---|
16 | /* |
---|
17 | * The AL_rctree is the base type for the alrc language. |
---|
18 | */ |
---|
19 | typedef struct _AL_rctree { |
---|
20 | ALRcEnum type; |
---|
21 | |
---|
22 | union { |
---|
23 | ALboolean b; |
---|
24 | ALint i; |
---|
25 | ALfloat f; |
---|
26 | ALuint ui; |
---|
27 | ALvoid *p; |
---|
28 | |
---|
29 | struct { |
---|
30 | char c_str[ALRC_MAXSTRLEN]; |
---|
31 | size_t len; |
---|
32 | } str; |
---|
33 | struct _AL_rctree *(*proc)(struct _AL_rctree *env, struct _AL_rctree *args); |
---|
34 | struct { |
---|
35 | struct _AL_rctree *car; |
---|
36 | struct _AL_rctree *cdr; |
---|
37 | } ccell; |
---|
38 | } data; |
---|
39 | } AL_rctree; |
---|
40 | |
---|
41 | /* |
---|
42 | * alrc_prim is a typedef that aids in the handling of alrc primitives, which |
---|
43 | * provide a sort of foreign function interface. |
---|
44 | */ |
---|
45 | typedef AL_rctree *(*alrc_prim)( AL_rctree *env, AL_rctree *args ); |
---|
46 | |
---|
47 | /* |
---|
48 | * Allocate, initialize, and return an AL_rctree object. |
---|
49 | */ |
---|
50 | AL_rctree *_alRcTreeAlloc( void ); |
---|
51 | |
---|
52 | /* |
---|
53 | * Finalize and deallocate an AL_rctree object. |
---|
54 | */ |
---|
55 | void _alRcTreeFree( AL_rctree *node ); |
---|
56 | |
---|
57 | /* |
---|
58 | * Deallocates any and all AL_rctree objects creates thus far. |
---|
59 | */ |
---|
60 | void _alRcTreeDestroyAll( void ); |
---|
61 | |
---|
62 | #endif /* AL_RCTREE_H_ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.