Skip to content
Newer
Older
100644 1339 lines (943 sloc) 24.1 KB
3e1f322 Inline docs update
Michael Scott authored
1 /*
76c4c09 @chromatic [External] Explicitly export external API symbols.
chromatic authored
2 Copyright (C) 2001-2007, The Perl Foundation.
3e1f322 Inline docs update
Michael Scott authored
3 $Id$
4
5 =head1 NAME
6
7 src/extend.c - Parrot extension interface
8
9 =head1 DESCRIPTION
99b337c start of actual extension routines and docs
Dan Sugalski authored
10
3e1f322 Inline docs update
Michael Scott authored
11 These are the functions that parrot extensions (i.e. parrot subroutines
12 written in C, or some other compiled language, rather than in parrot
13 bytecode) may access.
14
15 There is a deliberate distancing from the internals here. Don't go
16 peeking inside -- you've as much access as bytecode does, but no more,
17 so we can provide backwards compatibility for as long as we possibly
18 can.
19
20 =head2 Functions
21
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
22 =over 4
23
24 =cut
25
3e1f322 Inline docs update
Michael Scott authored
26 */
99b337c start of actual extension routines and docs
Dan Sugalski authored
27
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
28 /* Some internal notes. Parrot will die a horrible and bizarre death
29 if the stack start pointer's not set and a DOD run is
30 triggered. The pointer *will* be set by the interpreter if the
31 interpreter calls code which calls these functions, so most
32 extension code is safe, no problem.
33
34 The problem comes in if these routines are called from *outside*
35 an interpreter. This happens when an embedding application calls
36 them to do stuff with PMCs, STRINGS, interpreter contents, and
37 suchlike things. This is perfectly legal -- in fact it's what
38 we've documented should be done -- but the problem is that the
39 stack base pointer will be NULL. This is Very Bad.
40
41 To deal with this there are two macros that are defined to handle
42 the problem.
43
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
44 PARROT_CALLIN_START(interp) will figure out if the stack
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
45 anchor needs setting and, if so, will set it. It must *always*
46 come immediately after the last variable declared in the block
47 making the calls into the interpreter, as it declares a variable
48 and has some code.
49
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
50 PARROT_CALLIN_END(interp) will put the stack anchor back to
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
51 the way it was, and should always be the last statement before a
52 return. (If you have multiple returns have it in multiple times)
53
54 Not doing this is a good way to introduce bizarre heisenbugs, so
55 just do it. This is the only place they ought to have to be put
56 in, and most of the functions are already written, so it's not
57 like it's an onerous requirement.
58
59 */
60
99b337c start of actual extension routines and docs
Dan Sugalski authored
61 #include "parrot/parrot.h"
62 #include "parrot/extend.h"
63
490c1c6 @petdance Changed HEADERIZER TARGET to HEADERIZER HFILE
petdance authored
64 /* HEADERIZER HFILE: include/parrot/extend.h */
df5e1a1 @petdance lie to the headerizer
petdance authored
65
3e1f322 Inline docs update
Michael Scott authored
66 /*
67
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
68 =item C<int Parrot_vfprintf>
69
70 Writes a C string format with a varargs list to a PIO.
71
72 =item C<int Parrot_fprintf>
73
74 Writes a C string format with varargs to a PIO.
75
76 =item C<int Parrot_printf>
77
78 Writes a C string format with varargs to C<stdout>.
79
80 =item C<int Parrot_eprintf>
81
82 Writes a C string format with varargs to C<stderr>.
83
fb2ca1e @NotFound fix lack of cut in a pod comment
NotFound authored
84 =cut
85
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
86 */
87
88 PARROT_API
89 int
90 Parrot_vfprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
91 ARGIN(const char *s), va_list args)
92 {
93 STRING * str;
94 INTVAL retval;
95
96 PARROT_CALLIN_START(interp);
97 str = Parrot_vsprintf_c(interp, s, args);
98 retval = PIO_putps(interp, pio, str);
99 PARROT_CALLIN_END(interp);
100
101 return retval;
102 }
103
104 PARROT_API
105 int
106 Parrot_fprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
107 ARGIN(const char *s), ...)
108 {
109 va_list args;
110 INTVAL retval;
111
112 va_start(args, s);
113 retval = Parrot_vfprintf(interp, pio, s, args);
114 va_end(args);
115
116 return retval;
117 }
118
119 PARROT_API
120 int
121 Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...)
122 {
123 va_list args;
124 INTVAL retval;
125 va_start(args, s);
126
127 if (interp) {
128 retval = Parrot_vfprintf(interp, PIO_STDOUT(interp), s, args);
129 }
130 else {
131 /* Be nice about this...
132 ** XXX BD Should this use the default PIO_STDOUT or something?
133 */
134 retval = vfprintf(stdout, s, args);
135 }
136 va_end(args);
137
138 return retval;
139 }
140
141 PARROT_API
142 int
143 Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...)
144 {
145 va_list args;
146 INTVAL retval;
147
148 va_start(args, s);
149
150 if (interp) {
151 retval = Parrot_vfprintf(interp, PIO_STDERR(interp), s, args);
152 }
153 else {
154 /* Be nice about this...
155 ** XXX BD Should this use the default PIO_STDOUT or something?
156 */
157 retval=vfprintf(stderr, s, args);
158 }
159
160 va_end(args);
161
162 return retval;
163 }
164
165 /*
166
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
167 =item C<Parrot_String Parrot_PMC_get_string_intkey>
9b7e2b7 Add missing Parrot_PMC_get_string_intkey function
Simon Glover authored
168
169 Return the integer keyed string value of the passed-in PMC
170
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
171 =cut
172
9b7e2b7 Add missing Parrot_PMC_get_string_intkey function
Simon Glover authored
173 */
174
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
175 PARROT_API
176 Parrot_String
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
177 Parrot_PMC_get_string_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
178 Parrot_PMC pmc, Parrot_Int key)
179 {
ef4c70a @chromatic Sanitize external interface, mostly by changing Parrot_STRING to Parr…
chromatic authored
180 Parrot_String retval;
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
181 PARROT_CALLIN_START(interp);
182 retval = VTABLE_get_string_keyed_int(interp, pmc, key);
183 PARROT_CALLIN_END(interp);
184 return retval;
9b7e2b7 Add missing Parrot_PMC_get_string_intkey function
Simon Glover authored
185 }
186
187
188 /*
189
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
190 =item C<void * Parrot_PMC_get_pointer_intkey>
3e1f322 Inline docs update
Michael Scott authored
191
faaf609 @bschmalhofer Correct documentation of Parrot_PMC_get_pointer_intkey()
bschmalhofer authored
192 Return a pointer to the PMC indicated by an integer key.
3e1f322 Inline docs update
Michael Scott authored
193
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
194 =cut
195
3e1f322 Inline docs update
Michael Scott authored
196 */
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
197
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
198 PARROT_API
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
199 PARROT_WARN_UNUSED_RESULT
200 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
201 void *
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
202 Parrot_PMC_get_pointer_intkey(PARROT_INTERP,
1d5d0f2 @petdance Fixed declaration of Parrot_PMC_get_pointer_intkey
petdance authored
203 Parrot_PMC pmc, Parrot_Int key)
204 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
205 void *retval;
206 PARROT_CALLIN_START(interp);
207 retval = VTABLE_get_pointer_keyed_int(interp, pmc, key);
208 PARROT_CALLIN_END(interp);
209 return retval;
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
210 }
211
3e1f322 Inline docs update
Michael Scott authored
212 /*
213
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
214 =item C<Parrot_PMC Parrot_PMC_get_pmc_intkey>
3e1f322 Inline docs update
Michael Scott authored
215
216 Return the integer keyed PMC value of the passed-in PMC
217
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
218 =cut
219
3e1f322 Inline docs update
Michael Scott authored
220 */
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
221
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
222 PARROT_API
223 Parrot_PMC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
224 Parrot_PMC_get_pmc_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
225 Parrot_PMC pmc, Parrot_Int key)
226 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
227 Parrot_PMC retval;
228 PARROT_CALLIN_START(interp);
229 retval = VTABLE_get_pmc_keyed_int(interp, pmc, key);
230 PARROT_CALLIN_END(interp);
231 return retval;
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
232 }
233
3e1f322 Inline docs update
Michael Scott authored
234 /*
235
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
236 =item C<Parrot_Int Parrot_PMC_get_intval>
3e1f322 Inline docs update
Michael Scott authored
237
238 Return the signed integer value of the value in the PMC.
239
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
240 =cut
241
3e1f322 Inline docs update
Michael Scott authored
242 */
99b337c start of actual extension routines and docs
Dan Sugalski authored
243
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
244 PARROT_API
245 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
246 Parrot_PMC_get_intval(PARROT_INTERP, Parrot_PMC pmc)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
247 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
248 Parrot_Int retval;
249 PARROT_CALLIN_START(interp);
250 retval = VTABLE_get_integer(interp, pmc);
251 PARROT_CALLIN_END(interp);
252 return retval;
99b337c start of actual extension routines and docs
Dan Sugalski authored
253 }
254
3e1f322 Inline docs update
Michael Scott authored
255 /*
256
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
257 =item C<Parrot_Int Parrot_PMC_get_intval_intkey>
3e1f322 Inline docs update
Michael Scott authored
258
259 Return the keyed, signed integer value of the value in the PMC.
260
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
261 =cut
262
3e1f322 Inline docs update
Michael Scott authored
263 */
808faf0 Add integer keyed get/set for ints, for Ponie
Dan Sugalski authored
264
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
265 PARROT_API
266 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
267 Parrot_PMC_get_intval_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
268 Parrot_PMC pmc, Parrot_Int key)
269 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
270 Parrot_Int retval;
271 PARROT_CALLIN_START(interp);
272 retval = VTABLE_get_integer_keyed_int(interp, pmc, key);
273 PARROT_CALLIN_END(interp);
274 return retval;
808faf0 Add integer keyed get/set for ints, for Ponie
Dan Sugalski authored
275 }
276
3e1f322 Inline docs update
Michael Scott authored
277 /*
278
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
279 =item C<Parrot_Int Parrot_PMC_get_intval_pmckey>
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
280
281 Return the keyed, signed integer value of the value in the PMC.
282
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
283 =cut
284
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
285 */
286
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
287 PARROT_API
288 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
289 Parrot_PMC_get_intval_pmckey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
290 Parrot_PMC pmc, Parrot_PMC key)
291 {
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
292 Parrot_Int retval;
293 PARROT_CALLIN_START(interp);
294 retval = VTABLE_get_integer_keyed(interp, pmc, key);
295 PARROT_CALLIN_END(interp);
296 return retval;
297 }
298
299 /*
300
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
301 =item C<Parrot_Float Parrot_PMC_get_numval>
3e1f322 Inline docs update
Michael Scott authored
302
303 Return the floating-point value of the PMC.
304
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
305 =cut
306
3e1f322 Inline docs update
Michael Scott authored
307 */
99b337c start of actual extension routines and docs
Dan Sugalski authored
308
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
309 PARROT_API
310 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
311 Parrot_PMC_get_numval(PARROT_INTERP, Parrot_PMC pmc)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
312 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
313 Parrot_Float retval;
314 PARROT_CALLIN_START(interp);
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
315 retval = VTABLE_get_number(interp, pmc);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
316 PARROT_CALLIN_END(interp);
317 return retval;
fa999b0 First chunk of extension code done
Dan Sugalski authored
318 }
319
3e1f322 Inline docs update
Michael Scott authored
320 /*
321
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
322 =item C<Parrot_Float Parrot_PMC_get_numval_intkey>
3e1f322 Inline docs update
Michael Scott authored
323
324 Return the keyed, signed integer value of the value in the PMC.
325
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
326 =cut
327
3e1f322 Inline docs update
Michael Scott authored
328 */
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
329
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
330 PARROT_API
331 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
332 Parrot_PMC_get_numval_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
333 Parrot_PMC pmc, Parrot_Int key)
334 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
335 Parrot_Float retval;
336 PARROT_CALLIN_START(interp);
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
337 retval = VTABLE_get_number_keyed_int(interp, pmc, key);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
338 PARROT_CALLIN_END(interp);
339 return retval;
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
340 }
341
3e1f322 Inline docs update
Michael Scott authored
342 /*
343
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
344 =item C<char * Parrot_PMC_get_cstring_intkey>
3e1f322 Inline docs update
Michael Scott authored
345
346 Return a null-terminated string that represents the string value of the PMC.
347
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
348 Note that you must free this string with C<string_cstring_free()>!
349
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
350 =cut
351
3e1f322 Inline docs update
Michael Scott authored
352 */
353
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
354 PARROT_API
5fd22eb @petdance Converted vast numbers of old-style WARN_UNUSED, CONST, PURE decorati…
petdance authored
355 PARROT_MALLOC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
356 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
357 char *
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
358 Parrot_PMC_get_cstring_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
359 Parrot_PMC pmc, Parrot_Int key)
360 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
361 STRING *intermediate;
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
362 char *retval;
363
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
364 PARROT_CALLIN_START(interp);
365 intermediate = VTABLE_get_string_keyed_int(interp, pmc, key);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
366 retval = string_to_cstring(interp, intermediate);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
367 PARROT_CALLIN_END(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
368
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
369 return retval;
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
370 }
371
3e1f322 Inline docs update
Michael Scott authored
372 /*
373
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
374 =item C<char * Parrot_PMC_get_cstring>
3e1f322 Inline docs update
Michael Scott authored
375
376 Return a null-terminated string that represents the string value of the PMC.
377
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
378 Note that you must free this string with C<string_cstring_free()>!
379
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
380 =cut
381
3e1f322 Inline docs update
Michael Scott authored
382 */
383
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
384 PARROT_API
5fd22eb @petdance Converted vast numbers of old-style WARN_UNUSED, CONST, PURE decorati…
petdance authored
385 PARROT_MALLOC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
386 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
387 char *
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
388 Parrot_PMC_get_cstring(PARROT_INTERP, Parrot_PMC pmc)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
389 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
390 STRING *intermediate;
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
391 char *retval;
392
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
393 PARROT_CALLIN_START(interp);
394 intermediate = VTABLE_get_string(interp, pmc);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
395 retval = string_to_cstring(interp, intermediate);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
396 PARROT_CALLIN_END(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
397
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
398 return retval;
fa999b0 First chunk of extension code done
Dan Sugalski authored
399 }
400
3e1f322 Inline docs update
Michael Scott authored
401 /*
402
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
403 =item C<char * Parrot_PMC_get_cstringn>
3e1f322 Inline docs update
Michael Scott authored
404
405 Return a null-terminated string for the PMC, along with the length.
406
407 Yes, right now this is a bit of a cheat. It needs fixing, but without
408 disturbing the interface.
409
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
410 Note that you must free the string with C<string_cstring_free()>.
411
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
412 =cut
413
3e1f322 Inline docs update
Michael Scott authored
414 */
415
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
416 PARROT_API
5fd22eb @petdance Converted vast numbers of old-style WARN_UNUSED, CONST, PURE decorati…
petdance authored
417 PARROT_MALLOC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
418 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
419 char *
3de5a81 @petdance Headerized events.c and the rest of gc/*
petdance authored
420 Parrot_PMC_get_cstringn(PARROT_INTERP, ARGIN(Parrot_PMC pmc),
421 ARGOUT(Parrot_Int *length))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
422 {
fa999b0 First chunk of extension code done
Dan Sugalski authored
423 char *retval;
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
424
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
425 PARROT_CALLIN_START(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
426 retval = string_to_cstring(interp, VTABLE_get_string(interp, pmc));
fa999b0 First chunk of extension code done
Dan Sugalski authored
427 *length = strlen(retval);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
428 PARROT_CALLIN_END(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
429
fa999b0 First chunk of extension code done
Dan Sugalski authored
430 return retval;
431 }
432
3e1f322 Inline docs update
Michael Scott authored
433 /*
434
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
435 =item C<char * Parrot_PMC_get_cstringn_intkey>
3e1f322 Inline docs update
Michael Scott authored
436
437 Return a null-terminated string for the PMC, along with the length.
438
439 Yes, right now this is a bit of a cheat. It needs fixing, but without
440 disturbing the interface.
441
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
442 Note that you must free this string with C<string_cstring_free()>.
443
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
444 =cut
445
3e1f322 Inline docs update
Michael Scott authored
446 */
447
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
448 PARROT_API
5fd22eb @petdance Converted vast numbers of old-style WARN_UNUSED, CONST, PURE decorati…
petdance authored
449 PARROT_MALLOC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
450 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
451 char *
3de5a81 @petdance Headerized events.c and the rest of gc/*
petdance authored
452 Parrot_PMC_get_cstringn_intkey(PARROT_INTERP, ARGIN(Parrot_PMC pmc),
453 ARGOUT(Parrot_Int *length), Parrot_Int key)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
454 {
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
455 char *retval;
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
456
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
457 PARROT_CALLIN_START(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
458 retval = string_to_cstring(interp,
d067bc6 @ambs 80's cuts.
ambs authored
459 VTABLE_get_string_keyed_int(interp, pmc, key));
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
460 *length = strlen(retval);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
461 PARROT_CALLIN_END(interp);
13ad730 @chromatic Free strings allocated with string_to_cstring().
chromatic authored
462
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
463 return retval;
464 }
465
3e1f322 Inline docs update
Michael Scott authored
466 /*
467
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
468 =item C<void Parrot_PMC_set_string>
3e1f322 Inline docs update
Michael Scott authored
469
470 Assign the passed-in Parrot string to the passed-in PMC.
471
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
472 =cut
473
3e1f322 Inline docs update
Michael Scott authored
474 */
475
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
476 PARROT_API
477 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
478 Parrot_PMC_set_string(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
479 Parrot_PMC pmc, Parrot_String value)
480 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
481 PARROT_CALLIN_START(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
482 VTABLE_set_string_native(interp, pmc, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
483 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
484 }
485
3e1f322 Inline docs update
Michael Scott authored
486 /*
487
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
488 =item C<void Parrot_PMC_set_string_intkey>
3e1f322 Inline docs update
Michael Scott authored
489
490 Assign the passed-in Parrot string to the passed-in PMC.
491
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
492 =cut
493
3e1f322 Inline docs update
Michael Scott authored
494 */
495
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
496 PARROT_API
497 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
498 Parrot_PMC_set_string_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
499 Parrot_PMC pmc, Parrot_Int key, Parrot_String value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
500 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
501 PARROT_CALLIN_START(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
502 VTABLE_set_string_keyed_int(interp, pmc, key, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
503 PARROT_CALLIN_END(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
504 }
505
3e1f322 Inline docs update
Michael Scott authored
506 /*
507
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
508 =item C<void Parrot_PMC_set_pmc_intkey>
3e1f322 Inline docs update
Michael Scott authored
509
a2516e7 Transpose Parrot_PMC_set_pointer and Parrot_PMC_set_pmc_intkey to giv…
Nicholas Clark authored
510 Assign the passed-in pmc to the passed-in slot of the passed-in PMC.
3e1f322 Inline docs update
Michael Scott authored
511
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
512 =cut
513
3e1f322 Inline docs update
Michael Scott authored
514 */
515
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
516 PARROT_API
517 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
518 Parrot_PMC_set_pmc_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
519 Parrot_PMC pmc, Parrot_Int key, Parrot_PMC value)
520 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
521 PARROT_CALLIN_START(interp);
a2516e7 Transpose Parrot_PMC_set_pointer and Parrot_PMC_set_pmc_intkey to giv…
Nicholas Clark authored
522 VTABLE_set_pmc_keyed_int(interp, pmc, key, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
523 PARROT_CALLIN_END(interp);
cf4fa0b expose get/set pointer functions
Dan Sugalski authored
524 }
525
3e1f322 Inline docs update
Michael Scott authored
526 /*
527
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
528 =item C<void Parrot_PMC_set_pmc_pmckey>
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
529
530 Assign the passed-in pmc to the passed-in slot of the passed-in PMC.
531
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
532 =cut
533
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
534 */
535
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
536 PARROT_API
537 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
538 Parrot_PMC_set_pmc_pmckey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
539 Parrot_PMC pmc, Parrot_PMC key, Parrot_PMC value)
540 {
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
541 PARROT_CALLIN_START(interp);
542 VTABLE_set_pmc_keyed(interp, pmc, key, value);
543 PARROT_CALLIN_END(interp);
544 }
545
546 /*
547
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
548 =item C<void Parrot_PMC_set_pointer_intkey>
3e1f322 Inline docs update
Michael Scott authored
549
550 Assign the passed-in pointer to the passed-in PMC.
551
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
552 =cut
553
3e1f322 Inline docs update
Michael Scott authored
554 */
555
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
556 PARROT_API
557 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
558 Parrot_PMC_set_pointer_intkey(PARROT_INTERP,
3de5a81 @petdance Headerized events.c and the rest of gc/*
petdance authored
559 ARGIN(Parrot_PMC pmc), Parrot_Int key, ARGIN_NULLOK(void *value))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
560 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
561 PARROT_CALLIN_START(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
562 VTABLE_set_pointer_keyed_int(interp, pmc, key, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
563 PARROT_CALLIN_END(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
564 }
565
3e1f322 Inline docs update
Michael Scott authored
566 /*
567
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
568 =item C<void Parrot_PMC_set_intval>
3e1f322 Inline docs update
Michael Scott authored
569
570 Assign the passed-in Parrot integer to the passed-in PMC.
571
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
572 =cut
573
3e1f322 Inline docs update
Michael Scott authored
574 */
575
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
576 PARROT_API
577 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
578 Parrot_PMC_set_intval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Int value)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
579 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
580 PARROT_CALLIN_START(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
581 VTABLE_set_integer_native(interp, pmc, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
582 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
583 }
584
3e1f322 Inline docs update
Michael Scott authored
585 /*
586
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
587 =item C<void Parrot_PMC_set_intval_intkey>
3e1f322 Inline docs update
Michael Scott authored
588
589 Assign the passed-in Parrot integer to the passed-in PMC.
590
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
591 =cut
592
3e1f322 Inline docs update
Michael Scott authored
593 */
594
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
595 PARROT_API
596 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
597 Parrot_PMC_set_intval_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
598 Parrot_PMC pmc, Parrot_Int key, Parrot_Int value)
599 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
600 PARROT_CALLIN_START(interp);
808faf0 Add integer keyed get/set for ints, for Ponie
Dan Sugalski authored
601 VTABLE_set_integer_keyed_int(interp, pmc, key, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
602 PARROT_CALLIN_END(interp);
808faf0 Add integer keyed get/set for ints, for Ponie
Dan Sugalski authored
603 }
604
3e1f322 Inline docs update
Michael Scott authored
605 /*
606
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
607 =item C<void Parrot_PMC_set_numval>
3e1f322 Inline docs update
Michael Scott authored
608
609 Assign the passed-in Parrot number to the passed-in PMC.
610
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
611 =cut
612
3e1f322 Inline docs update
Michael Scott authored
613 */
614
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
615 PARROT_API
616 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
617 Parrot_PMC_set_numval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Float value)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
618 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
619 PARROT_CALLIN_START(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
620 VTABLE_set_number_native(interp, pmc, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
621 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
622 }
623
3e1f322 Inline docs update
Michael Scott authored
624 /*
625
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
626 =item C<void Parrot_PMC_set_numval_intkey>
3e1f322 Inline docs update
Michael Scott authored
627
628 Assign the passed-in Parrot number to the passed-in PMC.
629
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
630 =cut
631
3e1f322 Inline docs update
Michael Scott authored
632 */
633
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
634 PARROT_API
635 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
636 Parrot_PMC_set_numval_intkey(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
637 Parrot_PMC pmc, Parrot_Int key, Parrot_Float value)
638 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
639 PARROT_CALLIN_START(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
640 VTABLE_set_number_keyed_int(interp, pmc, key, value);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
641 PARROT_CALLIN_END(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
642 }
643
3e1f322 Inline docs update
Michael Scott authored
644 /*
645
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
646 =item C<void Parrot_PMC_set_cstring>
3e1f322 Inline docs update
Michael Scott authored
647
648 Assign the passed-in null-terminated C string to the passed-in PMC.
649
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
650 =cut
651
3e1f322 Inline docs update
Michael Scott authored
652 */
653
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
654 PARROT_API
655 void
802efc1 @petdance If something is NULLOK(const...) it is by definition ARGIN_NULLOK(con…
petdance authored
656 Parrot_PMC_set_cstring(PARROT_INTERP, Parrot_PMC pmc, ARGIN_NULLOK(const char *value))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
657 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
658 PARROT_CALLIN_START(interp);
bf41b66 @particle [PDD07]: ws cleanup in src/, src/dynpmc/, and src/pmc/
particle authored
659 VTABLE_set_string_native(interp, pmc,
d067bc6 @ambs 80's cuts.
ambs authored
660 string_from_cstring(interp, value, 0));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
661 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
662 }
663
3e1f322 Inline docs update
Michael Scott authored
664 /*
665
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
666 =item C<void Parrot_PMC_set_cstring_intkey>
3e1f322 Inline docs update
Michael Scott authored
667
668 Assign the passed-in null-terminated C string to the passed-in PMC.
669
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
670 =cut
671
3e1f322 Inline docs update
Michael Scott authored
672 */
673
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
674 PARROT_API
675 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
676 Parrot_PMC_set_cstring_intkey(PARROT_INTERP,
802efc1 @petdance If something is NULLOK(const...) it is by definition ARGIN_NULLOK(con…
petdance authored
677 Parrot_PMC pmc, Parrot_Int key, ARGIN_NULLOK(const char *value))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
678 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
679 PARROT_CALLIN_START(interp);
bf41b66 @particle [PDD07]: ws cleanup in src/, src/dynpmc/, and src/pmc/
particle authored
680 VTABLE_set_string_keyed_int(interp, pmc, key,
d067bc6 @ambs 80's cuts.
ambs authored
681 string_from_cstring(interp, value, 0));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
682 PARROT_CALLIN_END(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
683 }
684
3e1f322 Inline docs update
Michael Scott authored
685 /*
686
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
687 =item C<void Parrot_PMC_set_cstringn>
3e1f322 Inline docs update
Michael Scott authored
688
c03ee10 @chromatic r20350@windwheel: chromatic | 2006-08-19 13:49:15 -0700
chromatic authored
689 Assign the passed-in length-noted string to the passed-in PMC.
3e1f322 Inline docs update
Michael Scott authored
690
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
691 =cut
692
3e1f322 Inline docs update
Michael Scott authored
693 */
694
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
695 PARROT_API
696 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
697 Parrot_PMC_set_cstringn(PARROT_INTERP,
258de48 @chromatic [src] Cleaned up some conversion and signedness warnings.
chromatic authored
698 Parrot_PMC pmc, ARGIN_NULLOK(const char *value), Parrot_UInt length)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
699 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
700 PARROT_CALLIN_START(interp);
bf41b66 @particle [PDD07]: ws cleanup in src/, src/dynpmc/, and src/pmc/
particle authored
701 VTABLE_set_string_native(interp, pmc,
d067bc6 @ambs 80's cuts.
ambs authored
702 string_from_cstring(interp, value, length));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
703 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
704 }
705
3e1f322 Inline docs update
Michael Scott authored
706 /*
707
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
708 =item C<void Parrot_PMC_push_intval>
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
709
710 Push the passed-in Parrot integer onto the passed in PMC
711
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
712 =cut
713
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
714 */
715
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
716 PARROT_API
717 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
718 Parrot_PMC_push_intval(PARROT_INTERP,
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
719 Parrot_PMC pmc, Parrot_Int value)
720 {
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
721 PARROT_CALLIN_START(interp);
722 VTABLE_push_integer(interp, pmc, value);
723 PARROT_CALLIN_END(interp);
724 }
725
726 /*
727
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
728 =item C<void Parrot_PMC_push_numval>
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
729
730 Push the passed-in Parrot number onto the passed in PMC
731
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
732 =cut
733
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
734 */
735
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
736 PARROT_API
737 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
738 Parrot_PMC_push_numval(PARROT_INTERP, Parrot_PMC pmc, Parrot_Float value)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
739 {
8bb4c95 Add 4 types of push to extend.h
Nicholas Clark authored
740 PARROT_CALLIN_START(interp);
741 VTABLE_push_float(interp, pmc, value);
742 PARROT_CALLIN_END(interp);
743 }
744
745 /*
746
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
747 =item C<void Parrot_PMC_delete_pmckey>
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
748
749 Deletes the value associated with the passed-in PMC from the PMC.
750
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
751 =cut
752
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
753 */
754
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
755 PARROT_API
756 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
757 Parrot_PMC_delete_pmckey(PARROT_INTERP, Parrot_PMC pmc, Parrot_PMC key)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
758 {
5a3984a Expose VTABLE_get_integer_keyed, VTABLE_set_pmc_keyed and VTABLE_dele…
Nicholas Clark authored
759 PARROT_CALLIN_START(interp);
760 VTABLE_delete_keyed(interp, pmc, key);
761 PARROT_CALLIN_END(interp);
762 }
763
764 /*
765
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
766 =item C<void Parrot_PMC_set_cstringn_intkey>
3e1f322 Inline docs update
Michael Scott authored
767
768 Assign the passed-in length-noted string to the passed-in PMC.
769
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
770 =cut
771
3e1f322 Inline docs update
Michael Scott authored
772 */
773
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
774 PARROT_API
775 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
776 Parrot_PMC_set_cstringn_intkey(PARROT_INTERP,
258de48 @chromatic [src] Cleaned up some conversion and signedness warnings.
chromatic authored
777 Parrot_PMC pmc, Parrot_Int key, ARGIN_NULLOK(const char *value),
778 Parrot_UInt length)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
779 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
780 PARROT_CALLIN_START(interp);
d067bc6 @ambs 80's cuts.
ambs authored
781 VTABLE_set_string_keyed_int(interp, pmc, key,
782 string_from_cstring(interp, value, length));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
783 PARROT_CALLIN_END(interp);
6b2d2bf get/set intkey stuff for embedding
Dan Sugalski authored
784 }
785
3e1f322 Inline docs update
Michael Scott authored
786 /*
787
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
788 =item C<Parrot_PMC Parrot_PMC_new>
3e1f322 Inline docs update
Michael Scott authored
789
790 Create and return a new PMC.
791
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
792 =cut
793
3e1f322 Inline docs update
Michael Scott authored
794 */
795
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
796 PARROT_API
797 Parrot_PMC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
798 Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
799 {
fa999b0 First chunk of extension code done
Dan Sugalski authored
800 Parrot_PMC newpmc;
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
801 PARROT_CALLIN_START(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
802 newpmc = pmc_new_noinit(interp, type);
803 VTABLE_init(interp, newpmc);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
804 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
805 return newpmc;
806 }
807
3e1f322 Inline docs update
Michael Scott authored
808 /*
809
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
810 =item C<Parrot_Int Parrot_PMC_typenum>
3e1f322 Inline docs update
Michael Scott authored
811
812 Returns the internal identifier that represents the named class.
813
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
814 =cut
815
3e1f322 Inline docs update
Michael Scott authored
816 */
817
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
818 PARROT_API
819 Parrot_Int
802efc1 @petdance If something is NULLOK(const...) it is by definition ARGIN_NULLOK(con…
petdance authored
820 Parrot_PMC_typenum(PARROT_INTERP, ARGIN_NULLOK(const char *_class))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
821 {
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
822 Parrot_Int retval;
823 PARROT_CALLIN_START(interp);
14ff6e9 @chromatic C++ cleanups; mostly variable name changes. (Steve Peters, RT #42584).
chromatic authored
824 retval = pmc_type(interp, string_from_cstring(interp, _class, 0));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
825 PARROT_CALLIN_END(interp);
826 return retval;
fa999b0 First chunk of extension code done
Dan Sugalski authored
827 }
828
3e1f322 Inline docs update
Michael Scott authored
829 /*
830
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
831 =item C<Parrot_PMC Parrot_PMC_null>
3e1f322 Inline docs update
Michael Scott authored
832
833 Returns the special C<NULL> PMC.
834
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
835 =cut
836
3e1f322 Inline docs update
Michael Scott authored
837 */
838
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
839 PARROT_API
840 Parrot_PMC
841 Parrot_PMC_null(void)
842 {
8deb08e Expose PMCNULL to extension API.
Melvin Smith authored
843 return PMCNULL;
844 }
845
3e1f322 Inline docs update
Michael Scott authored
846 /*
847
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
848 =item C<void Parrot_free_cstring>
3e1f322 Inline docs update
Michael Scott authored
849
850 Deallocate a C string that the interpreter has handed to you.
851
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
852 =cut
853
3e1f322 Inline docs update
Michael Scott authored
854 */
8deb08e Expose PMCNULL to extension API.
Melvin Smith authored
855
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
856 PARROT_API
857 void
3de5a81 @petdance Headerized events.c and the rest of gc/*
petdance authored
858 Parrot_free_cstring(ARGIN_NULLOK(char *string))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
859 {
fa999b0 First chunk of extension code done
Dan Sugalski authored
860 string_cstring_free(string);
99b337c start of actual extension routines and docs
Dan Sugalski authored
861 }
862
3e1f322 Inline docs update
Michael Scott authored
863 /*
864
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
865 =item C<void* Parrot_call_sub>
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
866
c03ee10 @chromatic r20350@windwheel: chromatic | 2006-08-19 13:49:15 -0700
chromatic authored
867 Call a parrot subroutine with the given function signature. The first char in
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
868 C<signature> denotes the return value. Next chars are arguments.
869
870 The return value of this function can be void or a pointer type.
871
872 Signature chars are:
873
874 v ... void return
875 I ... Parrot_Int
876 N ... Parrot_Float
ef4c70a @chromatic Sanitize external interface, mostly by changing Parrot_STRING to Parr…
chromatic authored
877 S ... Parrot_String
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
878 P ... Parrot_PMC
879
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
880 =cut
881
3e1f322 Inline docs update
Michael Scott authored
882 */
883
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
884 PARROT_API
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
885 PARROT_WARN_UNUSED_RESULT
886 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
887 void*
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
888 Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
889 ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
890 {
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
891 va_list ap;
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
892 void *result;
893
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
894 PARROT_CALLIN_START(interp);
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
895
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
896 va_start(ap, signature);
637cc2a @chromatic [src] Changed CONTEXT(interp->ctx) to CONTEXT(interp), which seems cl…
chromatic authored
897 CONTEXT(interp)->constants =
839e959 @chromatic [REVERT] Reverted accidentally-committed code from r18635.
chromatic authored
898 PMC_sub(sub)->seg->const_table->constants;
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
899 result = Parrot_runops_fromc_arglist(interp, sub, signature, ap);
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
900 va_end(ap);
901
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
902 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
903 return result;
904 }
905
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
906 /*
907
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
908 =item C<Parrot_Int Parrot_call_sub_ret_int>
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
909
910 Like C<Parrot_call_sub>, with Parrot_Int return result.
911
912 =cut
913
914 */
915
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
916 PARROT_API
917 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
918 Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
919 ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
920 {
921 va_list ap;
922 Parrot_Int result;
923
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
924 PARROT_CALLIN_START(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
925
926 va_start(ap, signature);
637cc2a @chromatic [src] Changed CONTEXT(interp->ctx) to CONTEXT(interp), which seems cl…
chromatic authored
927 CONTEXT(interp)->constants =
fd76940 @jnthn Make sure the constants table pointer in the context is set correctly…
jnthn authored
928 PMC_sub(sub)->seg->const_table->constants;
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
929 result = Parrot_runops_fromc_arglist_reti(interp, sub, signature, ap);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
930 va_end(ap);
abe6ef8 Run a subroutine in Parrot_call
Leopold Toetsch authored
931
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
932 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
933 return result;
934 }
935
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
936 /*
937
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
938 =item C<Parrot_Float Parrot_call_sub_ret_float>
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
939
940 Like C<Parrot_call_sub>, with Parrot_Float return result.
941
942 =cut
943
944 */
945
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
946 PARROT_API
947 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
948 Parrot_call_sub_ret_float(PARROT_INTERP, Parrot_PMC sub,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
949 ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
950 {
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
951 va_list ap;
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
952 Parrot_Float result;
953
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
954 PARROT_CALLIN_START(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
955
956 va_start(ap, signature);
637cc2a @chromatic [src] Changed CONTEXT(interp->ctx) to CONTEXT(interp), which seems cl…
chromatic authored
957 CONTEXT(interp)->constants =
fd76940 @jnthn Make sure the constants table pointer in the context is set correctly…
jnthn authored
958 PMC_sub(sub)->seg->const_table->constants;
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
959 result = Parrot_runops_fromc_arglist_retf(interp, sub, signature, ap);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
960 va_end(ap);
961
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
962 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
963 return result;
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
964 }
965
3e1f322 Inline docs update
Michael Scott authored
966 /*
967
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
968 =item C<void * Parrot_call_method>
3e1f322 Inline docs update
Michael Scott authored
969
e02397e @Whiteknight [DOCS] Document Parrot_call_method as per RT#36243. Also, document a …
Whiteknight authored
970 Call the parrot subroutine C<sub> as a method on PMC object C<obj>. The method
971 should have the name C<method> as a Parrot_string, and should have a function
972 signature C<signature>. Any arguments to the method can be passed at the end
973 as a variadic argument list.
3e1f322 Inline docs update
Michael Scott authored
974
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
975 =cut
976
3e1f322 Inline docs update
Michael Scott authored
977 */
978
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
979 PARROT_API
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
980 PARROT_WARN_UNUSED_RESULT
981 PARROT_CAN_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
982 void *
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
983 Parrot_call_method(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
984 Parrot_String method, ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
985 {
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
986 void *result;
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
987 va_list ap;
988
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
989 PARROT_CALLIN_START(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
990 va_start(ap, signature);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
991 result = Parrot_run_meth_fromc_arglist(interp, sub,
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
992 obj, method, signature, ap);
993 va_end(ap);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
994 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
995 return result;
996 }
997
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
998 /*
999
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1000 =item C<Parrot_Int Parrot_call_method_ret_int>
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
1001
1002 Call a parrot method for the given object.
1003
1004 =cut
1005
1006 */
1007
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1008 PARROT_API
1009 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1010 Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
1011 Parrot_PMC obj, Parrot_String method, ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1012 {
1013 Parrot_Int result;
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
1014 va_list ap;
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1015
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1016 PARROT_CALLIN_START(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1017 va_start(ap, signature);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1018 result = Parrot_run_meth_fromc_arglist_reti(interp, sub,
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1019 obj, method, signature, ap);
1020 va_end(ap);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1021 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1022 return result;
1023 }
1024
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
1025 /*
1026
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1027 =item C<Parrot_Float Parrot_call_method_ret_float>
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
1028
1029 Call a parrot method for the given object.
1030
1031 =cut
1032
1033 */
1034
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1035 PARROT_API
1036 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1037 Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC sub,
a61c479 @petdance If something is NOTNULL(const...) it is by definition ARGIN(const...)
petdance authored
1038 Parrot_PMC obj, Parrot_String method, ARGIN(const char *signature), ...)
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1039 {
1040 Parrot_Float result;
43202f8 @kjs [src] align "=" and declarations. remove some spaces where they don't…
kjs authored
1041 va_list ap;
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1042
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1043 PARROT_CALLIN_START(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1044 va_start(ap, signature);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1045 result = Parrot_run_meth_fromc_arglist_retf(interp, sub,
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1046 obj, method, signature, ap);
1047 va_end(ap);
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
1048 PARROT_CALLIN_END(interp);
7decdbe changed extend.c:Parrot_call
Leopold Toetsch authored
1049 return result;
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
1050 }
1051
3e1f322 Inline docs update
Michael Scott authored
1052 /*
1053
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1054 =item C<Parrot_Int Parrot_get_intreg>
3e1f322 Inline docs update
Michael Scott authored
1055
1056 Return the value of an integer register.
1057
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1058 =cut
1059
3e1f322 Inline docs update
Michael Scott authored
1060 */
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
1061
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1062 PARROT_API
1063 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1064 Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1065 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1066 return REG_INT(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1067 }
1068
3e1f322 Inline docs update
Michael Scott authored
1069 /*
1070
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1071 =item C<Parrot_Float Parrot_get_numreg>
3e1f322 Inline docs update
Michael Scott authored
1072
1073 Return the value of a numeric register.
1074
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1075 =cut
1076
3e1f322 Inline docs update
Michael Scott authored
1077 */
1078
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1079 PARROT_API
1080 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1081 Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1082 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1083 return REG_NUM(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1084 }
1085
3e1f322 Inline docs update
Michael Scott authored
1086 /*
1087
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1088 =item C<Parrot_String Parrot_get_strreg>
3e1f322 Inline docs update
Michael Scott authored
1089
1090 Return the value of a string register.
1091
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1092 =cut
1093
3e1f322 Inline docs update
Michael Scott authored
1094 */
1095
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1096 PARROT_API
1097 Parrot_String
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1098 Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1099 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1100 return REG_STR(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1101 }
1102
3e1f322 Inline docs update
Michael Scott authored
1103 /*
1104
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1105 =item C<Parrot_PMC Parrot_get_pmcreg>
3e1f322 Inline docs update
Michael Scott authored
1106
1107 Return the value of a PMC register.
1108
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1109 =cut
1110
3e1f322 Inline docs update
Michael Scott authored
1111 */
1112
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1113 PARROT_API
1114 Parrot_PMC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1115 Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1116 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1117 return REG_PMC(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1118 }
1119
3e1f322 Inline docs update
Michael Scott authored
1120 /*
1121
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1122 =item C<void Parrot_set_intreg>
3e1f322 Inline docs update
Michael Scott authored
1123
1124 Set the value of an I register.
1125
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1126 =cut
1127
3e1f322 Inline docs update
Michael Scott authored
1128 */
1129
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1130 PARROT_API
1131 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1132 Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
1133 Parrot_Int value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1134 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1135 REG_INT(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1136 }
1137
3e1f322 Inline docs update
Michael Scott authored
1138 /*
1139
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1140 =item C<void Parrot_set_numreg>
3e1f322 Inline docs update
Michael Scott authored
1141
1142 Set the value of an N register.
1143
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1144 =cut
1145
3e1f322 Inline docs update
Michael Scott authored
1146 */
1147
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1148 PARROT_API
1149 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1150 Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
1151 Parrot_Float value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1152 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1153 REG_NUM(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1154 }
1155
3e1f322 Inline docs update
Michael Scott authored
1156 /*
1157
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1158 =item C<void Parrot_set_strreg>
3e1f322 Inline docs update
Michael Scott authored
1159
1160 Set the value of an S register.
1161
1162 */
1163
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1164 PARROT_API
1165 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1166 Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum,
ef4c70a @chromatic Sanitize external interface, mostly by changing Parrot_STRING to Parr…
chromatic authored
1167 Parrot_String value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1168 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1169 REG_STR(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1170 }
1171
3e1f322 Inline docs update
Michael Scott authored
1172 /*
1173
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1174 =item C<void Parrot_set_pmcreg>
3e1f322 Inline docs update
Michael Scott authored
1175
1176 Set the value of a P register.
1177
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
1178 =cut
1179
3e1f322 Inline docs update
Michael Scott authored
1180 */
1181
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
1182 PARROT_API
1183 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
1184 Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
1185 Parrot_PMC value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c heade…
petdance authored
1186 {
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
1187 REG_PMC(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
1188 }
1189
000d780 Add in some string construction functions
Dan Sugalski authored
1190 /*=for api extend Parrot_new_string
1191 *
1192 */
3e1f322 Inline docs update
Michael Scott authored
1193 /*
1194
ef5dfc9 @petdance I'm confident enough on the source rewriting the header blocks that i…
petdance authored
1195 =item C<Parrot_String Parrot_new_string>
3e1f322 Inline docs update
Michael Scott authored
1196
3a348a0 anchor overflow array immediately
Leopold Toetsch authored
1197 Create a new Parrot string from a passed-in buffer. Pass in a 0 for
e89e713