Commit | Line | Data |
---|---|---|
8f5cfc81 | 1 | /* Copyright (C) 2001 Free Software Foundation, Inc. |
17e90c5e | 2 | * |
560b9c25 AW |
3 | * This library is free software; you can redistribute it and/or |
4 | * modify it under the terms of the GNU Lesser General Public | |
5 | * License as published by the Free Software Foundation; either | |
6 | * version 2.1 of the License, or (at your option) any later version. | |
17e90c5e | 7 | * |
560b9c25 AW |
8 | * This library is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
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 | |
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
16 | */ | |
17e90c5e | 17 | |
8f5cfc81 KN |
18 | #ifndef _SCM_PROGRAMS_H_ |
19 | #define _SCM_PROGRAMS_H_ | |
17e90c5e KN |
20 | |
21 | #include <libguile.h> | |
53e28ed9 | 22 | #include <libguile/objcodes.h> |
17e90c5e KN |
23 | |
24 | /* | |
25 | * Programs | |
26 | */ | |
27 | ||
28 | typedef unsigned char scm_byte_t; | |
29 | ||
560b9c25 | 30 | SCM_API scm_t_bits scm_tc16_program; |
17e90c5e | 31 | |
3b9e095b AW |
32 | #define SCM_F_PROGRAM_IS_BOOT (1<<0) |
33 | ||
17e90c5e | 34 | #define SCM_PROGRAM_P(x) (SCM_SMOB_PREDICATE (scm_tc16_program, x)) |
53e28ed9 AW |
35 | #define SCM_PROGRAM_OBJCODE(x) (SCM_SMOB_OBJECT (x)) |
36 | #define SCM_PROGRAM_OBJTABLE(x) (SCM_SMOB_OBJECT_2 (x)) | |
37 | #define SCM_PROGRAM_EXTERNALS(x) (SCM_SMOB_OBJECT_3 (x)) | |
38 | #define SCM_PROGRAM_DATA(x) (SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x))) | |
17e90c5e | 39 | #define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P) |
3b9e095b | 40 | #define SCM_PROGRAM_IS_BOOT(x) (SCM_SMOB_FLAGS (x) & SCM_F_PROGRAM_IS_BOOT) |
17e90c5e | 41 | |
560b9c25 | 42 | SCM_API SCM scm_make_program (SCM objcode, SCM objtable, SCM externals); |
17e90c5e | 43 | |
560b9c25 AW |
44 | SCM_API SCM scm_program_p (SCM obj); |
45 | SCM_API SCM scm_program_base (SCM program); | |
46 | SCM_API SCM scm_program_arity (SCM program); | |
47 | SCM_API SCM scm_program_meta (SCM program); | |
48 | SCM_API SCM scm_program_bindings (SCM program); | |
49 | SCM_API SCM scm_program_sources (SCM program); | |
50 | SCM_API SCM scm_program_source (SCM program, SCM ip); | |
51 | SCM_API SCM scm_program_properties (SCM program); | |
52 | SCM_API SCM scm_program_name (SCM program); | |
53 | SCM_API SCM scm_program_objects (SCM program); | |
54 | SCM_API SCM scm_program_module (SCM program); | |
55 | SCM_API SCM scm_program_external (SCM program); | |
56 | SCM_API SCM scm_program_external_set_x (SCM program, SCM external); | |
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 | */ |