Skip to content
Newer
Older
100644 368 lines (256 sloc) 9.6 KB
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
1 /*
48311a5 @petdance teeny consting
petdance authored May 20, 2009
2 Copyright (C) 2007-2009, Parrot Foundation.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
3
4 =head1 NAME
5
6 src/pmc/exporter.pmc - Export globals from one namespace to another
7
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
8 =head1 SYNOPSIS
9
10 You can use Exporter in PIR to import subs from a library. At its simplest:
11
12 .sub main :main
13 load_bytecode 'Test/More.pir'
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
14
bdc07b9 @chromatic [PMC] Add Exporter documentation into POD (Pabellon, RT #44487).
chromatic authored Oct 13, 2007
15 .local pmc exporter, src_ns, dest_ns
16 src_ns = get_namespace [ 'Test'; 'More' ]
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
17 exporter = new 'Exporter'
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
18
bdc07b9 @chromatic [PMC] Add Exporter documentation into POD (Pabellon, RT #44487).
chromatic authored Oct 13, 2007
19 exporter.'import'( src_ns :named('source') 'plan ok' :named('globals') )
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
20 plan(1)
21 ok(1, 'exporter has imported the requested functions')
22 .end
23
bdc07b9 @chromatic [PMC] Add Exporter documentation into POD (Pabellon, RT #44487).
chromatic authored Oct 13, 2007
24 You can also specify the exporter attributes before making the import call,
25 for example to import into the alternate namespace 'Foo' you could use the
26 following code:
27
28 src_ns = get_namespace [ 'Test'; 'More' ]
29 dest_ns = get_namespace [ 'Foo' ]
30 exporter.'source'(src_ns)
31 exporter.'destination'(dest_ns)
32 exporter.'import'('plan ok' :named('globals'))
33
34 You can even import subroutines under different names if globals is a hash:
35
36 globals = new 'Hash'
37 globals['plan'] = 'steps'
38 globals['ok'] = 'passed'
39 exporter.'import'(globals :named('globals'))
40 steps(1)
41 passed(1)
42
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
43
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
44 =head1 DESCRIPTION
45
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
46 Exports globals from one namespace to another. Exporter always uses
6498378 @particle [pmc]: update Exporter documentation based on draft guidelines
particle authored Apr 5, 2007
47 the typed namespace interface, as outlined in
48 F<docs/pdds/pdd21_namespaces.pod>.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
49
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
50 Exporter is not derived from any other PMC, and does not provide any
1df1b75 @coke Eliminate 'vtable method'. It's a vtable, or a vtable function.
coke authored Mar 30, 2010
51 vtable interface--its interface consists solely of methods, not
52 vtable functions.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
53
54 =head2 Structure
55
56 The Exporter PMC structure (C<Parrot_Exporter>) consists of three items:
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
57
58 =over 4
59
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
60 =item C<ns_src>
61
62 The source namespace -- a NameSpace PMC.
5b556ee @particle [pmc]: Exporter is complete
particle authored Apr 10, 2007
63 A Null PMC is allocated during initialization.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
64
65 =item C<ns_dest>
66
67 The destination namespace -- a NameSpace PMC.
4b47d4c @particle [pmc]: Exporter
particle authored Apr 5, 2007
68 A PMC representing the current namespace is allocated upon initialization.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
69
70 =item C<globals>
71
bdc07b9 @chromatic [PMC] Add Exporter documentation into POD (Pabellon, RT #44487).
chromatic authored Oct 13, 2007
72 The globals to export -- a PMC that implements a hash, an array, a String
73 containing a list of space-separated subroutine names or Null.
74
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
75 A Null PMC is allocated during initialization.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
76
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
77 =cut
78
79 */
80
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
81 /*
82
83 =back
84
85 =head2 Functions
86
87 =over 4
88
89 =cut
90
91 */
92
6bdd5f9 @petdance headerizer now runs on PMC files
petdance authored Mar 28, 2010
93 /* HEADERIZER HFILE: none */
94 /* HEADERIZER BEGIN: static */
95 /* HEADERIZER END: static */
96
6b81760 @Whiteknight [pmc] we don't need need_ext anymore, so BALEETED
Whiteknight authored Aug 23, 2009
97 pmclass Exporter auto_attrs {
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
98
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
99 ATTR PMC *ns_src;
100 ATTR PMC *ns_dest;
101 ATTR PMC *globals;
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
102
103 /*
104
105 =item C<void init()>
106
b54e3d5 @particle [pmc]: documentation updates
particle authored Apr 13, 2007
107 Initializes an Exporter PMC.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
108
109 =cut
110
111 */
112
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
113 VTABLE void init() {
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
114 /* Set up the object. */
ac99f44 @NotFound [cage] full use of SET/GET ATTR in exporter PMC
NotFound authored Aug 6, 2009
115 SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
540d4c3 @bacek Merge context_pmc3 branch into trunk.
bacek authored Sep 3, 2009
116 SET_ATTR_ns_dest(INTERP, SELF, Parrot_pcc_get_namespace(INTERP, CURRENT_CONTEXT(INTERP)));
ac99f44 @NotFound [cage] full use of SET/GET ATTR in exporter PMC
NotFound authored Aug 6, 2009
117 SET_ATTR_globals(INTERP, SELF, PMCNULL);
366638e @particle [pmc]: set pmc flags after anchoring to prevent accidental collection…
particle authored Jul 20, 2007
118
1997c49 @cotto [gc] remove/replace DOD references in core PMCs
cotto authored Feb 12, 2009
119 /* Set flags for custom GC mark and destroy. */
366638e @particle [pmc]: set pmc flags after anchoring to prevent accidental collection…
particle authored Jul 20, 2007
120 PObj_custom_mark_SET(SELF);
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
121 }
122
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
123 /*
124
125 =item C<void mark()>
126
127 Mark referenced strings and PMCs in the structure as live.
128
129 =cut
130
131 */
132
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
133 VTABLE void mark() {
ac99f44 @NotFound [cage] full use of SET/GET ATTR in exporter PMC
NotFound authored Aug 6, 2009
134 PMC *ns_src;
135 PMC *ns_dest;
136 PMC *globals;
e8c1290 @NotFound [cage] codingstd hard tabs, mikehh++
NotFound authored Aug 6, 2009
137 GET_ATTR_ns_src(INTERP, SELF, ns_src);
138 GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
139 GET_ATTR_globals(INTERP, SELF, globals);
ac99f44 @NotFound [cage] full use of SET/GET ATTR in exporter PMC
NotFound authored Aug 6, 2009
140
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
141 Parrot_gc_mark_PMC_alive(INTERP, ns_src);
142 Parrot_gc_mark_PMC_alive(INTERP, ns_dest);
143 Parrot_gc_mark_PMC_alive(INTERP, globals);
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
144 }
145
146
147 /*
148
149 =back
150
151 =head2 Methods
152
153 =over 4
154
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
155 =item C<METHOD
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
156 source(PMC *src :optional, int got_src :opt_flag)>
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
157
158 Accessor for the source NameSpace object (C<ns_src>.)
159 Sets the value if C<src> is passed, otherwise returns the value.
160 Throws an exception if a non-NameSpace PMC is passed.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
161
162 =cut
163
164 */
165
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
166 METHOD source(PMC *src :optional, int got_src :opt_flag) {
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
167 if (got_src) {
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
168 if (src->vtable->base_type != enum_class_NameSpace)
8e59a00 @NotFound use appropiate exception types in Expporter misuses
NotFound authored Dec 22, 2010
169 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
ac3ceb6 @particle [pmc] finish Exporter's 'source' and 'destination' methods
particle authored Mar 28, 2007
170 "source must be a NameSpace PMC");
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
171
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
172 SET_ATTR_ns_src(INTERP, SELF, src);
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
173 }
174 else {
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
175 PMC *tmp_ns_src;
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
176 GET_ATTR_ns_src(INTERP, SELF, tmp_ns_src);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
177 RETURN(PMC *tmp_ns_src);
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
178 }
179 }
180
181
182 /*
183
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
184 =item C<METHOD
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
185 destination(PMC *dest :optional, int got_dest :opt_flag)>
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
186
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
187 Accessor for the destination NameSpace object (C<ns_dest>.)
188 Sets the value if C<dest> is passed, otherwise returns the value.
189 Throws an exception if a non-NameSpace PMC is passed.
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
190
191 =cut
192
193 */
194
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
195 METHOD destination(PMC *dest :optional, int got_dest :opt_flag) {
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
196 if (got_dest) {
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
197
198 if (dest->vtable->base_type != enum_class_NameSpace)
8e59a00 @NotFound use appropiate exception types in Expporter misuses
NotFound authored Dec 22, 2010
199 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
200 "destination must be a NameSpace PMC");
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
201
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
202 SET_ATTR_ns_dest(INTERP, SELF, dest);
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
203 }
204 else {
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
205 PMC *tmp_ns_dest;
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
206 GET_ATTR_ns_dest(INTERP, SELF, tmp_ns_dest);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
207 RETURN(PMC *tmp_ns_dest);
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
208 }
209 }
210
211
212 /*
213
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
214 =item C<METHOD
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
215 globals(PMC *glb :optional, int got_glb :opt_flag)>
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
216
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
217 Accessor for the globals to export (C<globals>.)
218 Sets the value if C<glb> is passed, otherwise returns the value.
219 If C<glb> is a String, it is split on ascii whitespace, and each array member
220 is added as a hash key.
221 If C<glb> implements the array interface, each member is added as a hash key.
222 if C<glb> implements the hash interface, it is assigned to Exporter's
223 C<globals> attribute.
224 Throws an exception if an unknown PMC type is passed.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
225
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
226 =cut
227
228 */
229
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
230 METHOD globals(PMC *glb :optional, int got_glb :opt_flag) {
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
231 STRING * const s_str = CONST_STRING(INTERP, "String");
232 STRING * const s_arr = CONST_STRING(INTERP, "array");
233 STRING * const s_hash = CONST_STRING(INTERP, "hash");
234 STRING * const s_space = CONST_STRING(INTERP, " ");
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
235
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
236 if (got_glb) {
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
237 STRING * const s_empty = CONST_STRING(INTERP, "");
238 PMC *temp_globals = Parrot_pmc_new(INTERP, enum_class_Hash);
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
239
240 if (PMC_IS_NULL(glb)) {
241 temp_globals = PMCNULL;
242 }
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
243 else if (VTABLE_isa(INTERP, glb, s_str) || (VTABLE_does(INTERP, glb, s_arr))) {
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
244 PMC *glb_array;
245 INTVAL n, i;
246
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
247 if (VTABLE_isa(INTERP, glb, s_str))
248 glb_array = Parrot_str_split(INTERP, s_space,
249 VTABLE_get_string(INTERP, glb));
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
250 else
251 glb_array = glb;
252
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
253 n = VTABLE_elements(INTERP, glb_array);
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
254
255 if (n == 0)
256 temp_globals = PMCNULL;
257
40e294a manual optimization for old compiler
Jimmy Zhuo authored Apr 30, 2010
258 for (i = 0; i < n; ++i) {
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
259 STRING * const item = VTABLE_get_string_keyed_int(INTERP, glb_array, i);
260 VTABLE_set_string_keyed_str(INTERP, temp_globals, item, s_empty);
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
261 }
262 }
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
263 else if (VTABLE_does(INTERP, glb, s_hash)) {
264 if (VTABLE_elements(INTERP, glb) == 0)
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
265 temp_globals = PMCNULL;
266 else
267 temp_globals = glb;
268 }
269 else {
8e59a00 @NotFound use appropiate exception types in Expporter misuses
NotFound authored Dec 22, 2010
270 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
271 "Invalid type %d in globals()", glb->vtable->base_type);
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
272 }
273
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
274 SET_ATTR_globals(INTERP, SELF, temp_globals);
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
275 }
276 else {
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
277 PMC *tmp_globals;
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
278 GET_ATTR_globals(INTERP, SELF, tmp_globals);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
279 if (PMC_IS_NULL(tmp_globals)) {
280 RETURN(PMC *PMCNULL);
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
281 }
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
282 else
283 RETURN(PMC *tmp_globals);
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
284 }
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
285 }
286
287
288 /*
289
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
290 =item C<METHOD
37922cf @chromatic [lib/PMC] Modified :named parameter syntax in METHODs to match PDD03,…
chromatic authored Mar 15, 2008
291 import(PMC *dest :optional :named("destination"), int got_dest :opt_flag,
292 PMC *src :optional :named("source"), int got_src :opt_flag,
293 PMC *globals :optional :named("globals"), int got_globals :opt_flag)>
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
294
295 Import C<globals> from the C<src> namespace to the C<dest> namespace.
abc4db2 @particle [pmc]: exporter api changes
particle authored May 14, 2007
296 If C<src>, C<dest>, or C<globals> are passed, they override the current value.
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
297 C<import> follows the semantics of the C<export_to> method
298 of the C<NameSpace> PMC. in particular, if a NULL value is passed
299 for C<globals>, the default set of items will be imported.
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
300 Throws an exception upon error.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
301
302 =cut
303
304 */
305
37922cf @chromatic [lib/PMC] Modified :named parameter syntax in METHODs to match PDD03,…
chromatic authored Mar 15, 2008
306 METHOD import(PMC *dest :optional :named("destination"),
307 int got_dest :opt_flag,
308 PMC *src :optional :named("source"),
309 int got_src :opt_flag,
310 PMC *globals :optional :named("globals"),
311 int got_globals :opt_flag) {
2f8fa82 @particle [pmc]: Exporter beginning 'import' method
particle authored Mar 28, 2007
312
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
313 PMC *ns_src, *ns_dest, *ns_globals;
2f8fa82 @particle [pmc]: Exporter beginning 'import' method
particle authored Mar 28, 2007
314
315 if (got_src)
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
316 PCCINVOKE(INTERP, SELF, "source", PMC *src);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
317
2f8fa82 @particle [pmc]: Exporter beginning 'import' method
particle authored Mar 28, 2007
318 if (got_dest)
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
319 PCCINVOKE(INTERP, SELF, "destination", PMC *dest);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
320
2f8fa82 @particle [pmc]: Exporter beginning 'import' method
particle authored Mar 28, 2007
321 if (got_globals)
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
322 PCCINVOKE(INTERP, SELF, "globals", PMC *globals);
9318910 @particle [pmc] Exporter updates
particle authored Mar 26, 2007
323
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
324 GET_ATTR_ns_src(INTERP, SELF, ns_src);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
325 if (PMC_IS_NULL(ns_src))
8e59a00 @NotFound use appropiate exception types in Expporter misuses
NotFound authored Dec 22, 2010
326 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
327 "source namespace not set");
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
328
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
329 GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
0b29d99 @NotFound change a condition that can't be triggered to an assertion
NotFound authored Dec 24, 2010
330
331 /* This condition must never happen, destination is set during init and
332 * attempts to change it with wrong values are rejected.
333 * Even if it gets changed for unexpected reasons, "export_to" will
334 * catch the problem. */
335 PARROT_ASSERT(!PMC_IS_NULL(ns_dest));
2f8fa82 @particle [pmc]: Exporter beginning 'import' method
particle authored Mar 28, 2007
336
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
337 GET_ATTR_globals(INTERP, SELF, ns_globals);
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
338
26914e1 changed interp in pmc class to INTERP for unification
Jimmy Zhuo authored May 5, 2010
339 PCCINVOKE(INTERP, ns_src, "export_to", PMC *ns_dest, PMC *ns_globals);
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
340 }
341
342
b29ad29 @particle [pmc] Exporter updates
particle authored Apr 3, 2007
343 } /* end pmclass Exporter */
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
344
345 /*
346
347 =back
348
6498378 @particle [pmc]: update Exporter documentation based on draft guidelines
particle authored Apr 5, 2007
349 =head1 STABILITY
350
351 Unstable. This PMC is under active development; major portions of the
352 interface have not yet been completed.
353
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
354 =head1 SEE ALSO
355
eae5b2f @particle [pmc]: documentation overhaul for Exporter
particle authored Mar 30, 2007
356 F<docs/pdds/pdd17_basic_types.pod>, F<docs/pdds/pdd21_namespaces.pod>.
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
357
358 =cut
359
360 */
361
362 /*
363 * Local variables:
364 * c-file-style: "parrot"
365 * End:
1d7dded @plobsing update C file vim modelines
plobsing authored Nov 29, 2010
366 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
9255c82 @paultcochrane [src] Set svn:keywords and svn:eol-style properties appropriately
paultcochrane authored Mar 26, 2007
367 */
Something went wrong with that request. Please try again.