Commit | Line | Data |
---|---|---|
02aa5a4c MD |
1 | /* classes: h_files */ |
2 | ||
13dcb666 DH |
3 | #ifndef SCM_STACKS_H |
4 | #define SCM_STACKS_H | |
b29058ff | 5 | |
102dbb6f | 6 | /* Copyright (C) 1995,1996,2000,2001, 2004, 2006, 2008 Free Software Foundation, Inc. |
b29058ff | 7 | * |
73be1d9e | 8 | * This library is free software; you can redistribute it and/or |
53befeb7 NJ |
9 | * modify it under the terms of the GNU Lesser General Public License |
10 | * as published by the Free Software Foundation; either version 3 of | |
11 | * the License, or (at your option) any later version. | |
b29058ff | 12 | * |
53befeb7 NJ |
13 | * This library is distributed in the hope that it will be useful, but |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
73be1d9e MV |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | * Lesser General Public License for more details. | |
b29058ff | 17 | * |
73be1d9e MV |
18 | * You should have received a copy of the GNU Lesser General Public |
19 | * License along with this library; if not, write to the Free Software | |
53befeb7 NJ |
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
21 | * 02110-1301 USA | |
73be1d9e | 22 | */ |
d3a6bc94 | 23 | |
02aa5a4c MD |
24 | \f |
25 | ||
26 | #include "libguile/__scm.h" | |
aa3f6951 | 27 | #include "libguile/frames.h" |
02aa5a4c MD |
28 | |
29 | /* {Frames and stacks} | |
30 | */ | |
31 | ||
762e289a | 32 | SCM_API SCM scm_stack_type; |
b902ec85 | 33 | |
aa3f6951 AW |
34 | #define SCM_STACK_LAYOUT \ |
35 | "pw" /* len */ \ | |
36 | "pw" /* id */ \ | |
37 | "pw" /* frame */ | |
b902ec85 | 38 | |
aa3f6951 AW |
39 | #define SCM_STACKP(obj) (SCM_STRUCTP (obj) && scm_is_eq (SCM_STRUCT_VTABLE (obj), scm_stack_type)) |
40 | #define SCM_STACK_LENGTH(obj) (scm_to_long (SCM_STRUCT_SLOT_REF (obj,0))) | |
41 | #define SCM_SET_STACK_LENGTH(obj,f) (SCM_STRUCT_SLOT_SET (obj,0,scm_from_long (f))) | |
42 | #define SCM_STACK_ID(obj) (SCM_STRUCT_SLOT_REF (obj,1)) | |
43 | #define SCM_SET_STACK_ID(obj,f) (SCM_STRUCT_SLOT_SET (obj,1,f)) | |
44 | #define SCM_STACK_FRAME(obj) (SCM_STRUCT_SLOT_REF (obj,2)) | |
45 | #define SCM_SET_STACK_FRAME(obj,f) (SCM_STRUCT_SLOT_SET (obj,2,f)) | |
02aa5a4c | 46 | |
aa3f6951 | 47 | #define SCM_FRAMEP(obj) (SCM_VM_FRAME_P (obj)) |
02aa5a4c | 48 | |
02aa5a4c MD |
49 | |
50 | \f | |
51 | ||
33b001fd MV |
52 | SCM_API SCM scm_stack_p (SCM obj); |
53 | SCM_API SCM scm_make_stack (SCM obj, SCM args); | |
54 | SCM_API SCM scm_stack_id (SCM stack); | |
55 | SCM_API SCM scm_stack_ref (SCM stack, SCM i); | |
56 | SCM_API SCM scm_stack_length (SCM stack); | |
57 | ||
102dbb6f | 58 | SCM_INTERNAL void scm_init_stacks (void); |
02aa5a4c | 59 | |
b29058ff | 60 | #endif /* SCM_STACKS_H */ |
89e00824 ML |
61 | |
62 | /* | |
63 | Local Variables: | |
64 | c-file-style: "gnu" | |
65 | End: | |
66 | */ |