Skip to content
This repository
Newer
Older
100644 376 lines (331 sloc) 12.943 kb
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
1 #include "parrot/parrot.h"
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
2 #include "parrot/runcore_api.h"
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
3 #include "parrot/embed.h"
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
4 #include "parrot/api.h"
1b6d1ced » Whiteknight
2010-11-10 start breaking up the embedding stuff into multiple files. Add embed_…
5 #include "embed_private.h"
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
6
3f8ed92a » Whiteknight
2010-11-10 fix some file references and run headerizer to see my work so far
7 /* HEADERIZER HFILE: include/parrot/api.h */
8
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
9 PARROT_API
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
10 Parrot_Int
ae620cc9 » Whiteknight
2010-12-01 changes necessary so we build. Run fails horribly, but we build
11 Parrot_api_get_result(ARGMOD(PMC * interp_pmc), ARGOUT(Parrot_Int *is_error),
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
12 ARGOUT(PMC ** exception),
be50d63d » bluescreen10
2010-11-27 Implemented first version of Parrot_get_result, now a lot of failing …
13 ARGOUT(Parrot_Int *exit_code), ARGOUT(Parrot_String * errmsg))
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
14 {
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
15 EMBED_API_CALLIN(interp_pmc, interp)
be50d63d » bluescreen10
2010-11-27 Implemented first version of Parrot_get_result, now a lot of failing …
16 *exit_code = interp->exit_code;
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
17 *exception = interp->final_exception;
18 if (PMC_IS_NULL(exception)) {
19 *is_error = 0;
20 *errmsg = STRINGNULL;
21 } else {
22 *is_error = !interp->exit_code;
23 *errmsg = VTABLE_get_string(interp, *exception);
24 }
25 // TODO: GC mark interp->final_exception
26 interp->final_exception = PMCNULL;
be50d63d » bluescreen10
2010-11-27 Implemented first version of Parrot_get_result, now a lot of failing …
27 interp->exit_code = 0;
2483c688 » Whiteknight
2010-12-02 implement the new error-handling mechanism. Instead of a string, we p…
28 EMBED_API_CALLOUT(interp_pmc, interp)
29 }
30
31 PARROT_API
32 Parrot_Int
33 Parrot_api_get_exception_backtrace(ARGMOD(PMC * interp_pmc), ARGMOD(PMC * exception), ARGOUT(Parrot_String ** bt))
34 {
35 EMBED_API_CALLIN(interp_pmc, interp)
36 STRING * const bts = Parrot_dbg_get_exception_backtrace(interp, exception);
37 *bt = bts;
38 EMBED_API_CALLOUT(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
39 }
40
41 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
42 Parrot_Int
43 Parrot_api_make_interpreter(ARGIN_NULLOK(PMC *parent), Parrot_Int flags, ARGIN_NULLOK(Parrot_Init_Args *args), ARGOUT(PMC **interp))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
44 {
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
45 ASSERT_ARGS(Parrot_api_make_interpreter)
4a128d50 » Whiteknight
2010-11-09 lots of little changes
46 int alt_stacktop;
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
47 Parrot_Interp interp_raw;
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
48 void *stacktop_ptr = &alt_stacktop;
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
49 PMC * iglobals;
82cbd84b » Whiteknight
2010-11-18 parrot executable compiles, but miniparrot does not link. I need to s…
50 const Parrot_Interp parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
51 interp_raw = allocate_interpreter(parent_raw, flags);
52 if (args) {
53 if (args->stacktop)
54 stacktop_ptr = args->stacktop;
55 if (args->gc_system)
56 Parrot_gc_set_system_type(interp_raw, args->gc_system);
57 if (args->gc_threshold)
58 interp_raw->gc_threshold = args->gc_threshold;
59 if (args->hash_seed)
60 interp_raw->hash_seed = args->hash_seed;
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
61 }
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
62 initialize_interpreter(interp_raw, stacktop_ptr);
63 iglobals = interp_raw->iglobals;
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
64 *interp = VTABLE_get_pmc_keyed_int(interp_raw, interp_raw->iglobals, (Parrot_Int)IGLOBALS_INTERPRETER);
f2252b40 » Whiteknight
2010-11-09 remove the two-stage initialization dance. We can now initialize an i…
65 return !PMC_IS_NULL(*interp);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
66 }
67
68 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
69 Parrot_Int
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
70 Parrot_api_set_runcore(ARGIN(PMC *interp_pmc), const char * corename, Parrot_UInt trace)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
71 {
72 ASSERT_ARGS(Parrot_api_set_runcore)
3ea891ca » Mariano Wahlmann
2010-11-11 First round of syntax error fixes
73 EMBED_API_CALLIN(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
74 if (trace) {
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
75 Parrot_pcc_trace_flags_on(interp, interp->ctx, trace);
76 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
77 } else {
372f8f7b » bluescreen10
2010-11-28 Make bounds runcore available
78 if (!strcmp(corename, "slow") || !strcmp(corename, "bounds"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
79 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
80 else if (!strcmp(corename, "fast") || !strcmp(corename, "jit") || !strcmp(corename, "function"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
81 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
82 else if (!strcmp(corename, "exec"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
83 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
84 else if (!strcmp(corename, "trace"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
85 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
86 else if (!strcmp(corename, "profiling"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
87 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "profiling"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
88 else if (!strcmp(corename, "gcdebug"))
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
89 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "gcdebug"));
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
90 else
91 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Invalid runcore type %s", corename);
92 }
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
93 EMBED_API_CALLOUT(interp_pmc, interp)
94 }
95
96 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
97 Parrot_Int
98 Parrot_api_debug_flag(ARGMOD(PMC *interp_pmc), Parrot_Int flags, Parrot_Int set)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
99 {
100 ASSERT_ARGS(Parrot_api_debug_flag)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
101 EMBED_API_CALLIN(interp_pmc, interp)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
102 if (set)
103 interp->debug_flags |= flags;
104 else
105 interp->debug_flags &= ~flags;
106 EMBED_API_CALLOUT(interp_pmc, interp);
107 }
108
109 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
110 Parrot_Int
111 Parrot_api_flag(ARGMOD(PMC *interp_pmc), Parrot_Int flags, Parrot_Int set)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
112 {
113 ASSERT_ARGS(Parrot_api_flag)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
114 EMBED_API_CALLIN(interp_pmc, interp)
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
115 if (set) {
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
116 Interp_flags_SET(interp, flags);
117 if (flags & (PARROT_BOUNDS_FLAG | PARROT_PROFILE_FLAG))
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
118 Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
119 }
120 else
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
121 Interp_flags_CLEAR(interp, flags);
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
122 EMBED_API_CALLOUT(interp_pmc, interp);
123 }
124
125 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
126 Parrot_Int
f68bf566 » Whiteknight
2010-11-10 add Parrot_api_flag and Parrot_api_debug_flag. Use these in main.c in…
127 Parrot_api_set_executable_name(ARGMOD(PMC *interp_pmc), ARGIN(const char * name))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
128 {
129 ASSERT_ARGS(Parrot_api_set_executable_name)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
130 EMBED_API_CALLIN(interp_pmc, interp)
1a692e98 » Whiteknight
2010-11-10 _set_executable_name takes a C string instead of a Parrot string, for…
131 STRING * const name_str = Parrot_str_new(interp, name, 0);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
132 PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String);
1a692e98 » Whiteknight
2010-11-10 _set_executable_name takes a C string instead of a Parrot string, for…
133 VTABLE_set_string_native(interp, name_pmc, name_str);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
134 VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_EXECUTABLE,
135 name_pmc);
4a128d50 » Whiteknight
2010-11-09 lots of little changes
136 EMBED_API_CALLOUT(interp_pmc, interp);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
137 }
138
139 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
140 Parrot_Int
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
141 Parrot_api_destroy_interpreter(ARGIN(PMC *interp_pmc))
142 {
143 ASSERT_ARGS(Parrot_api_destroy_interpreter)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
144 EMBED_API_CALLIN(interp_pmc, interp)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
145 Parrot_destroy(interp);
ae620cc9 » Whiteknight
2010-12-01 changes necessary so we build. Run fails horribly, but we build
146 Parrot_x_exit(interp, 0);
4a128d50 » Whiteknight
2010-11-09 lots of little changes
147 EMBED_API_CALLOUT(interp_pmc, interp);
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
148 }
149
150 /*
151
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
152 =item C<PARROT_API Parrot_Int Parrot_api_load_bytecode_file(PMC *interp_pmc,
153 const char *filename, PMC **pbc)>
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
154
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
155 Load a bytecode file and return a bytecode PMC.
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
156
157 =cut
158
159 */
160
161 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
162 Parrot_Int
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
163 Parrot_api_load_bytecode_file(ARGMOD(PMC *interp_pmc), ARGIN(const char *filename), ARGOUT(PMC **pbc))
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
164 {
165 ASSERT_ARGS(Parrot_api_load_bytecode_file)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
166 EMBED_API_CALLIN(interp_pmc, interp)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
167 PackFile * const pf = Parrot_pbc_read(interp, filename, 0);
168 if (!pf)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
169 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not load packfile");
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
170 do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
950d7019 » Whiteknight
2010-11-19 Packfile PMCs don't do what I need them to do (yet). Use UnManagedStr…
171 *pbc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
172 VTABLE_set_pointer(interp, *pbc, pf);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
173 EMBED_API_CALLOUT(interp_pmc, interp)
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
174 }
175
176 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
177 Parrot_Int
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
178 Parrot_api_load_bytecode_bytes(ARGMOD(PMC *interp_pmc), ARGIN(const unsigned char * const pbc), Parrot_Int bytecode_size, ARGOUT(PMC **pbcpmc))
179 {
99428c28 » Mariano Wahlmann
2010-11-24 Make src/embed/pmc.c & src/embed/api.c compile with gcc
180 EMBED_API_CALLIN(interp_pmc, interp)
46b7a9d8 » Whiteknight
2010-11-23 upconvert pbc_to_exe to use the new API. it builds, but segfaults bui…
181 PackFile * const pf = PackFile_new(interp, 0);
182 if (!pf)
183 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not create packfile");
184
185 if (!PackFile_unpack(interp, pf, (const opcode_t *)pbc, bytecode_size))
186 Parrot_ex_throw_from_c_args(interp, NULL, 1, "could not unpack packfile");
187 do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
188 *pbcpmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
189 VTABLE_set_pointer(interp, *pbcpmc, pf);
190 EMBED_API_CALLOUT(interp_pmc, interp);
191 }
192
193 PARROT_API
194 Parrot_Int
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
195 Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mainargs))
196 {
197 ASSERT_ARGS(Parrot_api_run_bytecode)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
198 EMBED_API_CALLIN(interp_pmc, interp)
65bf81a5 » Whiteknight
2010-11-22 actually run the code, don't just look at it. Miniparrot runs now. pa…
199 PMC * main_sub = NULL;
200
98cd26c9 » Whiteknight
2010-11-19 don't call Parrot_pbc_load if the PBC comes straight out of IMCC. IMC…
201 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
9f7a94c5 » Whiteknight
2010-11-26 make sure to set :main() args in the iglobals array. This makes ops2c…
202
704e3c4d » bluescreen10
2010-11-28 Made another test case pass by putting debug information. Also remove…
203 /* Debugging mode nonsense. */
204 if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
205 Parrot_io_eprintf(interp, "*** Parrot VM: %Ss core ***\n",
206 interp->run_core->name);
207 }
208
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
209 if (!pf)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
210 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
98cd26c9 » Whiteknight
2010-11-19 don't call Parrot_pbc_load if the PBC comes straight out of IMCC. IMC…
211 if (pf->cur_cs != NULL)
212 Parrot_pbc_load(interp, pf);
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
213 PackFile_fixup_subs(interp, PBC_IMMEDIATE, NULL);
214 PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL);
215 PackFile_fixup_subs(interp, PBC_MAIN, NULL);
65bf81a5 » Whiteknight
2010-11-22 actually run the code, don't just look at it. Miniparrot runs now. pa…
216 main_sub = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
217
218 /* if no sub was marked being :main, we create a dummy sub with offset 0 */
219
220 if (!main_sub)
221 main_sub = set_current_sub(interp);
222
223 Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
224 Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table);
225
9f7a94c5 » Whiteknight
2010-11-26 make sure to set :main() args in the iglobals array. This makes ops2c…
226 VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_ARGV_LIST, mainargs);
65bf81a5 » Whiteknight
2010-11-22 actually run the code, don't just look at it. Miniparrot runs now. pa…
227 Parrot_ext_call(interp, main_sub, "P->", mainargs);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
228 EMBED_API_CALLOUT(interp_pmc, interp)
687438ef » Whiteknight
2010-11-08 add in the prototype embedding API functions I've been playing with
229 }
4a128d50 » Whiteknight
2010-11-09 lots of little changes
230
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
231 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
232 Parrot_Int
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
233 Parrot_api_disassemble_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(const char * const outfile), Parrot_Int opts)
234 {
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
235 EMBED_API_CALLIN(interp_pmc, interp)
590f3873 » Whiteknight
2010-11-24 update pbc_disassemble to the new API. Had to add a new API function …
236 PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
237 if (!pf)
238 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
239 if (pf->cur_cs != NULL)
240 Parrot_pbc_load(interp, pf);
241 Parrot_disassemble(interp, outfile, (Parrot_disassemble_options)opts);
242 EMBED_API_CALLOUT(interp_pmc, interp);
243 }
244
245 PARROT_API
246 Parrot_Int
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
247 Parrot_api_build_argv_array(ARGMOD(PMC *interp_pmc), Parrot_Int argc, ARGIN(char **argv), ARGOUT(PMC **args))
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
248 {
249 ASSERT_ARGS(Parrot_api_build_argv_array)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
250 EMBED_API_CALLIN(interp_pmc, interp)
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
251 PMC * const userargv = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
252 Parrot_Int i;
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
253
254 for (i = 0; i < argc; ++i) {
255 /* Run through argv, adding everything to the array */
256 STRING * const arg = Parrot_str_new_init(interp, argv[i], strlen(argv[i]),
257 Parrot_utf8_encoding_ptr, PObj_external_FLAG);
258 VTABLE_push_string(interp, userargv, arg);
259 }
260 *args = userargv;
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
261 EMBED_API_CALLOUT(interp_pmc, interp)
d4e87080 » Whiteknight
2010-11-09 add a failure macro for when an API call fails. Implement a few more …
262 }
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
263
264 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
265 Parrot_Int
266 Parrot_api_set_warnings(ARGMOD(PMC *interp_pmc), Parrot_Int flags)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
267 {
268 ASSERT_ARGS(Parrot_api_set_warnings)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
269 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
270 /* Activates the given warnings. (Macro from warnings.h.) */
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
271 PARROT_WARNINGS_on(interp, flags);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
272 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
273 }
274
275 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
276 Parrot_Int
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
277 Parrot_api_set_output_file(ARGMOD(PMC *interp_pmc), ARGIN_NULLOK(const char * filename))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
278 {
279 ASSERT_ARGS(Parrot_api_set_output_file)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
280 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
281 if (!filename && !interp->output_file)
282 interp->output_file = "-";
283 else
284 interp->output_file = filename;
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
285 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
286 }
287
288 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
289 Parrot_Int
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
290 Parrot_api_add_library_search_path(ARGMOD(PMC *interp_pmc), ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
291 {
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
292 //ASSERT_ARGS(Parrot_api_add_library_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
293 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
294 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_LIBRARY);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
295 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
296 }
297
298 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
299 Parrot_Int
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
300 Parrot_api_add_include_search_path(ARGMOD(PMC *interp_pmc), ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
301 {
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
302 //ASSERT_ARGS(Parrot_api_add_include_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
303 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
304 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_INCLUDE);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
305 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
306 }
307
308 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
309 Parrot_Int
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
310 Parrot_api_add_dynext_search_path(ARGMOD(PMC *interp_pmc), ARGIN(const char *path))
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
311 {
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
312 //ASSERT_ARGS(Parrot_api_add_dynext_search_path)
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
313 EMBED_API_CALLIN(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
314 Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_DYNEXT);
c1ab56ef » Mariano Wahlmann
2010-11-15 More fixes, almost there
315 EMBED_API_CALLOUT(interp_pmc, interp)
9d25cd4e » Whiteknight
2010-11-10 change the imcc_run function to return a PackFile PMC so we can use i…
316 }
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
317
318 /*
319
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
320 =item C<PARROT_API Parrot_Int Parrot_api_set_stdhandles(PMC *interp_pmc,
321 Parrot_Int stdin, Parrot_Int stdout, Parrot_Int stderr)>
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
322
323 Set the std file descriptors for the embedded interpreter. Any file descriptor
324 passed as argument and set to C<PIO_INVALID_HANDLE> is ignored.
325
326 =cut
327
328 */
329
330 PARROT_API
e98ef028 » Whiteknight
2010-11-14 lots of fixes. We still don't build completely, but we are much close…
331 Parrot_Int
332 Parrot_api_set_stdhandles(ARGIN(PMC *interp_pmc), Parrot_Int stdin, Parrot_Int stdout, Parrot_Int stderr)
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
333 {
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
334 ASSERT_ARGS(Parrot_api_set_stdhandles)
335 EMBED_API_CALLIN(interp_pmc, interp)
336 void *dummy;
337
338 if(PIO_INVALID_HANDLE != (PIOHANDLE)stdin) {
339 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
340 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stdin);
341 dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDIN_FILENO,pmc);
342 }
343
344 if(PIO_INVALID_HANDLE != (PIOHANDLE)stdout) {
345 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
346 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stdout);
347 dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDOUT_FILENO,pmc);
348 }
349
350 if(PIO_INVALID_HANDLE != (PIOHANDLE)stderr) {
351 PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
352 Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stderr);
353 dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDERR_FILENO,pmc);
354 }
355
356 EMBED_API_CALLOUT(interp_pmc, interp)
3259cda3 » Mariano Wahlmann
2010-11-10 First cut of Parrot_api_set_stdhandles API function
357 }
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
358
359 PARROT_API
360 Parrot_Int
361 Parrot_api_get_runtime_path(Parrot_PMC interp_pmc, ARGOUT(Parrot_String *runtime))
362 {
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
363 EMBED_API_CALLIN(interp_pmc, interp)
f41cf98f » Whiteknight
2010-11-17 many more fixes. We build main.c now but fail in some of the alternat…
364 *runtime = Parrot_get_runtime_path(interp);
365 EMBED_API_CALLOUT(interp_pmc, interp);
366 }
367
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
368 PARROT_API
369 Parrot_Int
370 Parrot_api_set_configuration_hash(Parrot_PMC interp_pmc, Parrot_PMC confighash)
371 {
e9934d79 » Mariano Wahlmann
2010-11-25 Made it compile with gcc
372 EMBED_API_CALLIN(interp_pmc, interp)
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
373 Parrot_set_config_hash_pmc(interp, confighash);
5c2c3d48 » Whiteknight
2010-11-23 fix library paths. The build now progresses through all the parts tha…
374 Parrot_lib_update_paths_from_config_hash(interp);
c4ccd134 » Whiteknight
2010-11-22 first prototype of a new mechanism for setting the configuration hash…
375 EMBED_API_CALLOUT(interp_pmc, interp);
376 }
377
378
Something went wrong with that request. Please try again.