From: Douglas Lankshear Date: Tue, 24 Feb 1998 07:57:07 +0000 (-0800) Subject: [asperl] added AS patch#7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7a92b15d369b78479721e50e5aad6f6d7b1862c;p=p5sagit%2Fp5-mst-13.2.git [asperl] added AS patch#7 Message-Id: <01BD40F9.CE57B210.dougl@ActiveState.com> Subject: [PATCH] Here's an attempt at 6. MANIFEST must be updated with new file names 5. Mktime(), Stat() etc., rather than MKtime()/STat() etc. And some changes to move toward 1. Merge PERL_OBJECT build support into regular Makefile and makefile.mk -- Doug p4raw-id: //depot/asperl@586 --- diff --git a/MANIFEST b/MANIFEST index a0e0dd5..1acac3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -28,6 +28,7 @@ README.vms Notes about VMS port README.win32 Notes about Win32 port Todo The Wishlist Todo.5.005 What needs doing before 5.005 release +XSLock.h Include file for extensions built with PERL_OBJECT defined XSUB.h Include file for extension subroutines av.c Array value code av.h Array value header @@ -385,6 +386,13 @@ installman Perl script to install man pages for pods installperl Perl script to do "make install" dirty work interp.sym Interpreter specific symbols to hide in a struct intrpvar.h Variables held in each interpreter instance +ipdir.h Directory interface for Perl Object +ipenv.h Environment interface for Perl Object +iplio.h Low level IO interface for Perl Object +ipmem.h Memory interface for Perl Object +ipproc.h Process interface for Perl Object +ipsock.h Socket interface for Perl Object +ipstdio.h Stdio interface for Perl Object keywords.h The keyword numbers keywords.pl Program to write keywords.h lib/AnyDBM_File.pm Perl module to emulate dbmopen @@ -543,6 +551,8 @@ miniperlmain.c Basic perl w/o dynamic loading or extensions mv-if-diff Script to mv a file if it changed myconfig Prints summary of the current configuration nostdio.h Cause compile error on stdio calls +objpp.h Scoping macros for Perl Object +ObjXSub.h Scoping macros for Perl Object in extensions op.c Opcode syntax tree code op.h Opcode syntax tree header opcode.h Automatically generated opcode header @@ -595,18 +605,18 @@ patchlevel.h The current patch level of perl perl.c main() perl.h Global declarations perl_exp.SH Creates list of exported symbols for AIX -perldir.h perldir stuff -perlenv.h perlenv stuff +perldir.h Macros for directory abstraction +perlenv.h Macros for environment abstraction perlio.c C code for PerlIO abstraction perlio.h Interface to PerlIO abstraction perlio.sym Symbols for PerlIO abstraction -perllio.h perllio stuff -perlmem.h perlmem stuff -perlproc.h perlproc stuff +perllio.h Macros for Low level IO abstraction +perlmem.h Macros for memory allocation abstraction +perlproc.h Macros for process abstraction perlsdio.h Fake stdio using perlio perlsfio.h Prototype sfio mapping for PerlIO perlsh A poor man's perl shell -perlsock.h perlsock stuff +perlsock.h Macros for socket abstraction perlvars.h Global variables perly.c A byacc'ed perly.y perly.c.diff Fixup perly.c to allow recursion diff --git a/installperl b/installperl index 6197e92..222f3d4 100755 --- a/installperl +++ b/installperl @@ -94,13 +94,16 @@ if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; } if ($^O eq 'MSWin32') { --f 'perl.' . $dlext || die "No perl DLL built\n"; +$perldll = 'perl.' . $dlext; +$perldll = 'perlcore.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i; + +-f $perldll || die "No perl DLL built\n"; # Install the DLL -safe_unlink("$installbin/perl.$dlext"); -copy("perl.$dlext", "$installbin/perl.$dlext"); -chmod(0755, "$installbin/perl.$dlext"); +safe_unlink("$installbin/$perldll"); +copy("$perldll", "$installbin/$perldll"); +chmod(0755, "$installbin/$perldll"); } # First we install the version-numbered executables. diff --git a/ipdir.h b/ipdir.h index fb6f1eb..d5c2c2f 100644 --- a/ipdir.h +++ b/ipdir.h @@ -1,7 +1,7 @@ /* - ipdir.h - Interface for perl directory functions + ipdir.h + Interface for perl directory functions */ @@ -11,15 +11,15 @@ class IPerlDir { public: - virtual int MKdir(const char *dirname, int mode, int &err) = 0; - virtual int Chdir(const char *dirname, int &err) = 0; - virtual int Rmdir(const char *dirname, int &err) = 0; - virtual int Close(DIR *dirp, int &err) = 0; - virtual DIR *Open(char *filename, int &err) = 0; - virtual struct direct *Read(DIR *dirp, int &err) = 0; - virtual void Rewind(DIR *dirp, int &err) = 0; - virtual void Seek(DIR *dirp, long loc, int &err) = 0; - virtual long Tell(DIR *dirp, int &err) = 0; + virtual int Makedir(const char *dirname, int mode, int &err) = 0; + virtual int Chdir(const char *dirname, int &err) = 0; + virtual int Rmdir(const char *dirname, int &err) = 0; + virtual int Close(DIR *dirp, int &err) = 0; + virtual DIR *Open(char *filename, int &err) = 0; + virtual struct direct *Read(DIR *dirp, int &err) = 0; + virtual void Rewind(DIR *dirp, int &err) = 0; + virtual void Seek(DIR *dirp, long loc, int &err) = 0; + virtual long Tell(DIR *dirp, int &err) = 0; }; #endif /* __Inc__IPerlDir___ */ diff --git a/ipenv.h b/ipenv.h index 0ec5f9f..76f8baa 100644 --- a/ipenv.h +++ b/ipenv.h @@ -1,7 +1,7 @@ /* - ipenv.h - Interface for perl environment functions + ipenv.h + Interface for perl environment functions */ @@ -11,9 +11,9 @@ class IPerlEnv { public: - virtual char* Getenv(const char *varname, int &err) = 0; - virtual int Putenv(const char *envstring, int &err) = 0; - virtual char* LibPath(char *sfx, ...) =0; + virtual char* Getenv(const char *varname, int &err) = 0; + virtual int Putenv(const char *envstring, int &err) = 0; + virtual char* LibPath(char *sfx, ...) =0; }; #endif /* __Inc__IPerlEnv___ */ diff --git a/iplio.h b/iplio.h index d4bcb27..9a6646d 100644 --- a/iplio.h +++ b/iplio.h @@ -1,7 +1,7 @@ /* - iplio.h - Interface for perl Low IO functions + iplio.h + Interface for perl Low IO functions */ @@ -11,30 +11,30 @@ class IPerlLIO { public: - virtual int Access(const char *path, int mode, int &err) = 0; - virtual int Chmod(const char *filename, int pmode, int &err) = 0; - virtual int Chsize(int handle, long size, int &err) = 0; - virtual int Close(int handle, int &err) = 0; - virtual int Dup(int handle, int &err) = 0; - virtual int Dup2(int handle1, int handle2, int &err) = 0; - virtual int Flock(int fd, int oper, int &err) = 0; - virtual int FStat(int handle, struct stat *buffer, int &err) = 0; - virtual int IOCtl(int i, unsigned int u, char *data, int &err) = 0; - virtual int Isatty(int handle, int &err) = 0; - virtual long Lseek(int handle, long offset, int origin, int &err) = 0; - virtual int Lstat(const char *path, struct stat *buffer, int &err) = 0; - virtual char *Mktemp(char *Template, int &err) = 0; - virtual int Open(const char *filename, int oflag, int &err) = 0; - virtual int Open(const char *filename, int oflag, int pmode, int &err) = 0; - virtual int Read(int handle, void *buffer, unsigned int count, int &err) = 0; - virtual int Rename(const char *oldname, const char *newname, int &err) = 0; - virtual int Setmode(int handle, int mode, int &err) = 0; - virtual int STat(const char *path, struct stat *buffer, int &err) = 0; - virtual char *Tmpnam(char *string, int &err) = 0; - virtual int Umask(int pmode, int &err) = 0; - virtual int Unlink(const char *filename, int &err) = 0; - virtual int Utime(char *filename, struct utimbuf *times, int &err) = 0; - virtual int Write(int handle, const void *buffer, unsigned int count, int &err) = 0; + virtual int Access(const char *path, int mode, int &err) = 0; + virtual int Chmod(const char *filename, int pmode, int &err) = 0; + virtual int Chsize(int handle, long size, int &err) = 0; + virtual int Close(int handle, int &err) = 0; + virtual int Dup(int handle, int &err) = 0; + virtual int Dup2(int handle1, int handle2, int &err) = 0; + virtual int Flock(int fd, int oper, int &err) = 0; + virtual int FileStat(int handle, struct stat *buffer, int &err) = 0; + virtual int IOCtl(int i, unsigned int u, char *data, int &err) = 0; + virtual int Isatty(int handle, int &err) = 0; + virtual long Lseek(int handle, long offset, int origin, int &err) = 0; + virtual int Lstat(const char *path, struct stat *buffer, int &err) = 0; + virtual char *Mktemp(char *Template, int &err) = 0; + virtual int Open(const char *filename, int oflag, int &err) = 0; + virtual int Open(const char *filename, int oflag, int pmode, int &err) = 0; + virtual int Read(int handle, void *buffer, unsigned int count, int &err) = 0; + virtual int Rename(const char *oldname, const char *newname, int &err) = 0; + virtual int Setmode(int handle, int mode, int &err) = 0; + virtual int NameStat(const char *path, struct stat *buffer, int &err) = 0; + virtual char *Tmpnam(char *string, int &err) = 0; + virtual int Umask(int pmode, int &err) = 0; + virtual int Unlink(const char *filename, int &err) = 0; + virtual int Utime(char *filename, struct utimbuf *times, int &err) = 0; + virtual int Write(int handle, const void *buffer, unsigned int count, int &err) = 0; }; #endif /* __Inc__IPerlLIO___ */ diff --git a/ipmem.h b/ipmem.h index 8e87be7..0554cf5 100644 --- a/ipmem.h +++ b/ipmem.h @@ -1,7 +1,7 @@ /* - ipmem.h - Interface for perl memory allocation + ipmem.h + Interface for perl memory allocation */ @@ -11,9 +11,9 @@ class IPerlMem { public: - virtual void* Malloc(size_t) = 0; - virtual void* Realloc(void*, size_t) = 0; - virtual void Free(void*) = 0; + virtual void* Malloc(size_t) = 0; + virtual void* Realloc(void*, size_t) = 0; + virtual void Free(void*) = 0; }; #endif /* __Inc__IPerlMem___ */ diff --git a/ipproc.h b/ipproc.h index fd04913..80e5da4 100644 --- a/ipproc.h +++ b/ipproc.h @@ -1,7 +1,7 @@ /* - ipproc.h - Interface for perl process functions + ipproc.h + Interface for perl process functions */ @@ -18,36 +18,36 @@ typedef Signal_t (*Sighandler_t) _((int)); class IPerlProc { public: - virtual void Abort(void) = 0; - virtual void Exit(int status) = 0; - virtual void _Exit(int status) = 0; - virtual int Execl(const char *cmdname, const char *arg0, const char *arg1, const char *arg2, const char *arg3) = 0; - virtual int Execv(const char *cmdname, const char *const *argv) = 0; - virtual int Execvp(const char *cmdname, const char *const *argv) = 0; - virtual uid_t Getuid(void) = 0; - virtual uid_t Geteuid(void) = 0; - virtual gid_t Getgid(void) = 0; - virtual gid_t Getegid(void) = 0; - virtual char *Getlogin(void) = 0; - virtual int Kill(int pid, int sig) = 0; - virtual int Killpg(int pid, int sig) = 0; - virtual int PauseProc(void) = 0; - virtual PerlIO* Popen(const char *command, const char *mode) = 0; - virtual int Pclose(PerlIO *stream) = 0; - virtual int Pipe(int *phandles) = 0; - virtual int Setuid(uid_t uid) = 0; - virtual int Setgid(gid_t gid) = 0; - virtual int Sleep(unsigned int) = 0; - virtual int Times(struct tms *timebuf) = 0; - virtual int Wait(int *status) = 0; - virtual Sighandler_t Signal(int sig, Sighandler_t subcode) = 0; + virtual void Abort(void) = 0; + virtual void Exit(int status) = 0; + virtual void _Exit(int status) = 0; + virtual int Execl(const char *cmdname, const char *arg0, const char *arg1, const char *arg2, const char *arg3) = 0; + virtual int Execv(const char *cmdname, const char *const *argv) = 0; + virtual int Execvp(const char *cmdname, const char *const *argv) = 0; + virtual uid_t Getuid(void) = 0; + virtual uid_t Geteuid(void) = 0; + virtual gid_t Getgid(void) = 0; + virtual gid_t Getegid(void) = 0; + virtual char *Getlogin(void) = 0; + virtual int Kill(int pid, int sig) = 0; + virtual int Killpg(int pid, int sig) = 0; + virtual int PauseProc(void) = 0; + virtual PerlIO* Popen(const char *command, const char *mode) = 0; + virtual int Pclose(PerlIO *stream) = 0; + virtual int Pipe(int *phandles) = 0; + virtual int Setuid(uid_t uid) = 0; + virtual int Setgid(gid_t gid) = 0; + virtual int Sleep(unsigned int) = 0; + virtual int Times(struct tms *timebuf) = 0; + virtual int Wait(int *status) = 0; + virtual Sighandler_t Signal(int sig, Sighandler_t subcode) = 0; #ifdef WIN32 - virtual void GetSysMsg(char*& msg, DWORD& dwLen, DWORD dwErr) = 0; - virtual void FreeBuf(char* msg) = 0; - virtual BOOL DoCmd(char *cmd) = 0; - virtual int Spawn(char*cmds) = 0; - virtual int Spawnvp(int mode, const char *cmdname, const char *const *argv) = 0; - virtual int ASpawn(void *vreally, void **vmark, void **vsp) = 0; + virtual void GetSysMsg(char*& msg, DWORD& dwLen, DWORD dwErr) = 0; + virtual void FreeBuf(char* msg) = 0; + virtual BOOL DoCmd(char *cmd) = 0; + virtual int Spawn(char*cmds) = 0; + virtual int Spawnvp(int mode, const char *cmdname, const char *const *argv) = 0; + virtual int ASpawn(void *vreally, void **vmark, void **vsp) = 0; #endif }; diff --git a/ipsock.h b/ipsock.h index 5dd9de9..152eb2d 100644 --- a/ipsock.h +++ b/ipsock.h @@ -1,7 +1,7 @@ /* - ipsock.h - Interface for perl socket functions + ipsock.h + Interface for perl socket functions */ @@ -11,48 +11,48 @@ class IPerlSock { public: - virtual u_long Htonl(u_long hostlong) = 0; - virtual u_short Htons(u_short hostshort) = 0; - virtual u_long Ntohl(u_long netlong) = 0; - virtual u_short Ntohs(u_short netshort) = 0; - virtual SOCKET Accept(SOCKET s, struct sockaddr* addr, int* addrlen, int &err) = 0; - virtual int Bind(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0; - virtual int Connect(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0; - virtual void Endhostent(int &err) = 0; - virtual void Endnetent(int &err) = 0; - virtual void Endprotoent(int &err) = 0; - virtual void Endservent(int &err) = 0; - virtual struct hostent* Gethostbyaddr(const char* addr, int len, int type, int &err) = 0; - virtual struct hostent* Gethostbyname(const char* name, int &err) = 0; - virtual struct hostent* Gethostent(int &err) = 0; - virtual int Gethostname(char* name, int namelen, int &err) = 0; - virtual struct netent *Getnetbyaddr(long net, int type, int &err) = 0; - virtual struct netent *Getnetbyname(const char *, int &err) = 0; - virtual struct netent *Getnetent(int &err) = 0; - virtual int Getpeername(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0; - virtual struct protoent* Getprotobyname(const char* name, int &err) = 0; - virtual struct protoent* Getprotobynumber(int number, int &err) = 0; - virtual struct protoent* Getprotoent(int &err) = 0; - virtual struct servent* Getservbyname(const char* name, const char* proto, int &err) = 0; - virtual struct servent* Getservbyport(int port, const char* proto, int &err) = 0; - virtual struct servent* Getservent(int &err) = 0; - virtual int Getsockname(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0; - virtual int Getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen, int &err) = 0; - virtual unsigned long InetAddr(const char* cp, int &err) = 0; - virtual char* InetNtoa(struct in_addr in, int &err) = 0; - virtual int Listen(SOCKET s, int backlog, int &err) = 0; - virtual int Recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen, int &err) = 0; - virtual int Select(int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout, int &err) = 0; - virtual int Send(SOCKET s, const char* buf, int len, int flags, int &err) = 0; - virtual int Sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen, int &err) = 0; - virtual void Sethostent(int stayopen, int &err) = 0; - virtual void Setnetent(int stayopen, int &err) = 0; - virtual void Setprotoent(int stayopen, int &err) = 0; - virtual void Setservent(int stayopen, int &err) = 0; - virtual int Setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen, int &err) = 0; - virtual int Shutdown(SOCKET s, int how, int &err) = 0; - virtual SOCKET Socket(int af, int type, int protocol, int &err) = 0; - virtual int Socketpair(int domain, int type, int protocol, int* fds, int &err) = 0; + virtual u_long Htonl(u_long hostlong) = 0; + virtual u_short Htons(u_short hostshort) = 0; + virtual u_long Ntohl(u_long netlong) = 0; + virtual u_short Ntohs(u_short netshort) = 0; + virtual SOCKET Accept(SOCKET s, struct sockaddr* addr, int* addrlen, int &err) = 0; + virtual int Bind(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0; + virtual int Connect(SOCKET s, const struct sockaddr* name, int namelen, int &err) = 0; + virtual void Endhostent(int &err) = 0; + virtual void Endnetent(int &err) = 0; + virtual void Endprotoent(int &err) = 0; + virtual void Endservent(int &err) = 0; + virtual struct hostent* Gethostbyaddr(const char* addr, int len, int type, int &err) = 0; + virtual struct hostent* Gethostbyname(const char* name, int &err) = 0; + virtual struct hostent* Gethostent(int &err) = 0; + virtual int Gethostname(char* name, int namelen, int &err) = 0; + virtual struct netent *Getnetbyaddr(long net, int type, int &err) = 0; + virtual struct netent *Getnetbyname(const char *, int &err) = 0; + virtual struct netent *Getnetent(int &err) = 0; + virtual int Getpeername(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0; + virtual struct protoent* Getprotobyname(const char* name, int &err) = 0; + virtual struct protoent* Getprotobynumber(int number, int &err) = 0; + virtual struct protoent* Getprotoent(int &err) = 0; + virtual struct servent* Getservbyname(const char* name, const char* proto, int &err) = 0; + virtual struct servent* Getservbyport(int port, const char* proto, int &err) = 0; + virtual struct servent* Getservent(int &err) = 0; + virtual int Getsockname(SOCKET s, struct sockaddr* name, int* namelen, int &err) = 0; + virtual int Getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen, int &err) = 0; + virtual unsigned long InetAddr(const char* cp, int &err) = 0; + virtual char* InetNtoa(struct in_addr in, int &err) = 0; + virtual int Listen(SOCKET s, int backlog, int &err) = 0; + virtual int Recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen, int &err) = 0; + virtual int Select(int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout, int &err) = 0; + virtual int Send(SOCKET s, const char* buf, int len, int flags, int &err) = 0; + virtual int Sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to, int tolen, int &err) = 0; + virtual void Sethostent(int stayopen, int &err) = 0; + virtual void Setnetent(int stayopen, int &err) = 0; + virtual void Setprotoent(int stayopen, int &err) = 0; + virtual void Setservent(int stayopen, int &err) = 0; + virtual int Setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen, int &err) = 0; + virtual int Shutdown(SOCKET s, int how, int &err) = 0; + virtual SOCKET Socket(int af, int type, int protocol, int &err) = 0; + virtual int Socketpair(int domain, int type, int protocol, int* fds, int &err) = 0; }; #endif /* __Inc__IPerlSock___ */ diff --git a/ipstdio.h b/ipstdio.h index 7ae28ce..e49f1be 100644 --- a/ipstdio.h +++ b/ipstdio.h @@ -1,7 +1,7 @@ /* - ipstdio.h - Interface for perl stdio functions + ipstdio.h + Interface for perl stdio functions */ @@ -15,43 +15,43 @@ typedef struct _PerlIO PerlIO; class IPerlStdIO { public: - virtual PerlIO* Stdin(void) = 0; - virtual PerlIO* Stdout(void) = 0; - virtual PerlIO* Stderr(void) = 0; - virtual PerlIO* Open(const char *, const char *, int &err) = 0; - virtual int Close(PerlIO*, int &err) = 0; - virtual int Eof(PerlIO*, int &err) = 0; - virtual int Error(PerlIO*, int &err) = 0; - virtual void Clearerr(PerlIO*, int &err) = 0; - virtual int Getc(PerlIO*, int &err) = 0; - virtual char* GetBase(PerlIO *, int &err) = 0; - virtual int GetBufsiz(PerlIO *, int &err) = 0; - virtual int GetCnt(PerlIO *, int &err) = 0; - virtual char* GetPtr(PerlIO *, int &err) = 0; - virtual int Putc(PerlIO*, int, int &err) = 0; - virtual int Puts(PerlIO*, const char *, int &err) = 0; - virtual int Flush(PerlIO*, int &err) = 0; - virtual int Ungetc(PerlIO*,int, int &err) = 0; - virtual int Fileno(PerlIO*, int &err) = 0; - virtual PerlIO* Fdopen(int, const char *, int &err) = 0; - virtual PerlIO* Reopen(const char*, const char*, PerlIO*, int &err) = 0; - virtual SSize_t Read(PerlIO*,void *,Size_t, int &err) = 0; - virtual SSize_t Write(PerlIO*,const void *,Size_t, int &err) = 0; - virtual void SetBuf(PerlIO *, char*, int &err) = 0; - virtual int SetVBuf(PerlIO *, char*, int, Size_t, int &err) = 0; - virtual void SetCnt(PerlIO *, int, int &err) = 0; - virtual void SetPtrCnt(PerlIO *, char *, int, int& err) = 0; - virtual void Setlinebuf(PerlIO*, int &err) = 0; - virtual int Printf(PerlIO*, int &err, const char *,...) = 0; - virtual int Vprintf(PerlIO*, int &err, const char *, va_list) = 0; - virtual long Tell(PerlIO*, int &err) = 0; - virtual int Seek(PerlIO*, off_t, int, int &err) = 0; - virtual void Rewind(PerlIO*, int &err) = 0; - virtual PerlIO* Tmpfile(int &err) = 0; - virtual int Getpos(PerlIO*, Fpos_t *, int &err) = 0; - virtual int Setpos(PerlIO*, const Fpos_t *, int &err) = 0; - virtual void Init(int &err) = 0; - virtual void InitOSExtras(void* p) = 0; + virtual PerlIO* Stdin(void) = 0; + virtual PerlIO* Stdout(void) = 0; + virtual PerlIO* Stderr(void) = 0; + virtual PerlIO* Open(const char *, const char *, int &err) = 0; + virtual int Close(PerlIO*, int &err) = 0; + virtual int Eof(PerlIO*, int &err) = 0; + virtual int Error(PerlIO*, int &err) = 0; + virtual void Clearerr(PerlIO*, int &err) = 0; + virtual int Getc(PerlIO*, int &err) = 0; + virtual char* GetBase(PerlIO *, int &err) = 0; + virtual int GetBufsiz(PerlIO *, int &err) = 0; + virtual int GetCnt(PerlIO *, int &err) = 0; + virtual char* GetPtr(PerlIO *, int &err) = 0; + virtual int Putc(PerlIO*, int, int &err) = 0; + virtual int Puts(PerlIO*, const char *, int &err) = 0; + virtual int Flush(PerlIO*, int &err) = 0; + virtual int Ungetc(PerlIO*,int, int &err) = 0; + virtual int Fileno(PerlIO*, int &err) = 0; + virtual PerlIO* Fdopen(int, const char *, int &err) = 0; + virtual PerlIO* Reopen(const char*, const char*, PerlIO*, int &err) = 0; + virtual SSize_t Read(PerlIO*,void *,Size_t, int &err) = 0; + virtual SSize_t Write(PerlIO*,const void *,Size_t, int &err) = 0; + virtual void SetBuf(PerlIO *, char*, int &err) = 0; + virtual int SetVBuf(PerlIO *, char*, int, Size_t, int &err) = 0; + virtual void SetCnt(PerlIO *, int, int &err) = 0; + virtual void SetPtrCnt(PerlIO *, char *, int, int& err) = 0; + virtual void Setlinebuf(PerlIO*, int &err) = 0; + virtual int Printf(PerlIO*, int &err, const char *,...) = 0; + virtual int Vprintf(PerlIO*, int &err, const char *, va_list) = 0; + virtual long Tell(PerlIO*, int &err) = 0; + virtual int Seek(PerlIO*, off_t, int, int &err) = 0; + virtual void Rewind(PerlIO*, int &err) = 0; + virtual PerlIO* Tmpfile(int &err) = 0; + virtual int Getpos(PerlIO*, Fpos_t *, int &err) = 0; + virtual int Setpos(PerlIO*, const Fpos_t *, int &err) = 0; + virtual void Init(int &err) = 0; + virtual void InitOSExtras(void* p) = 0; }; #endif /* __Inc__IPerlStdIO___ */ diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index ae2ef48..d6dfe4a 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -449,7 +449,10 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists sub perl_archive { - return '$(PERL_INC)\perl$(LIB_EXT)'; + if($OBJ) { + return '$(PERL_INC)\perlcore$(LIB_EXT)'; + } + return '$(PERL_INC)\perl$(LIB_EXT)'; } sub export_list diff --git a/perldir.h b/perldir.h index 1bc4b8a..3d71d6e 100644 --- a/perldir.h +++ b/perldir.h @@ -5,7 +5,7 @@ #include "ipdir.h" -#define PerlDir_mkdir(name, mode) piDir->MKdir((name), (mode), ErrorNo()) +#define PerlDir_mkdir(name, mode) piDir->Makedir((name), (mode), ErrorNo()) #define PerlDir_chdir(name) piDir->Chdir((name), ErrorNo()) #define PerlDir_rmdir(name) piDir->Rmdir((name), ErrorNo()) #define PerlDir_close(dir) piDir->Close((dir), ErrorNo()) diff --git a/perlenv.h b/perlenv.h index 6f4211e..eb631a2 100644 --- a/perlenv.h +++ b/perlenv.h @@ -7,7 +7,7 @@ #define PerlEnv_putenv(str) piENV->Putenv((str), ErrorNo()) #define PerlEnv_getenv(str) piENV->Getenv((str), ErrorNo()) -#define PerlEnv_lib_path piENV->LibPath +#define PerlEnv_lib_path piENV->LibPath #else #define PerlEnv_putenv(str) putenv((str)) #define PerlEnv_getenv(str) getenv((str)) diff --git a/perlio.h b/perlio.h index 48bb386..9df9575 100644 --- a/perlio.h +++ b/perlio.h @@ -25,49 +25,49 @@ extern void PerlIO_init _((void)); #include "ipstdio.h" #define PerlIO_canset_cnt(f) 1 -#define PerlIO_has_base(f) 1 +#define PerlIO_has_base(f) 1 #define PerlIO_has_cntptr(f) 1 -#define PerlIO_fast_gets(f) 1 - -#define PerlIO_stdin() piStdIO->Stdin() -#define PerlIO_stdout() piStdIO->Stdout() -#define PerlIO_stderr() piStdIO->Stderr() -#define PerlIO_open(x,y) piStdIO->Open((x),(y), ErrorNo()) -#define PerlIO_close(f) piStdIO->Close((f), ErrorNo()) -#define PerlIO_eof(f) piStdIO->Eof((f), ErrorNo()) -#define PerlIO_error(f) piStdIO->Error((f), ErrorNo()) -#define PerlIO_clearerr(f) piStdIO->Clearerr((f), ErrorNo()) -#define PerlIO_getc(f) piStdIO->Getc((f), ErrorNo()) -#define PerlIO_get_base(f) piStdIO->GetBase((f), ErrorNo()) +#define PerlIO_fast_gets(f) 1 + +#define PerlIO_stdin() piStdIO->Stdin() +#define PerlIO_stdout() piStdIO->Stdout() +#define PerlIO_stderr() piStdIO->Stderr() +#define PerlIO_open(x,y) piStdIO->Open((x),(y), ErrorNo()) +#define PerlIO_close(f) piStdIO->Close((f), ErrorNo()) +#define PerlIO_eof(f) piStdIO->Eof((f), ErrorNo()) +#define PerlIO_error(f) piStdIO->Error((f), ErrorNo()) +#define PerlIO_clearerr(f) piStdIO->Clearerr((f), ErrorNo()) +#define PerlIO_getc(f) piStdIO->Getc((f), ErrorNo()) +#define PerlIO_get_base(f) piStdIO->GetBase((f), ErrorNo()) #define PerlIO_get_bufsiz(f) piStdIO->GetBufsiz((f), ErrorNo()) -#define PerlIO_get_cnt(f) piStdIO->GetCnt((f), ErrorNo()) -#define PerlIO_get_ptr(f) piStdIO->GetPtr((f), ErrorNo()) -#define PerlIO_putc(f,c) piStdIO->Putc((f),(c), ErrorNo()) -#define PerlIO_puts(f,s) piStdIO->Puts((f),(s), ErrorNo()) -#define PerlIO_flush(f) piStdIO->Flush((f), ErrorNo()) -#define PerlIO_ungetc(f,c) piStdIO->Ungetc((f),(c), ErrorNo()) -#define PerlIO_fileno(f) piStdIO->Fileno((f), ErrorNo()) -#define PerlIO_fdopen(f, s) piStdIO->Fdopen((f),(s), ErrorNo()) +#define PerlIO_get_cnt(f) piStdIO->GetCnt((f), ErrorNo()) +#define PerlIO_get_ptr(f) piStdIO->GetPtr((f), ErrorNo()) +#define PerlIO_putc(f,c) piStdIO->Putc((f),(c), ErrorNo()) +#define PerlIO_puts(f,s) piStdIO->Puts((f),(s), ErrorNo()) +#define PerlIO_flush(f) piStdIO->Flush((f), ErrorNo()) +#define PerlIO_ungetc(f,c) piStdIO->Ungetc((f),(c), ErrorNo()) +#define PerlIO_fileno(f) piStdIO->Fileno((f), ErrorNo()) +#define PerlIO_fdopen(f, s) piStdIO->Fdopen((f),(s), ErrorNo()) #define PerlIO_reopen(p, m, f) piStdIO->Reopen((p), (m), (f), ErrorNo()) #define PerlIO_read(f,buf,count) (SSize_t)piStdIO->Read((f), (buf), (count), ErrorNo()) #define PerlIO_write(f,buf,count) piStdIO->Write((f), (buf), (count), ErrorNo()) -#define PerlIO_setbuf(f,b) piStdIO->SetBuf((f), (b), ErrorNo()) +#define PerlIO_setbuf(f,b) piStdIO->SetBuf((f), (b), ErrorNo()) #define PerlIO_setvbuf(f,b,t,s) piStdIO->SetVBuf((f), (b), (t), (s), ErrorNo()) -#define PerlIO_set_cnt(f,c) piStdIO->SetCnt((f), (c), ErrorNo()) +#define PerlIO_set_cnt(f,c) piStdIO->SetCnt((f), (c), ErrorNo()) #define PerlIO_set_ptrcnt(f,p,c) piStdIO->SetPtrCnt((f), (p), (c), ErrorNo()) #define PerlIO_setlinebuf(f) piStdIO->Setlinebuf((f), ErrorNo()) -#define PerlIO_printf fprintf -#define PerlIO_stdoutf piStdIO->Printf -#define PerlIO_vprintf(f,fmt,a) piStdIO->Vprintf((f), ErrorNo(), (fmt),a) -#define PerlIO_tell(f) piStdIO->Tell((f), ErrorNo()) -#define PerlIO_seek(f,o,w) piStdIO->Seek((f),(o),(w), ErrorNo()) -#define PerlIO_getpos(f,p) piStdIO->Getpos((f),(p), ErrorNo()) -#define PerlIO_setpos(f,p) piStdIO->Setpos((f),(p), ErrorNo()) -#define PerlIO_rewind(f) piStdIO->Rewind((f), ErrorNo()) -#define PerlIO_tmpfile() piStdIO->Tmpfile(ErrorNo()) -#define PerlIO_init() piStdIO->Init(ErrorNo()) +#define PerlIO_printf fprintf +#define PerlIO_stdoutf piStdIO->Printf +#define PerlIO_vprintf(f,fmt,a) piStdIO->Vprintf((f), ErrorNo(), (fmt),a) +#define PerlIO_tell(f) piStdIO->Tell((f), ErrorNo()) +#define PerlIO_seek(f,o,w) piStdIO->Seek((f),(o),(w), ErrorNo()) +#define PerlIO_getpos(f,p) piStdIO->Getpos((f),(p), ErrorNo()) +#define PerlIO_setpos(f,p) piStdIO->Setpos((f),(p), ErrorNo()) +#define PerlIO_rewind(f) piStdIO->Rewind((f), ErrorNo()) +#define PerlIO_tmpfile() piStdIO->Tmpfile(ErrorNo()) +#define PerlIO_init() piStdIO->Init(ErrorNo()) #undef init_os_extras -#define init_os_extras() piStdIO->InitOSExtras(this) +#define init_os_extras() piStdIO->InitOSExtras(this) #else #include "perlsdio.h" diff --git a/perllio.h b/perllio.h index 0b0f591..283e6ce 100644 --- a/perllio.h +++ b/perllio.h @@ -12,7 +12,7 @@ #define PerlLIO_dup(fd) piLIO->Dup((fd), ErrorNo()) #define PerlLIO_dup2(fd1, fd2) piLIO->Dup2((fd1), (fd2), ErrorNo()) #define PerlLIO_flock(fd, op) piLIO->Flock((fd), (op), ErrorNo()) -#define PerlLIO_fstat(fd, buf) piLIO->FStat((fd), (buf), ErrorNo()) +#define PerlLIO_fstat(fd, buf) piLIO->FileStat((fd), (buf), ErrorNo()) #define PerlLIO_ioctl(fd, u, buf) piLIO->IOCtl((fd), (u), (buf), ErrorNo()) #define PerlLIO_isatty(fd) piLIO->Isatty((fd), ErrorNo()) #define PerlLIO_lseek(fd, offset, mode) piLIO->Lseek((fd), (offset), (mode), ErrorNo()) @@ -23,7 +23,7 @@ #define PerlLIO_read(fd, buf, count) piLIO->Read((fd), (buf), (count), ErrorNo()) #define PerlLIO_rename(oldname, newname) piLIO->Rename((oldname), (newname), ErrorNo()) #define PerlLIO_setmode(fd, mode) piLIO->Setmode((fd), (mode), ErrorNo()) -#define PerlLIO_stat(name, buf) piLIO->STat((name), (buf), ErrorNo()) +#define PerlLIO_stat(name, buf) piLIO->NameStat((name), (buf), ErrorNo()) #define PerlLIO_tmpnam(str) piLIO->Tmpnam((str), ErrorNo()) #define PerlLIO_umask(mode) piLIO->Umask((mode), ErrorNo()) #define PerlLIO_unlink(file) piLIO->Unlink((file), ErrorNo()) diff --git a/win32/Makefile b/win32/Makefile index 05fe4ff..b77c409 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -88,11 +88,17 @@ LIB32=$(LINK32) -lib # Options # !IF "$(RUNTIME)" == "" +! IF "$(OBJECT)" == "-DPERL_OBJECT" +OBJECTFLAGS = -TP $(OBJECT) +RUNTIME = -MT +! ELSE +OBJECTFLAGS = RUNTIME = -MD +! ENDIF !ENDIF INCLUDES = -I.\include -I. -I.. #PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX -DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT) $(CRYPT_FLAG) $(OBJECT) +DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT) $(CRYPT_FLAG) LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console @@ -100,7 +106,7 @@ SUBSYS = console LIBC = msvcrt.lib WINIOMAYBE = !ELSE -LIBC = libcmt.lib +LIBC = WINIOMAYBE = !ENDIF @@ -126,10 +132,14 @@ LIBFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \ oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \ version.lib odbc32.lib odbccp32.lib +CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) + !IF "$(OBJECT)" == "-DPERL_OBJECT" -CFLAGS = -nologo -Gf -W3 -TP $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) +COBJFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(OBJECTFLAGS) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) +DMYMALLOC = undef !ELSE -CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) +COBJFLAGS = $(CFLAGS) +DMYMALLOC = define !ENDIF LINK_FLAGS = -nologo $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE) OBJOUT_FLAG = -Fo @@ -168,9 +178,14 @@ EXTUTILSDIR=$(LIBDIR)\extutils # # various targets +!IF "$(OBJECT)" == "-DPERL_OBJECT" +PERLIMPLIB=..\perlcore.lib +PERLDLL=..\perlcore.dll +!ELSE PERLIMPLIB=..\perl.lib -MINIPERL=..\miniperl.exe PERLDLL=..\perl.dll +!ENDIF +MINIPERL=..\miniperl.exe PERLEXE=..\perl.exe GLOBEXE=..\perlglob.exe CONFIGPM=..\lib\Config.pm @@ -380,23 +395,25 @@ config.w32 : $(CFGSH_TMPL) copy $(CFGH_TMPL) config.h ..\config.sh : config.w32 $(MINIPERL) config_sh.PL - $(MINIPERL) -I..\lib config_sh.PL \ - "INST_DRV=$(INST_DRV)" \ - "INST_TOP=$(INST_TOP)" \ - "archname=$(ARCHNAME)" \ - "cc=$(CC)" \ - "ccflags=$(OPTIMIZE) $(DEFINES)" \ - "cf_email=$(EMAIL)" \ - "d_crypt=$(D_CRYPT)" \ - "libs=$(LIBFILES)" \ - "incpath=$(CCINCDIR)" \ - "libpth=$(CCLIBDIR)" \ - "libc=$(LIBC)" \ - "static_ext=$(STATIC_EXT)" \ - "dynamic_ext=$(DYNAMIC_EXT)" \ - "LINK_FLAGS=$(LINK_FLAGS)" \ - "optimize=$(OPTIMIZE)" \ - config.w32 > ..\config.sh + $(MINIPERL) -I..\lib config_sh.PL \ + "INST_DRV=$(INST_DRV)" \ + "INST_TOP=$(INST_TOP)" \ + "archname=$(ARCHNAME)" \ + "cc=$(CC)" \ + "ccflags=$(OPTIMIZE) $(DEFINES) $(OBJECTFLAGS)"\ + "cf_email=$(EMAIL)" \ + "d_crypt=$(D_CRYPT)" \ + "libs=$(LIBFILES)" \ + "incpath=$(CCINCDIR)" \ + "libpth=$(CCLIBDIR)" \ + "libc=$(LIBC)" \ + "static_ext=$(STATIC_EXT)" \ + "dynamic_ext=$(DYNAMIC_EXT)" \ + "LINK_FLAGS=$(LINK_FLAGS)" \ + "optimize=$(OPTIMIZE)" \ + "libperl=$(PERLIMPLIB)" \ + "d_mymalloc=$(DMYMALLOC)" \ + config.w32 > ..\config.sh $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl cd .. && miniperl configpm @@ -418,10 +435,22 @@ $(DLL_OBJ) : $(CORE_H) $(PERL95_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H) + +!IF "$(OBJECT)" == "-DPERL_OBJECT" +perldll.def : makefile + echo LIBRARY PerlCore >perldll.def + echo DESCRIPTION 'Perl interpreter' >>perldll.def + echo EXPORTS >>perldll.def + echo perl_alloc >>perldll.def + +!ELSE perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \ CCTYPE=$(CCTYPE) > perldll.def +!ENDIF + + $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) $(LINK32) -dll -def:perldll.def -out:$@ @<< $(LINK_FLAGS) $(LIBFILES) $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) @@ -434,6 +463,21 @@ perl.def : $(MINIPERL) makeperldef.pl $(MINIMOD) : $(MINIPERL) ..\minimod.pl cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm +..\x2p\a2p$(o) : ..\x2p\a2p.c + $(CC) $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c + +..\x2p\hash$(o) : ..\x2p\hash.c + $(CC) $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c + +..\x2p\str$(o) : ..\x2p\str.c + $(CC) $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c + +..\x2p\util$(o) : ..\x2p\util.c + $(CC) $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c + +..\x2p\walk$(o) : ..\x2p\walk.c + $(CC) $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c + $(X2P) : $(X2P_OBJ) $(LINK32) -subsystem:console -out:$@ @<< $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)