Skip to content
This repository
Newer
Older
100644 758 lines (537 sloc) 17.562 kb
3e1f322b » Michael Scott
2004-01-26 Inline docs update
1 /*
10610ab1 » mikehh
2011-06-13 remove another compiler warning ["/*" within comment]
2 Copyright (C) 2001-2011, Parrot Foundation.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
3
4 =head1 NAME
5
6 src/extend.c - Parrot extension interface
7
8 =head1 DESCRIPTION
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
9
37fe0b34 » Whiteknight
2011-06-12 update some docs in src/extend.c
10 These are utility functions which extension code may use, but which are
11 typically not used by Parrot internally. These functions are for EXTENDING
12 use only, not for EMBEDDING. Embedding should be handed through the embedding
10610ab1 » mikehh
2011-06-13 remove another compiler warning ["/*" within comment]
13 API with c files in directory src/embed/.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
14
37fe0b34 » Whiteknight
2011-06-12 update some docs in src/extend.c
15 Extending situations are things like NCI function libraries, dyn-pmc and
16 dyn-op libraries which are loaded into Parrot and called from Parrot (as
17 opposed to embedding, where an external program calls into Parrot). These
18 functions assume the existance of an interpreter, memory management through
19 GC and stackwalking, and the presence of an exception-handling infrastructure.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
20
21 =head2 Functions
22
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
23 =over 4
24
25 =cut
26
3e1f322b » Michael Scott
2004-01-26 Inline docs update
27 */
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
28
37fe0b34 » Whiteknight
2011-06-12 update some docs in src/extend.c
29 /* DO NOT CALL THESE FUNCTIONS WITHOUT LIBPARROT, OR FROM OUTSIDE LIBPARROT!!
30
31 These functions presume that GC is available and is properly configured
32 (setting the stacktop for stack walking, etc) and that there is an active
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
33 exception-handling infrastructure. Calling these functions when there are
37fe0b34 » Whiteknight
2011-06-12 update some docs in src/extend.c
34 no exception handlers available, including a default top-level handler, or
35 when the GC is not properly initialized can lead to big problems. Be sure
36 to understand the difference between an embedding and an extending
37 situation. Using the wrong kind of function in the wrong situation, or
38 combining some functions from the Embedding API with functions from the
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
39 Extending API is a recipe for disaster. We (Parrot developers) will not be
37fe0b34 » Whiteknight
2011-06-12 update some docs in src/extend.c
40 held responsible if you insist on making these kinds of mistakes.
41
42 If there are utility functions that *YOU* as a user of parrot need from
43 either the extending or the embedding API, please request them or attempt
44 to write them yourself. Blindly mixing things from the wrong API, or
45 calling a function in the wrong context will cause you problems.
46
47 You have been warned.
48
49 Notice that the "Extending API" is a loosely-defined concept which is
50 currently understood to mean the sum of public APIs for various subsystems.
51 This definition may change in the future, but this is what we mean by the
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
52 phrase right now. The functions in this file do not belong to any
53 particular subsystem, and are always part of the extending API. Functions
54 named "Parrot_xxx_..." where "xxx" is a 2- or 3-letter subsystem
55 abbreviation and which are marked with "PARROT_EXPORT" can generally be
56 considered to be part of the public API. Subsystems which are properly
57 arranged will typically have a folder src/xxx/, and an "api.c" file
58 therein for holding API functions from that subsystem. Many of the bigger
59 systems are arranged in this way (and the rest of the systems will be
60 eventually). If so, that is the canonical source of information regarding
61 API functions for that subsystem.
62
63 Other documentation sources, such as the PDDs or other files in the
64 docs/ directory may include other information about the extending API.
ffd5c6dc » Dan Sugalski
2004-08-18 Make the extension interface set stacktop right when it needs to so
65
66 */
67
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
68 #include "parrot/parrot.h"
69 #include "parrot/extend.h"
63889c24 » cotto
2009-02-26 [PMC] replace PMC_struct_val and derivatives with ATTR accessors for …
70 #include "pmc/pmc_sub.h"
68bf4729 » bacek
2009-12-20 Merge context_unify3_simple branch back to trunk.
71 #include "pmc/pmc_callcontext.h"
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
72
490c1c65 » petdance
2007-07-02 Changed HEADERIZER TARGET to HEADERIZER HFILE
73 /* HEADERIZER HFILE: include/parrot/extend.h */
df5e1a10 » petdance
2007-06-15 lie to the headerizer
74
3e1f322b » Michael Scott
2004-01-26 Inline docs update
75 /*
76
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
77 =item C<int Parrot_vfprintf(PARROT_INTERP, Parrot_PMC pio, const char *s,
78 va_list args)>
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
79
80 Writes a C string format with a varargs list to a PIO.
81
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
82 =item C<int Parrot_fprintf(PARROT_INTERP, Parrot_PMC pio, const char *s, ...)>
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
83
84 Writes a C string format with varargs to a PIO.
85
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
86 =item C<int Parrot_printf(NULLOK_INTERP, const char *s, ...)>
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
87
88 Writes a C string format with varargs to C<stdout>.
89
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
90 =item C<int Parrot_eprintf(NULLOK_INTERP, const char *s, ...)>
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
91
92 Writes a C string format with varargs to C<stderr>.
93
fb2ca1e9 » NotFound
2008-08-28 fix lack of cut in a pod comment
94 =cut
95
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
96 */
97
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
98 PARROT_EXPORT
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
99 int
100 Parrot_vfprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
101 ARGIN(const char *s), va_list args)
102 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
103 ASSERT_ARGS(Parrot_vfprintf)
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
104 STRING * str;
105 INTVAL retval;
106
107 str = Parrot_vsprintf_c(interp, s, args);
9f9cea25 » allisonrandal
2008-12-09 [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
108 retval = Parrot_io_putps(interp, pio, str);
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
109
110 return retval;
111 }
112
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
113 PARROT_EXPORT
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
114 int
115 Parrot_fprintf(PARROT_INTERP, ARGIN(Parrot_PMC pio),
116 ARGIN(const char *s), ...)
117 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
118 ASSERT_ARGS(Parrot_fprintf)
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
119 va_list args;
120 INTVAL retval;
121
122 va_start(args, s);
123 retval = Parrot_vfprintf(interp, pio, s, args);
124 va_end(args);
125
126 return retval;
127 }
128
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
129 PARROT_EXPORT
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
130 int
131 Parrot_printf(NULLOK_INTERP, ARGIN(const char *s), ...)
132 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
133 ASSERT_ARGS(Parrot_printf)
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
134 va_list args;
135 INTVAL retval;
136 va_start(args, s);
137
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
138 if (interp)
9f9cea25 » allisonrandal
2008-12-09 [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
139 retval = Parrot_vfprintf(interp, Parrot_io_STDOUT(interp), s, args);
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
140 else
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
141 retval = vfprintf(stdout, s, args);
142 va_end(args);
143
144 return retval;
145 }
146
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
147 PARROT_EXPORT
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
148 int
149 Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...)
150 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
151 ASSERT_ARGS(Parrot_eprintf)
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
152 va_list args;
153 INTVAL retval;
154
155 va_start(args, s);
156
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
157 if (interp)
9f9cea25 » allisonrandal
2008-12-09 [pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r…
158 retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args);
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
159 else
160 retval = vfprintf(stderr, s, args);
87909b39 » NotFound
2008-07-08 Add Parrot_printf and Parrot_eprintf to the extend API
161
162 va_end(args);
163
164 return retval;
165 }
166
167 /*
168
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
169 =item C<Parrot_PMC Parrot_get_root_namespace(PARROT_INTERP)>
4429375e » NotFound
2009-02-18 [core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc…
170
171 Return the root namespace
172
173 =cut
174
175 */
176
177 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
178 PARROT_PURE_FUNCTION
4429375e » NotFound
2009-02-18 [core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc…
179 Parrot_PMC
180 Parrot_get_root_namespace(PARROT_INTERP)
181 {
182 ASSERT_ARGS(Parrot_get_root_namespace)
36938972 » leto
2011-06-19 Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
183
4429375e » NotFound
2009-02-18 [core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc…
184 return interp->root_namespace;
185 }
186
187 /*
188
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
189 =item C<Parrot_PMC Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
190
191 Create and return a new PMC.
192
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
193 =cut
194
3e1f322b » Michael Scott
2004-01-26 Inline docs update
195 */
196
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
197 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
198 Parrot_PMC
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
199 Parrot_PMC_new(PARROT_INTERP, Parrot_Int type)
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
200 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
201 ASSERT_ARGS(Parrot_PMC_new)
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
202 Parrot_PMC newpmc = Parrot_pmc_new_noinit(interp, type);
fa999b00 » Dan Sugalski
2003-10-03 First chunk of extension code done
203 VTABLE_init(interp, newpmc);
204 return newpmc;
205 }
206
3e1f322b » Michael Scott
2004-01-26 Inline docs update
207 /*
208
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
209 =item C<Parrot_Int Parrot_PMC_typenum(PARROT_INTERP, const char *_class)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
210
211 Returns the internal identifier that represents the named class.
212
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
213 =cut
214
3e1f322b » Michael Scott
2004-01-26 Inline docs update
215 */
216
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
217 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
218 Parrot_Int
802efc13 » petdance
2007-12-12 If something is NULLOK(const...) it is by definition ARGIN_NULLOK(con…
219 Parrot_PMC_typenum(PARROT_INTERP, ARGIN_NULLOK(const char *_class))
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
220 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
221 ASSERT_ARGS(Parrot_PMC_typenum)
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
222 Parrot_Int retval = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, _class, 0));
ffd5c6dc » Dan Sugalski
2004-08-18 Make the extension interface set stacktop right when it needs to so
223 return retval;
fa999b00 » Dan Sugalski
2003-10-03 First chunk of extension code done
224 }
225
3e1f322b » Michael Scott
2004-01-26 Inline docs update
226 /*
227
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
228 =item C<Parrot_PMC Parrot_PMC_null(void)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
229
230 Returns the special C<NULL> PMC.
231
06fb631f » paultcochrane
2007-11-05 [core] Added function documentation.
232 =cut
233
3e1f322b » Michael Scott
2004-01-26 Inline docs update
234 */
235
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
236 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
237 PARROT_PURE_FUNCTION
11323f5b » petdance
2011-03-26 fixing null/not-null annotations
238 PARROT_CAN_RETURN_NULL
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
239 Parrot_PMC
240 Parrot_PMC_null(void)
241 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
242 ASSERT_ARGS(Parrot_PMC_null)
8deb08ea » Melvin Smith
2003-10-28 Expose PMCNULL to extension API.
243 return PMCNULL;
244 }
245
3e1f322b » Michael Scott
2004-01-26 Inline docs update
246 /*
247
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
248 =item C<void Parrot_free_cstring(char *string)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
249
250 Deallocate a C string that the interpreter has handed to you.
251
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
252 =cut
253
3e1f322b » Michael Scott
2004-01-26 Inline docs update
254 */
8deb08ea » Melvin Smith
2003-10-28 Expose PMCNULL to extension API.
255
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
256 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
257 void
172bc908 » petdance
2010-04-10 updating annotations
258 Parrot_free_cstring(ARGFREE(char *string))
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
259 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
260 ASSERT_ARGS(Parrot_free_cstring)
b6bc0c34 » allisonrandal
2009-02-03 [pdd28str] Merging the pdd27mmd branch into trunk for r36123 to r36318.
261 Parrot_str_free_cstring(string);
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
262 }
263
3e1f322b » Michael Scott
2004-01-26 Inline docs update
264 /*
265
6c743bef » allisonrandal
2009-10-21 [pcc] Add a generic extend/embed interface function for invoking Parrot
266 =item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC sub_pmc, const char
267 *signature, ...)>
268
269 Call a Parrot subroutine or method with the given function signature. The
270 function signature holds one type character for each argument or return, these
271 are:
272
273 I ... Parrot_Int
274 N ... Parrot_Float
275 S ... Parrot_String
276 P ... Parrot_PMC
277
278 Returns come after the arguments, separated by an arrow, so "PN->S" takes a PMC
279 and a float as arguments and returns a string.
280
281 Pass the variables for the arguments and returns in the same order as the
282 signature, with returns as reference to the variable (so it can be modified).
283
284 Parrot_ext_call(interp, sub, "P->S", pmc_arg, &string_result);
285
286 To call a method, pass the object for the method as the first argument, and
287 mark it in the signature as "Pi" ("i" stands for "invocant").
288
289 Parrot_ext_call(interp, sub, "PiP->S", object_arg, pmc_arg, &string_result);
290
291 =cut
292
293 */
294
295 PARROT_EXPORT
296 void
297 Parrot_ext_call(PARROT_INTERP, ARGIN(Parrot_PMC sub_pmc),
298 ARGIN(const char *signature), ...)
299 {
300 ASSERT_ARGS(Parrot_ext_call)
301 va_list args;
363ca41f » chromatic
2010-03-22 Merged pcc_hackathon_6Mar10 into trunk. Because this changed op numbe…
302 PMC *call_obj;
f3faadb9 » bacek
2010-03-27 Fix build with g++
303 const char *arg_sig, *ret_sig;
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
304 PMC * old_call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
f084166f » petdance
2010-04-09 Removed an unused argument. Fixed consting.
305 Parrot_pcc_split_signature_string(signature, &arg_sig, &ret_sig);
6c743bef » allisonrandal
2009-10-21 [pcc] Add a generic extend/embed interface function for invoking Parrot
306
307 va_start(args, signature);
c9f655c8 » chromatic
2010-03-25 [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
308 call_obj = Parrot_pcc_build_call_from_varargs(interp, PMCNULL,
309 arg_sig, &args);
6c743bef » allisonrandal
2009-10-21 [pcc] Add a generic extend/embed interface function for invoking Parrot
310
363ca41f » chromatic
2010-03-22 Merged pcc_hackathon_6Mar10 into trunk. Because this changed op numbe…
311 Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, call_obj);
312 call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
313 Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args,
314 PARROT_ERRORS_RESULT_COUNT_FLAG);
315 va_end(args);
112c28ea » bacek
2010-03-23 Restore old CallContext in Parrot_ext_call. Spotted by fperrad++
316 Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_call_obj);
6c743bef » allisonrandal
2009-10-21 [pcc] Add a generic extend/embed interface function for invoking Parrot
317 }
318
668635fb » NotFound
2011-02-04 add function Parrot_ext_try and use it in extend_vtable tests
319 /*
320
321 =item C<void Parrot_ext_try(PARROT_INTERP, void (*cfunction(Parrot_Interp, void
322 *)), void (*chandler(Parrot_Interp, PMC *, void *)), void *data)>
323
324 Executes the cfunction argument wrapped in a exception handler.
325 If the function throws, the provided handler function is invoked
326
327 =cut
328
329 */
330
037628f8 » mikehh
2011-06-19 wrap macro arguments
331 #define POP_CONTEXT(interp, curctx, intialctx) \
332 Parrot_warn((interp), PARROT_WARNINGS_NONE_FLAG, \
333 "popping context in Parrot_ext_try"); \
334 do { \
335 if ((curctx) == NULL) \
336 do_panic((interp), "cannot restore context", \
337 __FILE__, __LINE__); \
338 } while (((curctx) = CONTEXT(interp)) != initialctx); \
3f7b5d35 » leto
2011-06-18 Refactor duplicated context popping code into a macro
339
340
668635fb » NotFound
2011-02-04 add function Parrot_ext_try and use it in extend_vtable tests
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;
8bf9b75c » NotFound
2011-02-10 restore initial context in Parrot_ext_try
351 Parrot_Context *initialctx, *curctx;
352 initialctx = CONTEXT(interp);
668635fb » NotFound
2011-02-04 add function Parrot_ext_try and use it in extend_vtable tests
353 switch (setjmp(jmp.resume)) {
354 case 0: /* try */
355 Parrot_ex_add_c_handler(interp, &jmp);
356 (*cfunction)(interp, data);
8bf9b75c » NotFound
2011-02-10 restore initial context in Parrot_ext_try
357 curctx = CONTEXT(interp);
358 if (curctx != initialctx) {
3f7b5d35 » leto
2011-06-18 Refactor duplicated context popping code into a macro
359 POP_CONTEXT(interp, curctx, initialctx);
8bf9b75c » NotFound
2011-02-10 restore initial context in Parrot_ext_try
360 }
668635fb » NotFound
2011-02-04 add function Parrot_ext_try and use it in extend_vtable tests
361 Parrot_cx_delete_handler_local(interp, STRINGNULL);
362 break;
363 default: /* catch */
364 {
365 PMC *exception = jmp.exception;
b03561f8 » NotFound
2011-02-11 initialize curctx in the catch part of Parrot_ext_try
366 curctx = CONTEXT(interp);
8bf9b75c » NotFound
2011-02-10 restore initial context in Parrot_ext_try
367 if (curctx != initialctx) {
3f7b5d35 » leto
2011-06-18 Refactor duplicated context popping code into a macro
368 POP_CONTEXT(interp, curctx, initialctx);
8bf9b75c » NotFound
2011-02-10 restore initial context in Parrot_ext_try
369 }
668635fb » NotFound
2011-02-04 add function Parrot_ext_try and use it in extend_vtable tests
370 Parrot_cx_delete_handler_local(interp, STRINGNULL);
371 if (chandler)
372 (*chandler)(interp, exception, data);
373 }
374 }
375 }
376 }
c9f655c8 » chromatic
2010-03-25 [src] Fixed yet another Parrot_pcc_split_signature_string() memory le…
377
6c743bef » allisonrandal
2009-10-21 [pcc] Add a generic extend/embed interface function for invoking Parrot
378 /*
379
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
380 =item C<Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
381
382 Return the value of an integer register.
383
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
384 DEPRECATED: Do not use. See TT #2133
385
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
386 =cut
387
3e1f322b » Michael Scott
2004-01-26 Inline docs update
388 */
3b31e028 » Dan Sugalski
2003-10-09 More extension stuff at least partially stubbed out
389
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
390 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
391 PARROT_PURE_FUNCTION
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
392 Parrot_Int
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
393 Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
394 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
395 ASSERT_ARGS(Parrot_get_intreg)
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
396 return REG_INT(interp, regnum);
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
397 }
398
3e1f322b » Michael Scott
2004-01-26 Inline docs update
399 /*
400
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
401 =item C<Parrot_Float Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
402
403 Return the value of a numeric register.
404
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
405 DEPRECATED: Do not use. See TT #2133
406
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
407 =cut
408
3e1f322b » Michael Scott
2004-01-26 Inline docs update
409 */
410
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
411 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
412 PARROT_PURE_FUNCTION
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
413 Parrot_Float
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
414 Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
415 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
416 ASSERT_ARGS(Parrot_get_numreg)
36938972 » leto
2011-06-19 Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
417
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
418 return REG_NUM(interp, regnum);
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
419 }
420
3e1f322b » Michael Scott
2004-01-26 Inline docs update
421 /*
422
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
423 =item C<Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
424
425 Return the value of a string register.
426
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
427 DEPRECATED: Do not use. See TT #2133
428
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
429 =cut
430
3e1f322b » Michael Scott
2004-01-26 Inline docs update
431 */
432
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
433 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
434 PARROT_PURE_FUNCTION
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
435 Parrot_String
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
436 Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
437 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
438 ASSERT_ARGS(Parrot_get_strreg)
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
439 return REG_STR(interp, regnum);
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
440 }
441
3e1f322b » Michael Scott
2004-01-26 Inline docs update
442 /*
443
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
444 =item C<Parrot_PMC Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
445
446 Return the value of a PMC register.
447
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
448 DEPRECATED: Do not use. See TT #2133
449
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
450 =cut
451
3e1f322b » Michael Scott
2004-01-26 Inline docs update
452 */
453
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
454 PARROT_EXPORT
b12ac0b8 » petdance
2010-06-30 function annotations
455 PARROT_PURE_FUNCTION
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
456 Parrot_PMC
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
457 Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
458 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
459 ASSERT_ARGS(Parrot_get_pmcreg)
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
460 return REG_PMC(interp, regnum);
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
461 }
462
3e1f322b » Michael Scott
2004-01-26 Inline docs update
463 /*
464
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
465 =item C<void Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Int
466 value)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
467
468 Set the value of an I register.
469
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
470 DEPRECATED: Do not use. See TT #2133
471
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
472 =cut
473
3e1f322b » Michael Scott
2004-01-26 Inline docs update
474 */
475
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
476 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
477 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
478 Parrot_set_intreg(PARROT_INTERP, Parrot_Int regnum,
d067bc63 » ambs
2006-08-20 80's cuts.
479 Parrot_Int value)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
480 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
481 ASSERT_ARGS(Parrot_set_intreg)
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
482 REG_INT(interp, regnum) = value;
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
483 }
484
3e1f322b » Michael Scott
2004-01-26 Inline docs update
485 /*
486
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
487 =item C<void Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum, Parrot_Float
488 value)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
489
490 Set the value of an N register.
491
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
492 DEPRECATED: Do not use. See TT #2133
493
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
494 =cut
495
3e1f322b » Michael Scott
2004-01-26 Inline docs update
496 */
497
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
498 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
499 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
500 Parrot_set_numreg(PARROT_INTERP, Parrot_Int regnum,
d067bc63 » ambs
2006-08-20 80's cuts.
501 Parrot_Float value)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
502 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
503 ASSERT_ARGS(Parrot_set_numreg)
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
504 REG_NUM(interp, regnum) = value;
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
505 }
506
3e1f322b » Michael Scott
2004-01-26 Inline docs update
507 /*
508
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
509 =item C<void Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum, Parrot_String
510 value)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
511
512 Set the value of an S register.
513
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
514 DEPRECATED: Do not use. See TT #2133
515
bc4de54b » moritz
2008-12-06 add '=cut' lines to some POD documents. Closes trac #19, jimmy++
516 =cut
517
3e1f322b » Michael Scott
2004-01-26 Inline docs update
518 */
519
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
520 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
521 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
522 Parrot_set_strreg(PARROT_INTERP, Parrot_Int regnum,
ef4c70a9 » chromatic
2007-05-02 Sanitize external interface, mostly by changing Parrot_STRING to Parr…
523 Parrot_String value)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
524 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
525 ASSERT_ARGS(Parrot_set_strreg)
36938972 » leto
2011-06-19 Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
526
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
527 REG_STR(interp, regnum) = value;
5f1d8d9f » bacek
2011-02-17 Add write barrier to Parrot_set_strreg
528 PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
529 }
530
3e1f322b » Michael Scott
2004-01-26 Inline docs update
531 /*
532
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
533 =item C<void Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum, Parrot_PMC
534 value)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
535
536 Set the value of a P register.
537
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
538 DEPRECATED: Do not use. See TT #2133
539
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
540 =cut
541
3e1f322b » Michael Scott
2004-01-26 Inline docs update
542 */
543
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
544 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
545 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
546 Parrot_set_pmcreg(PARROT_INTERP, Parrot_Int regnum,
d067bc63 » ambs
2006-08-20 80's cuts.
547 Parrot_PMC value)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
548 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
549 ASSERT_ARGS(Parrot_set_pmcreg)
36938972 » leto
2011-06-19 Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
550
db561ab5 » petdance
2007-07-09 Changed REG_(INT|NUM|PMC|STR) to explicitly pass in the interp variab…
551 REG_PMC(interp, regnum) = value;
2f168ec3 » bacek
2011-02-17 Add write barrier to Parrot_set_pmcreg.
552 PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
b4bdfa89 » Dan Sugalski
2003-10-09 Stub in some new object manipulation methods, and some extension rout…
553 }
554
000d780d » Dan Sugalski
2003-10-17 Add in some string construction functions
555 /*=for api extend Parrot_new_string
556 *
557 */
3e1f322b » Michael Scott
2004-01-26 Inline docs update
558 /*
559
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
560 =item C<Parrot_String Parrot_new_string(PARROT_INTERP, const char *buffer,
561 Parrot_UInt length, const char * const encoding_name, Parrot_UInt flags)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
562
3a348a0e » Leopold Toetsch
2004-05-03 anchor overflow array immediately
563 Create a new Parrot string from a passed-in buffer. Pass in a 0 for
e89e713f » Dan Sugalski
2004-04-09 Here is my (large-ish) patch which integrates ICU into the core of
564 flags for right now.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
565
566 A copy of the buffer is made.
567
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
568 DEPRECATED: Use Parrot_str_new or Parrot_str_new_init instead. See TT #2133
569
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
570 =cut
571
3e1f322b » Michael Scott
2004-01-26 Inline docs update
572 */
573
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
574 PARROT_EXPORT
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
575 PARROT_WARN_UNUSED_RESULT
576 PARROT_CANNOT_RETURN_NULL
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
577 Parrot_String
258de48b » chromatic
2008-10-14 [src] Cleaned up some conversion and signedness warnings.
578 Parrot_new_string(PARROT_INTERP, ARGIN_NULLOK(const char *buffer),
579 Parrot_UInt length, ARGIN_NULLOK(const char * const encoding_name),
580 Parrot_UInt flags)
831ff973 » petdance
2006-06-13 Added check to headerizer to check sanity of parms. Tweaked *.c heade…
581 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
582 ASSERT_ARGS(Parrot_new_string)
ef4c70a9 » chromatic
2007-05-02 Sanitize external interface, mostly by changing Parrot_STRING to Parr…
583 Parrot_String retval;
456db438 » nwellnhof
2010-10-03 [str] Prepare deprecation of string_* functions
584 const STR_VTABLE *encoding;
585
586 if (encoding_name) {
587 encoding = Parrot_find_encoding(interp, encoding_name);
588 if (!encoding)
589 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
590 "Can't make '%s' encoding strings", encoding_name);
591 }
592 else
593 encoding = Parrot_default_encoding_ptr;
594
595 retval = Parrot_str_new_init(interp, buffer, length, encoding, flags);
596
ffd5c6dc » Dan Sugalski
2004-08-18 Make the extension interface set stacktop right when it needs to so
597 return retval;
000d780d » Dan Sugalski
2003-10-17 Add in some string construction functions
598 }
599
3e1f322b » Michael Scott
2004-01-26 Inline docs update
600 /*
601
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
602 =item C<void Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
603
e1f3d509 » cotto
2009-02-12 [gc] replace/remove "DOD" in comments in most files in src/
604 Add a reference of the PMC to the interpreter's GC registry. This prevents PMCs
605 only known to extension from getting destroyed during GC runs.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
606
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
607 DEPRECATED: Use Parrot_pmc_gc_register instead
608
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
609 =cut
610
3e1f322b » Michael Scott
2004-01-26 Inline docs update
611 */
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
612
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
613 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
614 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
615 Parrot_register_pmc(PARROT_INTERP, Parrot_PMC pmc)
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
616 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
617 ASSERT_ARGS(Parrot_register_pmc)
847522f0 » Whiteknight
2010-02-16 rename the rest of the functions in pmc.c, start updating the rest of…
618 Parrot_pmc_gc_register(interp, pmc);
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
619 }
620
3e1f322b » Michael Scott
2004-01-26 Inline docs update
621 /*
622
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
623 =item C<void Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc)>
3e1f322b » Michael Scott
2004-01-26 Inline docs update
624
e1f3d509 » cotto
2009-02-12 [gc] replace/remove "DOD" in comments in most files in src/
625 Remove a reference of the PMC from the interpreter's GC registry. If the
626 reference count reaches zero, the PMC will be destroyed during the next GC run.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
627
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
628 DEPRECATED: Use Parrot_pmc_gc_unregister instead
629
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
630 =cut
631
3e1f322b » Michael Scott
2004-01-26 Inline docs update
632 */
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
633
42d0af3d » particle
2008-11-19 #60624: [DEPRECATED] PARROT_API changes to PARROT_EXPORT
634 PARROT_EXPORT
be68e0dc » petdance
2007-06-20 Headerized extend.h and extend.c
635 void
c4b44b07 » petdance
2007-07-22 Putting PARROT_INTERP in all the typedefs instead of Interp *, so tha…
636 Parrot_unregister_pmc(PARROT_INTERP, Parrot_PMC pmc)
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
637 {
00f1c245 » Infinoid
2009-01-05 [cage] Attempt to work around MSVC warnings related to ASSERT_ARGS().
638 ASSERT_ARGS(Parrot_unregister_pmc)
847522f0 » Whiteknight
2010-02-16 rename the rest of the functions in pmc.c, start updating the rest of…
639 Parrot_pmc_gc_unregister(interp, pmc);
9b7b3de2 » Leopold Toetsch
2003-12-31 register ops
640 }
641
06fb631f » paultcochrane
2007-11-05 [core] Added function documentation.
642 /*
643
859b8a93 » cotto
2010-10-07 [extend] add functions for string registering and unregistering for e…
644 =item C<void Parrot_register_string(PARROT_INTERP, Parrot_String s)>
645
646 Add a reference of the string to the interpreter's GC registry. This prevents
647 strings only known to extension from getting destroyed during GC runs.
648
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
649 DEPRECATED: Use Parrot_str_gc_register instead
650
859b8a93 » cotto
2010-10-07 [extend] add functions for string registering and unregistering for e…
651 =cut
652
653 */
654
655 PARROT_EXPORT
656 void
657 Parrot_register_string(PARROT_INTERP, Parrot_String s)
658 {
659 ASSERT_ARGS(Parrot_register_string)
660 Parrot_str_gc_register(interp, s);
661 }
662
663 /*
664
665 =item C<void Parrot_unregister_string(PARROT_INTERP, Parrot_String s)>
666
667 Remove a reference of the string from the interpreter's GC registry. If the
668 reference count reaches zero, the string will be destroyed during the next GC
669 run.
670
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
671 DEPRECATED: Use Parrot_str_gc_unregister instead
672
859b8a93 » cotto
2010-10-07 [extend] add functions for string registering and unregistering for e…
673 =cut
674
675 */
676
677 PARROT_EXPORT
678 void
679 Parrot_unregister_string(PARROT_INTERP, Parrot_String s)
680 {
681 ASSERT_ARGS(Parrot_unregister_string)
682 Parrot_str_gc_unregister(interp, s);
683 }
684
685 /*
686
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
687 =item C<Parrot_PMC Parrot_sub_new_from_c_func(PARROT_INTERP, void (*func(void)),
688 const char * signature)>
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
689
6d4f4cf9 » NotFound
2009-03-08 [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
690 Returns a PMC sub wrapper for a c function.
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
691
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
692 TODO: Clean this up, move it some place more appropriate
693
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
694 =cut
695
696 */
697
698 PARROT_EXPORT
699 Parrot_PMC
700 Parrot_sub_new_from_c_func(PARROT_INTERP,
969837b8 » Infinoid
2009-03-25 [cage] Add ARGIN() to some new function arguments.
701 ARGIN(void (*func)(void)), ARGIN(const char * signature))
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
702 {
6b45a4c3 » NotFound
2009-02-24 [cage] add missed ASSERT_ARGS
703 ASSERT_ARGS(Parrot_sub_new_from_c_func)
782bf966 » leto
2011-06-19 Attempt to make the MSWin32-x86-multi-thread ttbot happy by ANSI-89-i…
704
705 Parrot_String sig;
706 Parrot_PMC sub;
a0911dbf » leto
2011-06-19 Fix bug in Parrot_sub_new_from_c_func cause by not using PARROT_CALLI…
707
782bf966 » leto
2011-06-19 Attempt to make the MSWin32-x86-multi-thread ttbot happy by ANSI-89-i…
708 sig = Parrot_new_string(interp, signature, strlen(signature),
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
709 (char *) NULL, 0);
782bf966 » leto
2011-06-19 Attempt to make the MSWin32-x86-multi-thread ttbot happy by ANSI-89-i…
710
711 sub = Parrot_pmc_new(interp, enum_class_NCI);
50f5936b » NotFound
2009-02-19 [core] add Parrot_sub_new_from_c_func to extend.h
712 VTABLE_set_pointer_keyed_str(interp, sub, sig, F2DPTR(func));
713 return sub;
714 }
715
716 /*
717
4dc854f8 » coke
2009-04-01 [cage] run 'make headerizer'
718 =item C<Parrot_PMC Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype)>
6d4f4cf9 » NotFound
2009-03-08 [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
719
720 Create a class with the type given
721
942bad25 » Whiteknight
2011-06-21 Several misc cleanups to src/extend.c. Add some TODO and DEPRECATED n…
722 TODO: Clean this up, move this to src/oo.c
723
6d4f4cf9 » NotFound
2009-03-08 [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
724 =cut
725
726 */
727
728 PARROT_EXPORT
729 Parrot_PMC
730 Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype)
731 {
732 ASSERT_ARGS(Parrot_PMC_newclass)
85781e91 » Whiteknight
2011-06-21 Remove PARROT_CALLIN_START and PARROT_CALLIN_END macros. The Extendin…
733 return Parrot_pmc_new_init(interp, enum_class_Class, classtype);
6d4f4cf9 » NotFound
2009-03-08 [core] add Parrot_PMC_push_pmcval and Parrot_PMC_newclass to the exte…
734 }
735
736 /*
737
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
738 =back
739
3e1f322b » Michael Scott
2004-01-26 Inline docs update
740 =head1 SEE ALSO
741
0ba0e8ad » Simon Glover
2004-02-23 Remove extend.pod; superseded by PDD11
742 See F<include/parrot/extend.h> and F<docs/pdds/pdd11_extending.pod>.
3e1f322b » Michael Scott
2004-01-26 Inline docs update
743
744 =head1 HISTORY
745
746 Initial version by Dan Sugalski.
747
bc15dd53 » paultcochrane
2007-09-22 [core] Converted FUNCDOCs to POD and tidied the POD up a bit.
748 =cut
749
3e1f322b » Michael Scott
2004-01-26 Inline docs update
750 */
751
2a130ef7 » particle
2006-09-22 [PDD07]:
752
3e1f322b » Michael Scott
2004-01-26 Inline docs update
753 /*
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
754 * Local variables:
2a130ef7 » particle
2006-09-22 [PDD07]:
755 * c-file-style: "parrot"
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
756 * End:
1d7dded8 » plobsing
2010-11-29 update C file vim modelines
757 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
99b337c0 » Dan Sugalski
2003-10-03 start of actual extension routines and docs
758 */
Something went wrong with that request. Please try again.