# undef ungetc
# undef fileno
-//Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000
+/* Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000 */
#ifdef NETWARE
# undef readdir
# undef fstat
if (!(_emx_env & 0x200) || !use_my)
return flock(handle, o); /* Delegate to EMX. */
- // is this a file?
+ /* is this a file? */
if ((DosQueryHType(handle, &handle_type, &flag_word) != 0) ||
(handle_type & 0xFF))
{
errno = EBADF;
return -1;
}
- // set lock/unlock ranges
+ /* set lock/unlock ranges */
rNull.lOffset = rNull.lRange = rFull.lOffset = 0;
rFull.lRange = 0x7FFFFFFF;
- // set timeout for blocking
+ /* set timeout for blocking */
timeout = ((blocking = !(o & LOCK_NB))) ? 100 : 1;
- // shared or exclusive?
+ /* shared or exclusive? */
shared = (o & LOCK_SH) ? 1 : 0;
- // do not block the unlock
+ /* do not block the unlock */
if (o & (LOCK_UN | LOCK_SH | LOCK_EX)) {
rc = DosSetFileLocks(handle, &rFull, &rNull, timeout, shared);
switch (rc) {
errno = ENOLCK;
return -1;
case ERROR_LOCK_VIOLATION:
- break; // not an error
+ break; /* not an error */
case ERROR_INVALID_PARAMETER:
case ERROR_ATOMIC_LOCK_NOT_SUPPORTED:
case ERROR_READ_LOCKS_NOT_SUPPORTED:
return -1;
}
}
- // lock may block
+ /* lock may block */
if (o & (LOCK_SH | LOCK_EX)) {
- // for blocking operations
+ /* for blocking operations */
for (;;) {
rc =
DosSetFileLocks(
errno = EINVAL;
return -1;
}
- // give away timeslice
+ /* give away timeslice */
DosSleep(1);
}
}
if (!use_my_pwent())
return getpwent(); /* Delegate to EMX. */
if (pwent_cnt++)
- return 0; // Return one entry only
+ return 0; /* Return one entry only */
return getpwuid(0);
}
getgrent (void)
{
if (grent_cnt++)
- return 0; // Return one entry only
+ return 0; /* Return one entry only */
return getgrgid(0);
}
#if defined(HASVOLATILE) || defined(STANDARD_C)
# ifdef __cplusplus
-# define VOL // to temporarily suppress warnings
+# define VOL /* to temporarily suppress warnings */
# else
# define VOL volatile
# endif
-// netdb.h
+/* netdb.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_NETDB
#include <sys/socket.h>
-#endif //_INC_NETDB
+#endif /* _INC_NETDB */
-// sys/socket.h
+/* sys/socket.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_SYS_SOCKET
#define _INC_SYS_SOCKET
void win32_endservent(void);
#ifndef WIN32SCK_IS_STDSCK
-//
-// direct to our version
-//
+
+/* direct to our version */
+
#define htonl win32_htonl
#define htons win32_htons
#define ntohl win32_ntohl
}
#endif
-#endif // _INC_SYS_SOCKET
+#endif /* _INC_SYS_SOCKET */
DWORD m_dwEnvCount;
LPSTR* m_lppEnvList;
- BOOL m_bTopLevel; // is this a toplevel host?
+ BOOL m_bTopLevel; /* is this a toplevel host? */
static long num_hosts;
public:
inline int LastHost(void) { return num_hosts == 1L; };
CPerlHost::~CPerlHost(void)
{
-// Reset();
+/* Reset(); */
InterlockedDecrement(&num_hosts);
delete m_pvDir;
m_pVMemParse->Release();
int
lookup(const void *arg1, const void *arg2)
-{ // Compare strings
+{ /* Compare strings */
char*ptr1, *ptr2;
char c1,c2;
if(c2 == '\0' || c2 == '=')
break;
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
}
else if(c2 == '\0' || c2 == '=')
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
else if(c1 != c2) {
c1 = toupper(c1);
c2 = toupper(c2);
if(c1 != c2) {
if(c1 < c2)
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
}
}
}
int
compare(const void *arg1, const void *arg2)
-{ // Compare strings
+{ /* Compare strings */
char*ptr1, *ptr2;
char c1,c2;
if(c1 == c2)
break;
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
}
else if(c2 == '\0' || c2 == '=')
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
else if(c1 != c2) {
c1 = toupper(c1);
c2 = toupper(c2);
if(c1 != c2) {
if(c1 < c2)
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
}
}
}
szBuffer[index] = '\0';
- // replacing ?
+ /* replacing ? */
lpPtr = Lookup(szBuffer);
if(lpPtr != NULL) {
Renew(*lpPtr, length, char);
DWORD dwSize, dwEnvIndex;
int nLength, compVal;
- // get the process environment strings
+ /* get the process environment strings */
lpAllocPtr = lpTmp = (LPSTR)GetEnvironmentStrings();
- // step over current directory stuff
+ /* step over current directory stuff */
while(*lpTmp == '=')
lpTmp += strlen(lpTmp) + 1;
- // save the start of the environment strings
+ /* save the start of the environment strings */
lpEnvPtr = lpTmp;
for(dwSize = 1; *lpTmp != '\0'; lpTmp += strlen(lpTmp) + 1) {
- // calculate the size of the environment strings
+ /* calculate the size of the environment strings */
dwSize += strlen(lpTmp) + 1;
}
- // add the size of current directories
+ /* add the size of current directories */
dwSize += vDir.CalculateEnvironmentSpace();
- // add the additional space used by changes made to the environment
+ /* add the additional space used by changes made to the environment */
dwSize += CalculateEnvironmentSpace();
New(1, lpStr, dwSize, char);
lpPtr = lpStr;
if(lpStr != NULL) {
- // build the local environment
+ /* build the local environment */
lpStr = vDir.BuildEnvironmentSpace(lpStr);
dwEnvIndex = 0;
lpLocalEnv = GetIndex(dwEnvIndex);
while(*lpEnvPtr != '\0') {
if(!lpLocalEnv) {
- // all environment overrides have been added
- // so copy string into place
+ /* all environment overrides have been added */
+ /* so copy string into place */
strcpy(lpStr, lpEnvPtr);
nLength = strlen(lpEnvPtr) + 1;
lpStr += nLength;
lpEnvPtr += nLength;
}
else {
- // determine which string to copy next
+ /* determine which string to copy next */
compVal = compare(&lpEnvPtr, &lpLocalEnv);
if(compVal < 0) {
strcpy(lpStr, lpEnvPtr);
}
lpLocalEnv = GetIndex(dwEnvIndex);
if(compVal == 0) {
- // this string was replaced
+ /* this string was replaced */
lpEnvPtr += strlen(lpEnvPtr) + 1;
}
}
}
while(lpLocalEnv) {
- // still have environment overrides to add
- // so copy the strings into place if not an override
+ /* still have environment overrides to add */
+ /* so copy the strings into place if not an override */
char *ptr = strchr(lpLocalEnv, '=');
if(ptr && ptr[1]) {
strcpy(lpStr, lpLocalEnv);
lpLocalEnv = GetIndex(dwEnvIndex);
}
- // add final NULL
+ /* add final NULL */
*lpStr = '\0';
}
- // release the process environment strings
+ /* release the process environment strings */
FreeEnvironmentStrings(lpAllocPtr);
return lpPtr;
void* Expand(void* block, size_t size);
void WalkHeap(void);
- HANDLE m_hHeap; // memory heap for this script
- char m_FreeDummy[minAllocSize]; // dummy free block
- PBLOCK m_pFreeList; // pointer to first block on free list
- PBLOCK m_pRover; // roving pointer into the free list
- HeapRec m_heaps[maxHeaps]; // list of all non-contiguous heap areas
- int m_nHeaps; // no. of heaps in m_heaps
- long m_lAllocSize; // current alloc size
- long m_lRefCount; // number of current users
- CRITICAL_SECTION m_cs; // access lock
+ HANDLE m_hHeap; /* memory heap for this script */
+ char m_FreeDummy[minAllocSize]; /* dummy free block */
+ PBLOCK m_pFreeList; /* pointer to first block on free list */
+ PBLOCK m_pRover; /* roving pointer into the free list */
+ HeapRec m_heaps[maxHeaps]; /* list of all non-contiguous heap areas */
+ int m_nHeaps; /* no. of heaps in m_heaps */
+ long m_lAllocSize; /* current alloc size */
+ long m_lRefCount; /* number of current users */
+ CRITICAL_SECTION m_cs; /* access lock */
#ifdef _DEBUG_MEM
FILE* m_pLog;
#endif
};
-// #define _DEBUG_MEM
+/* #define _DEBUG_MEM */
#ifdef _DEBUG_MEM
#define ASSERT(f) if(!(f)) DebugBreak();
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
-#define EOSERR 15 // rk
+#define EOSERR 15 /* rk */
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
-// netdb.h
+/* netdb.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_NETDB
#include <sys/socket.h>
-#endif //_INC_NETDB
+#endif /* _INC_NETDB */
-// sys/socket.h
+/* sys/socket.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_SYS_SOCKET
#define _INC_SYS_SOCKET
#endif
#endif
-#endif //_WINDOWS_
-// #ifndef __GNUC__
+#endif /* _WINDOWS_ */
+/* #ifndef __GNUC__ */
#include <winsock.h>
-// #endif
+/* #endif */
#define ENOTSOCK WSAENOTSOCK
#undef HOST_NOT_FOUND
void win32_endservent(void);
#ifndef WIN32SCK_IS_STDSCK
-//
-// direct to our version
-//
+
+/* direct to our version */
+
#define htonl win32_htonl
#define htons win32_htons
#define ntohl win32_ntohl
}
#endif
-#endif // _INC_SYS_SOCKET
+#endif /* _INC_SYS_SOCKET */
#include <sys/types.h>
-// stat.h
+/* stat.h */
#define _S_IFMT 0170000 /* file type mask */
#define _S_IFDIR 0040000 /* directory */
#define _S_IFCHR 0020000 /* character special */
-// Time-stamp: <01/08/01 20:58:55 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:58:55 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
-// Time-stamp: <01/08/01 20:58:19 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:58:19 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
#endif
-// Called from w32console/wmain.c
+/* Called from w32console/wmain.c */
int
main(int argc, char **argv, char **env)
-// Time-stamp: <01/08/01 20:59:54 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:59:54 keuchel@w2k> */
/* WIN32.H
*
/* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
* real filehandles. XXX Should always be defined (the other version is untested) */
-//#define USE_SOCKETS_AS_HANDLES
+/* #define USE_SOCKETS_AS_HANDLES */
/* read() and write() aren't transparent for socket handles */
#define PERL_SOCK_SYSREAD_IS_RECV
-// Time-stamp: <01/08/01 21:00:16 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:16 keuchel@w2k> */
#ifndef WIN32IOP_H
#define WIN32IOP_H
-// Time-stamp: <01/08/01 21:00:29 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:29 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
-// Time-stamp: <01/08/01 21:00:36 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:36 keuchel@w2k> */
#ifndef _WIN32THREAD_H
#define _WIN32THREAD_H
return fseek(pf, offset, origin);
}
-// fpos_t seems to be int64 on hpc pro! Really stupid.
-// But maybe someday there will be such large disks in a hpc...
+/* fpos_t seems to be int64 on hpc pro! Really stupid. */
+/* But maybe someday there will be such large disks in a hpc... */
DllExport int
win32_fgetpos(FILE *pf, fpos_t *p)
{
return hModule;
}
-// this is needed by Cwd.pm...
+/* this is needed by Cwd.pm... */
static
XS(w32_GetCwd)
XPUSHs(newSViv(osver.dwMajorVersion));
XPUSHs(newSViv(osver.dwMinorVersion));
XPUSHs(newSViv(osver.dwBuildNumber));
- // WINCE = 3
+ /* WINCE = 3 */
XPUSHs(newSViv(osver.dwPlatformId));
PUTBACK;
}
return;
}
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
void
win32_argv2utf8(int argc, char** argv)
{
- // do nothing...
+ /* do nothing... */
}
void
# endif
}
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
#undef getcwd
-// wince.h
-//
-// Time-stamp: <01/08/01 20:48:08 keuchel@w2k>
+/* wince.h */
-// This file includes extracts from the celib-headers, because
-// the celib-headers produces macro conflicts with defines in
-// win32iop.h etc
+/* Time-stamp: <01/08/01 20:48:08 keuchel@w2k> */
+
+/* This file includes extracts from the celib-headers, because */
+/* the celib-headers produces macro conflicts with defines in */
+/* win32iop.h etc */
#ifndef WINCE_H
#define WINCE_H 1
#include "celib_defs.h"
-// include local copies of celib headers...
+/* include local copies of celib headers... */
#include "errno.h"
#include "sys/stat.h"
#include "time.h"
#define gmtime xcegmtime
#define localtime xcelocaltime
#define asctime xceasctime
-//#define utime xceutime
+/* #define utime xceutime */
#define futime xcefutime
#define ftime xceftime
#define ctime xcectime
XCE_EXPORT HMODULE XCEAPI XCEGetModuleHandleA(const char *lpName);
XCE_EXPORT FARPROC XCEAPI XCEGetProcAddressA(HMODULE hMod, const char *name);
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
#define getgid xcegetgid
#define getegid xcegetegid
-// Time-stamp: <01/08/01 21:01:12 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:01:12 keuchel@w2k> */
/* wincesck.c
*
* License or the Artistic License, as specified in the README file.
*/
-// The socket calls use fd functions from celib...
+/* The socket calls use fd functions from celib... */
#define WIN32IO_IS_STDIO
#define WIN32SCK_IS_STDSCK
#define getprotobyname xcegetprotobyname
#define getprotobynumber xcegetprotobynumber
-// uses fdtab...
+/* uses fdtab... */
#include "cesocket2.h"
#endif
Perl_fd_set* ex, const struct timeval* timeout)
{
StartSockets();
- // select not yet fixed
+ /* select not yet fixed */
errno = ENOSYS;
return -1;
}
STR *tmpstr;
#ifdef NETWARE
- fnInitGpfGlobals(); // For importing the CLIB calls in place of Watcom calls
+ fnInitGpfGlobals(); /* For importing the CLIB calls in place of Watcom calls */
#endif /* NETWARE */
myname = argv[0];