diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-01-29 18:11:00 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-01-29 18:11:00 +1200 |
commit | 0a753a764065f2260004b6e6975085378b850346 (patch) | |
tree | e5163ab53209cc4bf655cabaf4067f18036a9106 /win32/include | |
parent | 4b094ceb80288fc9f7c15ae78fc662051510284d (diff) | |
download | perl-0a753a764065f2260004b6e6975085378b850346.tar.gz |
[inseparable changes from patch from perl5.003_23 to perl5.003_24]perl-5.003_24
CORE LANGUAGE CHANGES
Subject: glob defaults to $_
Date: Mon, 27 Jan 1997 03:09:13 -0500
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: op.c opcode.pl pod/perlfunc.pod t/op/glob.t
private-msgid: <199701270809.DAA00934@aatma.engin.umich.edu>
Subject: Re: an overloading bug
Date: Sun, 26 Jan 1997 19:07:45 -0500
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: pod/perldiag.pod pod/perlfunc.pod pp_ctl.c
private-msgid: <199701270007.TAA26525@aatma.engin.umich.edu>
CORE PORTABILITY
Subject: Win32 port
From: Gary Ng <71564.1743@compuserve.com>
Files: MANIFEST win32/*
Subject: Amiga files
Date: Sun, 26 Jan 1997 17:42:15 +0100
From: Norbert Pueschel <pueschel@imsdd.meb.uni-bonn.de>
Files: MANIFEST README.amiga hints/amigaos.sh
private-msgid: <77724712@Armageddon.meb.uni-bonn.de>
DOCUMENTATION
Subject: perldelta Fcntl enhancement
Date: Sat, 25 Jan 1997 17:05:34 +0200 (EET)
From: Jarkko Hietaniemi <jhi@cc.hut.fi>
Files: pod/perldelta.pod
private-msgid: <199701251505.RAA22159@alpha.hut.fi>
Subject: Updates to perldelta re: Fcntl, DB_File, Net::Ping
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: pod/perldelta.pod
Subject: Document restrictions on gv_fetchmethod() and perl_call_sv()
From: Chip Salzenberg <chip@atlantic.net>
Files: pod/perldelta.pod pod/perlguts.pod
Subject: perldiag.pod: No comma allowed after %s
Date: Sat, 25 Jan 1997 17:41:53 +0200 (EET)
From: Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi>
Files: pod/perldiag.pod
private-msgid: <199701251541.RAA04120@alpha.hut.fi>
Subject: perlfunc.pod: localtime
Date: Sat, 25 Jan 1997 18:29:37 +0200 (EET)
From: Jarkko Hietaniemi <jhi@cc.hut.fi>
Files: pod/perlfunc.pod
private-msgid: <199701251629.SAA08114@alpha.hut.fi>
Subject: perlfunc diff: gmtime
Date: Tue, 28 Jan 1997 14:52:08 +0000
From: Peter Haworth <pmh@edison.ioppublishing.com>
Files: pod/perlfunc.pod
private-msgid: <32EE1298.7B90@edison.ioppublishing.com>
Subject: Updates to guts
Date: Sun, 26 Jan 1997 19:34:18 -0500 (EST)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: pod/perlguts.pod
private-msgid: <199701270034.TAA13177@monk.mps.ohio-state.edu>
TESTS
Subject: New test op/closure.t
From: Tom Phoenix <rootbeer@teleport.com>
Files: MANIFEST t/op/closure.t
Diffstat (limited to 'win32/include')
-rw-r--r-- | win32/include/arpa/inet.h | 4 | ||||
-rw-r--r-- | win32/include/dirent.h | 49 | ||||
-rw-r--r-- | win32/include/netdb.h | 12 | ||||
-rw-r--r-- | win32/include/sys/socket.h | 146 |
4 files changed, 211 insertions, 0 deletions
diff --git a/win32/include/arpa/inet.h b/win32/include/arpa/inet.h new file mode 100644 index 0000000000..0303df0876 --- /dev/null +++ b/win32/include/arpa/inet.h @@ -0,0 +1,4 @@ +/* + * this is a dummy header file for Socket.xs + */ + diff --git a/win32/include/dirent.h b/win32/include/dirent.h new file mode 100644 index 0000000000..8cc7e11479 --- /dev/null +++ b/win32/include/dirent.h @@ -0,0 +1,49 @@ +// dirent.h + +// djl +// Provide UNIX compatibility + +#ifndef _INC_DIRENT +#define _INC_DIRENT + +// +// NT versions of readdir(), etc +// From the MSDOS implementation +// + +// Directory entry size +#ifdef DIRSIZ +#undef DIRSIZ +#endif +#define DIRSIZ(rp) (sizeof(struct direct)) + +// needed to compile directory stuff +#define DIRENT direct + +// structure of a directory entry +typedef struct direct +{ + long d_ino; // inode number (not used by MS-DOS) + int d_namlen; // Name length + char d_name[257]; // file name +} _DIRECT; + +// structure for dir operations +typedef struct _dir_struc +{ + char *start; // Starting position + char *curr; // Current position + long size; // Size of string table + long nfiles; // number if filenames in table + struct direct dirstr; // Directory structure to return +} DIR; + +DIR *opendir(char *filename); +struct direct *readdir(DIR *dirp); +long telldir(DIR *dirp); +void seekdir(DIR *dirp,long loc); +void rewinddir(DIR *dirp); +int closedir(DIR *dirp); + + +#endif //_INC_DIRENT diff --git a/win32/include/netdb.h b/win32/include/netdb.h new file mode 100644 index 0000000000..b0c5ea1949 --- /dev/null +++ b/win32/include/netdb.h @@ -0,0 +1,12 @@ +// netdb.h + +// djl +// Provide UNIX compatibility + + +#ifndef _INC_NETDB +#define _INC_NETDB + +#include <sys/socket.h> + +#endif //_INC_NETDB diff --git a/win32/include/sys/socket.h b/win32/include/sys/socket.h new file mode 100644 index 0000000000..7485195590 --- /dev/null +++ b/win32/include/sys/socket.h @@ -0,0 +1,146 @@ +// sys/socket.h + +// djl +// Provide UNIX compatibility + +#ifdef __cplusplus +extern "C" { +#endif +#ifndef _INC_SYS_SOCKET +#define _INC_SYS_SOCKET + + +#ifndef _WINDOWS_ +#define _WINDOWS_ + +#define FAR +#define PASCAL __stdcall +#define WINAPI __stdcall + +#undef WORD +typedef int BOOL; +typedef unsigned short WORD; +typedef void* HANDLE; +typedef void* HWND; +typedef int (FAR WINAPI *FARPROC)(); + +typedef unsigned long DWORD; +typedef void *PVOID; + +#define IN +#define OUT + +typedef struct _OVERLAPPED { + DWORD Internal; + DWORD InternalHigh; + DWORD Offset; + DWORD OffsetHigh; + HANDLE hEvent; +} OVERLAPPED, *LPOVERLAPPED; + +#endif //_WINDOWS_ +#include <winsock.h> + +#define ENOTSOCK WSAENOTSOCK +#undef HOST_NOT_FOUND + + +SOCKET win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen); +int win32_bind (SOCKET s, const struct sockaddr *addr, int namelen); +int win32_closesocket (SOCKET s); +int win32_connect (SOCKET s, const struct sockaddr *name, int namelen); +int win32_ioctlsocket (SOCKET s, long cmd, u_long *argp); +int win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen); +int win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen); +int win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen); +u_long win32_htonl (u_long hostlong); +u_short win32_htons (u_short hostshort); +unsigned long win32_inet_addr (const char * cp); +char * win32_inet_ntoa (struct in_addr in); +int win32_listen (SOCKET s, int backlog); +u_long win32_ntohl (u_long netlong); +u_short win32_ntohs (u_short netshort); +int win32_recv (SOCKET s, char * buf, int len, int flags); +int win32_recvfrom (SOCKET s, char * buf, int len, int flags, + struct sockaddr *from, int * fromlen); +int win32_select (int nfds, int *readfds, int *writefds, int *exceptfds, const struct timeval *timeout); +int win32_send (SOCKET s, const char * buf, int len, int flags); +int win32_sendto (SOCKET s, const char * buf, int len, int flags, + const struct sockaddr *to, int tolen); +int win32_setsockopt (SOCKET s, int level, int optname, + const char * optval, int optlen); +SOCKET win32_socket (int af, int type, int protocol); +int win32_shutdown (SOCKET s, int how); + +/* Database function prototypes */ + +struct hostent * win32_gethostbyaddr(const char * addr, int len, int type); +struct hostent * win32_gethostbyname(const char * name); +int win32_gethostname (char * name, int namelen); +struct servent * win32_getservbyport(int port, const char * proto); +struct servent * win32_getservbyname(const char * name, const char * proto); +struct protoent * win32_getprotobynumber(int proto); +struct protoent * win32_getprotobyname(const char * name); +struct protoent *win32_getprotoent(void); +struct servent *win32_getservent(void); +void win32_sethostent(int stayopen); +void win32_setnetent(int stayopen); +void win32_setprotoent(int stayopen); +void win32_setservent(int stayopen); +void win32_endhostent(); +void win32_endnetent(); +void win32_endprotoent(); +void win32_endservent(); + +// +// direct to our version +// +#define htonl win32_htonl +#define htons win32_htons +#define ntohl win32_ntohl +#define ntohs win32_ntohs +#define inet_addr win32_inet_addr +#define inet_ntoa win32_inet_ntoa + +#define socket win32_socket +#define bind win32_bind +#define listen win32_listen +#define accept win32_accept +#define connect win32_connect +#define send win32_send +#define sendto win32_sendto +#define recv win32_recv +#define recvfrom win32_recvfrom +#define shutdown win32_shutdown +#define ioctlsocket win32_ioctlsocket +#define setsockopt win32_setsockopt +#define getsockopt win32_getsockopt +#define getpeername win32_getpeername +#define getsockname win32_getsockname +#define gethostname win32_gethostname +#define gethostbyname win32_gethostbyname +#define gethostbyaddr win32_gethostbyaddr +#define getprotobyname win32_getprotobyname +#define getprotobynumber win32_getprotobynumber +#define getservbyname win32_getservbyname +#define getservbyport win32_getservbyport +#define select win32_select +#define endhostent win32_endhostent +#define endnetent win32_endnetent +#define endprotoent win32_endprotoent +#define endservent win32_endservent +#define getnetent win32_getnetent +#define getnetbyname win32_getnetbyname +#define getnetbyaddr win32_getnetbyaddr +#define getprotoent win32_getprotoent +#define getservent win32_getservent +#define sethostent win32_sethostent +#define setnetent win32_setnetent +#define setprotoent win32_setprotoent +#define setservent win32_setservent + +#ifdef __cplusplus +} +#endif + +#endif // _INC_SYS_SOCKET |