Commit | Line | Data |
---|---|---|
20d47c39 | 1 | /* Copyright (C) 2001, 2009 Free Software Foundation, Inc. |
17e90c5e | 2 | * |
560b9c25 | 3 | * This library is free software; you can redistribute it and/or |
53befeb7 NJ |
4 | * modify it under the terms of the GNU Lesser General Public License |
5 | * as published by the Free Software Foundation; either version 3 of | |
6 | * the License, or (at your option) any later version. | |
17e90c5e | 7 | * |
53befeb7 NJ |
8 | * This library is distributed in the hope that it will be useful, but |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
560b9c25 AW |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | * Lesser General Public License for more details. | |
17e90c5e | 12 | * |
560b9c25 AW |
13 | * You should have received a copy of the GNU Lesser General Public |
14 | * License along with this library; if not, write to the Free Software | |
53befeb7 NJ |
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
16 | * 02110-1301 USA | |
560b9c25 | 17 | */ |
17e90c5e | 18 | |
8f5cfc81 KN |
19 | #ifndef _SCM_PROGRAMS_H_ |
20 | #define _SCM_PROGRAMS_H_ | |
17e90c5e KN |
21 | |
22 | #include <libguile.h> | |
53e28ed9 | 23 | #include <libguile/objcodes.h> |
17e90c5e KN |
24 | |
25 | /* | |
26 | * Programs | |
27 | */ | |
28 | ||
29 | typedef unsigned char scm_byte_t; | |
30 | ||
560b9c25 | 31 | SCM_API scm_t_bits scm_tc16_program; |
17e90c5e | 32 | |
3b9e095b AW |
33 | #define SCM_F_PROGRAM_IS_BOOT (1<<0) |
34 | ||
17e90c5e | 35 | #define SCM_PROGRAM_P(x) (SCM_SMOB_PREDICATE (scm_tc16_program, x)) |
53e28ed9 AW |
36 | #define SCM_PROGRAM_OBJCODE(x) (SCM_SMOB_OBJECT (x)) |
37 | #define SCM_PROGRAM_OBJTABLE(x) (SCM_SMOB_OBJECT_2 (x)) | |
20d47c39 | 38 | #define SCM_PROGRAM_FREE_VARS(x) (SCM_SMOB_OBJECT_3 (x)) |
53e28ed9 | 39 | #define SCM_PROGRAM_DATA(x) (SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x))) |
17e90c5e | 40 | #define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P) |
3b9e095b | 41 | #define SCM_PROGRAM_IS_BOOT(x) (SCM_SMOB_FLAGS (x) & SCM_F_PROGRAM_IS_BOOT) |
17e90c5e | 42 | |
20d47c39 | 43 | SCM_API SCM scm_make_program (SCM objcode, SCM objtable, SCM free_vars); |
17e90c5e | 44 | |
560b9c25 AW |
45 | SCM_API SCM scm_program_p (SCM obj); |
46 | SCM_API SCM scm_program_base (SCM program); | |
47 | SCM_API SCM scm_program_arity (SCM program); | |
48 | SCM_API SCM scm_program_meta (SCM program); | |
49 | SCM_API SCM scm_program_bindings (SCM program); | |
50 | SCM_API SCM scm_program_sources (SCM program); | |
51 | SCM_API SCM scm_program_source (SCM program, SCM ip); | |
52 | SCM_API SCM scm_program_properties (SCM program); | |
53 | SCM_API SCM scm_program_name (SCM program); | |
54 | SCM_API SCM scm_program_objects (SCM program); | |
55 | SCM_API SCM scm_program_module (SCM program); | |
20d47c39 | 56 | SCM_API SCM scm_program_free_vars (SCM program); |
560b9c25 | 57 | SCM_API SCM scm_program_objcode (SCM program); |
fcd4901b | 58 | |
560b9c25 | 59 | SCM_API SCM scm_c_program_source (SCM program, size_t ip); |
9a9f6487 | 60 | |
560b9c25 AW |
61 | SCM_INTERNAL void scm_bootstrap_programs (void); |
62 | SCM_INTERNAL void scm_init_programs (void); | |
17e90c5e | 63 | |
8f5cfc81 | 64 | #endif /* _SCM_PROGRAMS_H_ */ |
17e90c5e KN |
65 | |
66 | /* | |
67 | Local Variables: | |
68 | c-file-style: "gnu" | |
69 | End: | |
70 | */ |