programs have their own tc7 now
[bpt/guile.git] / libguile / programs.h
CommitLineData
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
2fb924f6 29#define SCM_F_PROGRAM_IS_BOOT (1<<16)
17e90c5e 30
2fb924f6
AW
31#define SCM_PROGRAM_P(x) (!SCM_IMP (x) && SCM_TYP7(x) == scm_tc7_program)
32#define SCM_PROGRAM_OBJCODE(x) (SCM_CELL_OBJECT_1 (x))
33#define SCM_PROGRAM_OBJTABLE(x) (SCM_CELL_OBJECT_2 (x))
34#define SCM_PROGRAM_FREE_VARIABLES(x) (SCM_CELL_OBJECT_3 (x))
53e28ed9 35#define SCM_PROGRAM_DATA(x) (SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x)))
17e90c5e 36#define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P)
2fb924f6 37#define SCM_PROGRAM_IS_BOOT(x) (SCM_CELL_WORD_0 (x) & SCM_F_PROGRAM_IS_BOOT)
17e90c5e 38
57ab0671 39SCM_API SCM scm_make_program (SCM objcode, SCM objtable, SCM free_variables);
17e90c5e 40
560b9c25
AW
41SCM_API SCM scm_program_p (SCM obj);
42SCM_API SCM scm_program_base (SCM program);
43SCM_API SCM scm_program_arity (SCM program);
44SCM_API SCM scm_program_meta (SCM program);
45SCM_API SCM scm_program_bindings (SCM program);
46SCM_API SCM scm_program_sources (SCM program);
47SCM_API SCM scm_program_source (SCM program, SCM ip);
48SCM_API SCM scm_program_properties (SCM program);
49SCM_API SCM scm_program_name (SCM program);
50SCM_API SCM scm_program_objects (SCM program);
51SCM_API SCM scm_program_module (SCM program);
57ab0671 52SCM_API SCM scm_program_free_variables (SCM program);
560b9c25 53SCM_API SCM scm_program_objcode (SCM program);
fcd4901b 54
560b9c25 55SCM_API SCM scm_c_program_source (SCM program, size_t ip);
9a9f6487 56
2fb924f6
AW
57SCM_INTERNAL void scm_i_program_print (SCM program, SCM port,
58 scm_print_state *pstate);
560b9c25
AW
59SCM_INTERNAL void scm_bootstrap_programs (void);
60SCM_INTERNAL void scm_init_programs (void);
17e90c5e 61
8f5cfc81 62#endif /* _SCM_PROGRAMS_H_ */
17e90c5e
KN
63
64/*
65 Local Variables:
66 c-file-style: "gnu"
67 End:
68*/