6 /* Copyright (C) 1995,1996,2000,2001, 2004, 2006, 2008 Free Software Foundation, Inc.
8 * This library is free software; you can redistribute it and/or
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.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
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
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "libguile/__scm.h"
27 #include "libguile/frames.h"
29 /* {Frames and stacks}
32 SCM_API SCM scm_stack_type
;
34 #define SCM_STACK_LAYOUT \
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))
47 #define SCM_FRAMEP(obj) (SCM_VM_FRAME_P (obj))
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
);
58 SCM_INTERNAL
void scm_init_stacks (void);
60 #endif /* SCM_STACKS_H */