This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dll linkage side decks for OS/390
[perl5.git] / globals.c
CommitLineData
ecfc5424
AD
1#include "INTERN.h"
2#include "perl.h"
76e3520e
GS
3
4#ifdef PERL_OBJECT
76e3520e 5
3dfd1da1
GS
6#undef PERLVAR
7#define PERLVAR(x, y)
8#undef PERLVARI
4c2891ed 9#define PERLVARI(x, y, z) PL_##x = z;
3dfd1da1 10#undef PERLVARIC
4c2891ed 11#define PERLVARIC(x, y, z) PL_##x = z;
3dfd1da1 12
76e3520e
GS
13CPerlObj::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*));
3dfd1da1
GS
17
18#include "thrdvar.h"
19#include "intrpvar.h"
20#include "perlvars.h"
21
4c2891ed
GS
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;
76e3520e
GS
29}
30
31void*
32CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl)
33{
34 if(pvtbl != NULL)
35 return pvtbl->Malloc(nSize);
36
37 return NULL;
38}
39
40int&
41CPerlObj::ErrorNo(void)
42{
5a092403 43 return errno;
76e3520e
GS
44}
45
46void
47CPerlObj::Init(void)
48{
76e3520e
GS
49}
50
22c35a8c
GS
51int
52fprintf(PerlIO *stream, const char *format, ...)
53{
54 va_list(arglist);
55 va_start(arglist, format);
56 return PerlIO_vprintf(stream, format, arglist);
57}
58
ab39fa9d 59#ifdef WIN32 /* XXX why are these needed? */
76e3520e
GS
60bool
61do_exec(char *cmd)
62{
c69f6586 63 return PerlProc_Cmd(cmd);
76e3520e
GS
64}
65
66int
67do_aspawn(void *vreally, void **vmark, void **vsp)
68{
c69f6586 69 return PerlProc_aspawn(vreally, vmark, vsp);
76e3520e 70}
76e3520e
GS
71#endif /* WIN32 */
72
73#endif /* PERL_OBJECT */