| 1 | #include "INTERN.h" |
| 2 | #include "perl.h" |
| 3 | |
| 4 | #ifdef PERL_OBJECT |
| 5 | |
| 6 | #undef PERLVAR |
| 7 | #define PERLVAR(x, y) |
| 8 | #undef PERLVARI |
| 9 | #define PERLVARI(x, y, z) PL_##x = z; |
| 10 | #undef PERLVARIC |
| 11 | #define PERLVARIC(x, y, z) PL_##x = z; |
| 12 | |
| 13 | CPerlObj::CPerlObj(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd, |
| 14 | IPerlLIO* ipLIO, IPerlDir* ipD, IPerlSock* ipS, IPerlProc* ipP) |
| 15 | { |
| 16 | memset(((char*)this)+sizeof(void*), 0, sizeof(CPerlObj)-sizeof(void*)); |
| 17 | |
| 18 | #include "thrdvar.h" |
| 19 | #include "intrpvar.h" |
| 20 | #include "perlvars.h" |
| 21 | |
| 22 | PL_piMem = ipM; |
| 23 | PL_piENV = ipE; |
| 24 | PL_piStdIO = ipStd; |
| 25 | PL_piLIO = ipLIO; |
| 26 | PL_piDir = ipD; |
| 27 | PL_piSock = ipS; |
| 28 | PL_piProc = ipP; |
| 29 | } |
| 30 | |
| 31 | void* |
| 32 | CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl) |
| 33 | { |
| 34 | if(pvtbl != NULL) |
| 35 | return pvtbl->Malloc(nSize); |
| 36 | |
| 37 | return NULL; |
| 38 | } |
| 39 | |
| 40 | int& |
| 41 | CPerlObj::ErrorNo(void) |
| 42 | { |
| 43 | return errno; |
| 44 | } |
| 45 | |
| 46 | void |
| 47 | CPerlObj::Init(void) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | int |
| 52 | fprintf(PerlIO *stream, const char *format, ...) |
| 53 | { |
| 54 | va_list(arglist); |
| 55 | va_start(arglist, format); |
| 56 | return PerlIO_vprintf(stream, format, arglist); |
| 57 | } |
| 58 | |
| 59 | #ifdef WIN32 /* XXX why are these needed? */ |
| 60 | bool |
| 61 | do_exec(char *cmd) |
| 62 | { |
| 63 | return PerlProc_Cmd(cmd); |
| 64 | } |
| 65 | |
| 66 | int |
| 67 | do_aspawn(void *vreally, void **vmark, void **vsp) |
| 68 | { |
| 69 | return PerlProc_aspawn(vreally, vmark, vsp); |
| 70 | } |
| 71 | #endif /* WIN32 */ |
| 72 | |
| 73 | #endif /* PERL_OBJECT */ |