2 * Copyright (C) 2001-2010, Parrot Foundation.
6 * This is the Parrot embedding system--the only part of Parrot that
7 * the outside world should see.
9 * embed.c, docs/embed.pod.
12 #ifndef PARROT_EMBED_H_GUARD
13 #define PARROT_EMBED_H_GUARD
15 #include "parrot/core_types.h" /* types used */
16 #include "parrot/compiler.h" /* compiler capabilities */
17 #include "parrot/config.h" /* PARROT_VERSION, PARROT_JIT_CAPABLE... */
18 #include "parrot/interpreter.h" /* give us the interpreter flags */
19 #include "parrot/warnings.h" /* give us the warnings flags */
21 typedef int Parrot_warnclass
;
26 } Parrot_disassemble_options
;
28 /* Parrot_set_config_hash exists in *_config.o (e.g install_config.o),
29 so if you make this call then you will need to link with it in
30 addition to libparrot */
31 void Parrot_set_config_hash(void);
34 PARROT_DOES_NOT_RETURN
37 Parrot_exit(PARROT_INTERP
, int status
);
40 void Parrot_destroy(PARROT_INTERP
)
41 __attribute__nonnull__(1);
44 /* HEADERIZER BEGIN: src/embed.c */
45 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
48 void Parrot_clear_debug(PARROT_INTERP
, Parrot_UInt flag
)
49 __attribute__nonnull__(1);
52 void Parrot_clear_flag(PARROT_INTERP
, Parrot_Int flag
)
53 __attribute__nonnull__(1);
56 void Parrot_clear_trace(PARROT_INTERP
, Parrot_UInt flag
)
57 __attribute__nonnull__(1);
60 Parrot_PMC
Parrot_compile_string(PARROT_INTERP
,
62 ARGIN(const char *code
),
63 ARGOUT(Parrot_String
*error
))
64 __attribute__nonnull__(1)
65 __attribute__nonnull__(3)
66 __attribute__nonnull__(4)
67 FUNC_MODIFIES(*error
);
70 PARROT_CAN_RETURN_NULL
71 Parrot_Opcode
* Parrot_debug(PARROT_INTERP
,
72 ARGIN(Parrot_Interp debugger
),
73 ARGIN(Parrot_Opcode
*pc
))
74 __attribute__nonnull__(1)
75 __attribute__nonnull__(2)
76 __attribute__nonnull__(3);
79 void Parrot_disassemble(PARROT_INTERP
,
80 ARGIN_NULLOK(const char *outfile
),
81 Parrot_disassemble_options options
)
82 __attribute__nonnull__(1);
85 void Parrot_init_stacktop(PARROT_INTERP
, ARGIN(void *stack_top
))
86 __attribute__nonnull__(1)
87 __attribute__nonnull__(2);
90 PARROT_CANNOT_RETURN_NULL
92 Parrot_Interp
Parrot_new(ARGIN_NULLOK(Parrot_Interp parent
));
95 void Parrot_pbc_fixup_loaded(PARROT_INTERP
)
96 __attribute__nonnull__(1);
99 void Parrot_pbc_load(PARROT_INTERP
, ARGIN(Parrot_PackFile pf
))
100 __attribute__nonnull__(1)
101 __attribute__nonnull__(2);
104 PARROT_CAN_RETURN_NULL
105 Parrot_PackFile
Parrot_pbc_read(PARROT_INTERP
,
106 ARGIN_NULLOK(const char *fullname
),
108 __attribute__nonnull__(1);
111 void Parrot_run_native(PARROT_INTERP
, native_func_t func
)
112 __attribute__nonnull__(1);
115 void Parrot_runcode(PARROT_INTERP
, int argc
, ARGIN(const char **argv
))
116 __attribute__nonnull__(1)
117 __attribute__nonnull__(3);
120 void Parrot_set_debug(PARROT_INTERP
, Parrot_UInt flag
)
121 __attribute__nonnull__(1);
124 void Parrot_set_executable_name(PARROT_INTERP
, Parrot_String name
)
125 __attribute__nonnull__(1);
128 void Parrot_set_flag(PARROT_INTERP
, Parrot_Int flag
)
129 __attribute__nonnull__(1);
132 void Parrot_set_run_core(PARROT_INTERP
, Parrot_Run_core_t core
)
133 __attribute__nonnull__(1);
136 void Parrot_set_trace(PARROT_INTERP
, Parrot_UInt flag
)
137 __attribute__nonnull__(1);
140 void Parrot_setwarnings(PARROT_INTERP
, Parrot_warnclass wc
)
141 __attribute__nonnull__(1);
145 Parrot_UInt
Parrot_test_debug(PARROT_INTERP
, Parrot_UInt flag
)
146 __attribute__nonnull__(1);
150 Parrot_Int
Parrot_test_flag(PARROT_INTERP
, Parrot_Int flag
)
151 __attribute__nonnull__(1);
155 Parrot_UInt
Parrot_test_trace(PARROT_INTERP
, Parrot_UInt flag
)
156 __attribute__nonnull__(1);
158 #define ASSERT_ARGS_Parrot_clear_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
159 PARROT_ASSERT_ARG(interp))
160 #define ASSERT_ARGS_Parrot_clear_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
161 PARROT_ASSERT_ARG(interp))
162 #define ASSERT_ARGS_Parrot_clear_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
163 PARROT_ASSERT_ARG(interp))
164 #define ASSERT_ARGS_Parrot_compile_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
165 PARROT_ASSERT_ARG(interp) \
166 , PARROT_ASSERT_ARG(code) \
167 , PARROT_ASSERT_ARG(error))
168 #define ASSERT_ARGS_Parrot_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
169 PARROT_ASSERT_ARG(interp) \
170 , PARROT_ASSERT_ARG(debugger) \
171 , PARROT_ASSERT_ARG(pc))
172 #define ASSERT_ARGS_Parrot_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
173 PARROT_ASSERT_ARG(interp))
174 #define ASSERT_ARGS_Parrot_init_stacktop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
175 PARROT_ASSERT_ARG(interp) \
176 , PARROT_ASSERT_ARG(stack_top))
177 #define ASSERT_ARGS_Parrot_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
178 #define ASSERT_ARGS_Parrot_pbc_fixup_loaded __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
179 PARROT_ASSERT_ARG(interp))
180 #define ASSERT_ARGS_Parrot_pbc_load __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
181 PARROT_ASSERT_ARG(interp) \
182 , PARROT_ASSERT_ARG(pf))
183 #define ASSERT_ARGS_Parrot_pbc_read __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
184 PARROT_ASSERT_ARG(interp))
185 #define ASSERT_ARGS_Parrot_run_native __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
186 PARROT_ASSERT_ARG(interp))
187 #define ASSERT_ARGS_Parrot_runcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
188 PARROT_ASSERT_ARG(interp) \
189 , PARROT_ASSERT_ARG(argv))
190 #define ASSERT_ARGS_Parrot_set_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
191 PARROT_ASSERT_ARG(interp))
192 #define ASSERT_ARGS_Parrot_set_executable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
193 PARROT_ASSERT_ARG(interp))
194 #define ASSERT_ARGS_Parrot_set_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
195 PARROT_ASSERT_ARG(interp))
196 #define ASSERT_ARGS_Parrot_set_run_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
197 PARROT_ASSERT_ARG(interp))
198 #define ASSERT_ARGS_Parrot_set_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
199 PARROT_ASSERT_ARG(interp))
200 #define ASSERT_ARGS_Parrot_setwarnings __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
201 PARROT_ASSERT_ARG(interp))
202 #define ASSERT_ARGS_Parrot_test_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
203 PARROT_ASSERT_ARG(interp))
204 #define ASSERT_ARGS_Parrot_test_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
205 PARROT_ASSERT_ARG(interp))
206 #define ASSERT_ARGS_Parrot_test_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
207 PARROT_ASSERT_ARG(interp))
208 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
209 /* HEADERIZER END: src/embed.c */
212 #endif /* PARROT_EMBED_H_GUARD */
216 * c-file-style: "parrot"
218 * vim: expandtab shiftwidth=4: