Skip to content
This repository
Newer
Older
100644 938 lines (729 sloc) 27.338 kb
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
1 /*
ced54a52 » NotFound
2011-01-27 Fix remaining 'might be clobbered' warning
2 Copyright (C) 2010-2011, Parrot Foundation.
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
3
4 =head1 NAME
5
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
6 src/embed/api.c - The Parrot embedding interface
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
7
8 =head1 DESCRIPTION
9
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
10 This file implements functions of the Parrot embedding interface.
11
12 =head2 Functions
13
14 =over 4
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
15
16 =cut
17
18 */
19
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
20 #include "parrot/parrot.h"
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
21 #include "parrot/runcore_api.h"
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
22 #include "parrot/embed.h"
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
23 #include "parrot/api.h"
1b6d1ced » Whiteknight
2010-11-10 start breaking up the embedding stuff into multiple files. Add embed_…
24 #include "embed_private.h"
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
25
3f8ed92a » Whiteknight
2010-11-10 fix some file references and run headerizer to see my work so far
26 /* HEADERIZER HFILE: include/parrot/api.h */
27
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
28
29 /*
30
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
31 =item C<Parrot_Int Parrot_api_get_result(Parrot_PMC interp_pmc, Parrot_Int
32 *is_error, Parrot_PMC * exception, Parrot_Int *exit_code, Parrot_String *
33 errmsg)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
34
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
35 Gets the results of the last API function call and stores the results in
36 C<is_error>, C<exception>, C<exit_code> and C<errmsg>. This function returns
37 a true value if this call is successful and false value otherwise. The stored
38 information is as follow:
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
39
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
40 C<is_error> a true value if an unhandled exception was thrown or the program
41 terminated with an error condition and a false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
42
43 C<exception> the last exception thrown.
44
45 C<exit_code> the exit code of the running program.
46
47 C<errmsg> contains an string with the last error message.
48
49 =cut
50
51 */
52
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
53 PARROT_API
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
54 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
55 Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error),
56 ARGOUT(Parrot_PMC * exception), ARGOUT(Parrot_Int *exit_code),
57 ARGOUT(Parrot_String * errmsg))
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
58 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
59 ASSERT_ARGS(Parrot_api_get_result)
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
60 EMBED_API_CALLIN(interp_pmc, interp)
be50d63d » bluescreen10
2010-11-27 Implemented first version of Parrot_get_result, now a lot of failing …
61 *exit_code = interp->exit_code;
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
62 *exception = interp->final_exception;
73f662d6 » Whiteknight
2010-12-05 some fixes so libparrot builds with g++
63 if (PMC_IS_NULL(*exception)) {
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
64 *is_error = 0;
65 *errmsg = STRINGNULL;
9703ef55 » jkeenan
2010-12-04 [codingstd] C-style coda needed. No cuddled elses.
66 }
67 else {
b3af8c93 » Whiteknight
2010-12-28 fix main.c so that we check the is_error flag and only show an error …
68 STRING * const severity_str = Parrot_str_new(interp, "severity", 0);
69 INTVAL severity = VTABLE_get_integer_keyed_str(interp, *exception, severity_str);
70 *is_error = (severity != EXCEPT_exit);
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
71 *errmsg = VTABLE_get_string(interp, *exception);
72 }
73 interp->final_exception = PMCNULL;
be50d63d » bluescreen10
2010-11-27 Implemented first version of Parrot_get_result, now a lot of failing …
74 interp->exit_code = 0;
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
75 EMBED_API_CALLOUT(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
76 }
77
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
78 /*
79
80 =item C<Parrot_Int Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc,
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
81 Parrot_PMC exception, Parrot_String * bt)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
82
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
83 Gets the backtrace of the interpreter's call chain for the given exception
84 C<expcetion> and stores the results in string C<bt>. This function returns a
85 true value if this call is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
86
87 =cut
88
89 */
90
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
91 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
92 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
93 Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc,
94 Parrot_PMC exception, ARGOUT(Parrot_String * bt))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
95 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
96 ASSERT_ARGS(Parrot_api_get_exception_backtrace)
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
97 EMBED_API_CALLIN(interp_pmc, interp)
3c6f7d0e » Whiteknight
2011-01-10 rethrow caches the old backtrace.
98 if (PMC_IS_NULL(exception))
99 *bt = STRINGNULL;
100 else
0a4f0934 » Whiteknight
2011-01-10 build fixes
101 *bt = Parrot_ex_build_complete_backtrace_string(interp, exception);
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
102 EMBED_API_CALLOUT(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
103 }
104
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
105
106 /*
107
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
108 =item C<Parrot_Int Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int
109 flags, Parrot_Init_Args *args, Parrot_PMC *interp)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
110
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
111 Creates a new interpreter and stores it in C<interp>. It takes three optional
112 parameters the new interpreter's C<flags>, the initialization paremeters C<args>
113 and the C<parent> interpreter. This function returns a true value if this call
114 is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
115
116 =cut
117
118 */
119
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
120 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
121 Parrot_Int
709eae7a » Whiteknight
2010-12-04 add in a handful of additional API functions, though they aren't bein…
122 Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags,
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
123 ARGIN_NULLOK(Parrot_Init_Args *args), ARGOUT(Parrot_PMC *interp))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
124 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
125 ASSERT_ARGS(Parrot_api_make_interpreter)
4a128d50 » Whiteknight
2010-11-09 lots of little changes
126 int alt_stacktop;
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
127 Parrot_Interp interp_raw;
9b2b6564 » nwellnhof
2010-12-24 Add minimum GC threshold option
128 Parrot_GC_Init_Args gc_args;
82cbd84b » Whiteknight
2010-11-18 parrot executable compiles, but miniparrot does not link. I need to s…
129 const Parrot_Interp parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
130 interp_raw = allocate_interpreter(parent_raw, flags);
131 if (args) {
400feaed » nwellnhof
2011-01-23 Merge branch 'master' into nwellnhof/gc_dynamic_threshold
132 gc_args.stacktop = args->stacktop
133 ? args->stacktop : &alt_stacktop;
134 gc_args.system = args->gc_system;
135 gc_args.dynamic_threshold = args->gc_dynamic_threshold;
136 gc_args.min_threshold = args->gc_min_threshold;
137
82cbd84b » Whiteknight
2010-11-18 parrot executable compiles, but miniparrot does not link. I need to s…
138 if (args->hash_seed)
139 interp_raw->hash_seed = args->hash_seed;
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
140 }
400feaed » nwellnhof
2011-01-23 Merge branch 'master' into nwellnhof/gc_dynamic_threshold
141 else {
142 memset(&gc_args, 0, sizeof (Parrot_GC_Init_Args));
143 gc_args.stacktop = &alt_stacktop;
144 }
9b2b6564 » nwellnhof
2010-12-24 Add minimum GC threshold option
145 initialize_interpreter(interp_raw, &gc_args);
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
146 *interp = VTABLE_get_pmc_keyed_int(
147 interp_raw, interp_raw->iglobals, (Parrot_Int)IGLOBALS_INTERPRETER);
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
148 return !PMC_IS_NULL(*interp);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
149 }
150
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
151 /*
152
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
153 =item C<Parrot_Int Parrot_api_set_runcore(Parrot_PMC interp_pmc, const char *
154 corename, Parrot_UInt trace)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
155
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
156 Sets the C<interp_pmc>'s bytecode running core, the core is specified by the
157 C<corename>. This function returns a true value if this call is successful and
158 false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
159
160 =cut
161
162 */
163
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
164 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
165 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
166 Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename),
167 Parrot_UInt trace)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
168 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
169 ASSERT_ARGS(Parrot_api_set_runcore)
3ea891ca » Mariano Wahlmann
2010-11-11 First round of syntax error fixes
170 EMBED_API_CALLIN(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
171 if (trace) {
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
172 Parrot_pcc_trace_flags_on(interp, interp->ctx, trace);
173 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
9703ef55 » jkeenan
2010-12-04 [codingstd] C-style coda needed. No cuddled elses.
174 }
175 else {
372f8f7b » bluescreen10
2010-11-28 Make bounds runcore available
176 if (!strcmp(corename, "slow") || !strcmp(corename, "bounds"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
177 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
178 else if (!strcmp(corename, "fast") ||
179 !strcmp(corename, "jit") || !strcmp(corename, "function"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
180 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
181 else if (!strcmp(corename, "exec"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
182 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
183 else if (!strcmp(corename, "trace"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
184 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
185 else if (!strcmp(corename, "profiling"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
186 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "profiling"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
187 else if (!strcmp(corename, "gcdebug"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
188 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "gcdebug"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
189 else
190 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Invalid runcore type %s", corename);
191 }
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
192 EMBED_API_CALLOUT(interp_pmc, interp)
193 }
194
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
195 /*
196
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
197 =item C<Parrot_Int Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int
198 flags, Parrot_Int set)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
199
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
200 Sets/Unsets the C<interp_pmc>'s debug flags. If C<set> is in a true value debug
201 flags are set otherwise debug flags are cleared. This function returns a true
202 value if this call is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
203
204 =cut
205
206 */
207
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
208 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
209 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
210 Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
211 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
212 ASSERT_ARGS(Parrot_api_debug_flag)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
213 EMBED_API_CALLIN(interp_pmc, interp)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
214 if (set)
215 interp->debug_flags |= flags;
216 else
217 interp->debug_flags &= ~flags;
218 EMBED_API_CALLOUT(interp_pmc, interp);
219 }
220
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
221 /*
222
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
223 =item C<Parrot_Int Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags,
224 Parrot_Int set)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
225
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
226 Set/Unset the C<interp_pmc>'s general flags. If C<set> is in a true value general
227 flags are set otherwise passed flags are cleared. This function returns a true
228 value if this call is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
229
230 =cut
231
232 */
233
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
234 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
235 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
236 Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
237 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
238 ASSERT_ARGS(Parrot_api_flag)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
239 EMBED_API_CALLIN(interp_pmc, interp)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
240 if (set) {
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
241 Interp_flags_SET(interp, flags);
242 if (flags & (PARROT_BOUNDS_FLAG | PARROT_PROFILE_FLAG))
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
243 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
244 }
245 else
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
246 Interp_flags_CLEAR(interp, flags);
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
247 EMBED_API_CALLOUT(interp_pmc, interp);
248 }
249
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
250 /*
251
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
252 =item C<Parrot_Int Parrot_api_set_executable_name(Parrot_PMC interp_pmc, const
253 char * name)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
254
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
255 Sets the executable name for the C<interp_pmc> interpreter. This function returns
256 a true value if this call is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
257
258 =cut
259
260 */
261
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
262 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
263 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
264 Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char * name))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
265 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
266 ASSERT_ARGS(Parrot_api_set_executable_name)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
267 EMBED_API_CALLIN(interp_pmc, interp)
9cc3acec » plobsing
2011-01-08 allow for unicode names of fakecutables
268 STRING * const name_str = Parrot_str_from_platform_cstring(interp, name);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
269 PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String);
1a692e98 » Whiteknight
2010-11-10 _set_executable_name takes a C string instead of a Parrot string, for…
270 VTABLE_set_string_native(interp, name_pmc, name_str);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
271 VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_EXECUTABLE,
272 name_pmc);
4a128d50 » Whiteknight
2010-11-09 lots of little changes
273 EMBED_API_CALLOUT(interp_pmc, interp);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
274 }
275
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
276 /*
277
278 =item C<Parrot_Int Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc)>
279
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
280 Destroys the C<interp_pmc> interpreter, freeing the memory structures allocated
281 for it. This function returns a true value if this call is successful and false
282 value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
283
284 =cut
285
286 */
287
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
288 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
289 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
290 Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
291 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
292 ASSERT_ARGS(Parrot_api_destroy_interpreter)
2dc51874 » nwellnhof
2010-12-25 [embed] Fix segfault with --leak-test option
293 Parrot_jump_buff env;
294 if (setjmp(env)) {
295 /* We can't check for potential errors because the interpreter
296 * might have been destroyed. */
297 return 1;
298 }
299 else {
ced54a52 » NotFound
2011-01-27 Fix remaining 'might be clobbered' warning
300 Interp * const interp = GET_INTERP(interp_pmc);
301 void * _oldtop = interp->lo_var_ptr;
302 if (_oldtop == NULL)
303 interp->lo_var_ptr = &_oldtop;
304 interp->api_jmp_buf = &env;
2dc51874 » nwellnhof
2010-12-25 [embed] Fix segfault with --leak-test option
305 Parrot_destroy(interp);
306 Parrot_x_exit(interp, 0);
307 /* Never reached, x_exit calls longjmp */
308 return 1;
309 }
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
310 }
311
312 /*
313
adc07e53 » nwellnhof
2011-01-18 Merge branch 'master' into nwellnhof/unicode_filenames
314 =item C<Parrot_Int Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc,
315 Parrot_String filename, Parrot_PMC * pbc)>
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
316
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
317 Load a bytecode file and stores the resulting bytecode in C<pbc>. This function
318 returns a true value if this call is successful and false value otherwise.
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
319
320 =cut
321
322 */
323
6be2b4aa » Whiteknight
2010-12-05 remove the ASSERT_ARGS stuff, and other things that are borking thebu…
324 /* TODO: This only works with the inital bytecode. After this we should use
d4cdba70 » Whiteknight
2011-01-14 remove .pbc loading logic from imcc_run, and move it into the parrot.…
325 Parrot_append_bytecode or something similar */
6be2b4aa » Whiteknight
2010-12-05 remove the ASSERT_ARGS stuff, and other things that are borking thebu…
326
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
327 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
328 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
329 Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc,
adc07e53 » nwellnhof
2011-01-18 Merge branch 'master' into nwellnhof/unicode_filenames
330 ARGIN(Parrot_String filename), ARGOUT(Parrot_PMC * pbc))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
331 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
332 ASSERT_ARGS(Parrot_api_load_bytecode_file)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
333 EMBED_API_CALLIN(interp_pmc, interp)
adc07e53 » nwellnhof
2011-01-18 Merge branch 'master' into nwellnhof/unicode_filenames
334 PackFile * const pf = PackFile_read_pbc(interp, filename, 0);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
335 if (!pf)
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
336 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_MALFORMED_PACKFILE,
337 "Could not load packfile");
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
338 do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
d9497e3f » bacek
2011-02-10 Apply patch from nwellnhof++ to disable GC during Packfile loading. W…
339 Parrot_block_GC_mark(interp);
950d7019 » Whiteknight
2010-11-19 Packfile PMCs don't do what I need them to do (yet). Use UnManagedStr…
340 *pbc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
d9497e3f » bacek
2011-02-10 Apply patch from nwellnhof++ to disable GC during Packfile loading. W…
341 Parrot_unblock_GC_mark(interp);
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
342 VTABLE_set_pointer(interp, *pbc, pf);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
343 EMBED_API_CALLOUT(interp_pmc, interp)
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
344 }
345
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
346 /*
347
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
348 =item C<Parrot_Int Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc, const
349 unsigned char * const pbc, Parrot_Int bytecode_size, Parrot_PMC * pbcpmc)>
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
350
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
351 Unpacks a bytecode from a buffer C<pbc> of a C<bytecode_size> size, and stores
352 the resulting bytecode in C<pbcpmc>. This function returns a true value if this
353 call is successful and false value otherwise.
36537842 » bluescreen10
2010-12-18 Embed API Documentation round 1
354
355 =cut
356
357 */
358
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
359 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
360 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
361 Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc,
362 ARGIN(const unsigned char * const pbc), Parrot_Int bytecode_size,
363 ARGOUT(Parrot_PMC * pbcpmc))
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
364 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
365 ASSERT_ARGS(Parrot_api_load_bytecode_bytes)
99428c28 » Mariano Wahlmann
2010-11-24 Make src/embed/pmc.c & src/embed/api.c compile with gcc
366 EMBED_API_CALLIN(interp_pmc, interp)
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
367 PackFile * const pf = PackFile_new(interp, 0);
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
368 PARROT_ASSERT(pf);
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
369
d9497e3f » bacek
2011-02-10 Apply patch from nwellnhof++ to disable GC during Packfile loading. W…
370 Parrot_block_GC_mark(interp);
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
371 if (!PackFile_unpack(interp, pf, (const opcode_t *)pbc, bytecode_size))
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
372 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_MALFORMED_PACKFILE,
f0c28dcd » Whiteknight
2011-02-07 Add in an API function so that we can reset and reuse an existing Cal…
373 "Could not unpack packfile");
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
374 do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
375 *pbcpmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
376 VTABLE_set_pointer(interp, *pbcpmc, pf);
d9497e3f » bacek
2011-02-10 Apply patch from nwellnhof++ to disable GC during Packfile loading. W…
377 Parrot_unblock_GC_mark(interp);
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
378 EMBED_API_CALLOUT(interp_pmc, interp);
379 }
380
6be2b4aa » Whiteknight
2010-12-05 remove the ASSERT_ARGS stuff, and other things that are borking thebu…
381 /* Load the bytecode into the interpreter, but don't execute it */
382 /* TODO: This only works with the inital bytecode. After this we should use
383 Parrot_append_bytecode or something similar */
384
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
385 /*
386
387 =item C<Parrot_Int Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC
388 pbc, Parrot_PMC *main_sub)>
389
390 Prepares the bytecode C<pbc> to be run and stores the entry point subroutine in
391 C<main_sub>. This function returns a true value if this call is successful and
392 false value otherwise.
393
394 =cut
395
396 */
397
709eae7a » Whiteknight
2010-12-04 add in a handful of additional API functions, though they aren't bein…
398 PARROT_API
399 Parrot_Int
400 Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
401 ARGOUT(Parrot_PMC *main_sub))
402 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
403 ASSERT_ARGS(Parrot_api_ready_bytecode)
709eae7a » Whiteknight
2010-12-04 add in a handful of additional API functions, though they aren't bein…
404 EMBED_API_CALLIN(interp_pmc, interp)
405 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
406
407 /* Debugging mode nonsense. */
408 if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
409 Parrot_io_eprintf(interp, "*** Parrot VM: %Ss core ***\n",
410 interp->run_core->name);
411 }
412
413 if (!pf)
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
414 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
415 "Could not get packfile.");
416 if (pf->cur_cs)
417 Parrot_pf_set_current_packfile(interp, pf);
709eae7a » Whiteknight
2010-12-04 add in a handful of additional API functions, though they aren't bein…
418 PackFile_fixup_subs(interp, PBC_MAIN, NULL);
419 *main_sub = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
420 Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table);
421 EMBED_API_CALLOUT(interp_pmc, interp)
422 }
423
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
424
425 /*
426
427 =item C<Parrot_Int Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC
428 pbc, Parrot_PMC mainargs)>
429
430 Runs the bytecode C<pbc> passing optional C<mainargs> parameters. This function
431 returns a true value if this call is successful and false value otherwise.
432
433 =cut
434
435 */
436
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
437 PARROT_API
438 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
439 Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
440 Parrot_PMC mainargs)
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
441 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
442 ASSERT_ARGS(Parrot_api_run_bytecode)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
443 EMBED_API_CALLIN(interp_pmc, interp)
98cd26c9 » Whiteknight
2010-11-19 don't call Parrot_pbc_load if the PBC comes straight out of IMCC. IMC…
444 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
9f7a94c5 » Whiteknight
2010-11-26 make sure to set :main() args in the iglobals array. This makes ops2c…
445
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
446 /* Debugging mode nonsense. */
447 if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
448 Parrot_io_eprintf(interp, "*** Parrot VM: %Ss core ***\n",
449 interp->run_core->name);
709eae7a » Whiteknight
2010-12-04 add in a handful of additional API functions, though they aren't bein…
450 }
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
451
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
452 if (!pf)
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
453 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
454 "Could not get packfile.");
2310551f » nwellnhof
2011-02-05 Fix assertion failure
455 if (!mainargs)
456 mainargs = PMCNULL;
240d5b77 » Whiteknight
2011-02-04 Add a new function to execute a PackFile* as a program
457 Parrot_pf_execute_bytecode_program(interp, pf, mainargs);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
458 EMBED_API_CALLOUT(interp_pmc, interp)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
459 }
4a128d50 » Whiteknight
2010-11-09 lots of little changes
460
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
461 /*
462
463 =item C<Parrot_Int Parrot_api_disassemble_bytecode(Parrot_PMC interp_pmc,
464 Parrot_PMC pbc, const char * const outfile, Parrot_Int opts)>
465
466 Disassembles and prints out the C<pbc> bytecode. This function returns a true
467 value if this call is successful and false value otherwise.
468
469 =cut
470
471 */
472
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
473 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
474 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
475 Parrot_api_disassemble_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
476 ARGIN_NULLOK(const char * const outfile), Parrot_Int opts)
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
477 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
478 ASSERT_ARGS(Parrot_api_disassemble_bytecode)
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
479 EMBED_API_CALLIN(interp_pmc, interp)
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
480 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
481 if (!pf)
fc0f7590 » Whiteknight
2011-01-13 Add some accessors for interp->initial_pf and interp->code to the pac…
482 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
483 "Could not get packfile.");
484 if (pf->cur_cs)
485 Parrot_pf_set_current_packfile(interp, pf);
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
486 /* TODO: Break up the dependency with emebed.c */
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
487 Parrot_disassemble(interp, outfile, (Parrot_disassemble_options)opts);
488 EMBED_API_CALLOUT(interp_pmc, interp);
489 }
490
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
491 /*
492
31792fae » Whiteknight
2011-01-14 Add a new API function to serialize a packfile PMC into a format suit…
493 =item C<Parrot_Int Parrot_api_serialize_bytecode_pmc(Parrot_PMC interp_pmc,
494 Parrot_PMC pbc, Parrot_String * bc)>
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
495
31792fae » Whiteknight
2011-01-14 Add a new API function to serialize a packfile PMC into a format suit…
496 Serialize a packfile PMC into a sequence of bytes suitable for writing out
497 to a .pbc file
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
498
499 =cut
500
501 */
502
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
503 PARROT_API
504 Parrot_Int
31792fae » Whiteknight
2011-01-14 Add a new API function to serialize a packfile PMC into a format suit…
505 Parrot_api_serialize_bytecode_pmc(Parrot_PMC interp_pmc, Parrot_PMC pbc,
506 ARGOUT(Parrot_String * bc))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
507 {
31792fae » Whiteknight
2011-01-14 Add a new API function to serialize a packfile PMC into a format suit…
508 ASSERT_ARGS(Parrot_api_serialize_bytecode_pmc)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
509 EMBED_API_CALLIN(interp_pmc, interp)
31792fae » Whiteknight
2011-01-14 Add a new API function to serialize a packfile PMC into a format suit…
510 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
511 if (!pf)
512 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
513 "Could not get packfile.");
514 else {
515 const Parrot_Int size = PackFile_pack_size(interp, pf) * sizeof (opcode_t);
516 opcode_t * const packed = (opcode_t*) mem_sys_allocate(size);
517 PackFile_pack(interp, pf, packed);
518 *bc = Parrot_str_new_init(interp, (const char *)packed, size,
519 Parrot_binary_encoding_ptr, 0);
520 }
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
521 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
522 }
523
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
524 /*
525
526 =item C<Parrot_Int Parrot_api_set_warnings(Parrot_PMC interp_pmc, Parrot_Int
527 flags)>
528
529 Enables C<inter_pmc>'s warning messages the type of warning information to be
530 print out is specified by C<flags>. This function returns a true value if this
531 call is successful and false value otherwise.
532
533 =cut
534
535 */
536
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
537 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
538 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
539 Parrot_api_set_warnings(Parrot_PMC interp_pmc, Parrot_Int flags)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
540 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
541 ASSERT_ARGS(Parrot_api_set_warnings)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
542 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
543 /* Activates the given warnings. (Macro from warnings.h.) */
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
544 PARROT_WARNINGS_on(interp, flags);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
545 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
546 }
547
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
548 /*
549
550 =item C<Parrot_Int Parrot_api_add_library_search_path(Parrot_PMC interp_pmc,
551 const char *path)>
552
553 Adds C<path> to the C<inter_pmc>'s library search path list. This function
554 returns a true value if this call is successful and false value otherwise.
555
556 =cut
557
558 */
559
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
560 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
561 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
562 Parrot_api_add_library_search_path(Parrot_PMC interp_pmc,
563 ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
564 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
565 ASSERT_ARGS(Parrot_api_add_library_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
566 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
567 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_LIBRARY);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
568 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
569 }
570
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
571 /*
572
573 =item C<Parrot_Int Parrot_api_add_include_search_path(Parrot_PMC interp_pmc,
574 const char *path)>
575
576 Adds C<path> to the C<inter_pmc>'s include search path list. This function
577 returns a true value if this call is successful and false value otherwise.
578
579 =cut
580
581 */
582
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
583 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
584 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
585 Parrot_api_add_include_search_path(Parrot_PMC interp_pmc,
586 ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
587 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
588 ASSERT_ARGS(Parrot_api_add_include_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
589 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
590 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_INCLUDE);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
591 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
592 }
593
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
594 /*
595
596 =item C<Parrot_Int Parrot_api_add_dynext_search_path(Parrot_PMC interp_pmc,
597 const char *path)>
598
599 Adds C<path> to the C<inter_pmc>'s dynext search path list. This function
600 returns a true value if this call is successful and false value otherwise.
601
602 =cut
603
604 */
605
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
606 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
607 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
608 Parrot_api_add_dynext_search_path(Parrot_PMC interp_pmc,
609 ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
610 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
611 ASSERT_ARGS(Parrot_api_add_dynext_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
612 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
613 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_DYNEXT);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
614 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
615 }
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
616
617 /*
618
c7def2f5 » jkeenan
2010-12-06 Run 'perl tools/dev/headerizer.pl src/embed/api.o'.
619 =item C<Parrot_Int Parrot_api_set_stdhandles(Parrot_PMC interp_pmc, Parrot_Int
620 in, Parrot_Int out, Parrot_Int err)>
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
621
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
622 Set the C<interp_pmc>'s standard file descriptors STDIN, STDOUT, STDERR. Any
623 file descriptor set to C<PIO_INVALID_HANDLE> is ignored. This function returns
624 a true value if this call is successful and false value otherwise.
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
625
626 =cut
627
628 */
f30aa2fb » kapace
2011-01-07 Added some tests for embed api, get/set compiler and commented set_st…
629 /* Whiteknight told me that theres no way to test this for now, so it should be
630 commented out, for now.
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
631
632 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
633 Parrot_Int
aef7ea18 » Mariano Wahlmann
2010-12-06 Fixed stdin,stdout and stderr Andy++ pointed out
634 Parrot_api_set_stdhandles(Parrot_PMC interp_pmc, Parrot_Int in,
635 Parrot_Int out, Parrot_Int err)
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
636 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
637 ASSERT_ARGS(Parrot_api_set_stdhandles)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
638 EMBED_API_CALLIN(interp_pmc, interp)
639 void *dummy;
640
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
641 if (PIO_INVALID_HANDLE != (PIOHANDLE)in) {
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
642 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
aef7ea18 » Mariano Wahlmann
2010-12-06 Fixed stdin,stdout and stderr Andy++ pointed out
643 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)in);
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
644 dummy = (void *)Parrot_io_stdhandle(interp, PIO_STDIN_FILENO, pmc);
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
645 }
646
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
647 if (PIO_INVALID_HANDLE != (PIOHANDLE)out) {
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
648 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
aef7ea18 » Mariano Wahlmann
2010-12-06 Fixed stdin,stdout and stderr Andy++ pointed out
649 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)out);
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
650 dummy = (void *)Parrot_io_stdhandle(interp, PIO_STDOUT_FILENO, pmc);
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
651 }
652
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
653 if (PIO_INVALID_HANDLE != (PIOHANDLE)err) {
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
654 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
aef7ea18 » Mariano Wahlmann
2010-12-06 Fixed stdin,stdout and stderr Andy++ pointed out
655 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)err);
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
656 dummy = (void *)Parrot_io_stdhandle(interp, PIO_STDERR_FILENO, pmc);
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
657 }
16e368de » Whiteknight
2010-12-13 fix several build warnings in src/embed/* in gcc, g++, and icc
658 UNUSED(dummy);
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
659
660 EMBED_API_CALLOUT(interp_pmc, interp)
f30aa2fb » kapace
2011-01-07 Added some tests for embed api, get/set compiler and commented set_st…
661 }*/
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
662
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
663 /*
664
665 =item C<Parrot_Int Parrot_api_get_runtime_path(Parrot_PMC interp_pmc,
666 Parrot_String *runtime)>
667
668 Stores in C<runtime> the C<interp_pmc>'s running path. This function returns a
669 true value if this call is successful and false value otherwise.
670
671 =cut
672
673 */
674
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
675 PARROT_API
676 Parrot_Int
1216a51d » Whiteknight
2010-12-04 quick initial pass for codestd
677 Parrot_api_get_runtime_path(Parrot_PMC interp_pmc,
678 ARGOUT(Parrot_String *runtime))
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
679 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
680 ASSERT_ARGS(Parrot_api_get_runtime_path)
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
681 EMBED_API_CALLIN(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
682 *runtime = Parrot_get_runtime_path(interp);
683 EMBED_API_CALLOUT(interp_pmc, interp);
684 }
685
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
686 /*
687
688 =item C<Parrot_Int Parrot_api_set_configuration_hash(Parrot_PMC interp_pmc,
689 Parrot_PMC confighash)>
690
691 Sets the C<interp_pmc>'s configuration hash passed in C<confighash>. This
692 function returns a true value if this call is successful and false value
693 otherwise.
694
695 =cut
696
697 */
698
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
699 PARROT_API
700 Parrot_Int
701 Parrot_api_set_configuration_hash(Parrot_PMC interp_pmc, Parrot_PMC confighash)
702 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
703 ASSERT_ARGS(Parrot_api_set_configuration_hash)
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
704 EMBED_API_CALLIN(interp_pmc, interp)
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
705 Parrot_set_config_hash_pmc(interp, confighash);
5c2c3d48 » Whiteknight
2010-11-23 fix library paths. The build now progresses through all the parts tha…
706 Parrot_lib_update_paths_from_config_hash(interp);
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
707 EMBED_API_CALLOUT(interp_pmc, interp);
708 }
709
e1ced3e3 » Whiteknight
2010-12-04 add a note explaining this stupid function
710 /*
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
711
903db1c2 » nwellnhof
2011-01-08 [imcc] Switch to PIO and STRING filenames for all input files
712 =item C<Parrot_Int Parrot_api_wrap_imcc_hack(Parrot_PMC interp_pmc,
713 Parrot_String sourcefile, int argc, const char **argv, Parrot_PMC* bytecodepmc,
714 int *result, imcc_hack_func_t func)>
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
715
716 WARNING: This is an evil hack to provide a wrapper around IMCC to catch unhandled
717 exceptions without having to assume IMCC is linked in with libparrot. Delete this
718 as soon as we don't need it anymore.
719
720 This function returns a true value if this call is successful and false value
721 otherwise.
722
723 =cut
724
e1ced3e3 » Whiteknight
2010-12-04 add a note explaining this stupid function
725 */
726
5b6a239a » Whiteknight
2010-12-04 Add a new, temporary hack API for wrapping up IMCC so we can catch er…
727 PARROT_API
728 Parrot_Int
903db1c2 » nwellnhof
2011-01-08 [imcc] Switch to PIO and STRING filenames for all input files
729 Parrot_api_wrap_imcc_hack(Parrot_PMC interp_pmc, ARGIN(Parrot_String sourcefile),
ca855f2c » Whiteknight
2011-01-16 implement the test for Parrot_api_serialize_bytecode_pmc. Fix some AR…
730 int argc, ARGIN_NULLOK(const char **argv), ARGMOD(Parrot_PMC* bytecodepmc),
eaf402c6 » nwellnhof
2010-12-30 Fix headerizer warnings
731 ARGOUT(int *result), imcc_hack_func_t func)
5b6a239a » Whiteknight
2010-12-04 Add a new, temporary hack API for wrapping up IMCC so we can catch er…
732 {
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
733 ASSERT_ARGS(Parrot_api_wrap_imcc_hack)
5b6a239a » Whiteknight
2010-12-04 Add a new, temporary hack API for wrapping up IMCC so we can catch er…
734 EMBED_API_CALLIN(interp_pmc, interp)
735 *result = func(interp_pmc, sourcefile, argc, argv, bytecodepmc);
736 EMBED_API_CALLOUT(interp_pmc, interp)
737 }
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
738
7db7331c » jkeenan
2010-12-04 Correct C-comment syntax error.
739 /*
740
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
741 =item C<Parrot_Int Parrot_api_load_language(Parrot_PMC interp_pmc, Parrot_String
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
742 lang)>
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
743
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
744 Loads the HLL compiler libraries for C<lang> into the C<interp_pmc>. This
745 function returns a true value if this call is successful and false value
746 otherwise.
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
747
748 =cut
749
750 */
751
752 PARROT_API
753 Parrot_Int
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
754 Parrot_api_load_language(Parrot_PMC interp_pmc, Parrot_String lang)
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
755 {
756 ASSERT_ARGS(Parrot_api_load_language)
757 EMBED_API_CALLIN(interp_pmc, interp)
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
758 Parrot_load_language(interp, lang);
759 EMBED_API_CALLOUT(interp_pmc, interp);
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
760 }
761
762 /*
763
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
764 =item C<Parrot_Int Parrot_api_get_compiler(Parrot_PMC interp_pmc, Parrot_String
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
765 type, Parrot_PMC *compiler)>
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
766
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
767 Gets the compiler PMC and stores it in C<compiler>. This function returns a true
768 value if this call is successful and false value otherwise.
769
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
770 =cut
771
772 */
773
774 PARROT_API
775 Parrot_Int
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
776 Parrot_api_get_compiler(Parrot_PMC interp_pmc, Parrot_String type,
777 ARGOUT(Parrot_PMC *compiler))
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
778 {
779 ASSERT_ARGS(Parrot_api_get_compiler)
780 EMBED_API_CALLIN(interp_pmc, interp)
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
781 *compiler = Parrot_get_compiler(interp, type);
782 EMBED_API_CALLOUT(interp_pmc, interp);
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
783 }
784
785 /*
786
787 =item C<Parrot_Int Parrot_api_set_compiler(Parrot_PMC interp_pmc, Parrot_String
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
788 type, Parrot_PMC compiler)>
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
789
cc0610ab » bluescreen10
2010-12-19 Fixed codigstd tests
790 Sets the C<compiler> object for the C<type> files. This function returns a true
791 value if this call is successful and false value otherwise.
792
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
793 =cut
794
795 */
796
797 PARROT_API
798 Parrot_Int
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
799 Parrot_api_set_compiler(Parrot_PMC interp_pmc, Parrot_String type,
800 Parrot_PMC compiler)
f0bd1e1c » Mariano Wahlmann
2010-12-06 First cut of load_language, set_compiler, get compiler
801 {
802 ASSERT_ARGS(Parrot_api_set_compiler)
803 EMBED_API_CALLIN(interp_pmc, interp)
d74cf453 » Whiteknight
2010-12-12 fix build warnings in src/embed/api.c
804 Parrot_set_compiler(interp, type, compiler);
255a8d8f » Whiteknight
2011-01-16 move -G commandline argument parsing from IMCC into the frontend
805 EMBED_API_CALLOUT(interp_pmc, interp)
3562b6b4 » Mariano Wahlmann
2010-12-05 Unfished work implemented API functions
806 }
0814f941 » Mariano Wahlmann
2010-12-05 Merged changes with branch
807
255a8d8f » Whiteknight
2011-01-16 move -G commandline argument parsing from IMCC into the frontend
808 /*
809
810 =item C<Parrot_Int Parrot_api_toggle_gc(Parrot_PMC interp_pmc, Parrot_Int on)>
811
812 Turn Parrot's GC on or off.
813
814 =cut
815
816 */
817
818 PARROT_API
819 Parrot_Int
820 Parrot_api_toggle_gc(Parrot_PMC interp_pmc, Parrot_Int on)
821 {
822 ASSERT_ARGS(Parrot_api_toggle_gc)
823 EMBED_API_CALLIN(interp_pmc, interp)
824 if (on) {
825 Parrot_unblock_GC_mark(interp);
826 Parrot_unblock_GC_sweep(interp);
827 }
828 else {
829 Parrot_block_GC_mark(interp);
830 Parrot_block_GC_sweep(interp);
831 }
832 EMBED_API_CALLOUT(interp_pmc, interp)
833 }
6f90f7de » nol888
2010-12-17 Add API functions to get a class from an array, and to instantiate a …
834
c6fa8b73 » mikehh
2011-02-08 fix codetest failures - add c function docs and ASSERT_ARGS
835 /*
836
837 =item C<Parrot_Int Parrot_api_reset_call_signature(Parrot_PMC interp_pmc,
838 Parrot_PMC ctx)>
839
840 Reset the call signature
841
842 =cut
843
844 */
845
f0c28dcd » Whiteknight
2011-02-07 Add in an API function so that we can reset and reuse an existing Cal…
846 PARROT_API
847 Parrot_Int
848 Parrot_api_reset_call_signature(Parrot_PMC interp_pmc, Parrot_PMC ctx)
849 {
c6fa8b73 » mikehh
2011-02-08 fix codetest failures - add c function docs and ASSERT_ARGS
850 ASSERT_ARGS(Parrot_api_reset_call_signature)
f0c28dcd » Whiteknight
2011-02-07 Add in an API function so that we can reset and reuse an existing Cal…
851 EMBED_API_CALLIN(interp_pmc, interp)
852 STRING * const callcontext = Parrot_str_new(interp, "CallContext", 0);
853 if (!VTABLE_isa(interp, ctx, callcontext))
854 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
855 "Not a valid CallContext");
856 VTABLE_morph(interp, ctx, PMCNULL);
857 EMBED_API_CALLOUT(interp_pmc, interp)
858 }
859
0814f941 » Mariano Wahlmann
2010-12-05 Merged changes with branch
860 /*
861
027abfaa » Whiteknight
2011-03-02 add two new API functions for dealing with opaque user data pointers
862 =item C<Parrot_Int Parrot_api_wrap_pointer(Parrot_PMC interp_pmc, void *ptr,
863 Parrot_Int size, Parrot_PMC *pmc)>
864
865 Wrap a user data pointer into a Ptr PMC for passing into Parrot. This PMC
866 is designed such that Parrot will treat the pointer as being opaque and will
867 not attempt to dereference, examine, or manipulate it at all.
868
869 Optionally a C<size> parameter can be passed. If C<size> is greater than zero,
870 the size information will be included with the pointer for later use. If
871 C<size> is less than or equal to zero, it will be ignored and will not be
872 included in the PMC object.
873
54d50264 » plobsing
2011-03-02 [codetest] correct format of C function doc =item
874 =item C<Parrot_Int Parrot_api_unwrap_pointer(Parrot_PMC interp_pmc, Parrot_PMC
875 pmc, void ** ptr, Parrot_Int * size)>
027abfaa » Whiteknight
2011-03-02 add two new API functions for dealing with opaque user data pointers
876
877 Return a pointer from a PMC. This is typically used in conjunction with
878 C<Parrot_api_wrap_pointer> to return the original wrapped pointer value from
879 the PMC. Used with other PMC types besides C<Ptr> or C<PtrBuf> will have
880 undefined results, and should not be used or relied upon.
881
882 If the pointer was stored with size information, C<size> will contain that
883 size value. Otherwise, C<size> will be -1.
884
885 Notice that this function does not destroy or alter the data PMC.
886
887 =cut
888
889 */
890
891 PARROT_API
892 Parrot_Int
893 Parrot_api_wrap_pointer(Parrot_PMC interp_pmc, ARGIN_NULLOK(void *ptr),
894 Parrot_Int size, ARGOUT(Parrot_PMC *pmc))
895 {
896 ASSERT_ARGS(Parrot_api_wrap_pointer)
897 EMBED_API_CALLIN(interp_pmc, interp)
898 PMC * ptr_pmc = NULL;
899 if (size > 0) {
900 ptr_pmc = Parrot_pmc_new(interp, enum_class_PtrBuf);
b65a8ba6 » bacek
2011-03-03 Fix braino in api_wrap/unwrap_pointer.
901 VTABLE_set_integer_native(interp, ptr_pmc, size);
edc686b8 » plobsing
2011-03-02 cuddled else
902 }
903 else
027abfaa » Whiteknight
2011-03-02 add two new API functions for dealing with opaque user data pointers
904 ptr_pmc = Parrot_pmc_new(interp, enum_class_Ptr);
b65a8ba6 » bacek
2011-03-03 Fix braino in api_wrap/unwrap_pointer.
905 VTABLE_set_pointer(interp, ptr_pmc, ptr);
027abfaa » Whiteknight
2011-03-02 add two new API functions for dealing with opaque user data pointers
906 *pmc = ptr_pmc;
907 EMBED_API_CALLOUT(interp_pmc, interp)
908 }
909
910 PARROT_API
911 Parrot_Int
912 Parrot_api_unwrap_pointer(Parrot_PMC interp_pmc, Parrot_PMC pmc,
913 ARGOUT(void ** ptr), ARGOUT(Parrot_Int * size))
914 {
915 ASSERT_ARGS(Parrot_api_unwrap_pointer)
916 EMBED_API_CALLIN(interp_pmc, interp)
917 *ptr = VTABLE_get_pointer(interp, pmc);
918 if (pmc->vtable->base_type == enum_class_PtrBuf)
919 *size = VTABLE_get_integer(interp, pmc);
920 else
921 *size = -1;
922 EMBED_API_CALLOUT(interp_pmc, interp);
923 }
924
925 /*
926
1311ceca » jkeenan
2010-12-11 [codingstd] Fix files so they pass c_operator, c_parens, pod_syntax, and
927 =back
928
9703ef55 » jkeenan
2010-12-04 [codingstd] C-style coda needed. No cuddled elses.
929 =cut
0814f941 » Mariano Wahlmann
2010-12-05 Merged changes with branch
930
7db7331c » jkeenan
2010-12-04 Correct C-comment syntax error.
931 */
9703ef55 » jkeenan
2010-12-04 [codingstd] C-style coda needed. No cuddled elses.
932
540a832b » jkeenan
2010-12-04 [codingstd] Mostly linelength fixes.
933 /*
934 * Local variables:
935 * c-file-style: "parrot"
936 * End:
937 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
938 */
0814f941 » Mariano Wahlmann
2010-12-05 Merged changes with branch
939
Something went wrong with that request. Please try again.