Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First round of syntax error fixes

  • Loading branch information...
commit 3ea891ca40d9b101aa85160f0b07008eaa04b556 1 parent 6e5f297
Mariano Wahlmann authored
View
3  MANIFEST
@@ -961,6 +961,7 @@ include/parrot/datatypes.h [main]include
include/parrot/debugger.h [main]include
include/parrot/dynext.h [main]include
include/parrot/embed.h [main]include
+include/parrot/api.h [main]include
include/parrot/encoding.h [main]include
include/parrot/enums.h [main]include
include/parrot/exceptions.h [main]include
@@ -1288,7 +1289,7 @@ src/dynpmc/rational.pmc []
src/dynpmc/rotest.pmc []
src/dynpmc/subproxy.pmc []
src/embed.c []
-src/embed_api.c []
+src/embed/api.c []
src/exceptions.c []
src/exit.c []
src/extend.c []
View
7 include/parrot/api.h
@@ -6,11 +6,14 @@
* them.
*/
-#ifdef PARROT_API_H_GUARD
+#ifndef PARROT_API_H_GUARD
#define PARROT_API_H_GUARD
#include "parrot/config.h"
#include "parrot/core_types.h"
+#include "pmc/pmc_parrotinterpreter.h"
+
+#define PARROT_API PARROT_EXPORT
typedef struct _Parrot_Init_Args {
void *stacktop;
@@ -93,7 +96,7 @@ PARROT_API
INTVAL Parrot_api_set_runcore(
ARGIN(PMC *interp_pmc),
Parrot_Run_core_t core,
- Parrot_Uint trace)
+ Parrot_UInt trace)
__attribute__nonnull__(1);
PARROT_API
View
27 src/embed/api.c
@@ -12,18 +12,24 @@ Parrot_api_make_interpreter(ARGIN_NULLOK(PMC *parent), INTVAL flags, ARGIN_NULLO
{
ASSERT_ARGS(Parrot_api_make_interpreter)
int alt_stacktop;
+ Parrot_Interp * const interp_raw;
+ PMC * interp_pmc;
void *stacktop_ptr = &alt_stacktop;
- Parrot_set_config_hash();
+
+ //SHOULD Parrot_set_config_hash();
+ //BE Parrot_set_config_internal_hash();
{
- Parrot_Interp * const parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
- Parrot_Interp * const interp_raw = allocate_interpreter(parent_raw, flags);
+ Parrot_Interp * const parent_raw;
+ parent_raw = PMC_IS_NULL(parent) ? NULL : GET_RAW_INTERP(parent);
+ interp_raw = allocate_interpreter(parent_raw, flags);
if (args) {
- if (args->stack_top)
+ if (args->stacktop)
stacktop_ptr = args->stacktop;
if (args->gc_system) {
const INTVAL sysid = Parrot_gc_get_system_id(interp, args->gc_system);
if (sysid == -1)
- EMBED_API_FAILURE(interp_pmc, interp);
+ // EMBED_API_FAILURE(interp_pmc, interp);
+ // This doesn't works without EMBED_API_CALLIN
interp->gc_sys->sys_type = sysid;
}
if (args->gc_threshold)
@@ -39,12 +45,12 @@ Parrot_api_make_interpreter(ARGIN_NULLOK(PMC *parent), INTVAL flags, ARGIN_NULLO
PARROT_API
INTVAL
-Parrot_api_set_runcore(ARGIN(PMC *interp_pmc), Parrot_Run_core_t core, Parrot_Uint trace)
+Parrot_api_set_runcore(ARGIN(PMC *interp_pmc), Parrot_Run_core_t core, Parrot_UInt trace)
{
ASSERT_ARGS(Parrot_api_set_runcore)
+ EMBED_API_CALLIN(interp_pmc, interp)
if (trace)
core = PARROT_SLOW_CORE;
- EMBED_API_CALLIN(interp_pmc, interp)
Parrot_set_trace(interp, (Parrot_trace_flags)trace);
Parrot_set_run_core(interp, core);
EMBED_API_CALLOUT(interp_pmc, interp)
@@ -236,23 +242,24 @@ Parrot_api_set_stdhandles(ARGIN(PMC *interp_pmc), INTVAL stdin, INTVAL stdout, I
{
ASSERT_ARGS(Parrot_api_set_stdhandles)
EMBED_API_CALLIN(interp_pmc, interp);
+ void *dummy;
if(PIO_INVALID_HANDLE != (PIOHANDLE)stdin) {
PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stdin);
- Parrot_io_sethandle(interp,PIO_STDIN_FILENO,pmc);
+ dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDIN_FILENO,pmc);
}
if(PIO_INVALID_HANDLE != (PIOHANDLE)stdout) {
PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stdout);
- Parrot_io_sethandle(interp,PIO_STDOUT_FILENO,pmc);
+ dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDOUT_FILENO,pmc);
}
if(PIO_INVALID_HANDLE != (PIOHANDLE)stderr) {
PMC * const pmc = Parrot_pmc_new(interp, enum_class_FileHandle);
Parrot_io_set_os_handle(interp, pmc, (PIOHANDLE)stderr);
- Parrot_io_sethandle(interp,PIO_STDERR_FILENO,pmc);
+ dummy = (void *)Parrot_io_stdhandle(interp,PIO_STDERR_FILENO,pmc);
}
EMBED_API_CALLOUT(interp_pmc, interp);
View
4 src/embed/embed_private.h
@@ -1,9 +1,9 @@
-
#define GET_RAW_INTERP(p) ((Parrot_ParrotInterpreter_attributes)(p)->data)->interp;
#define EMBED_API_CALLIN(p, i) \
jmp_buf _env; \
+ void * _oldtop; \
Interp * (i) = PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p); \
- void *_oldtop = (i)->lo_var_ptr; \
+ _oldtop = (i)->lo_var_ptr; \
if (_oldtop) {} else (1)->lo_var_ptr = &oldtop \
PARROT_ASSERT(i); \
PARROT_ASSERT((i)->lo_val_ptr); \
Please sign in to comment.
Something went wrong with that request. Please try again.