Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 749 lines (541 sloc) 16.174 kb
3e1f322 Inline docs update
Michael Scott authored
1 /*
c9f655c @chromatic [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
chromatic authored
2 Copyright (C) 2001-2010, Parrot Foundation.
3e1f322 Inline docs update
Michael Scott authored
3
4 =head1 NAME
5
6 src/extend.c - Parrot extension interface
7
8 =head1 DESCRIPTION
99b337c start of actual extension routines and docs
Dan Sugalski authored
9
3e1f322 Inline docs update
Michael Scott authored
10 These are the functions that parrot extensions (i.e. parrot subroutines
11 written in C, or some other compiled language, rather than in parrot
12 bytecode) may access.
13
14 There is a deliberate distancing from the internals here. Don't go
15 peeking inside -- you've as much access as bytecode does, but no more,
16 so we can provide backwards compatibility for as long as we possibly
17 can.
18
19 =head2 Functions
20
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
21 =over 4
22
23 =cut
24
3e1f322 Inline docs update
Michael Scott authored
25 */
99b337c start of actual extension routines and docs
Dan Sugalski authored
26
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
27 /* Some internal notes. Parrot will die a horrible and bizarre death
e1f3d50 @cotto [gc] replace/remove "DOD" in comments in most files in src/
cotto authored
28 if the stack start pointer's not set and a GC run is
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
29 triggered. The pointer *will* be set by the interpreter if the
30 interpreter calls code which calls these functions, so most
31 extension code is safe, no problem.
32
33 The problem comes in if these routines are called from *outside*
34 an interpreter. This happens when an embedding application calls
35 them to do stuff with PMCs, STRINGS, interpreter contents, and
36 suchlike things. This is perfectly legal -- in fact it's what
37 we've documented should be done -- but the problem is that the
38 stack base pointer will be NULL. This is Very Bad.
39
40 To deal with this there are two macros that are defined to handle
41 the problem.
42
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
43 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
44 anchor needs setting and, if so, will set it. It must *always*
45 come immediately after the last variable declared in the block
46 making the calls into the interpreter, as it declares a variable
47 and has some code.
48
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
49 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
50 the way it was, and should always be the last statement before a
51 return. (If you have multiple returns have it in multiple times)
52
53 Not doing this is a good way to introduce bizarre heisenbugs, so
54 just do it. This is the only place they ought to have to be put
55 in, and most of the functions are already written, so it's not
56 like it's an onerous requirement.
57
58 */
59
99b337c start of actual extension routines and docs
Dan Sugalski authored
60 #include "parrot/parrot.h"
61 #include "parrot/extend.h"
63889c2 @cotto [PMC] replace PMC_struct_val and derivatives with ATTR accessors for …
cotto authored
62 #include "pmc/pmc_sub.h"
68bf472 @bacek Merge context_unify3_simple branch back to trunk.
bacek authored
63 #include "pmc/pmc_callcontext.h"
99b337c start of actual extension routines and docs
Dan Sugalski authored
64
490c1c6 @petdance Changed HEADERIZER TARGET to HEADERIZER HFILE
petdance authored
65 /* HEADERIZER HFILE: include/parrot/extend.h */
df5e1a1 @petdance lie to the headerizer
petdance authored
66
3e1f322 Inline docs update
Michael Scott authored
67 /*
68
4dc854f @coke [cage] run 'make headerizer'
coke authored
69 =item C<int Parrot_vfprintf(PARROT_INTERP, Parrot_PMC pio, const char *s,
70 va_list args)>
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
71
72 Writes a C string format with a varargs list to a PIO.
73
4dc854f @coke [cage] run 'make headerizer'
coke authored
74 =item C<int Parrot_fprintf(PARROT_INTERP, Parrot_PMC pio, const char *s, ...)>
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
75
76 Writes a C string format with varargs to a PIO.
77
4dc854f @coke [cage] run 'make headerizer'
coke authored
78 =item C<int Parrot_printf(NULLOK_INTERP, const char *s, ...)>
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
79
80 Writes a C string format with varargs to C<stdout>.
81
4dc854f @coke [cage] run 'make headerizer'
coke authored
82 =item C<int Parrot_eprintf(NULLOK_INTERP, const char *s, ...)>
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
83
84 Writes a C string format with varargs to C<stderr>.
85
fb2ca1e @NotFound fix lack of cut in a pod comment
NotFound authored
86 =cut
87
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
88 */
89
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
90 PARROT_EXPORT
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
91 int
92 Parrot_vfprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
93 ARGIN(const char *s), va_list args)
94 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
95 ASSERT_ARGS(Parrot_vfprintf)
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
96 STRING * str;
97 INTVAL retval;
98
99 PARROT_CALLIN_START(interp);
100 str = Parrot_vsprintf_c(interp, s, args);
9f9cea2 @allisonrandal [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
allisonrandal authored
101 retval = Parrot_io_putps(interp, pio, str);
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
102 PARROT_CALLIN_END(interp);
103
104 return retval;
105 }
106
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
107 PARROT_EXPORT
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
108 int
109 Parrot_fprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
110 ARGIN(const char *s), ...)
111 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
112 ASSERT_ARGS(Parrot_fprintf)
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
113 va_list args;
114 INTVAL retval;
115
116 va_start(args, s);
117 retval = Parrot_vfprintf(interp, pio, s, args);
118 va_end(args);
119
120 return retval;
121 }
122
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
123 PARROT_EXPORT
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
124 int
125 Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...)
126 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
127 ASSERT_ARGS(Parrot_printf)
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
128 va_list args;
129 INTVAL retval;
130 va_start(args, s);
131
132 if (interp) {
9f9cea2 @allisonrandal [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
allisonrandal authored
133 retval = Parrot_vfprintf(interp, Parrot_io_STDOUT(interp), s, args);
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
134 }
135 else {
136 /* Be nice about this...
9f9cea2 @allisonrandal [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
allisonrandal authored
137 ** XXX BD Should this use the default Parrot_io_STDOUT or something?
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
138 */
139 retval = vfprintf(stdout, s, args);
140 }
141 va_end(args);
142
143 return retval;
144 }
145
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
146 PARROT_EXPORT
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
147 int
148 Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...)
149 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
150 ASSERT_ARGS(Parrot_eprintf)
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
151 va_list args;
152 INTVAL retval;
153
154 va_start(args, s);
155
156 if (interp) {
9f9cea2 @allisonrandal [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
allisonrandal authored
157 retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args);
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
158 }
159 else {
160 /* Be nice about this...
9f9cea2 @allisonrandal [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
allisonrandal authored
161 ** XXX BD Should this use the default Parrot_io_STDOUT or something?
87909b3 @NotFound Add Parrot_printf and Parrot_eprintf to the extend API
NotFound authored
162 */
163 retval=vfprintf(stderr, s, args);
164 }
165
166 va_end(args);
167
168 return retval;
169 }
170
171 /*
172
4dc854f @coke [cage] run 'make headerizer'
coke authored
173 =item C<Parrot_PMC Parrot_get_root_namespace(PARROT_INTERP)>
4429375 @NotFound [core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc…
NotFound authored
174
175 Return the root namespace
176
177 =cut
178
179 */
180
181 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
182 PARROT_PURE_FUNCTION
4429375 @NotFound [core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc…
NotFound authored
183 Parrot_PMC
184 Parrot_get_root_namespace(PARROT_INTERP)
185 {
186 ASSERT_ARGS(Parrot_get_root_namespace)
187 return interp->root_namespace;
188 }
189
190 /*
191
4dc854f @coke [cage] run 'make headerizer'
coke authored
192 =item C<Parrot_PMC Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)>
3e1f322 Inline docs update
Michael Scott authored
193
194 Create and return a new PMC.
195
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
196 =cut
197
3e1f322 Inline docs update
Michael Scott authored
198 */
199
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
200 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
201 Parrot_PMC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
202 Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
203 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
204 ASSERT_ARGS(Parrot_PMC_new)
fa999b0 First chunk of extension code done
Dan Sugalski authored
205 Parrot_PMC newpmc;
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
206 PARROT_CALLIN_START(interp);
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored
207 newpmc = Parrot_pmc_new_noinit(interp, type);
fa999b0 First chunk of extension code done
Dan Sugalski authored
208 VTABLE_init(interp, newpmc);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
209 PARROT_CALLIN_END(interp);
fa999b0 First chunk of extension code done
Dan Sugalski authored
210 return newpmc;
211 }
212
3e1f322 Inline docs update
Michael Scott authored
213 /*
214
4dc854f @coke [cage] run 'make headerizer'
coke authored
215 =item C<Parrot_Int Parrot_PMC_typenum(PARROT_INTERP, const char *_class)>
3e1f322 Inline docs update
Michael Scott authored
216
217 Returns the internal identifier that represents the named class.
218
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
219 =cut
220
3e1f322 Inline docs update
Michael Scott authored
221 */
222
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
223 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
224 Parrot_Int
802efc1 @petdance If something is NULLOK(const...) it is by definition ARGIN_NULLOK(con…
petdance authored
225 Parrot_PMC_typenum(PARROT_INTERP, ARGIN_NULLOK(const char *_class))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
226 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
227 ASSERT_ARGS(Parrot_PMC_typenum)
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
228 Parrot_Int retval;
229 PARROT_CALLIN_START(interp);
847522f @Whiteknight rename the rest of the functions in pmc.c, start updating the rest of…
Whiteknight authored
230 retval = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, _class, 0));
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
231 PARROT_CALLIN_END(interp);
232 return retval;
fa999b0 First chunk of extension code done
Dan Sugalski authored
233 }
234
3e1f322 Inline docs update
Michael Scott authored
235 /*
236
4dc854f @coke [cage] run 'make headerizer'
coke authored
237 =item C<Parrot_PMC Parrot_PMC_null(void)>
3e1f322 Inline docs update
Michael Scott authored
238
239 Returns the special C<NULL> PMC.
240
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
241 =cut
242
3e1f322 Inline docs update
Michael Scott authored
243 */
244
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
245 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
246 PARROT_PURE_FUNCTION
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
247 Parrot_PMC
248 Parrot_PMC_null(void)
249 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
250 ASSERT_ARGS(Parrot_PMC_null)
8deb08e Expose PMCNULL to extension API.
Melvin Smith authored
251 return PMCNULL;
252 }
253
3e1f322 Inline docs update
Michael Scott authored
254 /*
255
4dc854f @coke [cage] run 'make headerizer'
coke authored
256 =item C<void Parrot_free_cstring(char *string)>
3e1f322 Inline docs update
Michael Scott authored
257
258 Deallocate a C string that the interpreter has handed to you.
259
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
260 =cut
261
3e1f322 Inline docs update
Michael Scott authored
262 */
8deb08e Expose PMCNULL to extension API.
Melvin Smith authored
263
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
264 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
265 void
172bc90 @petdance updating annotations
petdance authored
266 Parrot_free_cstring(ARGFREE(char *string))
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
267 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
268 ASSERT_ARGS(Parrot_free_cstring)
b6bc0c3 @allisonrandal [pdd28str] Merging the pdd27mmd branch into trunk for r36123 to r36318.
allisonrandal authored
269 Parrot_str_free_cstring(string);
99b337c start of actual extension routines and docs
Dan Sugalski authored
270 }
271
3e1f322 Inline docs update
Michael Scott authored
272 /*
273
6c743be @allisonrandal [pcc] Add a generic extend/embed interface function for invoking Parrot
allisonrandal authored
274 =item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC sub_pmc, const char
275 *signature, ...)>
276
277 Call a Parrot subroutine or method with the given function signature. The
278 function signature holds one type character for each argument or return, these
279 are:
280
281 I ... Parrot_Int
282 N ... Parrot_Float
283 S ... Parrot_String
284 P ... Parrot_PMC
285
286 Returns come after the arguments, separated by an arrow, so "PN->S" takes a PMC
287 and a float as arguments and returns a string.
288
289 Pass the variables for the arguments and returns in the same order as the
290 signature, with returns as reference to the variable (so it can be modified).
291
292 Parrot_ext_call(interp, sub, "P->S", pmc_arg, &string_result);
293
294 To call a method, pass the object for the method as the first argument, and
295 mark it in the signature as "Pi" ("i" stands for "invocant").
296
297 Parrot_ext_call(interp, sub, "PiP->S", object_arg, pmc_arg, &string_result);
298
299 =cut
300
301 */
302
303 PARROT_EXPORT
304 void
305 Parrot_ext_call(PARROT_INTERP, ARGIN(Parrot_PMC sub_pmc),
306 ARGIN(const char *signature), ...)
307 {
308 ASSERT_ARGS(Parrot_ext_call)
309 va_list args;
363ca41 @chromatic Merged pcc_hackathon_6Mar10 into trunk. Because this changed op numb…
chromatic authored
310 PMC *call_obj;
f3faadb @bacek Fix build with g++
bacek authored
311 const char *arg_sig, *ret_sig;
c9f655c @chromatic [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
chromatic authored
312
f084166 @petdance Removed an unused argument. Fixed consting.
petdance authored
313 PMC * const old_call_obj = Parrot_pcc_get_signature(interp,
c9f655c @chromatic [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
chromatic authored
314 CURRENT_CONTEXT(interp));
f084166 @petdance Removed an unused argument. Fixed consting.
petdance authored
315 Parrot_pcc_split_signature_string(signature, &arg_sig, &ret_sig);
6c743be @allisonrandal [pcc] Add a generic extend/embed interface function for invoking Parrot
allisonrandal authored
316
317 va_start(args, signature);
c9f655c @chromatic [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
chromatic authored
318 call_obj = Parrot_pcc_build_call_from_varargs(interp, PMCNULL,
319 arg_sig, &args);
6c743be @allisonrandal [pcc] Add a generic extend/embed interface function for invoking Parrot
allisonrandal authored
320
363ca41 @chromatic Merged pcc_hackathon_6Mar10 into trunk. Because this changed op numb…
chromatic authored
321 Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, call_obj);
322 call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
323 Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args,
324 PARROT_ERRORS_RESULT_COUNT_FLAG);
325 va_end(args);
112c28e @bacek Restore old CallContext in Parrot_ext_call. Spotted by fperrad++
bacek authored
326 Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_call_obj);
6c743be @allisonrandal [pcc] Add a generic extend/embed interface function for invoking Parrot
allisonrandal authored
327 }
328
668635f @NotFound add function Parrot_ext_try and use it in extend_vtable tests
NotFound authored
329 /*
330
331 =item C<void Parrot_ext_try(PARROT_INTERP, void (*cfunction(Parrot_Interp, void
332 *)), void (*chandler(Parrot_Interp, PMC *, void *)), void *data)>
333
334 Executes the cfunction argument wrapped in a exception handler.
335 If the function throws, the provided handler function is invoked
336
337 =cut
338
339 */
340
341 PARROT_EXPORT
342 void
343 Parrot_ext_try(PARROT_INTERP,
344 ARGIN_NULLOK(void (*cfunction)(Parrot_Interp, void *)),
345 ARGIN_NULLOK(void (*chandler)(Parrot_Interp, PMC *, void *)),
346 ARGIN_NULLOK(void *data))
347 {
348 ASSERT_ARGS(Parrot_ext_try)
349 if (cfunction) {
350 Parrot_runloop jmp;
351 PARROT_CALLIN_START(interp);
352 switch (setjmp(jmp.resume)) {
353 case 0: /* try */
354 Parrot_ex_add_c_handler(interp, &jmp);
355 (*cfunction)(interp, data);
356 Parrot_cx_delete_handler_local(interp, STRINGNULL);
357 break;
358 default: /* catch */
359 {
360 PMC *exception = jmp.exception;
361 Parrot_cx_delete_handler_local(interp, STRINGNULL);
362 if (chandler)
363 (*chandler)(interp, exception, data);
364 }
365 }
366 PARROT_CALLIN_END(interp);
367 }
368 }
c9f655c @chromatic [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
chromatic authored
369
6c743be @allisonrandal [pcc] Add a generic extend/embed interface function for invoking Parrot
allisonrandal authored
370 /*
371
4dc854f @coke [cage] run 'make headerizer'
coke authored
372 =item C<Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322 Inline docs update
Michael Scott authored
373
374 Return the value of an integer register.
375
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
376 =cut
377
3e1f322 Inline docs update
Michael Scott authored
378 */
3b31e02 More extension stuff at least partially stubbed out
Dan Sugalski authored
379
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
380 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
381 PARROT_PURE_FUNCTION
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
382 Parrot_Int
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
383 Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
384 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
385 ASSERT_ARGS(Parrot_get_intreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
386 return REG_INT(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
387 }
388
3e1f322 Inline docs update
Michael Scott authored
389 /*
390
4dc854f @coke [cage] run 'make headerizer'
coke authored
391 =item C<Parrot_Float Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322 Inline docs update
Michael Scott authored
392
393 Return the value of a numeric register.
394
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
395 =cut
396
3e1f322 Inline docs update
Michael Scott authored
397 */
398
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
399 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
400 PARROT_PURE_FUNCTION
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
401 Parrot_Float
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
402 Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
403 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
404 ASSERT_ARGS(Parrot_get_numreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
405 return REG_NUM(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
406 }
407
3e1f322 Inline docs update
Michael Scott authored
408 /*
409
4dc854f @coke [cage] run 'make headerizer'
coke authored
410 =item C<Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322 Inline docs update
Michael Scott authored
411
412 Return the value of a string register.
413
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
414 =cut
415
3e1f322 Inline docs update
Michael Scott authored
416 */
417
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
418 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
419 PARROT_PURE_FUNCTION
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
420 Parrot_String
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
421 Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
422 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
423 ASSERT_ARGS(Parrot_get_strreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
424 return REG_STR(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
425 }
426
3e1f322 Inline docs update
Michael Scott authored
427 /*
428
4dc854f @coke [cage] run 'make headerizer'
coke authored
429 =item C<Parrot_PMC Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322 Inline docs update
Michael Scott authored
430
431 Return the value of a PMC register.
432
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
433 =cut
434
3e1f322 Inline docs update
Michael Scott authored
435 */
436
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
437 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
438 PARROT_PURE_FUNCTION
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
439 Parrot_PMC
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
440 Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
441 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
442 ASSERT_ARGS(Parrot_get_pmcreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
443 return REG_PMC(interp, regnum);
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
444 }
445
3e1f322 Inline docs update
Michael Scott authored
446 /*
447
4dc854f @coke [cage] run 'make headerizer'
coke authored
448 =item C<void Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Int
449 value)>
3e1f322 Inline docs update
Michael Scott authored
450
451 Set the value of an I register.
452
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
453 =cut
454
3e1f322 Inline docs update
Michael Scott authored
455 */
456
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
457 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
458 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
459 Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
460 Parrot_Int value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
461 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
462 ASSERT_ARGS(Parrot_set_intreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
463 REG_INT(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
464 }
465
3e1f322 Inline docs update
Michael Scott authored
466 /*
467
4dc854f @coke [cage] run 'make headerizer'
coke authored
468 =item C<void Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Float
469 value)>
3e1f322 Inline docs update
Michael Scott authored
470
471 Set the value of an N register.
472
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
473 =cut
474
3e1f322 Inline docs update
Michael Scott authored
475 */
476
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
477 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
478 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
479 Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
480 Parrot_Float value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
481 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
482 ASSERT_ARGS(Parrot_set_numreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
483 REG_NUM(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
484 }
485
3e1f322 Inline docs update
Michael Scott authored
486 /*
487
4dc854f @coke [cage] run 'make headerizer'
coke authored
488 =item C<void Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum, Parrot_String
489 value)>
3e1f322 Inline docs update
Michael Scott authored
490
491 Set the value of an S register.
492
bc4de54 @moritz add '=cut' lines to some POD documents. Closes trac #19, jimmy++
moritz authored
493 =cut
494
3e1f322 Inline docs update
Michael Scott authored
495 */
496
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
497 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
498 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
499 Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum,
ef4c70a @chromatic Sanitize external interface, mostly by changing Parrot_STRING to Parr…
chromatic authored
500 Parrot_String value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
501 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
502 ASSERT_ARGS(Parrot_set_strreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
503 REG_STR(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
504 }
505
3e1f322 Inline docs update
Michael Scott authored
506 /*
507
4dc854f @coke [cage] run 'make headerizer'
coke authored
508 =item C<void Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum, Parrot_PMC
509 value)>
3e1f322 Inline docs update
Michael Scott authored
510
511 Set the value of a P register.
512
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
513 =cut
514
3e1f322 Inline docs update
Michael Scott authored
515 */
516
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
517 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
518 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
519 Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum,
d067bc6 @ambs 80's cuts.
ambs authored
520 Parrot_PMC value)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
521 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
522 ASSERT_ARGS(Parrot_set_pmcreg)
db561ab @petdance Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
petdance authored
523 REG_PMC(interp, regnum) = value;
b4bdfa8 Stub in some new object manipulation methods, and some extension rout…
Dan Sugalski authored
524 }
525
000d780 Add in some string construction functions
Dan Sugalski authored
526 /*=for api extend Parrot_new_string
527 *
528 */
3e1f322 Inline docs update
Michael Scott authored
529 /*
530
4dc854f @coke [cage] run 'make headerizer'
coke authored
531 =item C<Parrot_String Parrot_new_string(PARROT_INTERP, const char *buffer,
532 Parrot_UInt length, const char * const encoding_name, Parrot_UInt flags)>
3e1f322 Inline docs update
Michael Scott authored
533
3a348a0 anchor overflow array immediately
Leopold Toetsch authored
534 Create a new Parrot string from a passed-in buffer. Pass in a 0 for
e89e713 Here is my (large-ish) patch which integrates ICU into the core of
Dan Sugalski authored
535 flags for right now.
3e1f322 Inline docs update
Michael Scott authored
536
537 A copy of the buffer is made.
538
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
539 =cut
540
3e1f322 Inline docs update
Michael Scott authored
541 */
542
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
543 PARROT_EXPORT
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
544 PARROT_WARN_UNUSED_RESULT
545 PARROT_CANNOT_RETURN_NULL
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
546 Parrot_String
258de48 @chromatic [src] Cleaned up some conversion and signedness warnings.
chromatic authored
547 Parrot_new_string(PARROT_INTERP, ARGIN_NULLOK(const char *buffer),
548 Parrot_UInt length, ARGIN_NULLOK(const char * const encoding_name),
549 Parrot_UInt flags)
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
550 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
551 ASSERT_ARGS(Parrot_new_string)
ef4c70a @chromatic Sanitize external interface, mostly by changing Parrot_STRING to Parr…
chromatic authored
552 Parrot_String retval;
456db43 @nwellnhof [str] Prepare deprecation of string_* functions
nwellnhof authored
553 const STR_VTABLE *encoding;
554
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
555 PARROT_CALLIN_START(interp);
456db43 @nwellnhof [str] Prepare deprecation of string_* functions
nwellnhof authored
556
557 if (encoding_name) {
558 encoding = Parrot_find_encoding(interp, encoding_name);
559 if (!encoding)
560 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
561 "Can't make '%s' encoding strings", encoding_name);
562 }
563 else
564 encoding = Parrot_default_encoding_ptr;
565
566 retval = Parrot_str_new_init(interp, buffer, length, encoding, flags);
567
3240c6e @chipdude Consistently name interpreter "interp" instead of "interpreter".
chipdude authored
568 PARROT_CALLIN_END(interp);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
569 return retval;
000d780 Add in some string construction functions
Dan Sugalski authored
570 }
571
3e1f322 Inline docs update
Michael Scott authored
572 /*
573
b12ac0b @petdance function annotations
petdance authored
574 =item C<Parrot_Language Parrot_find_language(PARROT_INTERP, const char
575 *language)>
3e1f322 Inline docs update
Michael Scott authored
576
577 Find the magic language token for a language, by language name.
578
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
579 =cut
580
3e1f322 Inline docs update
Michael Scott authored
581 */
582
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
583 PARROT_EXPORT
b12ac0b @petdance function annotations
petdance authored
584 PARROT_PURE_FUNCTION
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
585 PARROT_WARN_UNUSED_RESULT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
586 Parrot_Language
b12ac0b @petdance function annotations
petdance authored
587 Parrot_find_language(SHIM_INTERP, SHIM(const char *language))
831ff97 @petdance Added check to headerizer to check sanity of parms. Tweaked *.c head…
petdance authored
588 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
589 ASSERT_ARGS(Parrot_find_language)
000d780 Add in some string construction functions
Dan Sugalski authored
590 return 0;
591 }
592
3e1f322 Inline docs update
Michael Scott authored
593 /*
594
4dc854f @coke [cage] run 'make headerizer'
coke authored
595 =item C<void Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc)>
3e1f322 Inline docs update
Michael Scott authored
596
e1f3d50 @cotto [gc] replace/remove "DOD" in comments in most files in src/
cotto authored
597 Add a reference of the PMC to the interpreter's GC registry. This prevents PMCs
598 only known to extension from getting destroyed during GC runs.
3e1f322 Inline docs update
Michael Scott authored
599
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
600 =cut
601
3e1f322 Inline docs update
Michael Scott authored
602 */
9b7b3de register ops
Leopold Toetsch authored
603
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
604 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
605 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
606 Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc)
9b7b3de register ops
Leopold Toetsch authored
607 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
608 ASSERT_ARGS(Parrot_register_pmc)
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
609 PARROT_CALLIN_START(interp);
847522f @Whiteknight rename the rest of the functions in pmc.c, start updating the rest of…
Whiteknight authored
610 Parrot_pmc_gc_register(interp, pmc);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
611 PARROT_CALLIN_END(interp);
9b7b3de register ops
Leopold Toetsch authored
612 }
613
3e1f322 Inline docs update
Michael Scott authored
614 /*
615
4dc854f @coke [cage] run 'make headerizer'
coke authored
616 =item C<void Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc)>
3e1f322 Inline docs update
Michael Scott authored
617
e1f3d50 @cotto [gc] replace/remove "DOD" in comments in most files in src/
cotto authored
618 Remove a reference of the PMC from the interpreter's GC registry. If the
619 reference count reaches zero, the PMC will be destroyed during the next GC run.
3e1f322 Inline docs update
Michael Scott authored
620
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
621 =cut
622
3e1f322 Inline docs update
Michael Scott authored
623 */
9b7b3de register ops
Leopold Toetsch authored
624
42d0af3 @particle #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
particle authored
625 PARROT_EXPORT
be68e0d @petdance Headerized extend.h and extend.c
petdance authored
626 void
c4b44b0 @petdance Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
petdance authored
627 Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc)
9b7b3de register ops
Leopold Toetsch authored
628 {
00f1c24 @Infinoid [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
Infinoid authored
629 ASSERT_ARGS(Parrot_unregister_pmc)
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
630 PARROT_CALLIN_START(interp);
847522f @Whiteknight rename the rest of the functions in pmc.c, start updating the rest of…
Whiteknight authored
631 Parrot_pmc_gc_unregister(interp, pmc);
ffd5c6d Make the extension interface set stacktop right when it needs to so
Dan Sugalski authored
632 PARROT_CALLIN_END(interp);
9b7b3de register ops
Leopold Toetsch authored
633 }
634
06fb631 @paultcochrane [core] Added function documentation.
paultcochrane authored
635 /*
636
859b8a9 @cotto [extend] add functions for string registering and unregistering for e…
cotto authored
637 =item C<void Parrot_register_string(PARROT_INTERP, Parrot_String s)>
638
639 Add a reference of the string to the interpreter's GC registry. This prevents
640 strings only known to extension from getting destroyed during GC runs.
641
642 =cut
643
644 */
645
646 PARROT_EXPORT
647 void
648 Parrot_register_string(PARROT_INTERP, Parrot_String s)
649 {
650 ASSERT_ARGS(Parrot_register_string)
651 PARROT_CALLIN_START(interp);
652 Parrot_str_gc_register(interp, s);
653 PARROT_CALLIN_END(interp);
654 }
655
656 /*
657
658 =item C<void Parrot_unregister_string(PARROT_INTERP, Parrot_String s)>
659
660 Remove a reference of the string from the interpreter's GC registry. If the
661 reference count reaches zero, the string will be destroyed during the next GC
662 run.
663
664 =cut
665
666 */
667
668 PARROT_EXPORT
669 void
670 Parrot_unregister_string(PARROT_INTERP, Parrot_String s)
671 {
672 ASSERT_ARGS(Parrot_unregister_string)
673 PARROT_CALLIN_START(interp);
674 Parrot_str_gc_unregister(interp, s);
675 PARROT_CALLIN_END(interp);
676 }
677
678 /*
679
4dc854f @coke [cage] run 'make headerizer'
coke authored
680 =item C<Parrot_PMC Parrot_sub_new_from_c_func(PARROT_INTERP, void (*func(void)),
681 const char * signature)>
50f5936 @NotFound [core] add Parrot_sub_new_from_c_func to extend.h
NotFound authored
682
6d4f4cf @NotFound [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
NotFound authored
683 Returns a PMC sub wrapper for a c function.
50f5936 @NotFound [core] add Parrot_sub_new_from_c_func to extend.h
NotFound authored
684
685 =cut
686
687 */
688
689 PARROT_EXPORT
690 Parrot_PMC
691 Parrot_sub_new_from_c_func(PARROT_INTERP,
969837b @Infinoid [cage] Add ARGIN() to some new function arguments.
Infinoid authored
692 ARGIN(void (*func)(void)), ARGIN(const char * signature))
50f5936 @NotFound [core] add Parrot_sub_new_from_c_func to extend.h
NotFound authored
693 {
6b45a4c @NotFound [cage] add missed ASSERT_ARGS
NotFound authored
694 ASSERT_ARGS(Parrot_sub_new_from_c_func)
50f5936 @NotFound [core] add Parrot_sub_new_from_c_func to extend.h
NotFound authored
695 Parrot_String sig = Parrot_new_string(interp, signature, strlen(signature),
696 (char *) NULL, 0);
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored
697 Parrot_PMC sub = Parrot_pmc_new(interp, enum_class_NCI);
50f5936 @NotFound [core] add Parrot_sub_new_from_c_func to extend.h
NotFound authored
698 VTABLE_set_pointer_keyed_str(interp, sub, sig, F2DPTR(func));
699 return sub;
700 }
701
702 /*
703
4dc854f @coke [cage] run 'make headerizer'
coke authored
704 =item C<Parrot_PMC Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype)>
6d4f4cf @NotFound [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
NotFound authored
705
706 Create a class with the type given
707
708 =cut
709
710 */
711
712 PARROT_EXPORT
713 Parrot_PMC
714 Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype)
715 {
716 ASSERT_ARGS(Parrot_PMC_newclass)
717 Parrot_PMC result;
718 PARROT_CALLIN_START(interp);
719
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored
720 result = Parrot_pmc_new_init(interp, enum_class_Class, classtype);
6d4f4cf @NotFound [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
NotFound authored
721
722 PARROT_CALLIN_END(interp);
723 return result;
724 }
725
726 /*
727
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
728 =back
729
3e1f322 Inline docs update
Michael Scott authored
730 =head1 SEE ALSO
731
0ba0e8a Remove extend.pod; superseded by PDD11
Simon Glover authored
732 See F<include/parrot/extend.h> and F<docs/pdds/pdd11_extending.pod>.
3e1f322 Inline docs update
Michael Scott authored
733
734 =head1 HISTORY
735
736 Initial version by Dan Sugalski.
737
bc15dd5 @paultcochrane [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
paultcochrane authored
738 =cut
739
3e1f322 Inline docs update
Michael Scott authored
740 */
741
2a130ef @particle [PDD07]:
particle authored
742
3e1f322 Inline docs update
Michael Scott authored
743 /*
99b337c start of actual extension routines and docs
Dan Sugalski authored
744 * Local variables:
2a130ef @particle [PDD07]:
particle authored
745 * c-file-style: "parrot"
99b337c start of actual extension routines and docs
Dan Sugalski authored
746 * End:
1d7dded @plobsing update C file vim modelines
plobsing authored
747 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
99b337c start of actual extension routines and docs
Dan Sugalski authored
748 */
Something went wrong with that request. Please try again.