| File: | t/src/extend_16.c |
| Coverage: | 81.8% |
| line | stmt | code |
|---|---|---|
| 1 | #include <parrot/parrot.h> | |
| 2 | #include <parrot/embed.h> | |
| 3 | #include <parrot/extend.h> | |
| 4 | ||
| 5 | int | |
| 6 | main(int argc, const char *argv[]) | |
| 7 | 1 | { |
| 8 | Parrot_Int result; | |
| 9 | Parrot_PMC sub; | |
| 10 | Parrot_PackFile pf; | |
| 11 | 1 | Parrot_Interp interp = Parrot_new(NULL); |
| 12 | ||
| 13 | 1 | if (!interp) { |
| 14 | 0 | printf( "No interpreter\n" ); |
| 15 | 0 | return 1; |
| 16 | } | |
| 17 | ||
| 18 | 1 | pf = Parrot_pbc_read( interp, "/tmp/OJv17x6gPq.pbc", 0 ); |
| 19 | 1 | Parrot_pbc_load( interp, pf ); |
| 20 | ||
| 21 | 1 | sub = Parrot_ns_find_current_namespace_global( interp, Parrot_str_new_constant( interp, "add" ) ); |
| 22 | 1 | Parrot_ext_call(interp, sub, "II->I", 100, 200, &result); |
| 23 | 1 | printf( "Result is %d.\n", result ); |
| 24 | ||
| 25 | 1 | Parrot_exit(interp, 0); |
| 26 | return 0; | |
| 27 | } | |