--- a/Win32OperatingSystem.st Fri Apr 11 01:37:49 2003 +0200
+++ b/Win32OperatingSystem.st Fri Apr 11 01:39:04 2003 +0200
@@ -1,7 +1,7 @@
"
COPYRIGHT (c) 1988 by Claus Gittinger
COPYRIGHT (c) 1998 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -374,7 +374,7 @@
"
COPYRIGHT (c) 1988 by Claus Gittinger
COPYRIGHT (c) 1998 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -405,90 +405,90 @@
[Class variables:]
- HostName <String> remembered hostname
-
- DomainName <String> remembered domainname
-
- CurrentDirectory <String> remembered currentDirectories path
+ HostName <String> remembered hostname
+
+ DomainName <String> remembered domainname
+
+ CurrentDirectory <String> remembered currentDirectories path
[author:]
- Claus Gittinger (initial version & cleanup)
- Manfred Dierolf (many features)
+ Claus Gittinger (initial version & cleanup)
+ Manfred Dierolf (many features)
[see also:]
- OSProcessStatus
- Filename Date Time
- ExternalStream FileStream PipeStream Socket
+ OSProcessStatus
+ Filename Date Time
+ ExternalStream FileStream PipeStream Socket
"
!
examples
"
various queries
- [exBegin]
+ [exBegin]
Transcript
- showCR:'hello ' , (OperatingSystem getLoginName)
- [exEnd]
-
- [exBegin]
+ showCR:'hello ' , (OperatingSystem getLoginName)
+ [exEnd]
+
+ [exBegin]
OperatingSystem isUNIXlike ifTrue:[
- Transcript showCR:'this is some UNIX-like OS'
+ Transcript showCR:'this is some UNIX-like OS'
] ifFalse:[
- Transcript showCR:'this OS is not UNIX-like'
+ Transcript showCR:'this OS is not UNIX-like'
]
- [exEnd]
-
- [exBegin]
+ [exEnd]
+
+ [exBegin]
Transcript
- showCR:'this machine is called ' , OperatingSystem getHostName
- [exEnd]
-
- [exBegin]
+ showCR:'this machine is called ' , OperatingSystem getHostName
+ [exEnd]
+
+ [exBegin]
Transcript
- showCR:('this machine is in the '
- , OperatingSystem getDomainName
- , ' domain')
- [exEnd]
-
- [exBegin]
+ showCR:('this machine is in the '
+ , OperatingSystem getDomainName
+ , ' domain')
+ [exEnd]
+
+ [exBegin]
Transcript
- showCR:('this machine''s CPU is a '
- , OperatingSystem getCPUType
- )
- [exEnd]
-
- [exBegin]
+ showCR:('this machine''s CPU is a '
+ , OperatingSystem getCPUType
+ )
+ [exEnd]
+
+ [exBegin]
Transcript showCR:'executing ls command ...'.
OperatingSystem executeCommand:'ls'.
Transcript showCR:'... done.'.
- [exEnd]
+ [exEnd]
locking a file
(should be executed on two running smalltalks - not in two threads):
- [exBegin]
+ [exBegin]
|f|
f := 'testFile' asFilename readWriteStream.
10 timesRepeat:[
- 'about to lock ...' printCR.
- [
- OperatingSystem
- lockFD:(f fileDescriptor)
- shared:false
- blocking:false
- ] whileFalse:[
- 'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR.
- Delay waitForSeconds:1
- ].
- 'LOCKED ...' printCR.
- Delay waitForSeconds:10.
- 'unlock ...' printCR.
- (OperatingSystem
- unlockFD:(f fileDescriptor)) printCR.
- Delay waitForSeconds:3.
+ 'about to lock ...' printCR.
+ [
+ OperatingSystem
+ lockFD:(f fileDescriptor)
+ shared:false
+ blocking:false
+ ] whileFalse:[
+ 'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR.
+ Delay waitForSeconds:1
+ ].
+ 'LOCKED ...' printCR.
+ Delay waitForSeconds:10.
+ 'unlock ...' printCR.
+ (OperatingSystem
+ unlockFD:(f fileDescriptor)) printCR.
+ Delay waitForSeconds:3.
]
- [exBegin]
+ [exBegin]
"
! !
@@ -506,9 +506,9 @@
GetVersionEx (&osvi);
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- __isWinNT = 1;
+ __isWinNT = 1;
} else {
- __isWinNT = 0;
+ __isWinNT = 0;
}
%}.
!
@@ -530,14 +530,14 @@
"catch image restart and flush some cached data"
something == #earlyRestart ifTrue:[
- "
- flush cached data
- "
- HostName := nil.
- DomainName := nil.
- LastErrorNumber := nil.
- PipeFailed := false.
- self initOSType
+ "
+ flush cached data
+ "
+ HostName := nil.
+ DomainName := nil.
+ LastErrorNumber := nil.
+ PipeFailed := false.
+ self initOSType
]
"Modified: 22.4.1996 / 13:10:43 / cg"
@@ -1147,709 +1147,709 @@
int __eno = __intVal(errNr);
if (__isWIN32Error(__eno)) {
- switch (__eno & 0xFFFF) {
- /*
- * WIN32 GetLastError returns
- */
- case ERROR_INVALID_FUNCTION:
- sym = @symbol(ERROR_INVALID_FUNCTION);
- typ = @symbol(illegalOperationSignal);
- break;
-
- case ERROR_BAD_FORMAT:
- sym = @symbol(ERROR_BAD_FORMAT);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_FILE_NOT_FOUND:
- sym = @symbol(ERROR_FILE_NOT_FOUND);
- typ = @symbol(nonexistentSignal);
- break;
-
- case ERROR_PATH_NOT_FOUND:
- sym = @symbol(ERROR_PATH_NOT_FOUND);
- typ = @symbol(nonexistentSignal);
- break;
-
- case ERROR_TOO_MANY_OPEN_FILES:
- sym = @symbol(ERROR_TOO_MANY_OPEN_FILES);
- typ = @symbol(noResourcesSignal);
- break;
-
- /*
- * what a nice errorCode - thats the most "useful" one I ever
- * encountered ... (... those stupid micro-softies ...)
- */
- case ERROR_OPEN_FAILED:
- sym = @symbol(ERROR_OPEN_FAILED);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_ACCESS_DENIED:
- sym = @symbol(ERROR_ACCESS_DENIED);
- typ = @symbol(noPermissionsSignal);
- break;
-
- case ERROR_INVALID_HANDLE:
- sym = @symbol(ERROR_INVALID_HANDLE);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_NOT_ENOUGH_MEMORY:
- sym = @symbol(ERROR_NOT_ENOUGH_MEMORY);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_INVALID_ACCESS:
- sym = @symbol(ERROR_INVALID_ACCESS);
- typ = @symbol(inappropriateOperationSignal);
- break;
-
- case ERROR_INVALID_DATA:
- sym = @symbol(ERROR_INVALID_DATA);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_INVALID_NAME:
- sym = @symbol(ERROR_INVALID_NAME);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_ARENA_TRASHED:
- sym = @symbol(ERROR_ARENA_TRASHED);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_OUTOFMEMORY:
- sym = @symbol(ERROR_OUTOFMEMORY);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_BROKEN_PIPE:
- sym = @symbol(ERROR_BROKEN_PIPE);
- typ = @symbol(peerFaultSignal);
- break;
-
- case ERROR_GEN_FAILURE:
- sym = @symbol(ERROR_GEN_FAILURE);
- break;
-
- case ERROR_WRITE_PROTECT:
- sym = @symbol(ERROR_WRITE_PROTECT);
- typ = @symbol(inappropriateOperationSignal);
- break;
-
- case ERROR_WRITE_FAULT:
- sym = @symbol(ERROR_WRITE_FAULT);
- typ = @symbol(transferFaultSignal);
- break;
-
- case ERROR_READ_FAULT:
- sym = @symbol(ERROR_READ_FAULT);
- typ = @symbol(transferFaultSignal);
- break;
-
- case ERROR_HANDLE_DISK_FULL:
- sym = @symbol(ERROR_HANDLE_DISK_FULL);
- typ = @symbol(volumeFullSignal);
- break;
-
- case ERROR_DISK_FULL:
- sym = @symbol(ERROR_DISK_FULL);
- typ = @symbol(volumeFullSignal);
- break;
-
- case ERROR_SHARING_VIOLATION:
- sym = @symbol(ERROR_SHARING_VIOLATION);
- typ = @symbol(noPermissionsSignal);
- break;
-
- case ERROR_LOCK_VIOLATION:
- sym = @symbol(ERROR_LOCK_VIOLATION);
- typ = @symbol(noPermissionsSignal);
- break;
-
- case ERROR_INVALID_PARAMETER:
- sym = @symbol(ERROR_INVALID_PARAMETER);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_NET_WRITE_FAULT:
- sym = @symbol(ERROR_NET_WRITE_FAULT);
- typ = @symbol(transferFaultSignal);
- break;
-
- case ERROR_NOT_SUPPORTED:
- sym = @symbol(ERROR_NOT_SUPPORTED);
- typ = @symbol(inappropriateOperationSignal);
- break;
-
- case ERROR_REM_NOT_LIST:
- sym = @symbol(ERROR_REM_NOT_LIST);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_NETWORK_ACCESS_DENIED:
- sym = @symbol(ERROR_NETWORK_ACCESS_DENIED);
- typ = @symbol(noPermissionsSignal);
- break;
-
- case ERROR_DUP_NAME:
- sym = @symbol(ERROR_DUP_NAME);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_BAD_NETPATH:
- sym = @symbol(ERROR_BAD_NETPATH);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_NETWORK_BUSY:
- sym = @symbol(ERROR_NETWORK_BUSY);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_DRIVE_LOCKED:
- sym = @symbol(ERROR_DRIVE_LOCKED);
- typ = @symbol(inappropriateOperationSignal);
- break;
-
- case ERROR_INVALID_DRIVE:
- sym = @symbol(ERROR_INVALID_DRIVE);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_WRONG_DISK:
- sym = @symbol(ERROR_WRONG_DISK);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_CURRENT_DIRECTORY:
- sym = @symbol(ERROR_CURRENT_DIRECTORY);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- /*
- * what a nice errorCode - thats the most "useful" one I ever
- * encountered ... (... those stupid micro-softies ...)
- */
- case ERROR_CANNOT_MAKE:
- sym = @symbol(ERROR_CANNOT_MAKE);
- typ = @symbol(inappropriateOperationSignal);
- break;
-
- case ERROR_NO_MORE_FILES:
- sym = @symbol(ERROR_NO_MORE_FILES);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_NOT_READY:
- sym = @symbol(ERROR_NOT_READY);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_NOT_DOS_DISK:
- sym = @symbol(ERROR_NOT_DOS_DISK);
- typ = @symbol(invalidArgumentsSignal);
- break;
-
- case ERROR_OUT_OF_PAPER:
- sym = @symbol(ERROR_OUT_OF_PAPER);
- typ = @symbol(noResourcesSignal);
- break;
-
- case ERROR_PRINTQ_FULL:
- sym = @symbol(ERROR_PRINTQ_FULL);
- typ = @symbol(noResourcesSignal);
- break;
-
- default:
- sym = nil;
- break;
- }
+ switch (__eno & 0xFFFF) {
+ /*
+ * WIN32 GetLastError returns
+ */
+ case ERROR_INVALID_FUNCTION:
+ sym = @symbol(ERROR_INVALID_FUNCTION);
+ typ = @symbol(illegalOperationSignal);
+ break;
+
+ case ERROR_BAD_FORMAT:
+ sym = @symbol(ERROR_BAD_FORMAT);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_FILE_NOT_FOUND:
+ sym = @symbol(ERROR_FILE_NOT_FOUND);
+ typ = @symbol(nonexistentSignal);
+ break;
+
+ case ERROR_PATH_NOT_FOUND:
+ sym = @symbol(ERROR_PATH_NOT_FOUND);
+ typ = @symbol(nonexistentSignal);
+ break;
+
+ case ERROR_TOO_MANY_OPEN_FILES:
+ sym = @symbol(ERROR_TOO_MANY_OPEN_FILES);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ /*
+ * what a nice errorCode - thats the most "useful" one I ever
+ * encountered ... (... those stupid micro-softies ...)
+ */
+ case ERROR_OPEN_FAILED:
+ sym = @symbol(ERROR_OPEN_FAILED);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_ACCESS_DENIED:
+ sym = @symbol(ERROR_ACCESS_DENIED);
+ typ = @symbol(noPermissionsSignal);
+ break;
+
+ case ERROR_INVALID_HANDLE:
+ sym = @symbol(ERROR_INVALID_HANDLE);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ sym = @symbol(ERROR_NOT_ENOUGH_MEMORY);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_INVALID_ACCESS:
+ sym = @symbol(ERROR_INVALID_ACCESS);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+
+ case ERROR_INVALID_DATA:
+ sym = @symbol(ERROR_INVALID_DATA);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_INVALID_NAME:
+ sym = @symbol(ERROR_INVALID_NAME);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_ARENA_TRASHED:
+ sym = @symbol(ERROR_ARENA_TRASHED);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ sym = @symbol(ERROR_OUTOFMEMORY);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_BROKEN_PIPE:
+ sym = @symbol(ERROR_BROKEN_PIPE);
+ typ = @symbol(peerFaultSignal);
+ break;
+
+ case ERROR_GEN_FAILURE:
+ sym = @symbol(ERROR_GEN_FAILURE);
+ break;
+
+ case ERROR_WRITE_PROTECT:
+ sym = @symbol(ERROR_WRITE_PROTECT);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+
+ case ERROR_WRITE_FAULT:
+ sym = @symbol(ERROR_WRITE_FAULT);
+ typ = @symbol(transferFaultSignal);
+ break;
+
+ case ERROR_READ_FAULT:
+ sym = @symbol(ERROR_READ_FAULT);
+ typ = @symbol(transferFaultSignal);
+ break;
+
+ case ERROR_HANDLE_DISK_FULL:
+ sym = @symbol(ERROR_HANDLE_DISK_FULL);
+ typ = @symbol(volumeFullSignal);
+ break;
+
+ case ERROR_DISK_FULL:
+ sym = @symbol(ERROR_DISK_FULL);
+ typ = @symbol(volumeFullSignal);
+ break;
+
+ case ERROR_SHARING_VIOLATION:
+ sym = @symbol(ERROR_SHARING_VIOLATION);
+ typ = @symbol(noPermissionsSignal);
+ break;
+
+ case ERROR_LOCK_VIOLATION:
+ sym = @symbol(ERROR_LOCK_VIOLATION);
+ typ = @symbol(noPermissionsSignal);
+ break;
+
+ case ERROR_INVALID_PARAMETER:
+ sym = @symbol(ERROR_INVALID_PARAMETER);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_NET_WRITE_FAULT:
+ sym = @symbol(ERROR_NET_WRITE_FAULT);
+ typ = @symbol(transferFaultSignal);
+ break;
+
+ case ERROR_NOT_SUPPORTED:
+ sym = @symbol(ERROR_NOT_SUPPORTED);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+
+ case ERROR_REM_NOT_LIST:
+ sym = @symbol(ERROR_REM_NOT_LIST);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_NETWORK_ACCESS_DENIED:
+ sym = @symbol(ERROR_NETWORK_ACCESS_DENIED);
+ typ = @symbol(noPermissionsSignal);
+ break;
+
+ case ERROR_DUP_NAME:
+ sym = @symbol(ERROR_DUP_NAME);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_BAD_NETPATH:
+ sym = @symbol(ERROR_BAD_NETPATH);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_NETWORK_BUSY:
+ sym = @symbol(ERROR_NETWORK_BUSY);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_DRIVE_LOCKED:
+ sym = @symbol(ERROR_DRIVE_LOCKED);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+
+ case ERROR_INVALID_DRIVE:
+ sym = @symbol(ERROR_INVALID_DRIVE);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_WRONG_DISK:
+ sym = @symbol(ERROR_WRONG_DISK);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_CURRENT_DIRECTORY:
+ sym = @symbol(ERROR_CURRENT_DIRECTORY);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ /*
+ * what a nice errorCode - thats the most "useful" one I ever
+ * encountered ... (... those stupid micro-softies ...)
+ */
+ case ERROR_CANNOT_MAKE:
+ sym = @symbol(ERROR_CANNOT_MAKE);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+
+ case ERROR_NO_MORE_FILES:
+ sym = @symbol(ERROR_NO_MORE_FILES);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_NOT_READY:
+ sym = @symbol(ERROR_NOT_READY);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_NOT_DOS_DISK:
+ sym = @symbol(ERROR_NOT_DOS_DISK);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
+
+ case ERROR_OUT_OF_PAPER:
+ sym = @symbol(ERROR_OUT_OF_PAPER);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ case ERROR_PRINTQ_FULL:
+ sym = @symbol(ERROR_PRINTQ_FULL);
+ typ = @symbol(noResourcesSignal);
+ break;
+
+ default:
+ sym = nil;
+ break;
+ }
} else {
- switch (__eno) {
- /*
- * POSIX errnos - these should be defined
- */
+ switch (__eno) {
+ /*
+ * POSIX errnos - these should be defined
+ */
#ifdef EPERM
- case EPERM:
- sym = @symbol(EPERM);
- typ = @symbol(noPermissionsSignal);
- break;
+ case EPERM:
+ sym = @symbol(EPERM);
+ typ = @symbol(noPermissionsSignal);
+ break;
#endif
#ifdef ENOENT
- case ENOENT:
- sym = @symbol(ENOENT);
- typ = @symbol(nonexistentSignal);
- break;
+ case ENOENT:
+ sym = @symbol(ENOENT);
+ typ = @symbol(nonexistentSignal);
+ break;
#endif
#ifdef ESRCH
- case ESRCH:
- sym = @symbol(ESRCH);
- typ = @symbol(unavailableReferentSignal);
- break;
+ case ESRCH:
+ sym = @symbol(ESRCH);
+ typ = @symbol(unavailableReferentSignal);
+ break;
#endif
#ifdef EINTR
- case EINTR:
- sym = @symbol(EINTR);
- typ = @symbol(transientErrorSignal);
- break;
+ case EINTR:
+ sym = @symbol(EINTR);
+ typ = @symbol(transientErrorSignal);
+ break;
#endif
#ifdef EIO
- case EIO:
- sym = @symbol(EIO);
- typ = @symbol(transferFaultSignal);
- break;
+ case EIO:
+ sym = @symbol(EIO);
+ typ = @symbol(transferFaultSignal);
+ break;
#endif
#ifdef ENXIO
- case ENXIO:
- sym = @symbol(ENXIO);
- typ = @symbol(unavailableReferentSignal);
- break;
+ case ENXIO:
+ sym = @symbol(ENXIO);
+ typ = @symbol(unavailableReferentSignal);
+ break;
#endif
#ifdef E2BIG
- case E2BIG:
- sym = @symbol(E2BIG);
- typ = @symbol(invalidArgumentsSignal);
- break;
+ case E2BIG:
+ sym = @symbol(E2BIG);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
#endif
#ifdef ENOEXEC
- case ENOEXEC:
- sym = @symbol(ENOEXEC);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOEXEC:
+ sym = @symbol(ENOEXEC);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EBADF
- case EBADF:
- sym = @symbol(EBADF);
- typ = @symbol(badAccessorSignal);
- break;
+ case EBADF:
+ sym = @symbol(EBADF);
+ typ = @symbol(badAccessorSignal);
+ break;
#endif
#ifdef ECHILD
- case ECHILD:
- sym = @symbol(ECHILD);
- typ = @symbol(informationSignal);
- break;
+ case ECHILD:
+ sym = @symbol(ECHILD);
+ typ = @symbol(informationSignal);
+ break;
#endif
#if !defined(EWOULDBLOCK) && defined(EAGAIN) && (EWOULDBLOCK != EAGAIN)
- case EAGAIN:
- sym = @symbol(EAGAIN);
- typ = @symbol(notReadySignal);
- break;
+ case EAGAIN:
+ sym = @symbol(EAGAIN);
+ typ = @symbol(notReadySignal);
+ break;
#endif
#ifdef ENOMEM
- case ENOMEM:
- sym = @symbol(ENOMEM);
- typ = @symbol(noMemorySignal);
- break;
+ case ENOMEM:
+ sym = @symbol(ENOMEM);
+ typ = @symbol(noMemorySignal);
+ break;
#endif
#ifdef EACCES
- case EACCES:
- sym = @symbol(EACCES);
- typ = @symbol(noPermissionsSignal);
- break;
+ case EACCES:
+ sym = @symbol(EACCES);
+ typ = @symbol(noPermissionsSignal);
+ break;
#endif
#ifdef EFAULT
- case EFAULT:
- sym = @symbol(EFAULT);
- typ = @symbol(invalidArgumentsSignal);
- break;
+ case EFAULT:
+ sym = @symbol(EFAULT);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
#endif
#ifdef EBUSY
- case EBUSY:
- sym = @symbol(EBUSY);
- typ = @symbol(unavailableReferentSignal);
- break;
+ case EBUSY:
+ sym = @symbol(EBUSY);
+ typ = @symbol(unavailableReferentSignal);
+ break;
#endif
#ifdef EEXIST
- case EEXIST:
- sym = @symbol(EEXIST);
- typ = @symbol(existingReferentSignal);
- break;
+ case EEXIST:
+ sym = @symbol(EEXIST);
+ typ = @symbol(existingReferentSignal);
+ break;
#endif
#ifdef EXDEV
- case EXDEV:
- sym = @symbol(EXDEV);
- typ = @symbol(inappropriateReferentSignal);
- break;
+ case EXDEV:
+ sym = @symbol(EXDEV);
+ typ = @symbol(inappropriateReferentSignal);
+ break;
#endif
#ifdef ENODEV
- case ENODEV:
- sym = @symbol(ENODEV);
- typ = @symbol(inaccessibleSignal);
- break;
+ case ENODEV:
+ sym = @symbol(ENODEV);
+ typ = @symbol(inaccessibleSignal);
+ break;
#endif
#ifdef ENOTDIR
- case ENOTDIR:
- sym = @symbol(ENOTDIR);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOTDIR:
+ sym = @symbol(ENOTDIR);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EISDIR
- case EISDIR:
- sym = @symbol(EISDIR);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case EISDIR:
+ sym = @symbol(EISDIR);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EINVAL
- case EINVAL:
- sym = @symbol(EINVAL);
- typ = @symbol(invalidArgumentsSignal);
- break;
+ case EINVAL:
+ sym = @symbol(EINVAL);
+ typ = @symbol(invalidArgumentsSignal);
+ break;
#endif
#ifdef ENFILE
- case ENFILE:
- sym = @symbol(ENFILE);
- typ = @symbol(noResourcesSignal);
- break;
+ case ENFILE:
+ sym = @symbol(ENFILE);
+ typ = @symbol(noResourcesSignal);
+ break;
#endif
#ifdef EMFILE
- case EMFILE:
- sym = @symbol(EMFILE);
- typ = @symbol(noResourcesSignal);
- break;
+ case EMFILE:
+ sym = @symbol(EMFILE);
+ typ = @symbol(noResourcesSignal);
+ break;
#endif
#ifdef ENOTTY
- case ENOTTY:
- sym = @symbol(ENOTTY);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOTTY:
+ sym = @symbol(ENOTTY);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EFBIG
- case EFBIG:
- sym = @symbol(EFBIG);
- typ = @symbol(noResourcesSignal);
- break;
+ case EFBIG:
+ sym = @symbol(EFBIG);
+ typ = @symbol(noResourcesSignal);
+ break;
#endif
#ifdef ENOSPC
- case ENOSPC:
- sym = @symbol(ENOSPC);
- typ = @symbol(noResourcesSignal);
- break;
+ case ENOSPC:
+ sym = @symbol(ENOSPC);
+ typ = @symbol(noResourcesSignal);
+ break;
#endif
#ifdef ESPIPE
- case ESPIPE:
- sym = @symbol(ESPIPE);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ESPIPE:
+ sym = @symbol(ESPIPE);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EROFS
- case EROFS:
- sym = @symbol(EROFS);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case EROFS:
+ sym = @symbol(EROFS);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EMLINK
- case EMLINK:
- sym = @symbol(EMLINK);
- typ = @symbol(rangeErrorSignal);
- break;
+ case EMLINK:
+ sym = @symbol(EMLINK);
+ typ = @symbol(rangeErrorSignal);
+ break;
#endif
#ifdef EPIPE
- case EPIPE:
- sym = @symbol(EPIPE);
- typ = @symbol(peerFaultSignal);
- break;
+ case EPIPE:
+ sym = @symbol(EPIPE);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef EDOM
- case EDOM:
- sym = @symbol(EDOM);
- typ = @symbol(rangeErrorSignal);
- break;
+ case EDOM:
+ sym = @symbol(EDOM);
+ typ = @symbol(rangeErrorSignal);
+ break;
#endif
#ifdef ERANGE
- case ERANGE:
- sym = @symbol(ERANGE);
- typ = @symbol(rangeErrorSignal);
- break;
+ case ERANGE:
+ sym = @symbol(ERANGE);
+ typ = @symbol(rangeErrorSignal);
+ break;
#endif
#ifdef EDEADLK
# if EDEADLK != EWOULDBLOCK
- case EDEADLK:
- sym = @symbol(EDEADLK);
- typ = @symbol(noResourcesSignal);
- break;
+ case EDEADLK:
+ sym = @symbol(EDEADLK);
+ typ = @symbol(noResourcesSignal);
+ break;
# endif
#endif
#ifdef ENAMETOOLONG
- case ENAMETOOLONG:
- sym = @symbol(ENAMETOOLONG);
- typ = @symbol(rangeErrorSignal);
- break;
+ case ENAMETOOLONG:
+ sym = @symbol(ENAMETOOLONG);
+ typ = @symbol(rangeErrorSignal);
+ break;
#endif
#ifdef ENOLCK
- case ENOLCK:
- sym = @symbol(ENOLCK);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOLCK:
+ sym = @symbol(ENOLCK);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef ENOSYS
- case ENOSYS:
- sym = @symbol(ENOSYS);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOSYS:
+ sym = @symbol(ENOSYS);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST)
- case ENOTEMPTY:
- sym = @symbol(ENOTEMPTY);
- typ = @symbol(inappropriateReferentSignal);
- break;
+ case ENOTEMPTY:
+ sym = @symbol(ENOTEMPTY);
+ typ = @symbol(inappropriateReferentSignal);
+ break;
#endif
#ifdef EILSEQ
- case EILSEQ:
- sym = @symbol(EILSEQ);
- typ = @symbol(transferFaultSignal);
- break;
-#endif
- /*
- * XPG3 errnos - defined on most systems
- */
+ case EILSEQ:
+ sym = @symbol(EILSEQ);
+ typ = @symbol(transferFaultSignal);
+ break;
+#endif
+ /*
+ * XPG3 errnos - defined on most systems
+ */
#ifdef ENOTBLK
- case ENOTBLK:
- sym = @symbol(ENOTBLK);
- typ = @symbol(inappropriateReferentSignal);
- break;
+ case ENOTBLK:
+ sym = @symbol(ENOTBLK);
+ typ = @symbol(inappropriateReferentSignal);
+ break;
#endif
#ifdef ETXTBSY
- case ETXTBSY:
- sym = @symbol(ETXTBSY);
- typ = @symbol(inaccessibleSignal);
- break;
-#endif
- /*
- * some others
- */
+ case ETXTBSY:
+ sym = @symbol(ETXTBSY);
+ typ = @symbol(inaccessibleSignal);
+ break;
+#endif
+ /*
+ * some others
+ */
#ifdef EWOULDBLOCK
- case EWOULDBLOCK:
- sym = @symbol(EWOULDBLOCK);
- typ = @symbol(notReadySignal);
- break;
+ case EWOULDBLOCK:
+ sym = @symbol(EWOULDBLOCK);
+ typ = @symbol(notReadySignal);
+ break;
#endif
#ifdef ENOMSG
- case ENOMSG:
- sym = @symbol(ENOMSG);
- typ = @symbol(noDataSignal);
- break;
+ case ENOMSG:
+ sym = @symbol(ENOMSG);
+ typ = @symbol(noDataSignal);
+ break;
#endif
#ifdef ELOOP
- case ELOOP:
- sym = @symbol(ELOOP);
- typ = @symbol(rangeErrorSignal);
- break;
-#endif
-
- /*
- * some stream errors
- */
+ case ELOOP:
+ sym = @symbol(ELOOP);
+ typ = @symbol(rangeErrorSignal);
+ break;
+#endif
+
+ /*
+ * some stream errors
+ */
#ifdef ETIME
- case ETIME:
- sym = @symbol(ETIME);
- typ = @symbol(peerFaultSignal);
- break;
+ case ETIME:
+ sym = @symbol(ETIME);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ENOSR
- case ENOSR:
- sym = @symbol(ENOSR);
- typ = @symbol(noResourcesSignal);
- break;
+ case ENOSR:
+ sym = @symbol(ENOSR);
+ typ = @symbol(noResourcesSignal);
+ break;
#endif
#ifdef ENOSTR
- case ENOSTR:
- sym = @symbol(ENOSTR);
- typ = @symbol(inappropriateReferentSignal);
- break;
+ case ENOSTR:
+ sym = @symbol(ENOSTR);
+ typ = @symbol(inappropriateReferentSignal);
+ break;
#endif
#ifdef ECOMM
- case ECOMM:
- sym = @symbol(ECOMM);
- typ = @symbol(transferFaultSignal);
- break;
+ case ECOMM:
+ sym = @symbol(ECOMM);
+ typ = @symbol(transferFaultSignal);
+ break;
#endif
#ifdef EPROTO
- case EPROTO:
- sym = @symbol(EPROTO);
- typ = @symbol(inappropriateOperationSignal);
- break;
-#endif
- /*
- * nfs errors
- */
+ case EPROTO:
+ sym = @symbol(EPROTO);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
+#endif
+ /*
+ * nfs errors
+ */
#ifdef ESTALE
- case ESTALE:
- sym = @symbol(ESTALE);
- typ = @symbol(unavailableReferentSignal);
- break;
+ case ESTALE:
+ sym = @symbol(ESTALE);
+ typ = @symbol(unavailableReferentSignal);
+ break;
#endif
#ifdef EREMOTE
- case EREMOTE:
- sym = @symbol(EREMOTE);
- typ = @symbol(rangeErrorSignal);
- break;
-#endif
- /*
- * some networking errors
- */
+ case EREMOTE:
+ sym = @symbol(EREMOTE);
+ typ = @symbol(rangeErrorSignal);
+ break;
+#endif
+ /*
+ * some networking errors
+ */
#ifdef EINPROGRESS
- case EINPROGRESS:
- sym = @symbol(EINPROGRESS);
- typ = @symbol(operationStartedSignal);
- break;
+ case EINPROGRESS:
+ sym = @symbol(EINPROGRESS);
+ typ = @symbol(operationStartedSignal);
+ break;
#endif
#ifdef EALREADY
- case EALREADY:
- sym = @symbol(EALREADY);
- typ = @symbol(operationStartedSignal);
- break;
+ case EALREADY:
+ sym = @symbol(EALREADY);
+ typ = @symbol(operationStartedSignal);
+ break;
#endif
#ifdef ENOTSOCK
- case ENOTSOCK:
- sym = @symbol(ENOTSOCK);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case ENOTSOCK:
+ sym = @symbol(ENOTSOCK);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EDESTADDRREQ
- case EDESTADDRREQ:
- sym = @symbol(EDESTADDRREQ);
- typ = @symbol(underspecifiedSignal);
- break;
+ case EDESTADDRREQ:
+ sym = @symbol(EDESTADDRREQ);
+ typ = @symbol(underspecifiedSignal);
+ break;
#endif
#ifdef EMSGSIZE
- case EMSGSIZE:
- sym = @symbol(EMSGSIZE);
- typ = @symbol(rangeErrorSignal);
- break;
+ case EMSGSIZE:
+ sym = @symbol(EMSGSIZE);
+ typ = @symbol(rangeErrorSignal);
+ break;
#endif
#ifdef EPROTOTYPE
- case EPROTOTYPE:
- sym = @symbol(EPROTOTYPE);
- typ = @symbol(wrongSubtypeForOperationSignal);
- break;
+ case EPROTOTYPE:
+ sym = @symbol(EPROTOTYPE);
+ typ = @symbol(wrongSubtypeForOperationSignal);
+ break;
#endif
#ifdef ENOPROTOOPT
- case ENOPROTOOPT:
- sym = @symbol(ENOPROTOOPT);
- typ = @symbol(unsupportedOperationSignal);
- break;
+ case ENOPROTOOPT:
+ sym = @symbol(ENOPROTOOPT);
+ typ = @symbol(unsupportedOperationSignal);
+ break;
#endif
#ifdef EPROTONOSUPPORT
- case EPROTONOSUPPORT:
- sym = @symbol(EPROTONOSUPPORT);
- typ = @symbol(unsupportedOperationSignal);
- break;
+ case EPROTONOSUPPORT:
+ sym = @symbol(EPROTONOSUPPORT);
+ typ = @symbol(unsupportedOperationSignal);
+ break;
#endif
#ifdef ESOCKTNOSUPPORT
- case ESOCKTNOSUPPORT:
- sym = @symbol(ESOCKTNOSUPPORT);
- typ = @symbol(unsupportedOperationSignal);
- break;
+ case ESOCKTNOSUPPORT:
+ sym = @symbol(ESOCKTNOSUPPORT);
+ typ = @symbol(unsupportedOperationSignal);
+ break;
#endif
#ifdef EOPNOTSUPP
- case EOPNOTSUPP:
- sym = @symbol(EOPNOTSUPP);
- typ = @symbol(inappropriateOperationSignal);
- break;
+ case EOPNOTSUPP:
+ sym = @symbol(EOPNOTSUPP);
+ typ = @symbol(inappropriateOperationSignal);
+ break;
#endif
#ifdef EPFNOSUPPORT
- case EPFNOSUPPORT:
- sym = @symbol(EPFNOSUPPORT);
- typ = @symbol(unsupportedOperationSignal);
- break;
+ case EPFNOSUPPORT:
+ sym = @symbol(EPFNOSUPPORT);
+ typ = @symbol(unsupportedOperationSignal);
+ break;
#endif
#ifdef EAFNOSUPPORT
- case EAFNOSUPPORT:
- sym = @symbol(EAFNOSUPPORT);
- typ = @symbol(unsupportedOperationSignal);
- break;
+ case EAFNOSUPPORT:
+ sym = @symbol(EAFNOSUPPORT);
+ typ = @symbol(unsupportedOperationSignal);
+ break;
#endif
#ifdef EADDRINUSE
- case EADDRINUSE:
- sym = @symbol(EADDRINUSE);
- typ = @symbol(existingReferentSignal);
- break;
+ case EADDRINUSE:
+ sym = @symbol(EADDRINUSE);
+ typ = @symbol(existingReferentSignal);
+ break;
#endif
#ifdef EADDRNOTAVAIL
- case EADDRNOTAVAIL:
- sym = @symbol(EADDRNOTAVAIL);
- typ = @symbol(noPermissionsSignal);
- break;
+ case EADDRNOTAVAIL:
+ sym = @symbol(EADDRNOTAVAIL);
+ typ = @symbol(noPermissionsSignal);
+ break;
#endif
#ifdef ETIMEDOUT
- case ETIMEDOUT:
- sym = @symbol(ETIMEDOUT);
- typ = @symbol(peerFaultSignal);
- break;
+ case ETIMEDOUT:
+ sym = @symbol(ETIMEDOUT);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ECONNREFUSED
- case ECONNREFUSED:
- sym = @symbol(ECONNREFUSED);
- typ = @symbol(peerFaultSignal);
- break;
+ case ECONNREFUSED:
+ sym = @symbol(ECONNREFUSED);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ENETDOWN
- case ENETDOWN:
- sym = @symbol(ENETDOWN);
- typ = @symbol(peerFaultSignal);
- break;
+ case ENETDOWN:
+ sym = @symbol(ENETDOWN);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ENETUNREACH
- case ENETUNREACH:
- sym = @symbol(ENETUNREACH);
- typ = @symbol(peerFaultSignal);
- break;
+ case ENETUNREACH:
+ sym = @symbol(ENETUNREACH);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ENETRESET
- case ENETRESET:
- sym = @symbol(ENETRESET);
- typ = @symbol(peerFaultSignal);
- break;
+ case ENETRESET:
+ sym = @symbol(ENETRESET);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ECONNABORTED
- case ECONNABORTED:
- sym = @symbol(ECONNABORTED);
- typ = @symbol(peerFaultSignal);
- break;
+ case ECONNABORTED:
+ sym = @symbol(ECONNABORTED);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef ECONNRESET
- case ECONNRESET:
- sym = @symbol(ECONNRESET);
- typ = @symbol(peerFaultSignal);
- break;
+ case ECONNRESET:
+ sym = @symbol(ECONNRESET);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef EISCONN
- case EISCONN:
- sym = @symbol(EISCONN);
- typ = @symbol(unpreparedOperationSignal);
- break;
+ case EISCONN:
+ sym = @symbol(EISCONN);
+ typ = @symbol(unpreparedOperationSignal);
+ break;
#endif
#ifdef ENOTCONN
- case ENOTCONN:
- sym = @symbol(ENOTCONN);
- typ = @symbol(unpreparedOperationSignal);
- break;
+ case ENOTCONN:
+ sym = @symbol(ENOTCONN);
+ typ = @symbol(unpreparedOperationSignal);
+ break;
#endif
#ifdef ESHUTDOWN
- case ESHUTDOWN:
- sym = @symbol(ESHUTDOWN);
- typ = @symbol(unpreparedOperationSignal);
- break;
+ case ESHUTDOWN:
+ sym = @symbol(ESHUTDOWN);
+ typ = @symbol(unpreparedOperationSignal);
+ break;
#endif
#ifdef EHOSTDOWN
- case EHOSTDOWN:
- sym = @symbol(EHOSTDOWN);
- typ = @symbol(peerFaultSignal);
- break;
+ case EHOSTDOWN:
+ sym = @symbol(EHOSTDOWN);
+ typ = @symbol(peerFaultSignal);
+ break;
#endif
#ifdef EHOSTUNREACH
- case EHOSTUNREACH:
- sym = @symbol(EHOSTUNREACH);
- typ = @symbol(peerFaultSignal);
- break;
-#endif
-
- default:
- break;
- }
+ case EHOSTUNREACH:
+ sym = @symbol(EHOSTUNREACH);
+ typ = @symbol(peerFaultSignal);
+ break;
+#endif
+
+ default:
+ break;
+ }
}
}
%}.
@@ -1878,207 +1878,207 @@
*/
#ifdef ERROR_INVALID_FUNCTION
if (sym == @symbol(ERROR_INVALID_FUNCTION)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_FUNCTION) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_FUNCTION) );
}
#endif
#ifdef ERROR_BAD_FORMAT
if (sym == @symbol(ERROR_BAD_FORMAT)) {
- RETURN ( __MKSMALLINT(ERROR_BAD_FORMAT) );
+ RETURN ( __MKSMALLINT(ERROR_BAD_FORMAT) );
}
#endif
#ifdef ERROR_FILE_NOT_FOUND
if (sym == @symbol(ERROR_FILE_NOT_FOUND)) {
- RETURN ( __MKSMALLINT(ERROR_FILE_NOT_FOUND) );
+ RETURN ( __MKSMALLINT(ERROR_FILE_NOT_FOUND) );
}
#endif
#ifdef ERROR_PATH_NOT_FOUND
if (sym == @symbol(ERROR_PATH_NOT_FOUND)) {
- RETURN ( __MKSMALLINT(ERROR_PATH_NOT_FOUND) );
+ RETURN ( __MKSMALLINT(ERROR_PATH_NOT_FOUND) );
}
#endif
#ifdef ERROR_TOO_MANY_OPEN_FILES
if (sym == @symbol(ERROR_TOO_MANY_OPEN_FILES)) {
- RETURN ( __MKSMALLINT(ERROR_TOO_MANY_OPEN_FILES) );
+ RETURN ( __MKSMALLINT(ERROR_TOO_MANY_OPEN_FILES) );
}
#endif
#ifdef ERROR_OPEN_FAILED
if (sym == @symbol(ERROR_OPEN_FAILED)) {
- RETURN ( __MKSMALLINT(ERROR_OPEN_FAILED) );
+ RETURN ( __MKSMALLINT(ERROR_OPEN_FAILED) );
}
#endif
#ifdef ERROR_ACCESS_DENIED
if (sym == @symbol(ERROR_ACCESS_DENIED)) {
- RETURN ( __MKSMALLINT(ERROR_ACCESS_DENIED) );
+ RETURN ( __MKSMALLINT(ERROR_ACCESS_DENIED) );
}
#endif
#ifdef ERROR_INVALID_HANDLE
if (sym == @symbol(ERROR_INVALID_HANDLE)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_HANDLE) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_HANDLE) );
}
#endif
#ifdef ERROR_NOT_ENOUGH_MEMORY
if (sym == @symbol(ERROR_NOT_ENOUGH_MEMORY)) {
- RETURN ( __MKSMALLINT(ERROR_NOT_ENOUGH_MEMORY) );
+ RETURN ( __MKSMALLINT(ERROR_NOT_ENOUGH_MEMORY) );
}
#endif
#ifdef ERROR_INVALID_ACCESS
if (sym == @symbol(ERROR_INVALID_ACCESS)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_ACCESS) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_ACCESS) );
}
#endif
#ifdef ERROR_INVALID_DATA
if (sym == @symbol(ERROR_INVALID_DATA)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_DATA) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_DATA) );
}
#endif
#ifdef ERROR_INVALID_NAME
if (sym == @symbol(ERROR_INVALID_NAME)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_NAME) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_NAME) );
}
#endif
#ifdef ERROR_ARENA_TRASHED
if (sym == @symbol(ERROR_ARENA_TRASHED)) {
- RETURN ( __MKSMALLINT(ERROR_ARENA_TRASHED) );
+ RETURN ( __MKSMALLINT(ERROR_ARENA_TRASHED) );
}
#endif
#ifdef ERROR_OUTOFMEMORY
if (sym == @symbol(ERROR_OUTOFMEMORY)) {
- RETURN ( __MKSMALLINT(ERROR_OUTOFMEMORY) );
+ RETURN ( __MKSMALLINT(ERROR_OUTOFMEMORY) );
}
#endif
#ifdef ERROR_BROKEN_PIPE
if (sym == @symbol(ERROR_BROKEN_PIPE)) {
- RETURN ( __MKSMALLINT(ERROR_BROKEN_PIPE) );
+ RETURN ( __MKSMALLINT(ERROR_BROKEN_PIPE) );
}
#endif
#ifdef ERROR_GEN_FAILURE
if (sym == @symbol(ERROR_GEN_FAILURE)) {
- RETURN ( __MKSMALLINT(ERROR_GEN_FAILURE) );
+ RETURN ( __MKSMALLINT(ERROR_GEN_FAILURE) );
}
#endif
#ifdef ERROR_WRITE_PROTECT
if (sym == @symbol(ERROR_WRITE_PROTECT)) {
- RETURN ( __MKSMALLINT(ERROR_WRITE_PROTECT) );
+ RETURN ( __MKSMALLINT(ERROR_WRITE_PROTECT) );
}
#endif
#ifdef ERROR_WRITE_FAULT
if (sym == @symbol(ERROR_WRITE_FAULT)) {
- RETURN ( __MKSMALLINT(ERROR_WRITE_FAULT) );
+ RETURN ( __MKSMALLINT(ERROR_WRITE_FAULT) );
}
#endif
#ifdef ERROR_READ_FAULT
if (sym == @symbol(ERROR_READ_FAULT)) {
- RETURN ( __MKSMALLINT(ERROR_READ_FAULT) );
+ RETURN ( __MKSMALLINT(ERROR_READ_FAULT) );
}
#endif
#ifdef ERROR_HANDLE_DISK_FULL
if (sym == @symbol(ERROR_HANDLE_DISK_FULL)) {
- RETURN ( __MKSMALLINT(ERROR_HANDLE_DISK_FULL) );
+ RETURN ( __MKSMALLINT(ERROR_HANDLE_DISK_FULL) );
}
#endif
#ifdef ERROR_DISK_FULL
if (sym == @symbol(ERROR_DISK_FULL)) {
- RETURN ( __MKSMALLINT(ERROR_DISK_FULL) );
+ RETURN ( __MKSMALLINT(ERROR_DISK_FULL) );
}
#endif
#ifdef ERROR_ERROR_SHARING_VIOLATION
if (sym == @symbol(ERROR_ERROR_SHARING_VIOLATION)) {
- RETURN ( __MKSMALLINT(ERROR_ERROR_SHARING_VIOLATION) );
+ RETURN ( __MKSMALLINT(ERROR_ERROR_SHARING_VIOLATION) );
}
#endif
#ifdef ERROR_LOCK_VIOLATION
if (sym == @symbol(ERROR_LOCK_VIOLATION)) {
- RETURN ( __MKSMALLINT(ERROR_LOCK_VIOLATION) );
+ RETURN ( __MKSMALLINT(ERROR_LOCK_VIOLATION) );
}
#endif
#ifdef ERROR_INVALID_PARAMETER
if (sym == @symbol(ERROR_INVALID_PARAMETER)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_PARAMETER) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_PARAMETER) );
}
#endif
#ifdef ERROR_NET_WRITE_FAULT
if (sym == @symbol(ERROR_NET_WRITE_FAULT)) {
- RETURN ( __MKSMALLINT(ERROR_NET_WRITE_FAULT) );
+ RETURN ( __MKSMALLINT(ERROR_NET_WRITE_FAULT) );
}
#endif
#ifdef ERROR_NOT_SUPPORTED
if (sym == @symbol(ERROR_NOT_SUPPORTED)) {
- RETURN ( __MKSMALLINT(ERROR_NOT_SUPPORTED) );
+ RETURN ( __MKSMALLINT(ERROR_NOT_SUPPORTED) );
}
#endif
#ifdef ERROR_REM_NOT_LIST
if (sym == @symbol(ERROR_REM_NOT_LIST)) {
- RETURN ( __MKSMALLINT(ERROR_REM_NOT_LIST) );
+ RETURN ( __MKSMALLINT(ERROR_REM_NOT_LIST) );
}
#endif
#ifdef ERROR_NETWORK_ACCESS_DENIED
if (sym == @symbol(ERROR_NETWORK_ACCESS_DENIED)) {
- RETURN ( __MKSMALLINT(ERROR_NETWORK_ACCESS_DENIED) );
+ RETURN ( __MKSMALLINT(ERROR_NETWORK_ACCESS_DENIED) );
}
#endif
#ifdef ERROR_DUP_NAME
if (sym == @symbol(ERROR_DUP_NAME)) {
- RETURN ( __MKSMALLINT(ERROR_DUP_NAME) );
+ RETURN ( __MKSMALLINT(ERROR_DUP_NAME) );
}
#endif
#ifdef ERROR_BAD_NETPATH
if (sym == @symbol(ERROR_BAD_NETPATH)) {
- RETURN ( __MKSMALLINT(ERROR_BAD_NETPATH) );
+ RETURN ( __MKSMALLINT(ERROR_BAD_NETPATH) );
}
#endif
#ifdef ERROR_NETWORK_BUSY
if (sym == @symbol(ERROR_NETWORK_BUSY)) {
- RETURN ( __MKSMALLINT(ERROR_NETWORK_BUSY) );
+ RETURN ( __MKSMALLINT(ERROR_NETWORK_BUSY) );
}
#endif
#ifdef ERROR_DRIVE_LOCKED
if (sym == @symbol(ERROR_DRIVE_LOCKED)) {
- RETURN ( __MKSMALLINT(ERROR_DRIVE_LOCKED) );
+ RETURN ( __MKSMALLINT(ERROR_DRIVE_LOCKED) );
}
#endif
#ifdef ERROR_INVALID_DRIVE
if (sym == @symbol(ERROR_INVALID_DRIVE)) {
- RETURN ( __MKSMALLINT(ERROR_INVALID_DRIVE) );
+ RETURN ( __MKSMALLINT(ERROR_INVALID_DRIVE) );
}
#endif
#ifdef ERROR_WRONG_DISK
if (sym == @symbol(ERROR_WRONG_DISK)) {
- RETURN ( __MKSMALLINT(ERROR_WRONG_DISK) );
+ RETURN ( __MKSMALLINT(ERROR_WRONG_DISK) );
}
#endif
#ifdef ERROR_CURRENT_DIRECTORY
if (sym == @symbol(ERROR_CURRENT_DIRECTORY)) {
- RETURN ( __MKSMALLINT(ERROR_CURRENT_DIRECTORY) );
+ RETURN ( __MKSMALLINT(ERROR_CURRENT_DIRECTORY) );
}
#endif
#ifdef ERROR_CANNOT_MAKE
if (sym == @symbol(ERROR_CANNOT_MAKE)) {
- RETURN ( __MKSMALLINT(ERROR_CANNOT_MAKE) );
+ RETURN ( __MKSMALLINT(ERROR_CANNOT_MAKE) );
}
#endif
#ifdef ERROR_NO_MORE_FILES
if (sym == @symbol(ERROR_NO_MORE_FILES)) {
- RETURN ( __MKSMALLINT(ERROR_NO_MORE_FILES) );
+ RETURN ( __MKSMALLINT(ERROR_NO_MORE_FILES) );
}
#endif
#ifdef ERROR_NOT_READY
if (sym == @symbol(ERROR_NOT_READY)) {
- RETURN ( __MKSMALLINT(ERROR_NOT_READY) );
+ RETURN ( __MKSMALLINT(ERROR_NOT_READY) );
}
#endif
#ifdef ERROR_NOT_DOS_DISK
if (sym == @symbol(ERROR_NOT_DOS_DISK)) {
- RETURN ( __MKSMALLINT(ERROR_NOT_DOS_DISK) );
+ RETURN ( __MKSMALLINT(ERROR_NOT_DOS_DISK) );
}
#endif
#ifdef ERROR_OUT_OF_PAPER
if (sym == @symbol(ERROR_OUT_OF_PAPER)) {
- RETURN ( __MKSMALLINT(ERROR_OUT_OF_PAPER) );
+ RETURN ( __MKSMALLINT(ERROR_OUT_OF_PAPER) );
}
#endif
#ifdef ERROR_PRINTQ_FULL
if (sym == @symbol(ERROR_PRINTQ_FULL)) {
- RETURN ( __MKSMALLINT(ERROR_PRINTQ_FULL) );
+ RETURN ( __MKSMALLINT(ERROR_PRINTQ_FULL) );
}
#endif
@@ -2087,229 +2087,229 @@
*/
#ifdef EPERM
if (sym == @symbol(EPERM)) {
- RETURN ( __MKSMALLINT(EPERM) );
+ RETURN ( __MKSMALLINT(EPERM) );
}
#endif
#ifdef ENOENT
if (sym == @symbol(ENOENT)) {
- RETURN ( __MKSMALLINT(ENOENT) );
+ RETURN ( __MKSMALLINT(ENOENT) );
}
#endif
#ifdef ESRCH
if (sym == @symbol(ESRCH)) {
- RETURN ( __MKSMALLINT(ESRCH) );
+ RETURN ( __MKSMALLINT(ESRCH) );
}
#endif
#ifdef EINTR
if (sym == @symbol(EINTR)) {
- RETURN ( __MKSMALLINT(EINTR) );
+ RETURN ( __MKSMALLINT(EINTR) );
}
#endif
#ifdef EIO
if (sym == @symbol(EIO)) {
- RETURN ( __MKSMALLINT(EIO) );
+ RETURN ( __MKSMALLINT(EIO) );
}
#endif
#ifdef ENXIO
if (sym == @symbol(ENXIO)) {
- RETURN ( __MKSMALLINT(ENXIO) );
+ RETURN ( __MKSMALLINT(ENXIO) );
}
#endif
#ifdef E2BIG
if (sym == @symbol(E2BIG)) {
- RETURN ( __MKSMALLINT(E2BIG) );
+ RETURN ( __MKSMALLINT(E2BIG) );
}
#endif
#ifdef ENOEXEC
if (sym == @symbol(ENOEXEC)) {
- RETURN ( __MKSMALLINT(ENOEXEC) );
+ RETURN ( __MKSMALLINT(ENOEXEC) );
}
#endif
#ifdef EBADF
if (sym == @symbol(EBADF)) {
- RETURN ( __MKSMALLINT(EBADF) );
+ RETURN ( __MKSMALLINT(EBADF) );
}
#endif
#ifdef ECHILD
if (sym == @symbol(ECHILD)) {
- RETURN ( __MKSMALLINT(ECHILD) );
+ RETURN ( __MKSMALLINT(ECHILD) );
}
#endif
#if defined(EAGAIN)
if (sym == @symbol(EAGAIN)) {
- RETURN ( __MKSMALLINT(EAGAIN) );
+ RETURN ( __MKSMALLINT(EAGAIN) );
}
#endif
#ifdef ENOMEM
if (sym == @symbol(ENOMEM)) {
- RETURN ( __MKSMALLINT(ENOMEM) );
+ RETURN ( __MKSMALLINT(ENOMEM) );
}
#endif
#ifdef EACCES
if (sym == @symbol(EACCES)) {
- RETURN ( __MKSMALLINT(EACCES) );
+ RETURN ( __MKSMALLINT(EACCES) );
}
#endif
#ifdef EFAULT
if (sym == @symbol(EFAULT)) {
- RETURN ( __MKSMALLINT(EFAULT) );
+ RETURN ( __MKSMALLINT(EFAULT) );
}
#endif
#ifdef EBUSY
if (sym == @symbol(EBUSY)) {
- RETURN ( __MKSMALLINT(EBUSY) );
+ RETURN ( __MKSMALLINT(EBUSY) );
}
#endif
#ifdef EXDEV
if (sym == @symbol(EXDEV)) {
- RETURN ( __MKSMALLINT(EXDEV) );
+ RETURN ( __MKSMALLINT(EXDEV) );
}
#endif
#ifdef ENODEV
if (sym == @symbol(ENODEV)) {
- RETURN ( __MKSMALLINT(ENODEV) );
+ RETURN ( __MKSMALLINT(ENODEV) );
}
#endif
#ifdef ENOTDIR
if (sym == @symbol(ENOTDIR)) {
- RETURN ( __MKSMALLINT(ENOTDIR) );
+ RETURN ( __MKSMALLINT(ENOTDIR) );
}
#endif
#ifdef EISDIR
if (sym == @symbol(EISDIR)) {
- RETURN ( __MKSMALLINT(EISDIR) );
+ RETURN ( __MKSMALLINT(EISDIR) );
}
#endif
#ifdef EINVAL
if (sym == @symbol(EINVAL)) {
- RETURN ( __MKSMALLINT(EINVAL) );
+ RETURN ( __MKSMALLINT(EINVAL) );
}
#endif
#ifdef ENFILE
if (sym == @symbol(ENFILE)) {
- RETURN ( __MKSMALLINT(ENFILE) );
+ RETURN ( __MKSMALLINT(ENFILE) );
}
#endif
#ifdef EMFILE
if (sym == @symbol(EMFILE)) {
- RETURN ( __MKSMALLINT(EMFILE) );
+ RETURN ( __MKSMALLINT(EMFILE) );
}
#endif
#ifdef ENOTTY
if (sym == @symbol(ENOTTY)) {
- RETURN ( __MKSMALLINT(ENOTTY) );
+ RETURN ( __MKSMALLINT(ENOTTY) );
}
#endif
#ifdef EFBIG
if (sym == @symbol(EFBIG)) {
- RETURN ( __MKSMALLINT(EFBIG) );
+ RETURN ( __MKSMALLINT(EFBIG) );
}
#endif
#ifdef ENOSPC
if (sym == @symbol(ENOSPC)) {
- RETURN ( __MKSMALLINT(ENOSPC) );
+ RETURN ( __MKSMALLINT(ENOSPC) );
}
#endif
#ifdef ESPIPE
if (sym == @symbol(ESPIPE)) {
- RETURN ( __MKSMALLINT(ESPIPE) );
+ RETURN ( __MKSMALLINT(ESPIPE) );
}
#endif
#ifdef EROFS
if (sym == @symbol(EROFS)) {
- RETURN ( __MKSMALLINT(EROFS) );
+ RETURN ( __MKSMALLINT(EROFS) );
}
#endif
#ifdef EMLINK
if (sym == @symbol(EMLINK)) {
- RETURN ( __MKSMALLINT(EMLINK) );
+ RETURN ( __MKSMALLINT(EMLINK) );
}
#endif
#ifdef EPIPE
if (sym == @symbol(EPIPE)) {
- RETURN ( __MKSMALLINT(EPIPE) );
+ RETURN ( __MKSMALLINT(EPIPE) );
}
#endif
#ifdef EDOM
if (sym == @symbol(EDOM)) {
- RETURN ( __MKSMALLINT(EDOM) );
+ RETURN ( __MKSMALLINT(EDOM) );
}
#endif
#ifdef ERANGE
if (sym == @symbol(ERANGE)) {
- RETURN ( __MKSMALLINT(ERANGE) );
+ RETURN ( __MKSMALLINT(ERANGE) );
}
#endif
#ifdef EDEADLK
if (sym == @symbol(EDEADLK)) {
- RETURN ( __MKSMALLINT(EDEADLK) );
+ RETURN ( __MKSMALLINT(EDEADLK) );
}
#endif
#ifdef ENAMETOOLONG
if (sym == @symbol(ENAMETOOLONG)) {
- RETURN ( __MKSMALLINT(ENAMETOOLONG) );
+ RETURN ( __MKSMALLINT(ENAMETOOLONG) );
}
#endif
#ifdef ENOLCK
if (sym == @symbol(ENOLCK)) {
- RETURN ( __MKSMALLINT(ENOLCK) );
+ RETURN ( __MKSMALLINT(ENOLCK) );
}
#endif
#ifdef ENOSYS
if (sym == @symbol(ENOSYS)) {
- RETURN ( __MKSMALLINT(ENOSYS) );
+ RETURN ( __MKSMALLINT(ENOSYS) );
}
#endif
#ifdef ENOTEMPTY
if (sym == @symbol(ENOTEMPTY)) {
- RETURN ( __MKSMALLINT(ENOTEMPTY) );
+ RETURN ( __MKSMALLINT(ENOTEMPTY) );
}
#endif
#ifdef EEXIST
if (sym == @symbol(EEXIST)) {
- RETURN ( __MKSMALLINT(EEXIST) );
+ RETURN ( __MKSMALLINT(EEXIST) );
}
#endif
#ifdef EILSEQ
if (sym == @symbol(EILSEQ)) {
- RETURN ( __MKSMALLINT(EILSEQ) );
+ RETURN ( __MKSMALLINT(EILSEQ) );
}
#endif
@@ -2318,13 +2318,13 @@
*/
#ifdef ENOTBLK
if (sym == @symbol(ENOTBLK)) {
- RETURN ( __MKSMALLINT(ENOTBLK) );
+ RETURN ( __MKSMALLINT(ENOTBLK) );
}
#endif
#ifdef ETXTBSY
if (sym == @symbol(ETXTBSY)) {
- RETURN ( __MKSMALLINT(ETXTBSY) );
+ RETURN ( __MKSMALLINT(ETXTBSY) );
}
#endif
@@ -2333,19 +2333,19 @@
*/
#ifdef EWOULDBLOCK
if (sym == @symbol(EWOULDBLOCK)) {
- RETURN ( __MKSMALLINT(EWOULDBLOCK) );
+ RETURN ( __MKSMALLINT(EWOULDBLOCK) );
}
#endif
#ifdef ENOMSG
if (sym == @symbol(ENOMSG)) {
- RETURN ( __MKSMALLINT(ENOMSG) );
+ RETURN ( __MKSMALLINT(ENOMSG) );
}
#endif
#ifdef ELOOP
if (sym == @symbol(ELOOP)) {
- RETURN ( __MKSMALLINT(ELOOP) );
+ RETURN ( __MKSMALLINT(ELOOP) );
}
#endif
@@ -2354,31 +2354,31 @@
*/
#ifdef ETIME
if (sym == @symbol(ETIME)) {
- RETURN ( __MKSMALLINT(ETIME) );
+ RETURN ( __MKSMALLINT(ETIME) );
}
#endif
#ifdef ENOSR
if (sym == @symbol(ENOSR)) {
- RETURN ( __MKSMALLINT(ENOSR) );
+ RETURN ( __MKSMALLINT(ENOSR) );
}
#endif
#ifdef ENOSTR
if (sym == @symbol(ENOSTR)) {
- RETURN ( __MKSMALLINT(ENOSTR) );
+ RETURN ( __MKSMALLINT(ENOSTR) );
}
#endif
#ifdef ECOMM
if (sym == @symbol(ECOMM)) {
- RETURN ( __MKSMALLINT(ECOMM) );
+ RETURN ( __MKSMALLINT(ECOMM) );
}
#endif
#ifdef EPROTO
if (sym == @symbol(EPROTO)) {
- RETURN ( __MKSMALLINT(EPROTO) );
+ RETURN ( __MKSMALLINT(EPROTO) );
}
#endif
@@ -2387,13 +2387,13 @@
*/
#ifdef ESTALE
if (sym == @symbol(ESTALE)) {
- RETURN ( __MKSMALLINT(ESTALE) );
+ RETURN ( __MKSMALLINT(ESTALE) );
}
#endif
#ifdef EREMOTE
if (sym == @symbol(EREMOTE)) {
- RETURN ( __MKSMALLINT(EREMOTE) );
+ RETURN ( __MKSMALLINT(EREMOTE) );
}
#endif
@@ -2402,157 +2402,157 @@
*/
#ifdef EINPROGRESS
if (sym == @symbol(EINPROGRESS)) {
- RETURN ( __MKSMALLINT(EINPROGRESS) );
+ RETURN ( __MKSMALLINT(EINPROGRESS) );
}
#endif
#ifdef EALREADY
if (sym == @symbol(EALREADY)) {
- RETURN ( __MKSMALLINT(EALREADY) );
+ RETURN ( __MKSMALLINT(EALREADY) );
}
#endif
#ifdef ENOTSOCK
if (sym == @symbol(ENOTSOCK)) {
- RETURN ( __MKSMALLINT(ENOTSOCK) );
+ RETURN ( __MKSMALLINT(ENOTSOCK) );
}
#endif
#ifdef EDESTADDRREQ
if (sym == @symbol(EDESTADDRREQ)) {
- RETURN ( __MKSMALLINT(EDESTADDRREQ) );
+ RETURN ( __MKSMALLINT(EDESTADDRREQ) );
}
#endif
#ifdef EMSGSIZE
if (sym == @symbol(EMSGSIZE)) {
- RETURN ( __MKSMALLINT(EMSGSIZE) );
+ RETURN ( __MKSMALLINT(EMSGSIZE) );
}
#endif
#ifdef EPROTOTYPE
if (sym == @symbol(EPROTOTYPE)) {
- RETURN ( __MKSMALLINT(EPROTOTYPE) );
+ RETURN ( __MKSMALLINT(EPROTOTYPE) );
}
#endif
#ifdef ENOPROTOOPT
if (sym == @symbol(ENOPROTOOPT)) {
- RETURN ( __MKSMALLINT(ENOPROTOOPT) );
+ RETURN ( __MKSMALLINT(ENOPROTOOPT) );
}
#endif
#ifdef EPROTONOSUPPORT
if (sym == @symbol(EPROTONOSUPPORT)) {
- RETURN ( __MKSMALLINT(EPROTONOSUPPORT) );
+ RETURN ( __MKSMALLINT(EPROTONOSUPPORT) );
}
#endif
#ifdef ESOCKTNOSUPPORT
if (sym == @symbol(ESOCKTNOSUPPORT)) {
- RETURN ( __MKSMALLINT(ESOCKTNOSUPPORT) );
+ RETURN ( __MKSMALLINT(ESOCKTNOSUPPORT) );
}
#endif
#ifdef EOPNOTSUPP
if (sym == @symbol(EOPNOTSUPP)) {
- RETURN ( __MKSMALLINT(EOPNOTSUPP) );
+ RETURN ( __MKSMALLINT(EOPNOTSUPP) );
}
#endif
#ifdef EPFNOSUPPORT
if (sym == @symbol(EPFNOSUPPORT)) {
- RETURN ( __MKSMALLINT(EPFNOSUPPORT) );
+ RETURN ( __MKSMALLINT(EPFNOSUPPORT) );
}
#endif
#ifdef EAFNOSUPPORT
if (sym == @symbol(EAFNOSUPPORT)) {
- RETURN ( __MKSMALLINT(EAFNOSUPPORT) );
+ RETURN ( __MKSMALLINT(EAFNOSUPPORT) );
}
#endif
#ifdef EADDRINUSE
if (sym == @symbol(EADDRINUSE)) {
- RETURN ( __MKSMALLINT(EADDRINUSE) );
+ RETURN ( __MKSMALLINT(EADDRINUSE) );
}
#endif
#ifdef EADDRNOTAVAIL
if (sym == @symbol(EADDRNOTAVAIL)) {
- RETURN ( __MKSMALLINT(EADDRNOTAVAIL) );
+ RETURN ( __MKSMALLINT(EADDRNOTAVAIL) );
}
#endif
#ifdef ETIMEDOUT
if (sym == @symbol(ETIMEDOUT)) {
- RETURN ( __MKSMALLINT(ETIMEDOUT) );
+ RETURN ( __MKSMALLINT(ETIMEDOUT) );
}
#endif
#ifdef ECONNREFUSED
if (sym == @symbol(ECONNREFUSED)) {
- RETURN ( __MKSMALLINT(ECONNREFUSED) );
+ RETURN ( __MKSMALLINT(ECONNREFUSED) );
}
#endif
#ifdef ENETDOWN
if (sym == @symbol(ENETDOWN)) {
- RETURN ( __MKSMALLINT(ENETDOWN) );
+ RETURN ( __MKSMALLINT(ENETDOWN) );
}
#endif
#ifdef ENETUNREACH
if (sym == @symbol(ENETUNREACH)) {
- RETURN ( __MKSMALLINT(ENETUNREACH) );
+ RETURN ( __MKSMALLINT(ENETUNREACH) );
}
#endif
#ifdef ENETRESET
if (sym == @symbol(ENETRESET)) {
- RETURN ( __MKSMALLINT(ENETRESET) );
+ RETURN ( __MKSMALLINT(ENETRESET) );
}
#endif
#ifdef ECONNABORTED
if (sym == @symbol(ECONNABORTED)) {
- RETURN ( __MKSMALLINT(ECONNABORTED) );
+ RETURN ( __MKSMALLINT(ECONNABORTED) );
}
#endif
#ifdef ECONNRESET
if (sym == @symbol(ECONNRESET)) {
- RETURN ( __MKSMALLINT(ECONNRESET) );
+ RETURN ( __MKSMALLINT(ECONNRESET) );
}
#endif
#ifdef EISCONN
if (sym == @symbol(EISCONN)) {
- RETURN ( __MKSMALLINT(EISCONN) );
+ RETURN ( __MKSMALLINT(EISCONN) );
}
#endif
#ifdef ENOTCONN
if (sym == @symbol(ENOTCONN)) {
- RETURN ( __MKSMALLINT(ENOTCONN) );
+ RETURN ( __MKSMALLINT(ENOTCONN) );
}
#endif
#ifdef ESHUTDOWN
if (sym == @symbol(ESHUTDOWN)) {
- RETURN ( __MKSMALLINT(ESHUTDOWN) );
+ RETURN ( __MKSMALLINT(ESHUTDOWN) );
}
#endif
#ifdef EHOSTDOWN
if (sym == @symbol(EHOSTDOWN)) {
- RETURN ( __MKSMALLINT(EHOSTDOWN) );
+ RETURN ( __MKSMALLINT(EHOSTDOWN) );
}
#endif
#ifdef EHOSTUNREACH
if (sym == @symbol(EHOSTUNREACH)) {
- RETURN ( __MKSMALLINT(EHOSTUNREACH) );
+ RETURN ( __MKSMALLINT(EHOSTUNREACH) );
}
#endif
%}.
@@ -2610,49 +2610,49 @@
hasRedirection := false.
(aCommandString isNil or:[aCommandString includesAny:'<>|']) ifTrue:[
- hasRedirection := true
+ hasRedirection := true
].
self isMSWINDOWSNTlike ifTrue:[
- shell := self getEnvironment:'COMSPEC'.
- shell isNil ifTrue:[
- wDir := self getWindowsSystemDirectory asFilename.
- shell := (wDir construct:'cmd.exe').
- shell exists ifFalse:[
- shell := (wDir construct:'command.com').
- shell exists ifFalse:[
- self error:'no command.com available'.
- ]
- ].
- shell := shell pathName.
- ].
- aCommandString isNil ifTrue:[
- ^ Array with:nil with:shell
- ].
- ^ Array with:nil with:(shell , ' /c ' , aCommandString)
+ shell := self getEnvironment:'COMSPEC'.
+ shell isNil ifTrue:[
+ wDir := self getWindowsSystemDirectory asFilename.
+ shell := (wDir construct:'cmd.exe').
+ shell exists ifFalse:[
+ shell := (wDir construct:'command.com').
+ shell exists ifFalse:[
+ self error:'no command.com available'.
+ ]
+ ].
+ shell := shell pathName.
+ ].
+ aCommandString isNil ifTrue:[
+ ^ Array with:nil with:shell
+ ].
+ ^ Array with:nil with:(shell , ' /c ' , aCommandString)
].
"/ I/O redirection is not yet handled directly
"/ fallBack to command.com (below) to do it.
hasRedirection ifFalse:[
- words := aCommandString asCollectionOfSubstringsSeparatedBy:Character space.
- args := ' '.
- words from:2 to:(words size) do:[:s |
- args := args , (s , ' ').
- ].
-
- path := self pathOfCommand:(words at:1).
- path notNil ifTrue:[
- "/ execute the command directly -
- "/ without going through command.com
-
- self isMSWINDOWSNTlike ifTrue:[
- args := path , args.
- ].
-
- ^ Array with:path with:args
- ].
+ words := aCommandString asCollectionOfSubstringsSeparatedBy:Character space.
+ args := ' '.
+ words from:2 to:(words size) do:[:s |
+ args := args , (s , ' ').
+ ].
+
+ path := self pathOfCommand:(words at:1).
+ path notNil ifTrue:[
+ "/ execute the command directly -
+ "/ without going through command.com
+
+ self isMSWINDOWSNTlike ifTrue:[
+ args := path , args.
+ ].
+
+ ^ Array with:path with:args
+ ].
].
"/ windows-NT (where command.com works)
@@ -2660,18 +2660,18 @@
shell := self getEnvironment:'COMSPEC'.
shell isNil ifTrue:[
- wDir := self getWindowsSystemDirectory asFilename.
- shell := (wDir construct:'cmd.exe').
- shell exists ifFalse:[
- shell := (wDir construct:'command.com').
- shell exists ifFalse:[
- self error:'no command.com available'.
- ]
- ].
- shell := shell pathName.
+ wDir := self getWindowsSystemDirectory asFilename.
+ shell := (wDir construct:'cmd.exe').
+ shell exists ifFalse:[
+ shell := (wDir construct:'command.com').
+ shell exists ifFalse:[
+ self error:'no command.com available'.
+ ]
+ ].
+ shell := shell pathName.
].
aCommandString isNil ifTrue:[
- ^ Array with:shell with:shell
+ ^ Array with:shell with:shell
].
^ Array with:shell with:(shell , ' /c ' , aCommandString)
@@ -2683,56 +2683,56 @@
"Internal lowLevel entry for combined fork & exec for WIN32
If fork is false (chain a command):
- execute the OS command specified by the argument, aCommandPath, with
- arguments in argArray (no arguments, if nil).
- If successful, this method does not return and smalltalk is gone.
- If not successful, it does return.
- Normal use is with forkForCommand.
+ execute the OS command specified by the argument, aCommandPath, with
+ arguments in argArray (no arguments, if nil).
+ If successful, this method does not return and smalltalk is gone.
+ If not successful, it does return.
+ Normal use is with forkForCommand.
If fork is true (subprocess command execution):
- fork a child to do the above.
- The process id of the child process is returned; nil if the fork failed.
+ fork a child to do the above.
+ The process id of the child process is returned; nil if the fork failed.
fdArray contains the filedescriptors, to be used for the child (if fork is true).
- fdArray[1] = 15 -> use fd 15 as stdin.
- If an element of the array is set to nil, the corresponding filedescriptor
- will be closed for the child.
- fdArray[0] == StdIn for child
- fdArray[1] == StdOut for child
- fdArray[2] == StdErr for child
- on VMS, these must be channels as returned by createMailBox.
+ fdArray[1] = 15 -> use fd 15 as stdin.
+ If an element of the array is set to nil, the corresponding filedescriptor
+ will be closed for the child.
+ fdArray[0] == StdIn for child
+ fdArray[1] == StdOut for child
+ fdArray[2] == StdErr for child
+ on VMS, these must be channels as returned by createMailBox.
NOTE that in WIN32 the fds are HANDLES.
If newPgrp is true, the subprocess will be established in a new process group.
- The processgroup will be equal to id.
- newPgrp is not used on WIN32 and VMS systems."
+ The processgroup will be equal to id.
+ newPgrp is not used on WIN32 and VMS systems."
|dirPath cmdPath cmdLine|
aDirectory notNil ifTrue:[
- dirPath := aDirectory asFilename asAbsoluteFilename osNameForDirectory.
- (dirPath endsWith:':') ifTrue:[
- dirPath := dirPath , '\'.
- ].
+ dirPath := aDirectory asFilename asAbsoluteFilename osNameForDirectory.
+ (dirPath endsWith:':') ifTrue:[
+ dirPath := dirPath , '\'.
+ ].
].
self isMSWINDOWSNTlike ifTrue:[
- cmdPath := aCommandPath.
- cmdLine := argString
+ cmdPath := aCommandPath.
+ cmdLine := argString
] ifFalse:[
- cmdPath := 'stxspawn.exe'.
- cmdLine := 'stxspawn.exe ' , aCommandPath , ' ' , argString
+ cmdPath := 'stxspawn.exe'.
+ cmdLine := 'stxspawn.exe ' , aCommandPath , ' ' , argString
].
^ self
- primExec:cmdPath
- commandLine:cmdLine
- fileDescriptors:fdArray
- fork:doFork
- newPgrp:newPgrp
- inPath:dirPath
- createFlags:nil
+ primExec:cmdPath
+ commandLine:cmdLine
+ fileDescriptors:fdArray
+ fork:doFork
+ newPgrp:newPgrp
+ inPath:dirPath
+ createFlags:nil
"Modified: / 31.1.1998 / 10:54:24 / md"
"Modified: / 15.5.1999 / 18:07:51 / cg"
@@ -2747,28 +2747,28 @@
int status = -1;
if (__isExternalAddress(aProcessId)) {
- HANDLE handle = _HANDLEVal(aProcessId);
- if (handle) {
+ HANDLE handle = _HANDLEVal(aProcessId);
+ if (handle) {
#ifdef DO_WRAP_CALLS
- do {
- __threadErrno = 0;
- endStatus = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, handle, INFINITE);
- } while ((endStatus < 0) && (__threadErrno == EINTR));
+ do {
+ __threadErrno = 0;
+ endStatus = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, handle, INFINITE);
+ } while ((endStatus < 0) && (__threadErrno == EINTR));
#else
- endStatus = WaitForSingleObject(handle , INFINITE);
-#endif
- if (endStatus != WAIT_FAILED) {
- if (GetExitCodeProcess(handle,&endStatus)) {
- status = endStatus;
+ endStatus = WaitForSingleObject(handle , INFINITE);
+#endif
+ if (endStatus != WAIT_FAILED) {
+ if (GetExitCodeProcess(handle,&endStatus)) {
+ status = endStatus;
#ifdef PROCESSDEBUGWIN32
- fprintf(stderr, "getexitcode status = %d\n",status);
- } else {
- fprintf(stderr, "getexitcode failed.\n");
-#endif
- }
- }
- }
- RETURN ( __MKSMALLINT(status));
+ fprintf(stderr, "getexitcode status = %d\n",status);
+ } else {
+ fprintf(stderr, "getexitcode failed.\n");
+#endif
+ }
+ }
+ }
+ RETURN ( __MKSMALLINT(status));
}
%}.
self primitiveFailed
@@ -2782,31 +2782,31 @@
|path f fExt|
aCommand asFilename isAbsolute ifTrue:[
- aCommand asFilename exists ifTrue:[
- ^ aCommand
- ].
- ^ nil
+ aCommand asFilename exists ifTrue:[
+ ^ aCommand
+ ].
+ ^ nil
].
path := self getEnvironment:'PATH'.
path notNil ifTrue:[
- (path asCollectionOfSubstringsSeparatedBy:(self pathSeparator)) do:[:path |
- path isEmpty ifTrue:[
- f := aCommand asFilename
- ] ifFalse:[
- f := path asFilename construct:aCommand.
- ].
- self executableFileExtensions do:[:ext |
- ext notEmpty ifTrue:[
- fExt := (f pathName , '.' , ext) asFilename.
- ] ifFalse:[
- fExt := f.
- ].
- fExt isExecutable ifTrue:[
- ^ fExt pathName
- ].
- ].
- ].
+ (path asCollectionOfSubstringsSeparatedBy:(self pathSeparator)) do:[:path |
+ path isEmpty ifTrue:[
+ f := aCommand asFilename
+ ] ifFalse:[
+ f := path asFilename construct:aCommand.
+ ].
+ self executableFileExtensions do:[:ext |
+ ext notEmpty ifTrue:[
+ fExt := (f pathName , '.' , ext) asFilename.
+ ] ifFalse:[
+ fExt := f.
+ ].
+ fExt isExecutable ifTrue:[
+ ^ fExt pathName
+ ].
+ ].
+ ].
].
^ nil
@@ -3036,57 +3036,57 @@
aCommandString isNil ifTrue:[^ nil].
anExternalInStream notNil ifTrue:[
- in := anExternalInStream fileDescriptor.
+ in := anExternalInStream fileDescriptor.
] ifFalse:[
- self isMSWINDOWSNTlike ifTrue:[
- inStream := 'nul' asFilename readStream.
- inStream notNil ifTrue:[
- in := inStream fileDescriptor.
- ]
- ]
+ self isMSWINDOWSNTlike ifTrue:[
+ inStream := 'nul' asFilename readStream.
+ inStream notNil ifTrue:[
+ in := inStream fileDescriptor.
+ ]
+ ]
].
anExternalOutStream notNil ifTrue:[
- out := anExternalOutStream fileDescriptor.
+ out := anExternalOutStream fileDescriptor.
] ifFalse:[
- self isMSWINDOWSNTlike ifTrue:[
- outStream := 'nul' asFilename writeStream.
- outStream notNil ifTrue:[
- out := outStream fileDescriptor.
- ]
- ]
+ self isMSWINDOWSNTlike ifTrue:[
+ outStream := 'nul' asFilename writeStream.
+ outStream notNil ifTrue:[
+ out := outStream fileDescriptor.
+ ]
+ ]
].
anExternalErrStream notNil ifTrue:[
- err := anExternalErrStream fileDescriptor.
+ err := anExternalErrStream fileDescriptor.
] ifFalse:[
- self isMSWINDOWSNTlike ifTrue:[
- errStream := 'nul' asFilename writeStream.
- errStream notNil ifTrue:[
- err := errStream fileDescriptor.
- ]
- ]
+ self isMSWINDOWSNTlike ifTrue:[
+ errStream := 'nul' asFilename writeStream.
+ errStream notNil ifTrue:[
+ err := errStream fileDescriptor.
+ ]
+ ]
].
anExternalAuxStream notNil ifTrue:[
- self error:'Aux stream is not supported in Windows' mayProceed:true.
+ self error:'Aux stream is not supported in Windows' mayProceed:true.
].
shellAndArgs := self commandAndArgsForOSCommand:aCommandString.
ret := self
- exec:(shellAndArgs at:1)
- withArguments:(shellAndArgs at:2)
- environment:nil
- fileDescriptors:(Array with:in with:out with:err)
- fork:true
- newPgrp:false
- inDirectory:dirOrNil.
+ exec:(shellAndArgs at:1)
+ withArguments:(shellAndArgs at:2)
+ environment:nil
+ fileDescriptors:(Array with:in with:out with:err)
+ fork:true
+ newPgrp:false
+ inDirectory:dirOrNil.
inStream notNil ifTrue:[
- inStream close
+ inStream close
].
outStream notNil ifTrue:[
- outStream close
+ outStream close
].
errStream notNil ifTrue:[
- errStream close
+ errStream close
].
^ ret
@@ -3101,15 +3101,15 @@
%{
if (__isExternalAddress(anInteger) ) {
- if( !CloseHandle( anInteger ) ) {
- fprintf( stderr, "Could not close handle : %d\n", anInteger);
- }
- RETURN(self);
+ if( !CloseHandle( anInteger ) ) {
+ fprintf( stderr, "Could not close handle : %d\n", anInteger);
+ }
+ RETURN(self);
} else {
- if (__isSmallInteger(anInteger)) {
- close(__intVal(anInteger));
- RETURN(self);
- }
+ if (__isSmallInteger(anInteger)) {
+ close(__intVal(anInteger));
+ RETURN(self);
+ }
}
%}.
^ self primitiveFailed.
@@ -3127,20 +3127,20 @@
%{
if (__isString(aPathName)) {
- int ret;
- SECURITY_ATTRIBUTES sa;
-
- sa.nLength = sizeof( sa );
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = TRUE;
-
- ret = CreateDirectory(__stringVal(aPathName), &sa);
- if (ret != TRUE) {
- __threadErrno = __WIN32_ERR(GetLastError());
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ int ret;
+ SECURITY_ATTRIBUTES sa;
+
+ sa.nLength = sizeof( sa );
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ ret = CreateDirectory(__stringVal(aPathName), &sa);
+ if (ret != TRUE) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
self primitiveFailed
@@ -3166,10 +3166,10 @@
Return true if successful, false if not."
(oldPath isString not or:[newPath isString not]) ifTrue:[
- "/
- "/ bad argument(s) given
- "/
- ^ self primitiveFailed
+ "/
+ "/ bad argument(s) given
+ "/
+ ^ self primitiveFailed
].
"/
@@ -3201,14 +3201,14 @@
DWORD access, share, create, attr;
if (! __isString(pathName)) {
- fileHandle = nil;
- argumentError = @symbol(badPathName);
- goto badArgument;
+ fileHandle = nil;
+ argumentError = @symbol(badPathName);
+ goto badArgument;
}
if (! __isArray(attributeSpec)) {
- fileHandle = nil;
- argumentError = @symbol(badAttributeSpec);
- goto badArgument;
+ fileHandle = nil;
+ argumentError = @symbol(badAttributeSpec);
+ goto badArgument;
}
name = __stringVal(pathName);
@@ -3219,71 +3219,71 @@
attr = 0;
for (i=0; i<numAttrib;i++) {
- OBJ attrSym = ap[i];
-
- if (attrSym == @symbol(FILE_SHARE_READ)) {
- share |= FILE_SHARE_READ;
- } else if (attrSym == @symbol(FILE_SHARE_WRITE)) {
- share |= FILE_SHARE_WRITE;
-
- } else if (attrSym == @symbol(GENERIC_READ)) {
- access |= GENERIC_READ;
- } else if (attrSym == @symbol(GENERIC_WRITE)) {
- access |= GENERIC_WRITE;
-
- } else if (attrSym == @symbol(CREATE_NEW)) {
- create |= CREATE_NEW;
- } else if (attrSym == @symbol(CREATE_ALWAYS)) {
- create |= CREATE_ALWAYS;
- } else if (attrSym == @symbol(OPEN_EXISTING)) {
- create |= OPEN_EXISTING;
- } else if (attrSym == @symbol(OPEN_ALWAYS)) {
- create |= OPEN_ALWAYS;
- } else if (attrSym == @symbol(TRUNCATE_EXISTING)) {
- create |= TRUNCATE_EXISTING;
-
- } else if (attrSym == @symbol(FILE_ATTRIBUTE_HIDDEN)) {
- attr |= FILE_ATTRIBUTE_HIDDEN;
- } else if (attrSym == @symbol(FILE_ATTRIBUTE_READONLY)) {
- attr |= FILE_ATTRIBUTE_READONLY;
- } else if (attrSym == @symbol(FILE_ATTRIBUTE_READONLY)) {
- attr |= FILE_ATTRIBUTE_READONLY;
- } else if (attrSym == @symbol(FILE_FLAG_WRITE_THROUGH)) {
- attr |= FILE_FLAG_WRITE_THROUGH;
- } else if (attrSym == @symbol(FILE_FLAG_SEQUENTIAL_SCAN)) {
- attr |= FILE_FLAG_SEQUENTIAL_SCAN;
- } else if (attrSym == @symbol(FILE_FLAG_DELETE_ON_CLOSE)) {
- attr |= FILE_FLAG_DELETE_ON_CLOSE;
- } else {
- fprintf(stderr, "Win32OS [warning]: unsupported open mode\n");
- }
+ OBJ attrSym = ap[i];
+
+ if (attrSym == @symbol(FILE_SHARE_READ)) {
+ share |= FILE_SHARE_READ;
+ } else if (attrSym == @symbol(FILE_SHARE_WRITE)) {
+ share |= FILE_SHARE_WRITE;
+
+ } else if (attrSym == @symbol(GENERIC_READ)) {
+ access |= GENERIC_READ;
+ } else if (attrSym == @symbol(GENERIC_WRITE)) {
+ access |= GENERIC_WRITE;
+
+ } else if (attrSym == @symbol(CREATE_NEW)) {
+ create |= CREATE_NEW;
+ } else if (attrSym == @symbol(CREATE_ALWAYS)) {
+ create |= CREATE_ALWAYS;
+ } else if (attrSym == @symbol(OPEN_EXISTING)) {
+ create |= OPEN_EXISTING;
+ } else if (attrSym == @symbol(OPEN_ALWAYS)) {
+ create |= OPEN_ALWAYS;
+ } else if (attrSym == @symbol(TRUNCATE_EXISTING)) {
+ create |= TRUNCATE_EXISTING;
+
+ } else if (attrSym == @symbol(FILE_ATTRIBUTE_HIDDEN)) {
+ attr |= FILE_ATTRIBUTE_HIDDEN;
+ } else if (attrSym == @symbol(FILE_ATTRIBUTE_READONLY)) {
+ attr |= FILE_ATTRIBUTE_READONLY;
+ } else if (attrSym == @symbol(FILE_ATTRIBUTE_READONLY)) {
+ attr |= FILE_ATTRIBUTE_READONLY;
+ } else if (attrSym == @symbol(FILE_FLAG_WRITE_THROUGH)) {
+ attr |= FILE_FLAG_WRITE_THROUGH;
+ } else if (attrSym == @symbol(FILE_FLAG_SEQUENTIAL_SCAN)) {
+ attr |= FILE_FLAG_SEQUENTIAL_SCAN;
+ } else if (attrSym == @symbol(FILE_FLAG_DELETE_ON_CLOSE)) {
+ attr |= FILE_FLAG_DELETE_ON_CLOSE;
+ } else {
+ fprintf(stderr, "Win32OS [warning]: unsupported open mode\n");
+ }
}
if (create == 0) {
- fileHandle = nil;
- argumentError = @symbol(missingCreateMode);
- goto badArgument;
+ fileHandle = nil;
+ argumentError = @symbol(missingCreateMode);
+ goto badArgument;
}
fprintf(stderr, "name:<%s> access:%x share:%x create:%x attr:%x\n",
- name, access, share, create, attr);
+ name, access, share, create, attr);
h = CreateFile(name, access, share, 0 /* sa */, create, attr, 0 /* hTempl */);
if (h != INVALID_HANDLE_VALUE) {
- __externalAddressVal(fileHandle) = (void *)h;
+ __externalAddressVal(fileHandle) = (void *)h;
} else {
- fileHandle = nil;
- errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
+ fileHandle = nil;
+ errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
}
badArgument: ;
%}.
fileHandle notNil ifTrue:[
- fileHandle registerForFinalization.
- ^ fileHandle.
+ fileHandle registerForFinalization.
+ ^ fileHandle.
].
errorNumber isNil ifTrue:[
- self error:'invalid argument(s): ', argumentError.
+ self error:'invalid argument(s): ', argumentError.
] ifFalse:[
- (self errorHolderForNumber:errorNumber) reportError
+ (self errorHolderForNumber:errorNumber) reportError
].
self halt.
!
@@ -3328,24 +3328,24 @@
if (__isString(fullPathName)) {
#ifdef DO_WRAP_CALLS
- {
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(fullPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "RemoveDirectory", RemoveDirectory, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
- }
+ {
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(fullPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "RemoveDirectory", RemoveDirectory, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+ }
#else
- ret = RemoveDirectory((char *)__stringVal(fullPathName));
- __threadErrno = __WIN32_ERR(GetLastError());
-#endif
- if (ret != TRUE) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ ret = RemoveDirectory((char *)__stringVal(fullPathName));
+ __threadErrno = __WIN32_ERR(GetLastError());
+#endif
+ if (ret != TRUE) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
"/
@@ -3369,24 +3369,24 @@
if (__isString(fullPathName)) {
#ifdef DO_WRAP_CALLS
- {
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(fullPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "DeleteFile", DeleteFile, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
- }
+ {
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(fullPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "DeleteFile", DeleteFile, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+ }
#else
- ret = DeleteFile((char *)__stringVal(fullPathName));
- __threadErrno = __WIN32_ERR(GetLastError());
-#endif
- if (ret != TRUE) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ ret = DeleteFile((char *)__stringVal(fullPathName));
+ __threadErrno = __WIN32_ERR(GetLastError());
+#endif
+ if (ret != TRUE) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
^ self primitiveFailed
@@ -3405,32 +3405,32 @@
if (__isString(oldPath) && __isString(newPath)) {
#ifdef DO_WRAP_CALLS
- char _oldPath[MAXPATHLEN], _newPath[MAXPATHLEN];
-
- strncpy(_oldPath, __stringVal(oldPath), MAXPATHLEN-1); _oldPath[MAXPATHLEN-1] = '\0';
- strncpy(_newPath, __stringVal(newPath), MAXPATHLEN-1); _newPath[MAXPATHLEN-1] = '\0';
-
- do {
- __threadErrno = 0;
- ret = STX_C_CALL2( "rename", rename, _oldPath, _newPath);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _oldPath[MAXPATHLEN], _newPath[MAXPATHLEN];
+
+ strncpy(_oldPath, __stringVal(oldPath), MAXPATHLEN-1); _oldPath[MAXPATHLEN-1] = '\0';
+ strncpy(_newPath, __stringVal(newPath), MAXPATHLEN-1); _newPath[MAXPATHLEN-1] = '\0';
+
+ do {
+ __threadErrno = 0;
+ ret = STX_C_CALL2( "rename", rename, _oldPath, _newPath);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- __BEGIN_INTERRUPTABLE__
- do {
- __threadErrno = 0;
- ret = rename((char *) __stringVal(oldPath), (char *) __stringVal(newPath));
- } while ((ret < 0) && (__threadErrno == EINTR));
- __END_INTERRUPTABLE__
-
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ __BEGIN_INTERRUPTABLE__
+ do {
+ __threadErrno = 0;
+ ret = rename((char *) __stringVal(oldPath), (char *) __stringVal(newPath));
+ } while ((ret < 0) && (__threadErrno == EINTR));
+ __END_INTERRUPTABLE__
+
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
^ self primitiveFailed
@@ -3489,31 +3489,31 @@
# endif
if (aSymbol == @symbol(readUser)) {
- RETURN ( __MKSMALLINT(S_IRUSR) );
+ RETURN ( __MKSMALLINT(S_IRUSR) );
}
if (aSymbol == @symbol(writeUser)) {
- RETURN ( __MKSMALLINT(S_IWUSR) );
+ RETURN ( __MKSMALLINT(S_IWUSR) );
}
if (aSymbol == @symbol(executeUser)) {
- RETURN ( __MKSMALLINT(S_IXUSR) );
+ RETURN ( __MKSMALLINT(S_IXUSR) );
}
if (aSymbol == @symbol(readGroup)) {
- RETURN ( __MKSMALLINT(S_IRGRP) );
+ RETURN ( __MKSMALLINT(S_IRGRP) );
}
if (aSymbol == @symbol(writeGroup)) {
- RETURN ( __MKSMALLINT(S_IWGRP) );
+ RETURN ( __MKSMALLINT(S_IWGRP) );
}
if (aSymbol == @symbol(executeGroup)) {
- RETURN ( __MKSMALLINT(S_IXGRP) );
+ RETURN ( __MKSMALLINT(S_IXGRP) );
}
if (aSymbol == @symbol(readOthers)) {
- RETURN ( __MKSMALLINT(S_IROTH) );
+ RETURN ( __MKSMALLINT(S_IROTH) );
}
if (aSymbol == @symbol(writeOthers)) {
- RETURN ( __MKSMALLINT(S_IWOTH) );
+ RETURN ( __MKSMALLINT(S_IWOTH) );
}
if (aSymbol == @symbol(executeOthers)) {
- RETURN ( __MKSMALLINT(S_IXOTH) );
+ RETURN ( __MKSMALLINT(S_IXOTH) );
}
%}.
^ self primitiveFailed
@@ -3531,7 +3531,7 @@
"
this could have been implemented as:
- (self infoOf:aPathName) at:#mode
+ (self infoOf:aPathName) at:#mode
but for huge directory searches the code below is faster
"
@@ -3541,31 +3541,31 @@
if (__isString(aPathName)) {
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
-
- do {
- __threadErrno = 0;
- ret = STX_C_CALL2( "stat", stat, _aPathName, &buf);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+
+ do {
+ __threadErrno = 0;
+ ret = STX_C_CALL2( "stat", stat, _aPathName, &buf);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- __BEGIN_INTERRUPTABLE__
- do {
- __threadErrno = 0;
- ret = stat( (char *)__stringVal(aPathName), &buf);
- } while ((ret < 0) && (__threadErrno == EINTR));
- __END_INTERRUPTABLE__
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
-
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( nil );
- }
- RETURN ( __MKSMALLINT(buf.st_mode & 0777) );
+ __BEGIN_INTERRUPTABLE__
+ do {
+ __threadErrno = 0;
+ ret = stat( (char *)__stringVal(aPathName), &buf);
+ } while ((ret < 0) && (__threadErrno == EINTR));
+ __END_INTERRUPTABLE__
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( nil );
+ }
+ RETURN ( __MKSMALLINT(buf.st_mode & 0777) );
}
%}.
^ self primitiveFailed
@@ -3586,30 +3586,30 @@
if (__isString(aPathName) && __isSmallInteger(modeBits)) {
#ifdef DO_WRAP_CALLS
- int chmod();
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_C_CALL2( "chmod", chmod, _aPathName, __intVal(modeBits));
- } while ((ret < 0) && (__threadErrno == EINTR));
+ int chmod();
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_C_CALL2( "chmod", chmod, _aPathName, __intVal(modeBits));
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- __BEGIN_INTERRUPTABLE__
- do {
- __threadErrno = 0;
- ret = chmod((char *)__stringVal(aPathName), __intVal(modeBits));
- } while ((ret < 0) && (__threadErrno == EINTR));
- __END_INTERRUPTABLE__
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( false );
- }
- RETURN ( true );
+ __BEGIN_INTERRUPTABLE__
+ do {
+ __threadErrno = 0;
+ ret = chmod((char *)__stringVal(aPathName), __intVal(modeBits));
+ } while ((ret < 0) && (__threadErrno == EINTR));
+ __END_INTERRUPTABLE__
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( false );
+ }
+ RETURN ( true );
}
%}.
^ self primitiveFailed
@@ -3634,27 +3634,27 @@
|names n "{ Class: SmallInteger }" |
names := pathName
- asCollectionOfSubstringsSeparatedBy:self fileSeparator.
+ asCollectionOfSubstringsSeparatedBy:self fileSeparator.
names := names asOrderedCollection.
"
cut off initial double-slashes
"
[names startsWith:#('' '')] whileTrue:[
- names removeFirst.
+ names removeFirst.
].
"
cut off double-slashes at end
"
[names endsWith:#('')] whileTrue:[
- names removeLast.
+ names removeLast.
].
"
cut off current-dir at beginning
"
n := names size.
[(n >= 2) and:[names startsWith:#('.')]] whileTrue:[
- names removeFirst.
- n := n - 1.
+ names removeFirst.
+ n := n - 1.
].
"
@@ -3663,14 +3663,14 @@
[(n > 2)
and:[(names endsWith:#('..'))
and:[((names at:(n - 1)) startsWith:'.') not ]]] whileTrue:[
- names removeLast; removeLast.
- n := n - 2.
+ names removeLast; removeLast.
+ n := n - 2.
].
^ names asStringWith:self fileSeparator
- from:1
- to:n
- compressTabs:false final:nil
+ from:1
+ to:n
+ compressTabs:false final:nil
"
OperatingSystem compressPath:'.\..'
@@ -3695,8 +3695,8 @@
getDiskInfoOf:aVolumeName
"returns a dictionary filled with any of:
- freeBytes
- totalBytes
+ freeBytes
+ totalBytes
and possibly additional (OS-specific) information"
|info ok sectorsPerCluster bytesPerSector freeClusters totalClusters
@@ -3706,43 +3706,43 @@
DWORD __sectorsPerCluster, __bytesPerSector, __freeClusters, __totalClusters;
if (__isString(aVolumeName)) {
- if (GetDiskFreeSpace(__stringVal(aVolumeName),
- &__sectorsPerCluster,
- &__bytesPerSector,
- &__freeClusters,
- &__totalClusters) == TRUE) {
- sectorsPerCluster = __MKUINT(__sectorsPerCluster);
- bytesPerSector = __MKUINT(__bytesPerSector);
- freeClusters = __MKUINT(__freeClusters);
- totalClusters = __MKUINT(__totalClusters);
-
- switch (GetDriveType(__stringVal(aVolumeName))) {
- case DRIVE_REMOVABLE:
- type = @symbol(removable); break;
- case DRIVE_FIXED:
- type = @symbol(fixed); break;
- case DRIVE_REMOTE:
- type = @symbol(network); break;
- case DRIVE_CDROM:
- type = @symbol(cdrom); break;
- case DRIVE_RAMDISK:
- type = @symbol(ramdisk); break;
- }
- ok = true;
- }
+ if (GetDiskFreeSpace(__stringVal(aVolumeName),
+ &__sectorsPerCluster,
+ &__bytesPerSector,
+ &__freeClusters,
+ &__totalClusters) == TRUE) {
+ sectorsPerCluster = __MKUINT(__sectorsPerCluster);
+ bytesPerSector = __MKUINT(__bytesPerSector);
+ freeClusters = __MKUINT(__freeClusters);
+ totalClusters = __MKUINT(__totalClusters);
+
+ switch (GetDriveType(__stringVal(aVolumeName))) {
+ case DRIVE_REMOVABLE:
+ type = @symbol(removable); break;
+ case DRIVE_FIXED:
+ type = @symbol(fixed); break;
+ case DRIVE_REMOTE:
+ type = @symbol(network); break;
+ case DRIVE_CDROM:
+ type = @symbol(cdrom); break;
+ case DRIVE_RAMDISK:
+ type = @symbol(ramdisk); break;
+ }
+ ok = true;
+ }
}
%}.
ok == true ifTrue:[
- info := IdentityDictionary new.
- info at:#sectorsPerCluster put:sectorsPerCluster.
- info at:#bytesPerSector put:bytesPerSector.
- info at:#freeClusters put:freeClusters.
- info at:#totalClusters put:totalClusters.
- info at:#freeBytes put:(freeClusters * sectorsPerCluster * bytesPerSector).
- info at:#totalBytes put:(totalClusters * sectorsPerCluster * bytesPerSector).
- type notNil ifTrue:[
- info at:#type put:type
- ].
+ info := IdentityDictionary new.
+ info at:#sectorsPerCluster put:sectorsPerCluster.
+ info at:#bytesPerSector put:bytesPerSector.
+ info at:#freeClusters put:freeClusters.
+ info at:#totalClusters put:totalClusters.
+ info at:#freeBytes put:(freeClusters * sectorsPerCluster * bytesPerSector).
+ info at:#totalBytes put:(totalClusters * sectorsPerCluster * bytesPerSector).
+ type notNil ifTrue:[
+ info at:#type put:type
+ ].
].
^ info
@@ -3786,22 +3786,22 @@
This is a WIN32 specific entry, not for common usage."
%{
if (__isString(aPathName)) {
- int sz;
- DWORD dummy;
-
- sz = GetFileVersionInfoSize(__stringVal(aPathName), &dummy);
- if (sz > 0) {
- OBJ versionData;
-
- versionData = __BYTEARRAY_UNINITIALIZED_NEW_INT(sz);
- if (versionData == nil) {
- RETURN (nil);
- }
- if (GetFileVersionInfo(__stringVal(aPathName), 0, sz, __ByteArrayInstPtr(versionData)->ba_element) == FALSE) {
- RETURN (nil);
- }
- RETURN (versionData);
- }
+ int sz;
+ DWORD dummy;
+
+ sz = GetFileVersionInfoSize(__stringVal(aPathName), &dummy);
+ if (sz > 0) {
+ OBJ versionData;
+
+ versionData = __BYTEARRAY_UNINITIALIZED_NEW_INT(sz);
+ if (versionData == nil) {
+ RETURN (nil);
+ }
+ if (GetFileVersionInfo(__stringVal(aPathName), 0, sz, __ByteArrayInstPtr(versionData)->ba_element) == FALSE) {
+ RETURN (nil);
+ }
+ RETURN (versionData);
+ }
}
%}.
^ nil
@@ -3817,16 +3817,16 @@
"return some object filled with info for the file 'aPathName';
the info (for which corresponding access methods are understood by
the returned object) is:
- type - a symbol giving the files type
- mode - numeric access mode
- uid - owners user id
- gid - owners group id
- size - files size
- id - files number (i.e. inode number)
- accessed - last access time (as Timestamp)
- modified - last modification time (as Timestamp)
- statusChanged - last status change time (as Timestamp)
- alternativeName - (windows only:) the MSDOS name of the file
+ type - a symbol giving the files type
+ mode - numeric access mode
+ uid - owners user id
+ gid - owners group id
+ size - files size
+ id - files number (i.e. inode number)
+ accessed - last access time (as Timestamp)
+ modified - last modification time (as Timestamp)
+ statusChanged - last status change time (as Timestamp)
+ alternativeName - (windows only:) the MSDOS name of the file
Some of the fields may be returned as nil on systems which do not provide
all of the information.
@@ -3852,136 +3852,136 @@
unsigned INT ino;
if (__isString(aPathName)) {
- HANDLE hFile;
- SYSTEMTIME creationTime;
- SYSTEMTIME accessTime;
- SYSTEMTIME modificationTime;
- int modeBits = 0;
- WIN32_FIND_DATA findStruct;
+ HANDLE hFile;
+ SYSTEMTIME creationTime;
+ SYSTEMTIME accessTime;
+ SYSTEMTIME modificationTime;
+ int modeBits = 0;
+ WIN32_FIND_DATA findStruct;
#ifdef DO_WRAP_CALLS
- {
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- hFile = STX_API_CALL2( "FindFirstFile", FindFirstFile, _aPathName, &findStruct);
- } while ((hFile < 0) && (__threadErrno == EINTR));
- }
+ {
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ hFile = STX_API_CALL2( "FindFirstFile", FindFirstFile, _aPathName, &findStruct);
+ } while ((hFile < 0) && (__threadErrno == EINTR));
+ }
#else
- hFile = FindFirstFile(__stringVal(aPathName), &findStruct);
- if (hFile < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (! hFile || (hFile == (HANDLE)(-1)) || (hFile == INVALID_HANDLE_VALUE)) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- } else {
- FindClose(hFile);
-
- id = __MKSMALLINT(0); /* could get it by opening ... */
- size = __MKLARGEINT64(1, findStruct.nFileSizeLow, findStruct.nFileSizeHigh);
-
- if (findStruct.cFileName[0] != '\0') {
- bcopy(findStruct.cFileName, fileNameBuffer, MAX_PATH);
- fileNameBuffer[MAX_PATH] = '\0';
- fileName = __MKSTRING(fileNameBuffer); /* FULL name */
- }
-
- if (findStruct.cAlternateFileName[0] != '\0') {
- bcopy(findStruct.cAlternateFileName, alternativeFileNameBuffer, 14);
- alternativeFileNameBuffer[14] = '\0';
- alternativeName = __MKSTRING(alternativeFileNameBuffer); /* DOS name */
- }
-
- /*
- * simulate access bits
- */
- if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
- modeBits = 0444;
- } else {
- modeBits = 0666;
- }
-
- if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- type = @symbol(directory);
- modeBits |= 0111; /* executable */
- } else {
- type = @symbol(regular);
- }
-
- mode = __MKSMALLINT(modeBits);
-
- /*
- * sigh - convert from stupid time to useful time
- */
- FileTimeToSystemTime(&(findStruct.ftCreationTime), &creationTime);
- FileTimeToSystemTime(&(findStruct.ftLastAccessTime), &accessTime);
- FileTimeToSystemTime(&(findStruct.ftLastWriteTime), &modificationTime);
- aYr = __MKSMALLINT(accessTime.wYear);
- aMon = __MKSMALLINT(accessTime.wMonth);
- aDay = __MKSMALLINT(accessTime.wDay);
- aHr = __MKSMALLINT(accessTime.wHour);
- aMin = __MKSMALLINT(accessTime.wMinute);
- aSec = __MKSMALLINT(accessTime.wSecond);
- aMS = __MKSMALLINT(accessTime.wMilliseconds);
-
- mYr = __MKSMALLINT(modificationTime.wYear);
- mMon = __MKSMALLINT(modificationTime.wMonth);
- mDay = __MKSMALLINT(modificationTime.wDay);
- mHr = __MKSMALLINT(modificationTime.wHour);
- mMin = __MKSMALLINT(modificationTime.wMinute);
- mSec = __MKSMALLINT(modificationTime.wSecond);
- mMS = __MKSMALLINT(modificationTime.wMilliseconds);
-
- cYr = __MKSMALLINT(creationTime.wYear);
- cMon = __MKSMALLINT(creationTime.wMonth);
- cDay = __MKSMALLINT(creationTime.wDay);
- cHr = __MKSMALLINT(creationTime.wHour);
- cMin = __MKSMALLINT(creationTime.wMinute);
- cSec = __MKSMALLINT(creationTime.wSecond);
- cMS = __MKSMALLINT(creationTime.wMilliseconds);
- }
+ hFile = FindFirstFile(__stringVal(aPathName), &findStruct);
+ if (hFile < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (! hFile || (hFile == (HANDLE)(-1)) || (hFile == INVALID_HANDLE_VALUE)) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ } else {
+ FindClose(hFile);
+
+ id = __MKSMALLINT(0); /* could get it by opening ... */
+ size = __MKLARGEINT64(1, findStruct.nFileSizeLow, findStruct.nFileSizeHigh);
+
+ if (findStruct.cFileName[0] != '\0') {
+ bcopy(findStruct.cFileName, fileNameBuffer, MAX_PATH);
+ fileNameBuffer[MAX_PATH] = '\0';
+ fileName = __MKSTRING(fileNameBuffer); /* FULL name */
+ }
+
+ if (findStruct.cAlternateFileName[0] != '\0') {
+ bcopy(findStruct.cAlternateFileName, alternativeFileNameBuffer, 14);
+ alternativeFileNameBuffer[14] = '\0';
+ alternativeName = __MKSTRING(alternativeFileNameBuffer); /* DOS name */
+ }
+
+ /*
+ * simulate access bits
+ */
+ if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
+ modeBits = 0444;
+ } else {
+ modeBits = 0666;
+ }
+
+ if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ type = @symbol(directory);
+ modeBits |= 0111; /* executable */
+ } else {
+ type = @symbol(regular);
+ }
+
+ mode = __MKSMALLINT(modeBits);
+
+ /*
+ * sigh - convert from stupid time to useful time
+ */
+ FileTimeToSystemTime(&(findStruct.ftCreationTime), &creationTime);
+ FileTimeToSystemTime(&(findStruct.ftLastAccessTime), &accessTime);
+ FileTimeToSystemTime(&(findStruct.ftLastWriteTime), &modificationTime);
+ aYr = __MKSMALLINT(accessTime.wYear);
+ aMon = __MKSMALLINT(accessTime.wMonth);
+ aDay = __MKSMALLINT(accessTime.wDay);
+ aHr = __MKSMALLINT(accessTime.wHour);
+ aMin = __MKSMALLINT(accessTime.wMinute);
+ aSec = __MKSMALLINT(accessTime.wSecond);
+ aMS = __MKSMALLINT(accessTime.wMilliseconds);
+
+ mYr = __MKSMALLINT(modificationTime.wYear);
+ mMon = __MKSMALLINT(modificationTime.wMonth);
+ mDay = __MKSMALLINT(modificationTime.wDay);
+ mHr = __MKSMALLINT(modificationTime.wHour);
+ mMin = __MKSMALLINT(modificationTime.wMinute);
+ mSec = __MKSMALLINT(modificationTime.wSecond);
+ mMS = __MKSMALLINT(modificationTime.wMilliseconds);
+
+ cYr = __MKSMALLINT(creationTime.wYear);
+ cMon = __MKSMALLINT(creationTime.wMonth);
+ cDay = __MKSMALLINT(creationTime.wDay);
+ cHr = __MKSMALLINT(creationTime.wHour);
+ cMin = __MKSMALLINT(creationTime.wMinute);
+ cSec = __MKSMALLINT(creationTime.wSecond);
+ cMS = __MKSMALLINT(creationTime.wMilliseconds);
+ }
}
%}.
mode isNil ifTrue:[
- (self isDirectory:aPathName) ifTrue:[
- "/ the code above fails for root directories (these do not exist).
- "/ simulate
- mode := 8r777.
- type := #directory.
- uid := gid := 0.
- size := 0.
- id := 0.
- atime := mtime := ctime := AbsoluteTime now.
- ].
+ (self isDirectory:aPathName) ifTrue:[
+ "/ the code above fails for root directories (these do not exist).
+ "/ simulate
+ mode := 8r777.
+ type := #directory.
+ uid := gid := 0.
+ size := 0.
+ id := 0.
+ atime := mtime := ctime := AbsoluteTime now.
+ ].
].
mode notNil ifTrue:[
- atime isNil ifTrue:[
- atime := AbsoluteTime day:aDay month:aMon year:aYr hour:aHr minutes:aMin seconds:aSec milliseconds:aMS.
- ].
- mtime isNil ifTrue:[
- mtime := AbsoluteTime day:mDay month:mMon year:mYr hour:mHr minutes:mMin seconds:mSec milliseconds:mMS.
- ].
- ctime isNil ifTrue:[
- ctime := AbsoluteTime day:cDay month:cMon year:cYr hour:cHr minutes:cMin seconds:cSec milliseconds:cMS.
- ].
-
- info := FileStatusInfo
- type:type
- mode:mode
- uid:uid
- gid:gid
- size:size
- id:id
- accessed:atime
- modified:mtime
- created:ctime
- path:nil
- fullName:fileName
- alternativeName:alternativeName.
- ^ info
+ atime isNil ifTrue:[
+ atime := AbsoluteTime day:aDay month:aMon year:aYr hour:aHr minutes:aMin seconds:aSec milliseconds:aMS.
+ ].
+ mtime isNil ifTrue:[
+ mtime := AbsoluteTime day:mDay month:mMon year:mYr hour:mHr minutes:mMin seconds:mSec milliseconds:mMS.
+ ].
+ ctime isNil ifTrue:[
+ ctime := AbsoluteTime day:cDay month:cMon year:cYr hour:cHr minutes:cMin seconds:cSec milliseconds:cMS.
+ ].
+
+ info := FileStatusInfo
+ type:type
+ mode:mode
+ uid:uid
+ gid:gid
+ size:size
+ id:id
+ accessed:atime
+ modified:mtime
+ created:ctime
+ path:nil
+ fullName:fileName
+ alternativeName:alternativeName.
+ ^ info
].
^ nil
@@ -4003,33 +4003,33 @@
%{
if (__isString(aPathName)) {
- int ret;
+ int ret;
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( false );
- }
- RETURN ( (ret & FILE_ATTRIBUTE_DIRECTORY) ? true : false);
+ ret = GetFileAttributes((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( false );
+ }
+ RETURN ( (ret & FILE_ATTRIBUTE_DIRECTORY) ? true : false);
}
%}.
^ self primitiveFailed
"an alternative implementation would be:
- ^ (self infoOf:aPathName) type == #directory
+ ^ (self infoOf:aPathName) type == #directory
"
!
@@ -4039,31 +4039,31 @@
%{
if (__isString(aPathName)) {
- int ret;
-
- /*
- * under windows, there is no executable attribute ...
- * so, only check for the files existence here.
- */
+ int ret;
+
+ /*
+ * under windows, there is no executable attribute ...
+ * so, only check for the files existence here.
+ */
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ ret = GetFileAttributes((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
!
@@ -4074,31 +4074,31 @@
%{
if (__isString(aPathName)) {
- int ret;
-
- /*
- * under windows, all files are readable ...
- * so, only check for the files existence here.
- */
+ int ret;
+
+ /*
+ * under windows, all files are readable ...
+ * so, only check for the files existence here.
+ */
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN (false);
- }
- RETURN (true);
+ ret = GetFileAttributes((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN (false);
+ }
+ RETURN (true);
}
%}.
^ self primitiveFailed
@@ -4125,24 +4125,24 @@
if (__isString(aPathName) || __isSymbol(aPathName) ) {
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( false );
- }
- RETURN (true);
+ ret = GetFileAttributes((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( false );
+ }
+ RETURN (true);
}
%}.
^ self primitiveFailed
@@ -4157,24 +4157,24 @@
if (__isString(aPathName)) {
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
- } while ((ret < 0) && (__threadErrno == EINTR));
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ ret = STX_API_CALL1( "GetFileAttributes", GetFileAttributes, _aPathName);
+ } while ((ret < 0) && (__threadErrno == EINTR));
#else
- ret = GetFileAttributes((char *) __stringVal(aPathName));
- if (ret < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if (ret < 0) {
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( false );
- }
- RETURN ( (ret & FILE_ATTRIBUTE_READONLY) ? false : true);
+ ret = GetFileAttributes((char *) __stringVal(aPathName));
+ if (ret < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if (ret < 0) {
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( false );
+ }
+ RETURN ( (ret & FILE_ATTRIBUTE_READONLY) ? false : true);
}
%}.
^ self primitiveFailed
@@ -4199,8 +4199,8 @@
Returns nil if no mimeType for the given suffix is known."
^ RegistryEntry
- stringValueFor:'Content Type'
- atKey:('HKEY_CLASSES_ROOT\.' , aFileSuffix)
+ stringValueFor:'Content Type'
+ atKey:('HKEY_CLASSES_ROOT\.' , aFileSuffix)
"
self mimeTypeForSuffix:'au'
@@ -4232,20 +4232,20 @@
path := self primPathNameOf:pathName.
path isNil ifTrue:[
- (self isValidPath:pathName) ifFalse:[
- p := pathName.
- [(p size > 1)
- and:[p endsWith:(self fileSeparator)]
- ] whileTrue:[
- p := p copyWithoutLast:1.
- ].
- ^ p
- ].
-
- "/
- "/ return the original - there is nothing else can we do
- "/
- path := self compressPath:pathName
+ (self isValidPath:pathName) ifFalse:[
+ p := pathName.
+ [(p size > 1)
+ and:[p endsWith:(self fileSeparator)]
+ ] whileTrue:[
+ p := p copyWithoutLast:1.
+ ].
+ ^ p
+ ].
+
+ "/
+ "/ return the original - there is nothing else can we do
+ "/
+ path := self compressPath:pathName
].
^ path.
@@ -4281,34 +4281,34 @@
%{ /* xxSTACK: 16000 */
if (__isString(aPathName)) {
- char nameBuffer[MAXPATHLEN + 1 + MAXPATHLEN + 1];
- char *pFinal;
- int rslt;
+ char nameBuffer[MAXPATHLEN + 1 + MAXPATHLEN + 1];
+ char *pFinal;
+ int rslt;
#ifdef DO_WRAP_CALLS
- char _aPathName[MAXPATHLEN];
-
- strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
- do {
- __threadErrno = 0;
- rslt = STX_API_CALL4( "GetFullPathName", GetFullPathName, _aPathName, sizeof(nameBuffer), nameBuffer, &pFinal);
- } while ((rslt < 0) && (__threadErrno == EINTR));
- if (rslt > 0) {
- do {
- __threadErrno = 0;
- rslt = STX_API_CALL3( "GetLongPathName", GetLongPathName, nameBuffer, nameBuffer, sizeof(nameBuffer));
- } while ((rslt < 0) && (__threadErrno == EINTR));
- }
+ char _aPathName[MAXPATHLEN];
+
+ strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0';
+ do {
+ __threadErrno = 0;
+ rslt = STX_API_CALL4( "GetFullPathName", GetFullPathName, _aPathName, sizeof(nameBuffer), nameBuffer, &pFinal);
+ } while ((rslt < 0) && (__threadErrno == EINTR));
+ if (rslt > 0) {
+ do {
+ __threadErrno = 0;
+ rslt = STX_API_CALL3( "GetLongPathName", GetLongPathName, nameBuffer, nameBuffer, sizeof(nameBuffer));
+ } while ((rslt < 0) && (__threadErrno == EINTR));
+ }
#else
- rslt = GetFullPathName(__stringVal(aPathName), sizeof(nameBuffer), nameBuffer, &pFinal);
- if (rslt > 0) {
- rslt = GetLongPathName(nameBuffer, nameBuffer, sizeof(nameBuffer));
- }
-#endif
- if (rslt > 0) {
- RETURN ( __MKSTRING(nameBuffer) );
- }
- __threadErrno = __WIN32_ERR(GetLastError());
+ rslt = GetFullPathName(__stringVal(aPathName), sizeof(nameBuffer), nameBuffer, &pFinal);
+ if (rslt > 0) {
+ rslt = GetLongPathName(nameBuffer, nameBuffer, sizeof(nameBuffer));
+ }
+#endif
+ if (rslt > 0) {
+ RETURN ( __MKSTRING(nameBuffer) );
+ }
+ __threadErrno = __WIN32_ERR(GetLastError());
}
%}.
^ nil
@@ -4322,7 +4322,7 @@
For nonexistent files, nil is returned."
"could be implemented as:
- (self infoOf:aPathName) accessed
+ (self infoOf:aPathName) accessed
"
| i|
@@ -4340,7 +4340,7 @@
For nonexistent files, nil is returned."
"could be implemented as:
- (self infoOf:aPathName) modified
+ (self infoOf:aPathName) modified
"
| i|
@@ -4363,7 +4363,7 @@
"
this could have been implemented as:
- (self infoOf:aPathName) type
+ (self infoOf:aPathName) type
"
i := self infoOf:aPathName.
@@ -4386,7 +4386,7 @@
aPathString size < 2 ifTrue:[^ ''].
(aPathString at:2) == $: ifTrue:[
- ^ (aPathString at:1) asString.
+ ^ (aPathString at:1) asString.
].
^ ''
! !
@@ -4399,8 +4399,8 @@
%{
while(1) {
- printf("b");
- Sleep(50);
+ printf("b");
+ Sleep(50);
}
%}.
"
@@ -4422,8 +4422,8 @@
if (__isSmallInteger(signalNumber)) {
#ifdef SIG_DFL
- signal(__intVal(signalNumber), SIG_DFL);
- RETURN (self);
+ signal(__intVal(signalNumber), SIG_DFL);
+ RETURN (self);
#endif
}
%}.
@@ -4466,14 +4466,14 @@
%{ /* NOCONTEXT */
if (__isSmallInteger(signalNumber)) {
- int sigNo = __intVal(signalNumber);
-
- if (sigNo == 0) {
- RETURN (self);
- }
+ int sigNo = __intVal(signalNumber);
+
+ if (sigNo == 0) {
+ RETURN (self);
+ }
#ifdef SIG_IGN
- signal(sigNo, SIG_IGN);
- RETURN (self);
+ signal(sigNo, SIG_IGN);
+ RETURN (self);
#endif
}
%}.
@@ -4494,8 +4494,8 @@
disableTimer
"disable timer interrupts.
WARNING:
- the system will not operate correctly with timer interrupts
- disabled, because no scheduling or timeouts are possible."
+ the system will not operate correctly with timer interrupts
+ disabled, because no scheduling or timeouts are possible."
%{ /* NOCONTEXT */
@@ -4631,121 +4631,121 @@
&& (sigNr <= SIG_LIMIT)
#endif
) {
- /*
- * standard signals are forced into standard handlers
- * - all others go into general signalInterrupt
- */
+ /*
+ * standard signals are forced into standard handlers
+ * - all others go into general signalInterrupt
+ */
#if defined(SIGPOLL) && defined(SIGIO)
- if (sigNr == SIGPOLL)
- sigNr = SIGIO;
-#endif
- switch (sigNr) {
- case 0:
- /* enabling a non-supported signal */
- RETURN (self);
+ if (sigNr == SIGPOLL)
+ sigNr = SIGIO;
+#endif
+ switch (sigNr) {
+ case 0:
+ /* enabling a non-supported signal */
+ RETURN (self);
#ifdef SIGBREAK
- case SIGBREAK:
+ case SIGBREAK:
#endif
#ifdef SIGINT
- case SIGINT:
+ case SIGINT:
#endif
#ifdef SIGQUIT
- case SIGQUIT:
+ case SIGQUIT:
#endif
#ifdef SIGNALDEBUGWIN32
- printf("ConsoleSignal %d\n",sigNr);
-#endif
- SetConsoleCtrlHandler((PHANDLER_ROUTINE)__signalUserInterruptWIN32,TRUE);
- RETURN (self);
+ printf("ConsoleSignal %d\n",sigNr);
+#endif
+ SetConsoleCtrlHandler((PHANDLER_ROUTINE)__signalUserInterruptWIN32,TRUE);
+ RETURN (self);
#ifdef SIGFPE
- case SIGFPE:
- handler = __signalFpExceptionInterrupt;
- break;
+ case SIGFPE:
+ handler = __signalFpExceptionInterrupt;
+ break;
#endif
#ifdef SIGPIPE
- case SIGPIPE:
- handler = __signalPIPEInterrupt;
- break;
+ case SIGPIPE:
+ handler = __signalPIPEInterrupt;
+ break;
#endif
#ifdef SIGBUS
- case SIGBUS:
- handler = __signalBUSInterrupt;
- break;
+ case SIGBUS:
+ handler = __signalBUSInterrupt;
+ break;
#endif
#ifdef SIGSEGV
- case SIGSEGV:
- handler = __signalSEGVInterrupt;
- break;
+ case SIGSEGV:
+ handler = __signalSEGVInterrupt;
+ break;
#endif
#ifdef SIGILL
- case SIGILL:
- handler = __signalTrapInterrupt;
- break;
+ case SIGILL:
+ handler = __signalTrapInterrupt;
+ break;
#endif
#ifdef SIGEMT
- case SIGEMT:
- handler = __signalTrapInterrupt;
- break;
+ case SIGEMT:
+ handler = __signalTrapInterrupt;
+ break;
#endif
#ifdef SIGIO
- case SIGIO:
- handler = __signalIoInterrupt;
- break;
+ case SIGIO:
+ handler = __signalIoInterrupt;
+ break;
#endif
#ifdef CHILD_SIGNAL
- case CHILD_SIGNAL:
- handler = __signalChildInterrupt;
- break;
-#endif
-
- default:
- handler = __signalInterrupt;
- break;
- }
-
- {
+ case CHILD_SIGNAL:
+ handler = __signalChildInterrupt;
+ break;
+#endif
+
+ default:
+ handler = __signalInterrupt;
+ break;
+ }
+
+ {
#ifdef HAS_SIGACTION
- struct sigaction act;
-
- /*
- * Do not add SA_RESTART here. A signal can cause a
- * thread switch, another thread can do a garbage collect
- * and restarted system calls may write into old
- * (collected) addresses.
- */
-
- act.sa_flags = SA_SIGINFO; /* <- if you add more, remember dummys at the top */
- sigemptyset(&act.sa_mask);
- act.sa_handler = handler;
- sigaction(sigNr, &act, 0);
+ struct sigaction act;
+
+ /*
+ * Do not add SA_RESTART here. A signal can cause a
+ * thread switch, another thread can do a garbage collect
+ * and restarted system calls may write into old
+ * (collected) addresses.
+ */
+
+ act.sa_flags = SA_SIGINFO; /* <- if you add more, remember dummys at the top */
+ sigemptyset(&act.sa_mask);
+ act.sa_handler = handler;
+ sigaction(sigNr, &act, 0);
#else
# ifdef HAS_SIGVEC
- struct sigvec vec;
-
- vec.sv_flags = SV_INTERRUPT;
- sigemptyset(&vec.sv_mask);
- vec.sv_handler = handler;
- sigvec(sigNr, &vec, NULL);
+ struct sigvec vec;
+
+ vec.sv_flags = SV_INTERRUPT;
+ sigemptyset(&vec.sv_mask);
+ vec.sv_handler = handler;
+ sigvec(sigNr, &vec, NULL);
# else
# ifdef WIN32
# ifdef SIGNALDEBUGWIN32
- printf("signal %d can't change handler\n",sigNr);
+ printf("signal %d can't change handler\n",sigNr);
# endif
# else
- (void) signal(sigNr, handler);
+ (void) signal(sigNr, handler);
# endif
# endif
#endif
- }
-
- /*
- * maybe, we should Return the old enable-status
- * as boolean here ...
- */
- RETURN (self);
+ }
+
+ /*
+ * maybe, we should Return the old enable-status
+ * as boolean here ...
+ */
+ RETURN (self);
}
%}.
@@ -4763,10 +4763,10 @@
extern void __win32SetTimer();
if (__isSmallInteger(milliSeconds)) {
- int millis;
- millis = __intVal(milliSeconds);
- __win32SetTimer(millis);
- RETURN (true);
+ int millis;
+ millis = __intVal(milliSeconds);
+ __win32SetTimer(millis);
+ RETURN (true);
}
%}.
^ false
@@ -4786,8 +4786,8 @@
The process terminates immediately and has no chance to perform any cleanup actions.
WARNING: in order to avoid zombie processes (on unix),
- you have to fetch the processes exitstatus with
- OperatingSystem>>getStatusOfProcess:aProcessId."
+ you have to fetch the processes exitstatus with
+ OperatingSystem>>getStatusOfProcess:aProcessId."
self terminateProcess:processId
!
@@ -4799,9 +4799,9 @@
Do not confuse UNIX signals with Smalltalk-Signals.
WARNING: in order to avoid zombie processes (on unix),
- you may have to fetch the processes exitstatus with
- OperatingSystem>>getStatusOfProcess:aProcessId
- if the signal terminates that process."
+ you may have to fetch the processes exitstatus with
+ OperatingSystem>>getStatusOfProcess:aProcessId
+ if the signal terminates that process."
"/
"/ either invalid argument (non-integers)
@@ -4814,15 +4814,15 @@
"terminate a process.
The process has a chance to do some cleanup.
WIN32:
- Under unix, we have terminateProcess, which does a soft
- terminate (giving the process a chance to cleanup) and
- killProcess, which does a hard terminate.
- Under WIN32, both (currently) use the TerminateProcess
- function, which unconditionally causes a process to exit.
- I.e. under WIN32, the process has no chance to perform cleanup.
- Use it only in extreme circumstances. The state of
- global data maintained by dynamic-link libraries (DLLs)
- may be compromised if TerminateProcess is used.
+ Under unix, we have terminateProcess, which does a soft
+ terminate (giving the process a chance to cleanup) and
+ killProcess, which does a hard terminate.
+ Under WIN32, both (currently) use the TerminateProcess
+ function, which unconditionally causes a process to exit.
+ I.e. under WIN32, the process has no chance to perform cleanup.
+ Use it only in extreme circumstances. The state of
+ global data maintained by dynamic-link libraries (DLLs)
+ may be compromised if TerminateProcess is used.
TODO: send it a WM_QUIT instead, to allow for proper shutdown."
self terminateProcess:processId exitCode:0
@@ -4832,33 +4832,33 @@
"terminate a process.
The process has a chance to do some cleanup.
WIN32:
- Under unix, we have terminateProcess, which does a soft
- terminate (giving the process a chance to cleanup) and
- killProcess, which does a hard terminate.
- Under WIN32, both (currently) use the TerminateProcess
- function, which unconditionally causes a process to exit.
- I.e. under WIN32, the process has no chance to perform cleanup.
- Use it only in extreme circumstances. The state of
- global data maintained by dynamic-link libraries (DLLs)
- may be compromised if TerminateProcess is used.
+ Under unix, we have terminateProcess, which does a soft
+ terminate (giving the process a chance to cleanup) and
+ killProcess, which does a hard terminate.
+ Under WIN32, both (currently) use the TerminateProcess
+ function, which unconditionally causes a process to exit.
+ I.e. under WIN32, the process has no chance to perform cleanup.
+ Use it only in extreme circumstances. The state of
+ global data maintained by dynamic-link libraries (DLLs)
+ may be compromised if TerminateProcess is used.
TODO: send it a WM_QUIT instead, to allow for proper shutdown."
%{
if (__isExternalAddress(processId) ) {
- HANDLE __pid = _HANDLEVal(processId);
+ HANDLE __pid = _HANDLEVal(processId);
#ifdef PROCESS1DEBUGWIN32
- printf("Terminate ProcessHandle %x\n", __pid);
-#endif
- if (__pid != 0) {
- TerminateProcess(__pid, __intVal(exitCode));
- CloseHandle(__pid);
- _HANDLEVal(processId) = 0;
- }
+ printf("Terminate ProcessHandle %x\n", __pid);
+#endif
+ if (__pid != 0) {
+ TerminateProcess(__pid, __intVal(exitCode));
+ CloseHandle(__pid);
+ _HANDLEVal(processId) = 0;
+ }
}
#ifdef PROCESS1DEBUGWIN32
else {
- printf("Terminate wrong ProcessHandle\n");
+ printf("Terminate wrong ProcessHandle\n");
}
#endif
%}
@@ -4871,26 +4871,26 @@
"terminate a process group.
The processes have a chance to do some cleanup.
WIN32:
- The TerminateProcess function is used to unconditionally cause
- a process to exit.
- Use it only in extreme circumstances. The state of
- global data maintained by dynamic-link libraries (DLLs)
- may be compromised if TerminateProcess is used.
+ The TerminateProcess function is used to unconditionally cause
+ a process to exit.
+ Use it only in extreme circumstances. The state of
+ global data maintained by dynamic-link libraries (DLLs)
+ may be compromised if TerminateProcess is used.
Not implemented - TODO: enumerate all sub-processes and terminate them all ..."
%{
if (__isExternalAddress(processGroupId) ) {
- HANDLE __pgid = _HANDLEVal(processGroupId);
+ HANDLE __pgid = _HANDLEVal(processGroupId);
#ifdef PROCESS1DEBUGWIN32
- printf("primTerminateProcessGroup ProcessHandle %x not yet implemented.\n", __pgid);
-#endif
- if (__pgid != 0) {
- }
+ printf("primTerminateProcessGroup ProcessHandle %x not yet implemented.\n", __pgid);
+#endif
+ if (__pgid != 0) {
+ }
}
#ifdef PROCESS1DEBUGWIN32
else {
- printf("primTerminateProcessGroup wrong ProcessGroupHandle\n");
+ printf("primTerminateProcessGroup wrong ProcessGroupHandle\n");
}
#endif
%}
@@ -4917,8 +4917,8 @@
process.bInheritHandle = TRUE;
if( ! CreatePipe( &pipeRead, &pipeWrite, &process, 0 ) ) {
- @global(LastErrorNumber) = __MKSMALLINT( __WIN32_ERR(GetLastError()) );
- RETURN ( nil );
+ @global(LastErrorNumber) = __MKSMALLINT( __WIN32_ERR(GetLastError()) );
+ RETURN ( nil );
}
#ifdef USE_HANDLES
@@ -4937,7 +4937,7 @@
#endif
%}.
fd1 notNil ifTrue:[
- ^ Array with:fd1 with:fd2.
+ ^ Array with:fd1 with:fd2.
].
^ nil
! !
@@ -4948,13 +4948,13 @@
"free pid resource"
%{
if (__isExternalAddress(pid) ) {
- if (_HANDLEVal(pid) != 0) {
+ if (_HANDLEVal(pid) != 0) {
#ifdef PROCESSDEBUGWIN32
- printf("Close ProcessHandle %x\n",_HANDLEVal(pid));
-#endif
- CloseHandle(_HANDLEVal(pid));
- _HANDLEVal(pid) = 0;
- }
+ printf("Close ProcessHandle %x\n",_HANDLEVal(pid));
+#endif
+ CloseHandle(_HANDLEVal(pid));
+ _HANDLEVal(pid) = 0;
+ }
}
%}.
^ true.
@@ -4977,66 +4977,66 @@
getDomainName
"return the domain this host is in.
Notice:
- not all systems support this; on some, 'unknown' is returned."
+ not all systems support this; on some, 'unknown' is returned."
|name idx hostName k|
DomainName notNil ifTrue:[
- ^ DomainName
+ ^ DomainName
].
name := self getEnvironment:'DOMAIN'.
name isNil ifTrue:[
- name := self getEnvironment:'DOMAINNAME'.
+ name := self getEnvironment:'DOMAINNAME'.
].
name isNil ifTrue:[
- "/ sometimes, we can extract the domainName from the hostName ...
- hostName := self getHostName.
- hostName notNil ifTrue:[
- idx := hostName indexOf:$..
- idx ~~ 0 ifTrue:[
- name := hostName copyFrom:idx+1.
- ]
- ].
- name isNil ifTrue:[
- "/ ok, search the registry ...
-
- "/ under NT, it is found there ...
- k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System'.
- k notNil ifTrue:[
- k subKeysDo:[:subKey |
- subKey subKeysDo:[:subSubKey |
- |tcp params|
-
- (subSubKey path asLowercase endsWith:'services') ifTrue:[
- tcp := subSubKey subKeyNamed:'tcpip'.
- tcp notNil ifTrue:[
- params := tcp subKeyNamed:'parameters'.
- params notNil ifTrue:[
- name := params valueNamed:'Domain'.
- params close.
- ].
- tcp close.
- ]
- ]
- ]
- ]
- ].
- ].
- name isNil ifTrue:[
- "/ under Win95/Win98, it is found there ...
- k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP'.
- k notNil ifTrue:[
- name := k valueNamed:'Domain'.
- k close.
- ]
- ].
-
- name isNil ifTrue:[
- 'Win32OperatingSystem [warning]: cannot find out domainname' errorPrintCR.
- name := 'unknown'.
- ]
+ "/ sometimes, we can extract the domainName from the hostName ...
+ hostName := self getHostName.
+ hostName notNil ifTrue:[
+ idx := hostName indexOf:$..
+ idx ~~ 0 ifTrue:[
+ name := hostName copyFrom:idx+1.
+ ]
+ ].
+ name isNil ifTrue:[
+ "/ ok, search the registry ...
+
+ "/ under NT, it is found there ...
+ k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System'.
+ k notNil ifTrue:[
+ k subKeysDo:[:subKey |
+ subKey subKeysDo:[:subSubKey |
+ |tcp params|
+
+ (subSubKey path asLowercase endsWith:'services') ifTrue:[
+ tcp := subSubKey subKeyNamed:'tcpip'.
+ tcp notNil ifTrue:[
+ params := tcp subKeyNamed:'parameters'.
+ params notNil ifTrue:[
+ name := params valueNamed:'Domain'.
+ params close.
+ ].
+ tcp close.
+ ]
+ ]
+ ]
+ ]
+ ].
+ ].
+ name isNil ifTrue:[
+ "/ under Win95/Win98, it is found there ...
+ k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP'.
+ k notNil ifTrue:[
+ name := k valueNamed:'Domain'.
+ k close.
+ ]
+ ].
+
+ name isNil ifTrue:[
+ 'Win32OperatingSystem [warning]: cannot find out domainname' errorPrintCR.
+ name := 'unknown'.
+ ]
].
DomainName := name.
^ name
@@ -5057,17 +5057,17 @@
char *env;
if (__isString(aStringOrSymbol) || __isSymbol(aStringOrSymbol)) {
- char buff[512];
-
- env = NULL;
- if (GetEnvironmentVariable(__stringVal(aStringOrSymbol),
- buff,
- sizeof(buff)-1)) {
- env = buff;
- }
- if (env) {
- RETURN ( __MKSTRING(env) );
- }
+ char buff[512];
+
+ env = NULL;
+ if (GetEnvironmentVariable(__stringVal(aStringOrSymbol),
+ buff,
+ sizeof(buff)-1)) {
+ env = buff;
+ }
+ if (env) {
+ RETURN ( __MKSTRING(env) );
+ }
}
%}
.
@@ -5087,12 +5087,12 @@
"return the hostname we are running on - if there is
a HOST environment variable, we are much faster here ...
Notice:
- not all systems support this; on some, 'unknown' is returned."
+ not all systems support this; on some, 'unknown' is returned."
|name idx|
HostName notNil ifTrue:[
- ^ HostName
+ ^ HostName
].
%{ /* STACK: 2048 */
@@ -5100,34 +5100,34 @@
char buffer[256];
if (gethostname(buffer, sizeof(buffer)) == 0) {
- name = __MKSTRING(buffer);
+ name = __MKSTRING(buffer);
}
#else
char buffer[128];
int buffSize = sizeof(buffer);
if (GetComputerName(buffer, &buffSize) == TRUE) {
- name = __MKSTRING(buffer);
+ name = __MKSTRING(buffer);
}
#endif
%}.
name isNil ifTrue:[
- name := self getEnvironment:'HOST'.
- name isNil ifTrue:[
- name := self getEnvironment:'HOSTNAME'.
- ]
+ name := self getEnvironment:'HOST'.
+ name isNil ifTrue:[
+ name := self getEnvironment:'HOSTNAME'.
+ ]
].
name isNil ifTrue:[
- 'Win32OperatingSystem [warning]: cannot find out hostname' errorPrintCR.
- name := 'unknown'.
+ 'Win32OperatingSystem [warning]: cannot find out hostname' errorPrintCR.
+ name := 'unknown'.
] ifFalse:[
- "/ on some systems, the hostname already contains the domain.
- "/ decompose it here.
- idx := name indexOf:$..
- idx ~~ 0 ifTrue:[
- DomainName := name copyFrom:(idx+1).
- name := name copyTo:(idx-1).
- ]
+ "/ on some systems, the hostname already contains the domain.
+ "/ decompose it here.
+ idx := name indexOf:$..
+ idx ~~ 0 ifTrue:[
+ DomainName := name copyFrom:(idx+1).
+ name := name copyTo:(idx-1).
+ ]
].
HostName := name.
^ name
@@ -5141,42 +5141,42 @@
"return a dictionary filled with values from the locale information;
Not all fields may be present, depending on the OS's setup and capabilities.
Possible fields are:
- decimalPoint <String>
-
- thousandsSep <String>
-
- internationalCurrencySymbol <String>
-
- currencySymbol <String>
-
- monetaryDecimalPoint <String>
-
- monetaryThousandsSeparator <String>
-
- positiveSign <String>
-
- negativeSign <String>
-
- internationalFractionalDigits <Integer>
-
- fractionalDigits <Integer>
-
- positiveSignPrecedesCurrencySymbol <Boolean>
-
- negativeSignPrecedesCurrencySymbol <Boolean>
-
- positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean>
-
- negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean>
-
- positiveSignPosition <Symbol>
- one of: #parenthesesAround,
- #signPrecedes,
- #signSuceeds,
- #signPrecedesCurrencySymbol,
- #signSuceedsCurrencySymbol
-
- negativeSignPosition <like above>
+ decimalPoint <String>
+
+ thousandsSep <String>
+
+ internationalCurrencySymbol <String>
+
+ currencySymbol <String>
+
+ monetaryDecimalPoint <String>
+
+ monetaryThousandsSeparator <String>
+
+ positiveSign <String>
+
+ negativeSign <String>
+
+ internationalFractionalDigits <Integer>
+
+ fractionalDigits <Integer>
+
+ positiveSignPrecedesCurrencySymbol <Boolean>
+
+ negativeSignPrecedesCurrencySymbol <Boolean>
+
+ positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean>
+
+ negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean>
+
+ positiveSignPosition <Symbol>
+ one of: #parenthesesAround,
+ #signPrecedes,
+ #signSuceeds,
+ #signPrecedesCurrencySymbol,
+ #signSuceedsCurrencySymbol
+
+ negativeSignPosition <like above>
it is up to the application to deal with undefined values.
@@ -5187,9 +5187,9 @@
|info val|
LocaleInfo notNil ifTrue:[
- "/ return the internal info; useful on systems which do not
- "/ support this.
- ^ LocaleInfo
+ "/ return the internal info; useful on systems which do not
+ "/ support this.
+ ^ LocaleInfo
].
info := IdentityDictionary new.
@@ -5210,31 +5210,31 @@
int csNegSepBySpace; /* money: 1 if currency symbol should be separated by a space from a negative value; 0 if no space */
int csPosSignPosition; /* money: 0: ()'s around the value & currency symbol */
int csNegSignPosition; /* 1: sign precedes the value & currency symbol */
- /* 2: sign succeeds the value & currency symbol */
- /* 3: sign immediately precedes the currency symbol */
- /* 4: sign immediately suceeds the currency symbol */
+ /* 2: sign succeeds the value & currency symbol */
+ /* 3: sign immediately precedes the currency symbol */
+ /* 4: sign immediately suceeds the currency symbol */
#if defined(HAS_LOCALECONV)
struct lconv *conf;
conf = localeconv();
if (conf) {
- decimalPoint = conf->decimal_point;
- thousandsSep = conf->thousands_sep;
- intCurrencySymbol = conf->int_curr_symbol;
- currencySymbol = conf->currency_symbol;
- monDecimalPoint = conf->mon_decimal_point;
- monThousandsSep = conf->mon_thousands_sep;
- positiveSign = conf->positive_sign;
- negativeSign = conf->negative_sign;
- intFractDigits = conf->int_frac_digits;
- fractDigits = conf->frac_digits;
- csPosPrecedes = conf->p_cs_precedes;
- csNegPrecedes = conf->n_cs_precedes;
- csPosSepBySpace = conf->p_sep_by_space;
- csNegSepBySpace = conf->n_sep_by_space;
- csPosSignPosition = conf->p_sign_posn;
- csNegSignPosition = conf->n_sign_posn;
+ decimalPoint = conf->decimal_point;
+ thousandsSep = conf->thousands_sep;
+ intCurrencySymbol = conf->int_curr_symbol;
+ currencySymbol = conf->currency_symbol;
+ monDecimalPoint = conf->mon_decimal_point;
+ monThousandsSep = conf->mon_thousands_sep;
+ positiveSign = conf->positive_sign;
+ negativeSign = conf->negative_sign;
+ intFractDigits = conf->int_frac_digits;
+ fractDigits = conf->frac_digits;
+ csPosPrecedes = conf->p_cs_precedes;
+ csNegPrecedes = conf->n_cs_precedes;
+ csPosSepBySpace = conf->p_sep_by_space;
+ csNegSepBySpace = conf->n_sep_by_space;
+ csPosSignPosition = conf->p_sign_posn;
+ csNegSignPosition = conf->n_sign_posn;
}
#else
decimalPoint = (char *)0;
@@ -5255,129 +5255,129 @@
csNegSignPosition = -1;
#endif
if (decimalPoint) {
- val = __MKSTRING(decimalPoint);
- __AT_PUT_(info, @symbol(decimalPoint), val);
+ val = __MKSTRING(decimalPoint);
+ __AT_PUT_(info, @symbol(decimalPoint), val);
}
if (thousandsSep) {
- val = __MKSTRING(thousandsSep);
- __AT_PUT_(info, @symbol(thousandsSeparator), val);
+ val = __MKSTRING(thousandsSep);
+ __AT_PUT_(info, @symbol(thousandsSeparator), val);
}
if (intCurrencySymbol) {
- val = __MKSTRING(intCurrencySymbol);
- __AT_PUT_(info, @symbol(internationCurrencySymbol), val);
+ val = __MKSTRING(intCurrencySymbol);
+ __AT_PUT_(info, @symbol(internationCurrencySymbol), val);
}
if (currencySymbol) {
- val = __MKSTRING(currencySymbol);
- __AT_PUT_(info, @symbol(currencySymbol), val);
+ val = __MKSTRING(currencySymbol);
+ __AT_PUT_(info, @symbol(currencySymbol), val);
}
if (monDecimalPoint) {
- val = __MKSTRING(monDecimalPoint);
- __AT_PUT_(info, @symbol(monetaryDecimalPoint), val);
+ val = __MKSTRING(monDecimalPoint);
+ __AT_PUT_(info, @symbol(monetaryDecimalPoint), val);
}
if (monThousandsSep) {
- val = __MKSTRING(monThousandsSep);
- __AT_PUT_(info, @symbol(monetaryThousandsSeparator), val);
+ val = __MKSTRING(monThousandsSep);
+ __AT_PUT_(info, @symbol(monetaryThousandsSeparator), val);
}
if (positiveSign) {
- val = __MKSTRING(positiveSign);
- __AT_PUT_(info, @symbol(positiveSign), val);
+ val = __MKSTRING(positiveSign);
+ __AT_PUT_(info, @symbol(positiveSign), val);
}
if (negativeSign) {
- val = __MKSTRING(negativeSign);
- __AT_PUT_(info, @symbol(negativeSign), val);
+ val = __MKSTRING(negativeSign);
+ __AT_PUT_(info, @symbol(negativeSign), val);
}
if (intFractDigits >= 0) {
- __AT_PUT_(info, @symbol(internationalFractionalDigits), __MKSMALLINT(intFractDigits));
+ __AT_PUT_(info, @symbol(internationalFractionalDigits), __MKSMALLINT(intFractDigits));
}
if (fractDigits >= 0) {
- __AT_PUT_(info, @symbol(fractionalDigits), __MKSMALLINT(fractDigits));
+ __AT_PUT_(info, @symbol(fractionalDigits), __MKSMALLINT(fractDigits));
}
if (csPosPrecedes >= 0) {
- if (csPosPrecedes == 0) {
- val = false;
- } else {
- val = true;
- }
- __AT_PUT_(info, @symbol(positiveSignPrecedesCurrencySymbol), val );
+ if (csPosPrecedes == 0) {
+ val = false;
+ } else {
+ val = true;
+ }
+ __AT_PUT_(info, @symbol(positiveSignPrecedesCurrencySymbol), val );
}
if (csNegPrecedes >= 0) {
- if (csNegPrecedes == 0) {
- val = false;
- } else {
- val = true;
- }
- __AT_PUT_(info, @symbol(negativeSignPrecedesCurrencySymbol), val );
+ if (csNegPrecedes == 0) {
+ val = false;
+ } else {
+ val = true;
+ }
+ __AT_PUT_(info, @symbol(negativeSignPrecedesCurrencySymbol), val );
}
if (csPosSepBySpace >= 0) {
- if (csPosSepBySpace == 0) {
- val = false;
- } else {
- val = true;
- }
- __AT_PUT_(info, @symbol(positiveSignSeparatedBySpaceFromCurrencySymbol), val);
+ if (csPosSepBySpace == 0) {
+ val = false;
+ } else {
+ val = true;
+ }
+ __AT_PUT_(info, @symbol(positiveSignSeparatedBySpaceFromCurrencySymbol), val);
}
if (csNegSepBySpace >= 0) {
- if (csNegSepBySpace == 0) {
- val = false;
- } else {
- val = true;
- }
- __AT_PUT_(info, @symbol(negativeSignSeparatedBySpaceFromCurrencySymbol), val);
+ if (csNegSepBySpace == 0) {
+ val = false;
+ } else {
+ val = true;
+ }
+ __AT_PUT_(info, @symbol(negativeSignSeparatedBySpaceFromCurrencySymbol), val);
}
switch (csPosSignPosition) {
- case 0:
- val = @symbol(parenthesesAround);
- break;
-
- case 1:
- val = @symbol(signPrecedes);
- break;
-
- case 2:
- val = @symbol(signSuceeds);
- break;
-
- case 3:
- val = @symbol(signPrecedesCurrencySymbol);
- break;
-
- case 4:
- val = @symbol(signSuceedsCurrencySymbol);
- break;
-
- default:
- val = nil;
+ case 0:
+ val = @symbol(parenthesesAround);
+ break;
+
+ case 1:
+ val = @symbol(signPrecedes);
+ break;
+
+ case 2:
+ val = @symbol(signSuceeds);
+ break;
+
+ case 3:
+ val = @symbol(signPrecedesCurrencySymbol);
+ break;
+
+ case 4:
+ val = @symbol(signSuceedsCurrencySymbol);
+ break;
+
+ default:
+ val = nil;
}
if (val != nil) {
- __AT_PUT_(info, @symbol(positiveSignPosition), val);
+ __AT_PUT_(info, @symbol(positiveSignPosition), val);
}
switch (csNegSignPosition) {
- case 0:
- val = @symbol(parenthesesAround);
- break;
-
- case 1:
- val = @symbol(signPrecedes);
- break;
-
- case 2:
- val = @symbol(signSuceeds);
- break;
-
- case 3:
- val = @symbol(signPrecedesCurrencySymbol);
- break;
-
- case 4:
- val = @symbol(signSuceedsCurrencySymbol);
- break;
-
- default:
- val = nil;
+ case 0:
+ val = @symbol(parenthesesAround);
+ break;
+
+ case 1:
+ val = @symbol(signPrecedes);
+ break;
+
+ case 2:
+ val = @symbol(signSuceeds);
+ break;
+
+ case 3:
+ val = @symbol(signPrecedesCurrencySymbol);
+ break;
+
+ case 4:
+ val = @symbol(signSuceedsCurrencySymbol);
+ break;
+
+ default:
+ val = nil;
}
if (val != nil) {
- __AT_PUT_(info, @symbol(negativeSignPosition), val);
+ __AT_PUT_(info, @symbol(negativeSignPosition), val);
}
%}.
^ info
@@ -5391,8 +5391,8 @@
getNetworkMACAdresses
"return a dictionary filled with
- key -> name of interface
- value -> the MAC adress (as ByteArray)
+ key -> name of interface
+ value -> the MAC adress (as ByteArray)
for each interface
"
@@ -5406,28 +5406,28 @@
DWORD dwStatus;
dwStatus = GetAdaptersInfo(
- AdapterInfo, // [out] buffer to receive data
- &dwBufLen); // [in] size of receive data buffer
+ AdapterInfo, // [out] buffer to receive data
+ &dwBufLen); // [in] size of receive data buffer
if (dwStatus == ERROR_SUCCESS) {
- PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;
- unsigned char *bP;
- int nA = 0;
-
- bP = __byteArrayVal(rawData);
- do {
- nA++;
- bcopy(pAdapterInfo->Address, bP, 6);
- bP += 6;
- // PrintMACaddress(pAdapterInfo->Address);
- pAdapterInfo = pAdapterInfo->Next;
- } while(pAdapterInfo);
- nAdapters = __mkSmallInteger(nA);
+ PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;
+ unsigned char *bP;
+ int nA = 0;
+
+ bP = __byteArrayVal(rawData);
+ do {
+ nA++;
+ bcopy(pAdapterInfo->Address, bP, 6);
+ bP += 6;
+ // PrintMACaddress(pAdapterInfo->Address);
+ pAdapterInfo = pAdapterInfo->Next;
+ } while(pAdapterInfo);
+ nAdapters = __mkSmallInteger(nA);
}
#endif /* not NO_GETADAPTERSINFO */
%}.
nAdapters isNil ifTrue:[
- self primitiveFailed.
+ self primitiveFailed.
].
self halt.
!
@@ -5451,7 +5451,7 @@
"if supported by the OS, return the systemID;
a unique per machine identification.
WARNING:
- not all systems support this; on some, 'unknown' is returned."
+ not all systems support this; on some, 'unknown' is returned."
%{ /* NO_CONTEXT */
#if defined(HAS_GETHOSTID)
@@ -5465,15 +5465,15 @@
#endif
#if defined(HAS_SYSINFO) && defined(SI_HW_SERIAL)
{
- char buffer[128];
-
- buffer[0] = 0;
- if (sysinfo(SI_HW_SERIAL, buffer, sizeof(buffer))) {
- buffer[127] = 0;
- if (strlen(buffer) > 0) {
- RETURN(__MKSTRING(buffer));
- }
- }
+ char buffer[128];
+
+ buffer[0] = 0;
+ if (sysinfo(SI_HW_SERIAL, buffer, sizeof(buffer))) {
+ buffer[127] = 0;
+ if (strlen(buffer) > 0) {
+ RETURN(__MKSTRING(buffer));
+ }
+ }
}
#endif
%}.
@@ -5497,25 +5497,25 @@
This method is mainly provided to augment error reports with some system
information.
(in case of system/version specific OS errors, conditional workarounds and patches
- may be based upon this info).
+ may be based upon this info).
Your application should NOT depend upon this in any way.
The returned info may (or may not) contain:
- #system -> some operating system identification (irix, Linux, nt, win32s ...)
- #version -> OS version (some os version identification)
- #release -> OS release (3.5, 1.2.1 ...)
- #node -> some host identification (hostname)
- #domain -> domain name (hosts domain)
- #machine -> type of machine (i586, mips ...)
+ #system -> some operating system identification (irix, Linux, nt, win32s ...)
+ #version -> OS version (some os version identification)
+ #release -> OS release (3.5, 1.2.1 ...)
+ #node -> some host identification (hostname)
+ #domain -> domain name (hosts domain)
+ #machine -> type of machine (i586, mips ...)
win32:
- #physicalRam -> total amount of physical memory
- #freeRam -> amount of free memory
- #swapSize -> size of swapSpace (page file)
- #freeSwap -> free bytes in swapSpace
- #virtualRam -> total amount of virtual memory
- #freeVirtual -> amount of free virtual memory
- #memoryLoad -> percentage of memory usage (useless)
+ #physicalRam -> total amount of physical memory
+ #freeRam -> amount of free memory
+ #swapSize -> size of swapSpace (page file)
+ #freeSwap -> free bytes in swapSpace
+ #virtualRam -> total amount of virtual memory
+ #freeVirtual -> amount of free virtual memory
+ #memoryLoad -> percentage of memory usage (useless)
"
|sys node rel ver mach dom info arch
@@ -5537,14 +5537,14 @@
verMajor = LOBYTE(winVer);
if (HIWORD(vsn) & 0x8000) {
- s = "win95";
+ s = "win95";
} else {
- if ((verMajor > 5)
- || ((verMajor == 5) && (verMinor >= 1))) {
- s = "xp";
- } else {
- s = "nt";
- }
+ if ((verMajor > 5)
+ || ((verMajor == 5) && (verMinor >= 1))) {
+ s = "xp";
+ } else {
+ s = "nt";
+ }
}
sys = __MKSTRING(s);
sprintf(vsnBuffer, "%d.%d", verMajor, verMinor);
@@ -5571,103 +5571,103 @@
#endif
{
#ifdef PROCESSOR_ARCHITECTURE_INTEL
- case PROCESSOR_ARCHITECTURE_INTEL:
- s = "intel";
- break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ s = "intel";
+ break;
#endif
#ifdef PROCESSOR_ARCHITECTURE_MIPS
- case PROCESSOR_ARCHITECTURE_MIPS:
- s = "mips";
- break;
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ s = "mips";
+ break;
#endif
#ifdef PROCESSOR_ARCHITECTURE_ALPHA
- case PROCESSOR_ARCHITECTURE_ALPHA:
- s = "alpha";
- break;
+ case PROCESSOR_ARCHITECTURE_ALPHA:
+ s = "alpha";
+ break;
#endif
#ifdef PROCESSOR_ARCHITECTURE_PPC
- case PROCESSOR_ARCHITECTURE_PPC:
- s = "ppc";
- break;
+ case PROCESSOR_ARCHITECTURE_PPC:
+ s = "ppc";
+ break;
#endif
#ifdef PROCESSOR_ARCHITECTURE_ARM
- case PROCESSOR_ARCHITECTURE_ARM:
- s = "arm";
- break;
-#endif
- default:
- s = "unknown";
- break;
+ case PROCESSOR_ARCHITECTURE_ARM:
+ s = "arm";
+ break;
+#endif
+ default:
+ s = "unknown";
+ break;
}
arch = __MKSTRING(s);
switch (sysInfo.dwProcessorType) {
#ifdef PROCESSOR_INTEL_386
- case PROCESSOR_INTEL_386:
- s = "i386";
- break;
+ case PROCESSOR_INTEL_386:
+ s = "i386";
+ break;
#endif
#ifdef PROCESSOR_INTEL_486
- case PROCESSOR_INTEL_486:
- s = "i486";
- break;
+ case PROCESSOR_INTEL_486:
+ s = "i486";
+ break;
#endif
#ifdef PROCESSOR_INTEL_PENTIUM
- case PROCESSOR_INTEL_PENTIUM:
- s = "i586";
- break;
+ case PROCESSOR_INTEL_PENTIUM:
+ s = "i586";
+ break;
#endif
#ifdef PROCESSOR_INTEL_860
- case PROCESSOR_INTEL_860:
- s = "i860";
- break;
+ case PROCESSOR_INTEL_860:
+ s = "i860";
+ break;
#endif
#ifdef PROCESSOR_MIPS_R2000
- case PROCESSOR_MIPS_R2000:
- s = "r2000";
- break;
+ case PROCESSOR_MIPS_R2000:
+ s = "r2000";
+ break;
#endif
#ifdef PROCESSOR_MIPS_R3000
- case PROCESSOR_MIPS_R3000:
- s = "r3000";
- break;
+ case PROCESSOR_MIPS_R3000:
+ s = "r3000";
+ break;
#endif
#ifdef PROCESSOR_MIPS_R4000
- case PROCESSOR_MIPS_R4000:
- s = "r4000";
- break;
+ case PROCESSOR_MIPS_R4000:
+ s = "r4000";
+ break;
#endif
#ifdef PROCESSOR_ALPHA_21064
- case PROCESSOR_ALPHA_21064:
- s = "alpha21064";
- break;
+ case PROCESSOR_ALPHA_21064:
+ s = "alpha21064";
+ break;
#endif
#ifdef PROCESSOR_ARM_7TDMI
- case PROCESSOR_ARM_7TDMI:
- s = "arm70001";
- break;
-#endif
- default:
- sprintf(vsnBuffer, "%d", sysInfo.dwProcessorType);
- s = vsnBuffer;
- break;
+ case PROCESSOR_ARM_7TDMI:
+ s = "arm70001";
+ break;
+#endif
+ default:
+ sprintf(vsnBuffer, "%d", sysInfo.dwProcessorType);
+ s = vsnBuffer;
+ break;
}
mach = __MKSTRING(s);
%}.
sys isNil ifTrue:[
- sys := self getSystemType.
+ sys := self getSystemType.
].
node isNil ifTrue:[
- node := self getHostName.
+ node := self getHostName.
].
dom isNil ifTrue:[
- dom := self getDomainName.
+ dom := self getDomainName.
].
mach isNil ifTrue:[
- mach := self getCPUType.
+ mach := self getCPUType.
].
arch isNil ifTrue:[
- arch := 'unknown'.
+ arch := 'unknown'.
].
info := IdentityDictionary new.
@@ -5720,7 +5720,7 @@
char buffer[MAXPATHLEN];
if (GetWindowsDirectory(buffer, MAXPATHLEN)) {
- RETURN (__MKSTRING(buffer));
+ RETURN (__MKSTRING(buffer));
}
%}.
^ nil
@@ -5741,7 +5741,7 @@
char buffer[MAXPATHLEN];
if (GetSystemDirectory(buffer, MAXPATHLEN)) {
- RETURN (__MKSTRING(buffer));
+ RETURN (__MKSTRING(buffer));
}
%}.
^ nil
@@ -5779,7 +5779,7 @@
%{ /* NOCONTEXT */
if (__isWinNT)
- RETURN(true);
+ RETURN(true);
%}.
^ false.
!
@@ -5794,11 +5794,11 @@
maxFileNameLength
"return the max number of characters in a filename.
CAVEAT:
- Actually, the following is somewhat wrong - some systems
- support different sizes, depending on the volume.
- We return a somewhat conservative number here.
- Another entry, to query for volume specific max
- will be added in the future."
+ Actually, the following is somewhat wrong - some systems
+ support different sizes, depending on the volume.
+ We return a somewhat conservative number here.
+ Another entry, to query for volume specific max
+ will be added in the future."
%{ /* NOCONTEXT */
@@ -6064,39 +6064,39 @@
pPath := super defaultPackagePath.
pkgDirPath := self stxPackageDirPath.
pkgDirPath notNil ifTrue:[
- "/ and also add the packageDirPath from the registry ...
- dirs := pkgDirPath asCollectionOfSubstringsSeparatedBy:$;.
- dirs do:[:aDir |
- (pPath includes:aDir) ifFalse:[
- pPath add:aDir.
- ]
- ]
+ "/ and also add the packageDirPath from the registry ...
+ dirs := pkgDirPath asCollectionOfSubstringsSeparatedBy:$;.
+ dirs do:[:aDir |
+ (pPath includes:aDir) ifFalse:[
+ pPath add:aDir.
+ ]
+ ]
] ifFalse:[
- #(
- '\smalltalk'
- '\programme\smalltalk'
- '\programme\eXept\smalltalk'
- '\programs\smalltalk'
- '\programs\eXept\smalltalk'
- ) do:[:d | |dd|
- dd := d asFilename constructString:'packages'.
- (pPath includes:dd) ifFalse:[
- pPath add:dd.
- ].
- dd := (d asFilename construct:Smalltalk versionString) constructString:'packages'.
- (pPath includes:dd) ifFalse:[
- pPath add:dd.
- ].
- ].
+ #(
+ '\smalltalk'
+ '\programme\smalltalk'
+ '\programme\eXept\smalltalk'
+ '\programs\smalltalk'
+ '\programs\eXept\smalltalk'
+ ) do:[:d | |dd|
+ dd := d asFilename constructString:'packages'.
+ (pPath includes:dd) ifFalse:[
+ pPath add:dd.
+ ].
+ dd := (d asFilename construct:Smalltalk versionString) constructString:'packages'.
+ (pPath includes:dd) ifFalse:[
+ pPath add:dd.
+ ].
+ ].
].
"/ under windows, the commandName includes the path - good.
p := Smalltalk commandName.
p notNil ifTrue:[
- p := p asFilename directory constructString:'packages'.
- (pPath includes:p) ifFalse:[
- pPath add:p.
- ]
+ p := p asFilename directory constructString:'packages'.
+ (pPath includes:p) ifFalse:[
+ pPath add:p.
+ ]
].
pPath := pPath select:[:p | p asFilename exists].
^ pPath
@@ -6115,37 +6115,37 @@
sysPath := super defaultSystemPath.
libDirPath := self stxLibDirPath.
libDirPath notNil ifTrue:[
- "/ and also add the libDirPath from the registry ...
- (sysPath includes:libDirPath) ifFalse:[
- sysPath add:libDirPath
- ].
+ "/ and also add the libDirPath from the registry ...
+ (sysPath includes:libDirPath) ifFalse:[
+ sysPath add:libDirPath
+ ].
] ifFalse:[
- #(
- '\smalltalk'
- '\programme\smalltalk'
- '\programme\eXept\smalltalk'
- '\programs\smalltalk'
- '\programs\eXept\smalltalk'
- ) do:[:d | |dd|
- (d asFilename isDirectory) ifTrue:[
- (sysPath includes:d) ifFalse:[
- sysPath add:d.
- ].
- dd := d , '\' , Smalltalk versionString.
- (sysPath includes:dd) ifFalse:[
- sysPath add:dd.
- ]
- ]
- ].
+ #(
+ '\smalltalk'
+ '\programme\smalltalk'
+ '\programme\eXept\smalltalk'
+ '\programs\smalltalk'
+ '\programs\eXept\smalltalk'
+ ) do:[:d | |dd|
+ (d asFilename isDirectory) ifTrue:[
+ (sysPath includes:d) ifFalse:[
+ sysPath add:d.
+ ].
+ dd := d , '\' , Smalltalk versionString.
+ (sysPath includes:dd) ifFalse:[
+ sysPath add:dd.
+ ]
+ ]
+ ].
].
"/ under windows, the commandName includes the path - good.
p := Smalltalk commandName.
p notNil ifTrue:[
- p := p asFilename directoryName.
- (sysPath includes:p) ifFalse:[
- sysPath add:p.
- ]
+ p := p asFilename directoryName.
+ (sysPath includes:p) ifFalse:[
+ sysPath add:p.
+ ]
].
^ sysPath
@@ -6159,7 +6159,7 @@
k := RegistryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString.
k notNil ifTrue:[
- p := k valueNamed:'BinDir'.
+ p := k valueNamed:'BinDir'.
].
^ p
@@ -6175,7 +6175,7 @@
k := RegistryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString.
k notNil ifTrue:[
- p := k valueNamed:'LibDir'.
+ p := k valueNamed:'LibDir'.
].
^ p
@@ -6191,7 +6191,7 @@
k := RegistryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString.
k notNil ifTrue:[
- p := k valueNamed:'PackageDirPath'.
+ p := k valueNamed:'PackageDirPath'.
].
^ p
@@ -6226,27 +6226,27 @@
I added this in order to be able to shutdown w95 cleanly"
confirmationMessageOrNil notNil ifTrue:[
- (Dialog confirm:confirmationMessageOrNil) ifFalse:[
- ^ false
- ].
+ (Dialog confirm:confirmationMessageOrNil) ifFalse:[
+ ^ false
+ ].
].
%{
int flag;
if (how == @symbol(shutdown)) {
- flag = EWX_SHUTDOWN;
+ flag = EWX_SHUTDOWN;
} else if (how == @symbol(reboot)) {
- flag = EWX_REBOOT;
+ flag = EWX_REBOOT;
} else if (how == @symbol(logoff)) {
- flag = EWX_LOGOFF;
+ flag = EWX_LOGOFF;
} else if (how == @symbol(forceShutdown)) {
- flag = EWX_SHUTDOWN | EWX_FORCE;
+ flag = EWX_SHUTDOWN | EWX_FORCE;
} else if (how == @symbol(forceReboot)) {
- flag = EWX_REBOOT | EWX_FORCE;
+ flag = EWX_REBOOT | EWX_FORCE;
} else if (how == @symbol(forceLogoff)) {
- flag = EWX_LOGOFF | EWX_FORCE;
+ flag = EWX_LOGOFF | EWX_FORCE;
} else {
- RETURN (false);
+ RETURN (false);
}
RETURN ((ExitWindowsEx(flag, 0) == TRUE) ? true : false);
%}
@@ -6279,7 +6279,7 @@
"
OperatingSystem computeDatePartsOf:0 for:[:y :m :d |
- y printCR. m printCR. d printCR
+ y printCR. m printCR. d printCR
]
"
!
@@ -6298,21 +6298,21 @@
if (__bothSmallInteger(y, m)
&& __bothSmallInteger(d, h)
&& __bothSmallInteger(min, s)) {
- tm.tm_hour = __intVal(h);
- tm.tm_min = __intVal(min);
- tm.tm_sec = __intVal(s);
-
- tm.tm_year = __intVal(y) - 1900;
- tm.tm_mon = __intVal(m) - 1;
- tm.tm_mday = __intVal(d);
- tm.tm_isdst = -1;
-
- t = mktime(&tm);
- osSeconds = __MKUINT((INT)t);
+ tm.tm_hour = __intVal(h);
+ tm.tm_min = __intVal(min);
+ tm.tm_sec = __intVal(s);
+
+ tm.tm_year = __intVal(y) - 1900;
+ tm.tm_mon = __intVal(m) - 1;
+ tm.tm_mday = __intVal(d);
+ tm.tm_isdst = -1;
+
+ t = mktime(&tm);
+ osSeconds = __MKUINT((INT)t);
}
%}.
osSeconds notNil ifTrue:[
- ^ osSeconds * 1000 + millis
+ ^ osSeconds * 1000 + millis
].
^ self primitiveFailed
@@ -6356,14 +6356,14 @@
wDay = __MKSMALLINT(tmPtr->tm_wday == 0 ? 7 : tmPtr->tm_wday);
if (tmPtr->tm_isdst == 0) {
- dst = false;
- utcOffset = __MKINT(TIMEZONE(tmPtr));
+ dst = false;
+ utcOffset = __MKINT(TIMEZONE(tmPtr));
} else {
- dst = true;
+ dst = true;
#ifdef HAS_ALTZONE
- utcOffset = __MKINT(altzone);
+ utcOffset = __MKINT(altzone);
#else
- utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600);
+ utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600);
#endif
}
%}.
@@ -6413,7 +6413,7 @@
"
OperatingSystem computeTimePartsOf:100 for:[:h :m :s :milli |
- h printCR. m printCR. s printCR. millis printCR
+ h printCR. m printCR. s printCR. millis printCR
]
"
!
@@ -6450,14 +6450,14 @@
wDay = __MKSMALLINT(tmPtr->tm_wday == 0 ? 7 : tmPtr->tm_wday);
if (tmPtr->tm_isdst == 0) {
- dst = false;
- utcOffset = __MKINT(TIMEZONE(tmPtr));
+ dst = false;
+ utcOffset = __MKINT(TIMEZONE(tmPtr));
} else {
- dst = true;
+ dst = true;
#ifdef HAS_ALTZONE
- utcOffset = __MKINT(altzone);
+ utcOffset = __MKINT(altzone);
#else
- utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600);
+ utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600);
#endif
}
%}.
@@ -6505,7 +6505,7 @@
"
OperatingSystem computeUTCTimePartsOf:100 for:[:h :m :s :milli |
- h printCR. m printCR. s printCR. milli printCR
+ h printCR. m printCR. s printCR. milli printCR
]
"
!
@@ -6519,8 +6519,8 @@
Use the millisecondTimeXXX:-methods to compare and add time deltas - these know about the wrap.
BAD DESIGN:
- This should be changed to return some instance of RelativeTime,
- and these computations moved there.
+ This should be changed to return some instance of RelativeTime,
+ and these computations moved there.
Dont use this method in application code since it is an internal (private)
interface. For compatibility with ST-80, use Time millisecondClockValue.
@@ -6671,9 +6671,9 @@
then := Win32OperatingSystem millisecondTimeAdd:now and:millis.
[Win32OperatingSystem millisecondTime:then isAfter:now] whileTrue:[
- delta := Win32OperatingSystem millisecondTimeDeltaBetween:then and:now.
- self selectOnAnyReadable:nil writable:nil exception:nil withTimeOut:delta.
- now := Win32OperatingSystem getMillisecondTime.
+ delta := Win32OperatingSystem millisecondTimeDeltaBetween:then and:now.
+ self selectOnAnyReadable:nil writable:nil exception:nil withTimeOut:delta.
+ now := Win32OperatingSystem getMillisecondTime.
]
"
@@ -6695,8 +6695,8 @@
%{ /* NOCONTEXT */
if (__isSmallInteger(numberOfSeconds)) {
- sleep(__intVal(numberOfSeconds));
- RETURN ( self );
+ sleep(__intVal(numberOfSeconds));
+ RETURN ( self );
}
%}.
"
@@ -6750,11 +6750,11 @@
info := self userInfoOf:userID.
(info notNil
and:[info includesKey:#gecos]) ifTrue:[
- gecos := info at:#gecos.
- (gecos includes:$,) ifTrue:[
- ^ gecos copyTo:(gecos indexOf:$,) - 1
- ].
- ^ gecos
+ gecos := info at:#gecos.
+ (gecos includes:$,) ifTrue:[
+ ^ gecos copyTo:(gecos indexOf:$,) - 1
+ ].
+ ^ gecos
].
^ self getUserNameFromID:userID
@@ -6805,15 +6805,15 @@
dir := self getEnvironment:'HOME'.
dir isNil ifTrue:[
- "/ for NT users:
- "/ if HOME is nil, try HOMEDRIVE and HOMEPATH
- "/
- ((drv := self getEnvironment:'HOMEDRIVE') notNil
- and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
- dir := drv , path
- ] ifFalse:[
- dir := '.'.
- ].
+ "/ for NT users:
+ "/ if HOME is nil, try HOMEDRIVE and HOMEPATH
+ "/
+ ((drv := self getEnvironment:'HOMEDRIVE') notNil
+ and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
+ dir := drv , path
+ ] ifFalse:[
+ dir := '.'.
+ ].
].
^ dir
@@ -6838,33 +6838,33 @@
char *name = (char *)0;
if (firstCall) {
- int nameSize = sizeof(cachedName);
-
- if (GetUserName(cachedName, &nameSize) == TRUE) {
- name = cachedName;
- firstCall = 0;
- }
+ int nameSize = sizeof(cachedName);
+
+ if (GetUserName(cachedName, &nameSize) == TRUE) {
+ name = cachedName;
+ firstCall = 0;
+ }
} else {
- name = cachedName;
+ name = cachedName;
}
/*
* try a few common environment variables ...
*/
if (! name || (name[0] == 0) ) {
- name = getenv("LOGIN");
- if (! name || (name[0] == 0) ) {
- name = getenv("LOGNAME");
- if (! name || (name[0] == 0) ) {
- name = getenv("USER");
- }
- }
+ name = getenv("LOGIN");
+ if (! name || (name[0] == 0) ) {
+ name = getenv("LOGNAME");
+ if (! name || (name[0] == 0) ) {
+ name = getenv("USER");
+ }
+ }
}
/*
* nope - I really font know who you are.
*/
if (! name || (name[0] == 0) ) {
- name = "you";
+ name = "you";
}
RETURN ( __MKSTRING(name) );
@@ -6893,7 +6893,7 @@
This is the login name, not the fullName."
aNumber == self getUserID ifTrue:[
- ^ self getLoginName
+ ^ self getLoginName
].
^ '? (' , aNumber printString , ')'
@@ -6918,19 +6918,19 @@
info := IdentityDictionary new.
name isNil ifTrue:[
- aNameOrID == self getUserID ifTrue:[
- name := self getLoginName
- ].
+ aNameOrID == self getUserID ifTrue:[
+ name := self getLoginName
+ ].
].
name notNil ifTrue:[
- info at:#name put:name.
+ info at:#name put:name.
] ifFalse:[
- info at:#name put:'unknown'
+ info at:#name put:'unknown'
].
dir isNil ifTrue:[
- aNameOrID == self getUserID ifTrue:[
- dir := self getHomeDirectory
- ]
+ aNameOrID == self getUserID ifTrue:[
+ dir := self getHomeDirectory
+ ]
].
dir notNil ifTrue:[info at:#dir put:dir].
"/ uid notNil ifTrue:[info at:#uid put:uid].
@@ -6971,63 +6971,63 @@
DWORD endStatus;
if (__isExternalAddress(pidToWait) ) {
- HANDLE __pidToWait = _HANDLEVal(pidToWait);
- int t;
+ HANDLE __pidToWait = _HANDLEVal(pidToWait);
+ int t;
#ifdef PROCESS1DEBUGWIN32
- printf("childProcessWait %x b %d\n",__pidToWait,blocking==true);
-#endif
- t = blocking==true ? INFINITE : 0;
+ printf("childProcessWait %x b %d\n",__pidToWait,blocking==true);
+#endif
+ t = blocking==true ? INFINITE : 0;
#ifdef DO_WRAP_CALLS
- do {
- __threadErrno = 0;
- endStatus = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, __pidToWait, t);
- } while ((endStatus < 0) && (__threadErrno == EINTR));
+ do {
+ __threadErrno = 0;
+ endStatus = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, __pidToWait, t);
+ } while ((endStatus < 0) && (__threadErrno == EINTR));
#else
- endStatus = WaitForSingleObject(__pidToWait, t);
- if (endStatus < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
- }
-#endif
- if ( endStatus == WAIT_TIMEOUT ) {
- if (blocking==true)
- status = @symbol(timeout);
- else {
- status = @symbol(continue);
+ endStatus = WaitForSingleObject(__pidToWait, t);
+ if (endStatus < 0) {
+ __threadErrno = __WIN32_ERR(GetLastError());
+ }
+#endif
+ if ( endStatus == WAIT_TIMEOUT ) {
+ if (blocking==true)
+ status = @symbol(timeout);
+ else {
+ status = @symbol(continue);
#ifdef PROCESS1DEBUGWIN32
- printf("ret nil\n");
-#endif
- RETURN(nil);
- }
- } else {
- status = @symbol(exit);
+ printf("ret nil\n");
+#endif
+ RETURN(nil);
+ }
+ } else {
+ status = @symbol(exit);
#ifdef PROCESS1DEBUGWIN32
- printf("exit\n");
-#endif
- if (endStatus == WAIT_OBJECT_0) {
- if (GetExitCodeProcess(__pidToWait, &endStatus)) {
- if (endStatus == STILL_ACTIVE) {
- RETURN(nil);
- }
+ printf("exit\n");
+#endif
+ if (endStatus == WAIT_OBJECT_0) {
+ if (GetExitCodeProcess(__pidToWait, &endStatus)) {
+ if (endStatus == STILL_ACTIVE) {
+ RETURN(nil);
+ }
#ifdef PROCESS1DEBUGWIN32
- printf("exit %d\n",endStatus);
-#endif
- code = __MKSMALLINT(endStatus);
- } else {
- code = __MKSMALLINT(GetLastError());
- }
- } else {
- code = __MKSMALLINT(-1);
- }
- }
- core = false;
- pid = pidToWait;
+ printf("exit %d\n",endStatus);
+#endif
+ code = __MKSMALLINT(endStatus);
+ } else {
+ code = __MKSMALLINT(GetLastError());
+ }
+ } else {
+ code = __MKSMALLINT(-1);
+ }
+ }
+ core = false;
+ pid = pidToWait;
}
%}.
(status isNil or:[pid isNil]) ifTrue:[
- ^ self primitiveFailed
+ ^ self primitiveFailed
].
"/ Transcript show:'pid: '; show:pid; show:' status: '; show:status;
@@ -7079,217 +7079,217 @@
int retArray[MAXHANDLE];
if (__isNonNilObject(readFdArray)) {
- if (! __isArray(readFdArray)) {
- goto fail;
- }
- count = __arraySize(readFdArray);
-
- for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
- fd = __ArrayInstPtr(readFdArray)->a_element[i];
- if (fd != nil) {
- HANDLE h;
-
- if (__isExternalAddress(fd)) {
- hArray[numHandles] = h = _HANDLEVal(fd);
- } else {
- hArray[numHandles] = h = (HANDLE) _get_osfhandle (__intVal(fd));
-
- if (ioctlsocket((SOCKET)h, FIONREAD, &res)==0) {
- if (res > 0) {
+ if (! __isArray(readFdArray)) {
+ goto fail;
+ }
+ count = __arraySize(readFdArray);
+
+ for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
+ fd = __ArrayInstPtr(readFdArray)->a_element[i];
+ if (fd != nil) {
+ HANDLE h;
+
+ if (__isExternalAddress(fd)) {
+ hArray[numHandles] = h = _HANDLEVal(fd);
+ } else {
+ hArray[numHandles] = h = (HANDLE) _get_osfhandle (__intVal(fd));
+
+ if (ioctlsocket((SOCKET)h, FIONREAD, &res)==0) {
+ if (res > 0) {
#ifdef SELECT2DEBUGWIN32
- printf("no wait result=%d (this is a Socket fd=%x h=%x)\n", res, fd, h);
-#endif
- RETURN (fd);
- }
+ printf("no wait result=%d (this is a Socket fd=%x h=%x)\n", res, fd, h);
+#endif
+ RETURN (fd);
+ }
#ifdef SELECT2DEBUGWIN32
- printf("readWait Handle %d (this is a Socket fd=%x h=%x)\n", i, fd, h);
-#endif
- //if (!__isWinNT)
- // continue;
- } else {
- if (PeekNamedPipe((HANDLE)h, 0, 0, 0, &res, 0)) {
- if (1 /*res > 0*/) {
+ printf("readWait Handle %d (this is a Socket fd=%x h=%x)\n", i, fd, h);
+#endif
+ //if (!__isWinNT)
+ // continue;
+ } else {
+ if (PeekNamedPipe((HANDLE)h, 0, 0, 0, &res, 0)) {
+ if (1 /*res > 0*/) {
#ifdef SELECT1DEBUGWIN32
- printf("no wait l=%d ret this is a Pipe %x\n", res, fd);
-#endif
- RETURN (fd);
- }
+ printf("no wait l=%d ret this is a Pipe %x\n", res, fd);
+#endif
+ RETURN (fd);
+ }
#ifdef SELECT1DEBUGWIN32
- printf("readWait Handle %d this is a Pipe %x\n", i, fd);
-#endif
- continue;
- } else {
+ printf("readWait Handle %d this is a Pipe %x\n", i, fd);
+#endif
+ continue;
+ } else {
#ifdef SELECT2DEBUGWIN32
- printf("readWait Handle %d this is ??? %x\n", i, fd);
-#endif
- __threadErrno = EBADF;
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- RETURN ( nil );
- }
- }
- }
- retArray[numHandles] = i;
- numHandles++;
- }
- }
+ printf("readWait Handle %d this is ??? %x\n", i, fd);
+#endif
+ __threadErrno = EBADF;
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ RETURN ( nil );
+ }
+ }
+ }
+ retArray[numHandles] = i;
+ numHandles++;
+ }
+ }
}
if (__isNonNilObject(writeFdArray)) {
- if (! __isArray(writeFdArray)) {
- goto fail;
- }
- count = __arraySize(writeFdArray);
- for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
- fd = __ArrayInstPtr(writeFdArray)->a_element[i];
- if (fd != nil) {
- if (__isExternalAddress(fd)) {
- hArray[numHandles] = _HANDLEVal(fd);
- } else {
- hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd));
- }
+ if (! __isArray(writeFdArray)) {
+ goto fail;
+ }
+ count = __arraySize(writeFdArray);
+ for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
+ fd = __ArrayInstPtr(writeFdArray)->a_element[i];
+ if (fd != nil) {
+ if (__isExternalAddress(fd)) {
+ hArray[numHandles] = _HANDLEVal(fd);
+ } else {
+ hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd));
+ }
#ifdef SELECTDEBUGWIN32
- printf("select of writeFdArray %x\n",hArray[numHandles]);
-#endif
- retArray[numHandles] = i + 10000;
- numHandles++;
- }
- }
+ printf("select of writeFdArray %x\n",hArray[numHandles]);
+#endif
+ retArray[numHandles] = i + 10000;
+ numHandles++;
+ }
+ }
}
if (__isNonNilObject(exceptFdArray)) {
- if (! __isArray(exceptFdArray)) {
- goto fail;
- }
- count = __arraySize(exceptFdArray);
- for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
- fd = __ArrayInstPtr(exceptFdArray)->a_element[i];
- if (fd != nil) {
- if (__isExternalAddress(fd)) {
- hArray[numHandles] = _HANDLEVal(fd);
- } else {
- hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd));
- }
+ if (! __isArray(exceptFdArray)) {
+ goto fail;
+ }
+ count = __arraySize(exceptFdArray);
+ for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) {
+ fd = __ArrayInstPtr(exceptFdArray)->a_element[i];
+ if (fd != nil) {
+ if (__isExternalAddress(fd)) {
+ hArray[numHandles] = _HANDLEVal(fd);
+ } else {
+ hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd));
+ }
#ifdef SELECTDEBUGWIN32
- printf("select of exceptFdArray %x\n",hArray[numHandles]);
-#endif
- retArray[numHandles] = i + 20000;
- numHandles++;
- }
- }
+ printf("select of exceptFdArray %x\n",hArray[numHandles]);
+#endif
+ retArray[numHandles] = i + 20000;
+ numHandles++;
+ }
+ }
}
if (__isSmallInteger(millis)) {
- t = __intVal(millis);
+ t = __intVal(millis);
} else {
- t = INFINITE;
+ t = INFINITE;
}
if (numHandles) {
#ifdef SELECT3DEBUGWIN32
- printf("wait Handles = %d timeout = %d\n",numHandles,t);
-#endif
- res = __vmWait(numHandles, hArray, MAXHANDLE, t);
-
- if (res == WAIT_FAILED) {
+ printf("wait Handles = %d timeout = %d\n",numHandles,t);
+#endif
+ res = __vmWait(numHandles, hArray, MAXHANDLE, t);
+
+ if (res == WAIT_FAILED) {
#ifdef SELECT2DEBUGWIN32
- printf("- error %d; ret nil\n",GetLastError());
-#endif
- if (__threadErrno == EINTR) {
- __threadErrno = 0;
- @global(LastErrorNumber) = nil;
- } else {
- __threadErrno = EBADF;
- if (@global(InfoPrinting) == true) {
- fprintf(stderr, "OS [info]: select errno = %d\n", __threadErrno);
- }
- @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
- }
- RETURN ( nil );
- }
-
- if (res == WAIT_TIMEOUT) {
+ printf("- error %d; ret nil\n",GetLastError());
+#endif
+ if (__threadErrno == EINTR) {
+ __threadErrno = 0;
+ @global(LastErrorNumber) = nil;
+ } else {
+ __threadErrno = EBADF;
+ if (@global(InfoPrinting) == true) {
+ fprintf(stderr, "OS [info]: select errno = %d\n", __threadErrno);
+ }
+ @global(LastErrorNumber) = __MKSMALLINT(__threadErrno);
+ }
+ RETURN ( nil );
+ }
+
+ if (res == WAIT_TIMEOUT) {
#ifdef SELECT3DEBUGWIN32
- printf("- timeOut; ret nil\n");
-#endif
- goto polling;
- // @global(LastErrorNumber) = nil;
- // RETURN ( nil );
- }
-
- if ((res < 0) || (res >= numHandles)) {
+ printf("- timeOut; ret nil\n");
+#endif
+ goto polling;
+ // @global(LastErrorNumber) = nil;
+ // RETURN ( nil );
+ }
+
+ if ((res < 0) || (res >= numHandles)) {
#ifdef SELECTDEBUGWIN32
- printf("- res=%d error1 %d\n", res, GetLastError());
+ printf("- res=%d error1 %d\n", res, GetLastError());
#endif
- __threadErrno = 0;
- @global(LastErrorNumber) = nil;
- RETURN ( nil );
- }
-
- ret = res;
-
- if (ret < numHandles) {
- int fd = retArray[ret];
-
- @global(LastErrorNumber) = nil;
+ __threadErrno = 0;
+ @global(LastErrorNumber) = nil;
+ RETURN ( nil );
+ }
+
+ ret = res;
+
+ if (ret < numHandles) {
+ int fd = retArray[ret];
+
+ @global(LastErrorNumber) = nil;
#ifdef SELECTDEBUGWIN32
- if (ret) printf("wait Handles %d %d ret\n", ret, fd);
-#endif
- if (fd < 10000) {
- RETURN ( __ArrayInstPtr(readFdArray)->a_element[fd] );
- }
- if (fd < 20000) {
- RETURN ( __ArrayInstPtr(writeFdArray)->a_element[fd-10000] );
- }
- RETURN ( __ArrayInstPtr(exceptFdArray)->a_element[fd-20000] );
- }
- printf("wait Handles ret = %d error2 %d\n", ret, GetLastError());
- goto fail;
+ if (ret) printf("wait Handles %d %d ret\n", ret, fd);
+#endif
+ if (fd < 10000) {
+ RETURN ( __ArrayInstPtr(readFdArray)->a_element[fd] );
+ }
+ if (fd < 20000) {
+ RETURN ( __ArrayInstPtr(writeFdArray)->a_element[fd-10000] );
+ }
+ RETURN ( __ArrayInstPtr(exceptFdArray)->a_element[fd-20000] );
+ }
+ printf("wait Handles ret = %d error2 %d\n", ret, GetLastError());
+ goto fail;
} else {
#ifdef SELECTDEBUGWIN32
- printf("wait NoHandles timeout = %d\n",t);
-#endif
- res = __vmWait(0, hArray, MAXHANDLE, t);
+ printf("wait NoHandles timeout = %d\n",t);
+#endif
+ res = __vmWait(0, hArray, MAXHANDLE, t);
polling:
- if (__isNonNilObject(readFdArray)) {
- HANDLE h;
- if (! __isArray(readFdArray)) {
- goto fail;
- }
- count = __arraySize(readFdArray);
- for (i=0; (i<count);i++) {
- fd = __ArrayInstPtr(readFdArray)->a_element[i];
- if (fd != nil) {
- if (__isExternalAddress(fd)) {
- continue;
- } else {
- h = (HANDLE) _get_osfhandle (__intVal(fd));
-
- if (ioctlsocket((SOCKET)h, FIONREAD, &res)==0) {
- if (1 /*res > 0*/) {
- RETURN ( fd );
- }
- } else {
- if (PeekNamedPipe((HANDLE)h,0,0,0,&res,0)) {
- if (1 /*res > 0*/) {
- RETURN ( fd );
- } else {
- continue;
- }
- } else {
- if (t) {
- RETURN ( fd );
- }
- }
- }
- }
- }
- }
- }
- @global(LastErrorNumber) = nil;
- RETURN ( nil );
+ if (__isNonNilObject(readFdArray)) {
+ HANDLE h;
+ if (! __isArray(readFdArray)) {
+ goto fail;
+ }
+ count = __arraySize(readFdArray);
+ for (i=0; (i<count);i++) {
+ fd = __ArrayInstPtr(readFdArray)->a_element[i];
+ if (fd != nil) {
+ if (__isExternalAddress(fd)) {
+ continue;
+ } else {
+ h = (HANDLE) _get_osfhandle (__intVal(fd));
+
+ if (ioctlsocket((SOCKET)h, FIONREAD, &res)==0) {
+ if (1 /*res > 0*/) {
+ RETURN ( fd );
+ }
+ } else {
+ if (PeekNamedPipe((HANDLE)h,0,0,0,&res,0)) {
+ if (1 /*res > 0*/) {
+ RETURN ( fd );
+ } else {
+ continue;
+ }
+ } else {
+ if (t) {
+ RETURN ( fd );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ @global(LastErrorNumber) = nil;
+ RETURN ( nil );
}
fail: ;
@@ -7330,51 +7330,51 @@
INT i, count;
if (! __isArray(fdOrHandleArray)) {
- goto fail;
+ goto fail;
}
count = __arraySize(fdOrHandleArray);
for (i=0; i<count; i++) {
- OBJ fdOrHandle = __ArrayInstPtr(fdOrHandleArray)->a_element[i];
- HANDLE h;
-
- if (__isExternalAddress(fdOrHandle)) {
- h = _HANDLEVal(fdOrHandle);
- } else {
- if (__isSmallInteger(fdOrHandle)) {
- h = (HANDLE) _get_osfhandle (__intVal(fdOrHandle));
- } else {
- goto fail;
- }
- }
- hArray[i] = h;
+ OBJ fdOrHandle = __ArrayInstPtr(fdOrHandleArray)->a_element[i];
+ HANDLE h;
+
+ if (__isExternalAddress(fdOrHandle)) {
+ h = _HANDLEVal(fdOrHandle);
+ } else {
+ if (__isSmallInteger(fdOrHandle)) {
+ h = (HANDLE) _get_osfhandle (__intVal(fdOrHandle));
+ } else {
+ goto fail;
+ }
+ }
+ hArray[i] = h;
}
if (__isSmallInteger(millis)) {
- t = __intVal(millis);
+ t = __intVal(millis);
} else {
- t = INFINITE;
+ t = INFINITE;
}
#ifdef DO_WRAP_CALLS
do {
- __threadErrno = 0;
- res = STX_API_CALL4( "WaitForMultipleObjects", WaitForMultipleObjects, count, hArray, FALSE, t);
+ __threadErrno = 0;
+ res = STX_API_CALL4( "WaitForMultipleObjects", WaitForMultipleObjects, count, hArray, FALSE, t);
} while ((res < 0) && (__threadErrno == EINTR));
#else
res = WaitForMultipleObjects(count, hArray, FALSE, t);
if (res < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
+ __threadErrno = __WIN32_ERR(GetLastError());
}
#endif
if (res == WAIT_FAILED) {
- RETURN (nil);
+ RETURN (nil);
}
if (res == WAIT_TIMEOUT) {
- RETURN (nil);
+ RETURN (nil);
}
if ((res >= WAIT_OBJECT_0) && (res < (WAIT_OBJECT_0+count))) {
- RETURN (__ArrayInstPtr(fdOrHandleArray)->a_element[res-WAIT_OBJECT_0]);
+ RETURN (__ArrayInstPtr(fdOrHandleArray)->a_element[res-WAIT_OBJECT_0]);
}
RETURN (nil);
@@ -7399,37 +7399,37 @@
HANDLE h = NULL;
if (__isExternalAddress(fdOrHandle)) {
- h = _HANDLEVal(fdOrHandle);
+ h = _HANDLEVal(fdOrHandle);
} else {
- if (__isSmallInteger(fdOrHandle)) {
- h = (HANDLE) _get_osfhandle (__intVal(fdOrHandle));
- } else {
- goto fail;
- }
+ if (__isSmallInteger(fdOrHandle)) {
+ h = (HANDLE) _get_osfhandle (__intVal(fdOrHandle));
+ } else {
+ goto fail;
+ }
}
if (__isSmallInteger(millis)) {
- t = __intVal(millis);
+ t = __intVal(millis);
} else {
- t = INFINITE;
+ t = INFINITE;
}
#ifdef DO_WRAP_CALLS
do {
- __threadErrno = 0;
- res = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, h, t);
+ __threadErrno = 0;
+ res = STX_API_CALL2( "WaitForSingleObject", WaitForSingleObject, h, t);
} while ((res < 0) && (__threadErrno == EINTR));
#else
res = WaitForSingleObject(h, t);
if (res < 0) {
- __threadErrno = __WIN32_ERR(GetLastError());
+ __threadErrno = __WIN32_ERR(GetLastError());
}
#endif
if (res == WAIT_FAILED) {
- RETURN (nil);
+ RETURN (nil);
}
if (res == WAIT_TIMEOUT) {
- RETURN (nil);
+ RETURN (nil);
}
RETURN (fdOrHandle);
@@ -7445,18 +7445,18 @@
type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT created:cT path:lP alternativeName:name2
^ self basicNew
- type:t mode:m uid:u gid:g size:s
- id:i accessed:aT modified:mT created:cT
- path:lP alternativeName:name2
+ type:t mode:m uid:u gid:g size:s
+ id:i accessed:aT modified:mT created:cT
+ path:lP alternativeName:name2
!
type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT created:cT path:lP fullName:fullName alternativeName:name2
^ self basicNew
- type:t mode:m uid:u gid:g size:s
- id:i accessed:aT modified:mT created:cT
- path:lP
- fullName:fullName
- alternativeName:name2
+ type:t mode:m uid:u gid:g size:s
+ id:i accessed:aT modified:mT created:cT
+ path:lP
+ fullName:fullName
+ alternativeName:name2
! !
!Win32OperatingSystem::FileStatusInfo methodsFor:'accessing'!
@@ -7673,20 +7673,20 @@
[Instance variables:]
- pid <Integer> OS-Process identifier
-
- status <Symbol> either #exit #signal #stop #continue
-
- code <Integer> either exitcode or signalnumber
-
- core <Boolean> true if core has been dumped
+ pid <Integer> OS-Process identifier
+
+ status <Symbol> either #exit #signal #stop #continue
+
+ code <Integer> either exitcode or signalnumber
+
+ core <Boolean> true if core has been dumped
[author:]
- Stefan Vogel
+ Stefan Vogel
[see also:]
- OperatingSystem
+ OperatingSystem
"
! !
@@ -7826,13 +7826,13 @@
rootKeyNames
^ #(
- 'HKEY_CLASSES_ROOT'
- 'HKEY_CURRENT_USER'
- 'HKEY_LOCAL_MACHINE'
- 'HKEY_USERS'
- 'HKEY_PERFORMANCE_DATA'
- 'HKEY_CURRENT_CONFIG'
- 'HKEY_DYN_DATA'
+ 'HKEY_CLASSES_ROOT'
+ 'HKEY_CURRENT_USER'
+ 'HKEY_LOCAL_MACHINE'
+ 'HKEY_USERS'
+ 'HKEY_PERFORMANCE_DATA'
+ 'HKEY_CURRENT_CONFIG'
+ 'HKEY_DYN_DATA'
)
!
@@ -7847,7 +7847,7 @@
Interface to a WIN32 registry.
[author:]
- Claus Gittinger (initial version & cleanup)
+ Claus Gittinger (initial version & cleanup)
"
@@ -7856,131 +7856,131 @@
examples
"
create a key (if not already present):
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'
+ [exEnd]
ask a keys value:
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion'.
- Transcript show:'Windows serial NR:'; showCR:(k valueNamed:'ProductId').
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
- Transcript showCR:(k valueNamed:'CurrentVersion').
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion'.
+ Transcript show:'Windows serial NR:'; showCR:(k valueNamed:'ProductId').
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+ Transcript showCR:(k valueNamed:'CurrentVersion').
+ [exEnd]
create a sub-key (if not already present):
- [exBegin]
- |k subKey|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
- subKey := k createSubKeyNamed:'RegistryDemo'
- [exEnd]
+ [exBegin]
+ |k subKey|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+ subKey := k createSubKeyNamed:'RegistryDemo'
+ [exEnd]
change a keys value:
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
- k valueNamed:'FooBarBaz' put:'a foo bar baz string'.
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
+ k valueNamed:'FooBarBaz' put:'a foo bar baz string'.
+ [exEnd]
delete a value:
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
- k deleteValueNamed:'FooBarBaz'.
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\RegistryDemo'.
+ k deleteValueNamed:'FooBarBaz'.
+ [exEnd]
delete a key:
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
- k deleteSubKeyNamed:'RegistryDemo'.
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'.
+ k deleteSubKeyNamed:'RegistryDemo'.
+ [exEnd]
enumerate keys:
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'.
- k subKeysDo:[:subKey |
- Transcript showCR:subKey path
- ]
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'.
+ k subKeysDo:[:subKey |
+ Transcript showCR:subKey path
+ ]
+ [exEnd]
enumerate all keys (recursive):
- [exBegin]
- |k|
-
- k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'.
- k allSubKeysDo:[:subKey |
- Transcript showCR:subKey path
- ]
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := Win32OperatingSystem::RegistryEntry key:'HKEY_LOCAL_MACHINE\Software'.
+ k allSubKeysDo:[:subKey |
+ Transcript showCR:subKey path
+ ]
+ [exEnd]
fetch value by index:
- [exBegin]
- |k|
-
- k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
- Transcript showCR:(k valueNameAtIndex:0)
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+ Transcript showCR:(k valueNameAtIndex:0)
+ [exEnd]
enumerate value names:
- [exBegin]
- |k|
-
- k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
- k valueNamesDo:[:nm |
- Transcript showCR:nm.
- ]
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+ k valueNamesDo:[:nm |
+ Transcript showCR:nm.
+ ]
+ [exEnd]
enumerate values:
- [exBegin]
- |k|
-
- k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
- k valueNamesAndValuesDo:[:nm :val |
- Transcript showCR:(nm , ' -> ' , val storeString).
- ]
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
+ k valueNamesAndValuesDo:[:nm :val |
+ Transcript showCR:(nm , ' -> ' , val storeString).
+ ]
+ [exEnd]
search for a value (where does NT store the domain ?):
- [exBegin]
- |k|
-
- k := self key:'HKEY_LOCAL_MACHINE\System'.
- k subKeysDo:[:subKey |
- subKey subKeysDo:[:subSubKey |
- |tcp params|
-
- (subSubKey path asLowercase endsWith:'services') ifTrue:[
- tcp := subSubKey subKeyNamed:'tcpip'.
- tcp notNil ifTrue:[
- params := tcp subKeyNamed:'parameters'.
- params notNil ifTrue:[
- Transcript showCR:'Domain is found in ' , params path ,
- ' value: ' , (params valueNamed:'Domain').
- params close.
- ].
- tcp close.
- ]
- ]
- ]
- ]
- [exEnd]
+ [exBegin]
+ |k|
+
+ k := self key:'HKEY_LOCAL_MACHINE\System'.
+ k subKeysDo:[:subKey |
+ subKey subKeysDo:[:subSubKey |
+ |tcp params|
+
+ (subSubKey path asLowercase endsWith:'services') ifTrue:[
+ tcp := subSubKey subKeyNamed:'tcpip'.
+ tcp notNil ifTrue:[
+ params := tcp subKeyNamed:'parameters'.
+ params notNil ifTrue:[
+ Transcript showCR:'Domain is found in ' , params path ,
+ ' value: ' , (params valueNamed:'Domain').
+ params close.
+ ].
+ tcp close.
+ ]
+ ]
+ ]
+ ]
+ [exEnd]
"
@@ -8007,25 +8007,25 @@
HKEY_CLASSES_ROOT isNil ifTrue:[self initialize].
specialKeyStringOrSymbol = 'HKEY_CLASSES_ROOT' ifTrue:[
- ^ HKEY_CLASSES_ROOT.
+ ^ HKEY_CLASSES_ROOT.
].
specialKeyStringOrSymbol = 'HKEY_CURRENT_USER' ifTrue:[
- ^ HKEY_CURRENT_USER.
+ ^ HKEY_CURRENT_USER.
].
specialKeyStringOrSymbol = 'HKEY_LOCAL_MACHINE' ifTrue:[
- ^ HKEY_LOCAL_MACHINE.
+ ^ HKEY_LOCAL_MACHINE.
].
specialKeyStringOrSymbol = 'HKEY_USERS' ifTrue:[
- ^ HKEY_USERS.
+ ^ HKEY_USERS.
].
specialKeyStringOrSymbol = 'HKEY_PERFORMANCE_DATA' ifTrue:[
- ^ HKEY_PERFORMANCE_DATA.
+ ^ HKEY_PERFORMANCE_DATA.
].
specialKeyStringOrSymbol = 'HKEY_CURRENT_CONFIG' ifTrue:[
- ^ HKEY_CURRENT_CONFIG.
+ ^ HKEY_CURRENT_CONFIG.
].
specialKeyStringOrSymbol = 'HKEY_DYN_DATA' ifTrue:[
- ^ HKEY_DYN_DATA.
+ ^ HKEY_DYN_DATA.
].
^ nil
@@ -8046,11 +8046,11 @@
idx :=
idx := aKeyNamePath indexOf:(self separator).
idx == 0 ifTrue:[
- first := aKeyNamePath.
- rest := nil.
+ first := aKeyNamePath.
+ rest := nil.
] ifFalse:[
- first := aKeyNamePath copyTo:idx-1.
- rest := aKeyNamePath copyFrom:idx+1
+ first := aKeyNamePath copyTo:idx-1.
+ rest := aKeyNamePath copyFrom:idx+1
].
first := first asUppercase.
@@ -8058,11 +8058,11 @@
"/ the first is a pseudo name
root := self rootKey:first.
root isNil ifTrue:[
- ^ nil
+ ^ nil
].
rest size == 0 ifTrue:[
- ^ root
+ ^ root
].
^ root subKeyNamed:rest.
@@ -8110,8 +8110,8 @@
"
self
- stringValueFor:'Content Type'
- atKey:'HKEY_CLASSES_ROOT\.au'
+ stringValueFor:'Content Type'
+ atKey:'HKEY_CLASSES_ROOT\.au'
"
! !
@@ -8148,18 +8148,18 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(subKeyString) || __isSymbol(subKeyString))) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegCreateKey(myKey, __stringVal(subKeyString), &subKey) == ERROR_SUCCESS) {
- subHandle = __MKEXTERNALADDRESS(subKey);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegCreateKey(myKey, __stringVal(subKeyString), &subKey) == ERROR_SUCCESS) {
+ subHandle = __MKEXTERNALADDRESS(subKey);
+ }
}
%}.
subHandle notNil ifTrue:[
- newEntry := self class basicNew
- setHandle:subHandle
- path:(path , self class separator asString , subKeyString).
- Lobby register:newEntry.
- ^ newEntry.
+ newEntry := self class basicNew
+ setHandle:subHandle
+ path:(path , self class separator asString , subKeyString).
+ Lobby register:newEntry.
+ ^ newEntry.
].
^ nil
@@ -8180,10 +8180,10 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(subKeyString) || __isSymbol(subKeyString))) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegDeleteKey(myKey, __stringVal(subKeyString)) == ERROR_SUCCESS) {
- RETURN (true);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegDeleteKey(myKey, __stringVal(subKeyString)) == ERROR_SUCCESS) {
+ RETURN (true);
+ }
}
%}.
^ false
@@ -8207,16 +8207,16 @@
HKEY myKey, remoteKey = 0;
if (__isExternalAddress(__INST(handle)) && __isString(hostName)) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegConnectRegistry(__stringVal(hostName), myKey, &remoteKey) == ERROR_SUCCESS) {
- remoteHandle = __MKEXTERNALADDRESS(remoteKey);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegConnectRegistry(__stringVal(hostName), myKey, &remoteKey) == ERROR_SUCCESS) {
+ remoteHandle = __MKEXTERNALADDRESS(remoteKey);
+ }
}
%}.
remoteHandle notNil ifTrue:[
- newEntry := self class basicNew setHandle:remoteHandle path:path.
- Lobby register:newEntry.
- ^ newEntry.
+ newEntry := self class basicNew setHandle:remoteHandle path:path.
+ Lobby register:newEntry.
+ ^ newEntry.
].
^ nil
@@ -8263,18 +8263,18 @@
if (__isExternalAddress(__INST(handle))
&& __isSmallInteger(subKeyIndex)) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegEnumKeyEx(myKey, __intVal(subKeyIndex),
- nameBuffer, &nameSize,
- NULL,
- classNameBuffer, &classNameSize,
- &modificationTime) == ERROR_SUCCESS) {
- nameBuffer[nameSize] = '\0';
- classNameBuffer[classNameSize] = '\0';
- subKeyName = __MKSTRING(nameBuffer);
- subKeyClassName = __MKSTRING(classNameBuffer);
- } else {
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegEnumKeyEx(myKey, __intVal(subKeyIndex),
+ nameBuffer, &nameSize,
+ NULL,
+ classNameBuffer, &classNameSize,
+ &modificationTime) == ERROR_SUCCESS) {
+ nameBuffer[nameSize] = '\0';
+ classNameBuffer[classNameSize] = '\0';
+ subKeyName = __MKSTRING(nameBuffer);
+ subKeyClassName = __MKSTRING(classNameBuffer);
+ } else {
+ }
}
%}.
subKeyName isNil ifTrue:[^ nil].
@@ -8299,18 +8299,18 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(subKeyString) || __isSymbol(subKeyString))) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegOpenKey(myKey, __stringVal(subKeyString), &subKey) == ERROR_SUCCESS) {
- subHandle = __MKEXTERNALADDRESS(subKey);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegOpenKey(myKey, __stringVal(subKeyString), &subKey) == ERROR_SUCCESS) {
+ subHandle = __MKEXTERNALADDRESS(subKey);
+ }
}
%}.
subHandle notNil ifTrue:[
- newEntry := self class basicNew
- setHandle:subHandle
- path:(path , self class separator asString , subKeyString).
- Lobby register:newEntry.
- ^ newEntry.
+ newEntry := self class basicNew
+ setHandle:subHandle
+ path:(path , self class separator asString , subKeyString).
+ Lobby register:newEntry.
+ ^ newEntry.
].
^ nil
@@ -8333,10 +8333,10 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(aValueName) || __isSymbol(aValueName))) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegDeleteValue(myKey, __stringVal(aValueName)) == ERROR_SUCCESS) {
- RETURN (true);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegDeleteValue(myKey, __stringVal(aValueName)) == ERROR_SUCCESS) {
+ RETURN (true);
+ }
}
%}.
^ false
@@ -8356,15 +8356,15 @@
if (__isExternalAddress(__INST(handle))
&& __isSmallInteger(valueIndex)) {
- myKey = (HKEY)__externalAddressVal(__INST(handle));
- if (RegEnumValue(myKey, __intVal(valueIndex),
- nameBuffer, &nameSize,
- NULL,
- &valueType,
- NULL, NULL) == ERROR_SUCCESS) {
- nameBuffer[nameSize] = '\0';
- valueName = __MKSTRING(nameBuffer);
- }
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+ if (RegEnumValue(myKey, __intVal(valueIndex),
+ nameBuffer, &nameSize,
+ NULL,
+ &valueType,
+ NULL, NULL) == ERROR_SUCCESS) {
+ nameBuffer[nameSize] = '\0';
+ valueName = __MKSTRING(nameBuffer);
+ }
}
%}.
^ valueName
@@ -8379,11 +8379,11 @@
valueNamed:aValueName
"retrieve a value; the returned object depends upon the type:
- REG_BINARY -> ByteArray
- REG_SZ -> String
- REG_MULTI_SZ -> Array of strings
- REG_DWORD -> Integer
- REG_NONE -> nil
+ REG_BINARY -> ByteArray
+ REG_SZ -> String
+ REG_MULTI_SZ -> Array of strings
+ REG_DWORD -> Integer
+ REG_NONE -> nil
"
|data stringArray|
@@ -8391,9 +8391,9 @@
HKEY myKey;
DWORD valueType;
union {
- DWORD dWord;
- unsigned char dWordBytes[4];
- unsigned char smallDataBuffer[256];
+ DWORD dWord;
+ unsigned char dWordBytes[4];
+ unsigned char smallDataBuffer[256];
} quickData;
int val;
DWORD dataSize = sizeof(quickData);
@@ -8401,116 +8401,116 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(aValueName) || __isSymbol(aValueName))) {
- int ret;
-
- myKey = (HKEY)__externalAddressVal(__INST(handle));
-
- /*
- * try to get it with one call ...
- */
- ret = RegQueryValueEx(myKey, __stringVal(aValueName),
- NULL,
- &valueType,
- &quickData, &dataSize);
-
- if (ret == ERROR_MORE_DATA) {
- /*
- * nope - need another one ...
- */
- switch (valueType) {
- case REG_BINARY:
- case REG_MULTI_SZ:
- data = __BYTEARRAY_UNINITIALIZED_NEW_INT(dataSize);
- dataBuffer = __ByteArrayInstPtr(data)->ba_element;
- break;
- case REG_SZ:
- data = __MKEMPTYSTRING(dataSize-1);
- dataBuffer = __stringVal(data);
- break;
- }
- if (dataBuffer) {
- ret = RegQueryValueEx(myKey, __stringVal(aValueName),
- NULL,
- &valueType,
- dataBuffer, &dataSize);
- }
- }
-
- if (ret == ERROR_SUCCESS) {
- switch (valueType) {
- case REG_NONE:
- /* RETURN (@symbol(none)); */
- RETURN (nil);
-
- case REG_BINARY:
- /*
- * did we get it with the first call ?
- */
- if (! dataBuffer) {
- data = __MKBYTEARRAY(quickData.smallDataBuffer, dataSize);
- }
- RETURN (data);
-
- case REG_SZ:
- case REG_EXPAND_SZ:
- /*
- * did we get it with the first call ?
- */
- if (! dataBuffer) {
- data = __MKSTRING_L(quickData.smallDataBuffer, dataSize-1);
- }
- RETURN (data);
+ int ret;
+
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+
+ /*
+ * try to get it with one call ...
+ */
+ ret = RegQueryValueEx(myKey, __stringVal(aValueName),
+ NULL,
+ &valueType,
+ &quickData, &dataSize);
+
+ if (ret == ERROR_MORE_DATA) {
+ /*
+ * nope - need another one ...
+ */
+ switch (valueType) {
+ case REG_BINARY:
+ case REG_MULTI_SZ:
+ data = __BYTEARRAY_UNINITIALIZED_NEW_INT(dataSize);
+ dataBuffer = __ByteArrayInstPtr(data)->ba_element;
+ break;
+ case REG_SZ:
+ data = __MKEMPTYSTRING(dataSize-1);
+ dataBuffer = __stringVal(data);
+ break;
+ }
+ if (dataBuffer) {
+ ret = RegQueryValueEx(myKey, __stringVal(aValueName),
+ NULL,
+ &valueType,
+ dataBuffer, &dataSize);
+ }
+ }
+
+ if (ret == ERROR_SUCCESS) {
+ switch (valueType) {
+ case REG_NONE:
+ /* RETURN (@symbol(none)); */
+ RETURN (nil);
+
+ case REG_BINARY:
+ /*
+ * did we get it with the first call ?
+ */
+ if (! dataBuffer) {
+ data = __MKBYTEARRAY(quickData.smallDataBuffer, dataSize);
+ }
+ RETURN (data);
+
+ case REG_SZ:
+ case REG_EXPAND_SZ:
+ /*
+ * did we get it with the first call ?
+ */
+ if (! dataBuffer) {
+ data = __MKSTRING_L(quickData.smallDataBuffer, dataSize-1);
+ }
+ RETURN (data);
#if 0
- case REG_DWORD:
- /* int in native format */
- RETURN (__MKUINT(quickData.dWord));
-#endif
- case REG_DWORD_LITTLE_ENDIAN:
- val = quickData.dWordBytes[3];
- val = (val << 8) | quickData.dWordBytes[2];
- val = (val << 8) | quickData.dWordBytes[1];
- val = (val << 8) | quickData.dWordBytes[0];
- RETURN (__MKUINT(val));
-
- case REG_DWORD_BIG_ENDIAN:
- val = quickData.dWordBytes[0];
- val = (val << 8) | quickData.dWordBytes[1];
- val = (val << 8) | quickData.dWordBytes[2];
- val = (val << 8) | quickData.dWordBytes[3];
- RETURN (__MKUINT(val));
-
- case REG_MULTI_SZ:
- {
- char *cp, *cp0;
- int ns = 0, i;
-
- cp0 = dataBuffer ? dataBuffer : quickData.smallDataBuffer;
- cp = cp0;
- while (*cp) {
- while (*cp++) ;;
- ns++;
- cp++;
- }
- stringArray = __ARRAY_NEW_INT(ns);
-
- i = 0;
- while (*cp0) {
- OBJ s;
-
- cp = cp0;
- while (*cp++) ;;
- s = __MKSTRING(cp0);
- __ArrayInstPtr(stringArray)->a_element[i] = s;
- __STORE(stringArray, s);
- cp++;
- cp0 = cp;
- i++;
- }
- RETURN (stringArray);
- }
- }
- }
+ case REG_DWORD:
+ /* int in native format */
+ RETURN (__MKUINT(quickData.dWord));
+#endif
+ case REG_DWORD_LITTLE_ENDIAN:
+ val = quickData.dWordBytes[3];
+ val = (val << 8) | quickData.dWordBytes[2];
+ val = (val << 8) | quickData.dWordBytes[1];
+ val = (val << 8) | quickData.dWordBytes[0];
+ RETURN (__MKUINT(val));
+
+ case REG_DWORD_BIG_ENDIAN:
+ val = quickData.dWordBytes[0];
+ val = (val << 8) | quickData.dWordBytes[1];
+ val = (val << 8) | quickData.dWordBytes[2];
+ val = (val << 8) | quickData.dWordBytes[3];
+ RETURN (__MKUINT(val));
+
+ case REG_MULTI_SZ:
+ {
+ char *cp, *cp0;
+ int ns = 0, i;
+
+ cp0 = dataBuffer ? dataBuffer : quickData.smallDataBuffer;
+ cp = cp0;
+ while (*cp) {
+ while (*cp++) ;;
+ ns++;
+ cp++;
+ }
+ stringArray = __ARRAY_NEW_INT(ns);
+
+ i = 0;
+ while (*cp0) {
+ OBJ s;
+
+ cp = cp0;
+ while (*cp++) ;;
+ s = __MKSTRING(cp0);
+ __ArrayInstPtr(stringArray)->a_element[i] = s;
+ __STORE(stringArray, s);
+ cp++;
+ cp0 = cp;
+ i++;
+ }
+ RETURN (stringArray);
+ }
+ }
+ }
}
%}.
^ nil
@@ -8525,11 +8525,11 @@
valueNamed:aValueName put:datum
"store a value; the value type depends upon the stored value:
- ByteArray -> REG_BINARY
- String -> REG_SZ
- Array of string -> REG_MULTI_SZ
- Integer -> REG_DWORD
- nil -> REG_NONE
+ ByteArray -> REG_BINARY
+ String -> REG_SZ
+ Array of string -> REG_MULTI_SZ
+ Integer -> REG_DWORD
+ nil -> REG_NONE
"
|data stringArray|
@@ -8543,89 +8543,89 @@
if (__isExternalAddress(__INST(handle))
&& (__isString(aValueName) || __isSymbol(aValueName))) {
- int ret;
- OBJ cls;
-
- myKey = (HKEY)__externalAddressVal(__INST(handle));
-
- if (datum == nil) {
- valueType = REG_NONE;
- dataSize = 0;
- } else if (__isSmallInteger(datum)) {
- valueType = REG_DWORD;
- val = __intVal(datum);
- dataPointer = (unsigned char *)(&val);
- dataSize = sizeof(val);
- } else if (__isString(datum) || __isSymbol(datum)) {
- valueType = REG_SZ;
- dataPointer = __stringVal(datum);
- dataSize = __stringSize(datum) + 1;
- } else if (__Class(datum) == ByteArray) {
- valueType = REG_BINARY;
- dataPointer = __ByteArrayInstPtr(datum)->ba_element;
- dataSize = __byteArraySize(datum);
- } else if (__Class(datum) == LargeInteger) {
- valueType = REG_DWORD;
- val = __longIntVal(datum);
- if (val) {
- dataPointer = (unsigned char *)(&val);
- dataSize = sizeof(val);
- } else {
- datumOk = 0;
- }
- } else if (__Class(datum) == Array) {
- int i = 0, ns = 0, totalSize = 0;
-
- valueType = REG_MULTI_SZ;
-
- /*
- * must allocate a local buffer
- * find size ...
- */
- for (i=0; i<__arraySize(datum); i++) {
- OBJ s = __ArrayInstPtr(datum)->a_element[i];
-
- if (__isString(datum) || __isSymbol(datum)) {
- totalSize += __stringSize(datum) + 1;
- } else {
- datumOk = 0;
- break;
- }
- ns++;
- }
- if (datumOk) {
- char *cp;
-
- /*
- * allocate and fill...
- */
- totalSize ++;
- dataPointer = (char *)(malloc(totalSize));
- mustFreeData = 1;
- cp = dataPointer;
- for (i=0; i<__arraySize(datum); i++) {
- OBJ s = __ArrayInstPtr(datum)->a_element[i];
-
- strcpy(cp, __stringVal(s));
- cp += __stringSize(datum);
- *cp++ = '\0';
- }
- *cp++ = '\0';
- dataSize = totalSize;
- }
- } else {
- datumOk = 0;
- }
-
- if (datumOk) {
- ret = RegSetValueEx(myKey, __stringVal(aValueName),
- 0, valueType,
- dataPointer, dataSize);
- if (mustFreeData) {
- free(dataPointer);
- }
- RETURN ((ret == ERROR_SUCCESS) ? true : false);
- }
+ int ret;
+ OBJ cls;
+
+ myKey = (HKEY)__externalAddressVal(__INST(handle));
+
+ if (datum == nil) {
+ valueType = REG_NONE;
+ dataSize = 0;
+ } else if (__isSmallInteger(datum)) {
+ valueType = REG_DWORD;
+ val = __intVal(datum);
+ dataPointer = (unsigned char *)(&val);
+ dataSize = sizeof(val);
+ } else if (__isString(datum) || __isSymbol(datum)) {
+ valueType = REG_SZ;
+ dataPointer = __stringVal(datum);
+ dataSize = __stringSize(datum) + 1;
+ } else if (__Class(datum) == ByteArray) {
+ valueType = REG_BINARY;
+ dataPointer = __ByteArrayInstPtr(datum)->ba_element;
+ dataSize = __byteArraySize(datum);
+ } else if (__Class(datum) == LargeInteger) {
+ valueType = REG_DWORD;
+ val = __longIntVal(datum);
+ if (val) {
+ dataPointer = (unsigned char *)(&val);
+ dataSize = sizeof(val);
+ } else {
+ datumOk = 0;
+ }
+ } else if (__Class(datum) == Array) {
+ int i = 0, ns = 0, totalSize = 0;
+
+ valueType = REG_MULTI_SZ;
+
+ /*
+ * must allocate a local buffer
+ * find size ...
+ */
+ for (i=0; i<__arraySize(datum); i++) {
+ OBJ s = __ArrayInstPtr(datum)->a_element[i];
+
+ if (__isString(datum) || __isSymbol(datum)) {
+ totalSize += __stringSize(datum) + 1;
+ } else {
+ datumOk = 0;
+ break;
+ }
+ ns++;
+ }
+ if (datumOk) {
+ char *cp;
+
+ /*
+ * allocate and fill...
+ */
+ totalSize ++;
+ dataPointer = (char *)(malloc(totalSize));
+ mustFreeData = 1;
+ cp = dataPointer;
+ for (i=0; i<__arraySize(datum); i++) {
+ OBJ s = __ArrayInstPtr(datum)->a_element[i];
+
+ strcpy(cp, __stringVal(s));
+ cp += __stringSize(datum);
+ *cp++ = '\0';
+ }
+ *cp++ = '\0';
+ dataSize = totalSize;
+ }
+ } else {
+ datumOk = 0;
+ }
+
+ if (datumOk) {
+ ret = RegSetValueEx(myKey, __stringVal(aValueName),
+ 0, valueType,
+ dataPointer, dataSize);
+ if (mustFreeData) {
+ free(dataPointer);
+ }
+ RETURN ((ret == ERROR_SUCCESS) ? true : false);
+ }
}
%}.
^ false
@@ -8647,14 +8647,14 @@
idx := 0.
[true] whileTrue:[
- subEntry := self subKeyAtIndex:idx.
- subEntry isNil ifTrue:[
- ^self
- ].
- aBlock value:subEntry.
- subEntry allSubKeysDo:aBlock.
- subEntry close.
- idx := idx + 1.
+ subEntry := self subKeyAtIndex:idx.
+ subEntry isNil ifTrue:[
+ ^self
+ ].
+ aBlock value:subEntry.
+ subEntry allSubKeysDo:aBlock.
+ subEntry close.
+ idx := idx + 1.
]
"
@@ -8662,7 +8662,7 @@
top := self key:'HKEY_LOCAL_MACHINE'.
top allSubKeysDo:[:subEntry |
- Transcript showCR:subEntry path
+ Transcript showCR:subEntry path
]
"
!
@@ -8694,13 +8694,13 @@
idx := 0.
[true] whileTrue:[
- subEntry := self subKeyAtIndex:idx.
- subEntry isNil ifTrue:[
- ^self
- ].
- aBlock value:subEntry.
- subEntry close.
- idx := idx + 1.
+ subEntry := self subKeyAtIndex:idx.
+ subEntry isNil ifTrue:[
+ ^self
+ ].
+ aBlock value:subEntry.
+ subEntry close.
+ idx := idx + 1.
]
"
@@ -8708,7 +8708,7 @@
top := self key:'HKEY_LOCAL_MACHINE'.
top subKeysDo:[:subEntry |
- Transcript showCR:subEntry path
+ Transcript showCR:subEntry path
]
"
!
@@ -8717,7 +8717,7 @@
"evaluate aBlock for all value names"
self valueNamesDo:[:nm |
- aBlock value:nm value:(self valueNamed:nm)
+ aBlock value:nm value:(self valueNamed:nm)
]
"
@@ -8725,7 +8725,7 @@
key := self key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X'.
key valueNamesAndValuesDo:[:nm :val |
- Transcript showCR:(nm , ' -> ' , val storeString).
+ Transcript showCR:(nm , ' -> ' , val storeString).
]
"
!
@@ -8737,12 +8737,12 @@
idx := 0.
[true] whileTrue:[
- valueName := self valueNameAtIndex:idx.
- valueName isNil ifTrue:[
- ^self
- ].
- aBlock value:valueName.
- idx := idx + 1.
+ valueName := self valueNameAtIndex:idx.
+ valueName isNil ifTrue:[
+ ^self
+ ].
+ aBlock value:valueName.
+ idx := idx + 1.
]
! !
@@ -8764,9 +8764,9 @@
HKEY myKey;
if (__isExternalAddress(__INST(handle))) {
- myKey = (HKEY)(__externalAddressVal(__INST(handle)));
- __INST(handle) = nil;
- RegCloseKey(myKey);
+ myKey = (HKEY)(__externalAddressVal(__INST(handle)));
+ __INST(handle) = nil;
+ RegCloseKey(myKey);
}
%}
!
@@ -8775,7 +8775,7 @@
"some entry has been collected - close it"
handle notNil ifTrue:[
- self closeKey.
+ self closeKey.
]
"Created: / 19.5.1999 / 22:39:52 / cg"
@@ -8802,7 +8802,7 @@
key = __longIntVal(integerHandleValue);
if (! key) {
- RETURN (nil);
+ RETURN (nil);
}
__INST(handle) = t = __MKEXTERNALADDRESS(key); __STORE(self, t);
@@ -8825,7 +8825,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.126 2003-04-01 15:17:39 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.127 2003-04-10 23:39:04 cg Exp $'
! !
!Win32OperatingSystem::Win32FILEHandle methodsFor:'release'!
@@ -8837,8 +8837,8 @@
FILE *f = (FILE *)(__externalAddressVal(self));
if (f) {
- __externalAddressVal(self) = NULL;
- fclose(f);
+ __externalAddressVal(self) = NULL;
+ fclose(f);
}
%}.
! !
@@ -8852,7 +8852,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.126 2003-04-01 15:17:39 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.127 2003-04-10 23:39:04 cg Exp $'
! !
!Win32OperatingSystem::Win32Handle methodsFor:'io'!
@@ -8875,92 +8875,92 @@
BOOL ok;
if ((hFile == 0) || (hFile == INVALID_HANDLE_VALUE)) {
- errSym = @symbol(errorNotOpen);
- goto bad;
+ errSym = @symbol(errorNotOpen);
+ goto bad;
}
if (! __bothSmallInteger(count, firstIndex)) {
- errSym = @symbol(badArgument);
- goto bad;
+ errSym = @symbol(badArgument);
+ goto bad;
}
cntWanted = __smallIntegerVal(count);
if (cntWanted <= 0) {
- errSym = @symbol(badCount);
- goto bad;
+ errSym = @symbol(badCount);
+ goto bad;
}
offs = __smallIntegerVal(firstIndex) - 1;
if (offs < 0) {
- errSym = @symbol(badOffset);
- goto bad;
- }
-
- bufferIsExternalBytes = __isExternalBytes(aByteBuffer);
+ errSym = @symbol(badOffset);
+ goto bad;
+ }
+
+ bufferIsExternalBytes = __isExternalBytesLike(aByteBuffer);
if (! bufferIsExternalBytes) {
- if (__isByteArray(aByteBuffer)) {
- bufferSize = __byteArraySize(aByteBuffer);
- } else if (__isString(aByteBuffer)) {
- bufferSize = __stringSize(aByteBuffer);
- } else {
- errSym = @symbol(badBuffer);
- goto bad;
- }
- if (bufferSize < (cntWanted + offs)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- if (cntWanted <= sizeof(miniBuffer)) {
- extPtr = miniBuffer;
- } else {
- extPtr = malloc(cntWanted);
- mustFreeBuffer = 1;
- }
+ if (__isByteArray(aByteBuffer)) {
+ bufferSize = __byteArraySize(aByteBuffer);
+ } else if (__isString(aByteBuffer)) {
+ bufferSize = __stringSize(aByteBuffer);
+ } else {
+ errSym = @symbol(badBuffer);
+ goto bad;
+ }
+ if (bufferSize < (cntWanted + offs)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ if (cntWanted <= sizeof(miniBuffer)) {
+ extPtr = miniBuffer;
+ } else {
+ extPtr = malloc(cntWanted);
+ mustFreeBuffer = 1;
+ }
} else {
- OBJ sz;
-
- extPtr = (char *)(__externalBytesAddress(aByteBuffer));
- sz = __externalBytesSize(aByteBuffer);
- if (! __isSmallInteger(sz)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- bufferSize = __smallIntegerVal(sz);
- if (bufferSize < (cntWanted + offs)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- extPtr = extPtr + offs;
+ OBJ sz;
+
+ extPtr = (char *)(__externalBytesAddress(aByteBuffer));
+ sz = __externalBytesSize(aByteBuffer);
+ if (! __isSmallInteger(sz)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ bufferSize = __smallIntegerVal(sz);
+ if (bufferSize < (cntWanted + offs)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ extPtr = extPtr + offs;
}
do {
- __threadErrno = 0;
+ __threadErrno = 0;
#ifndef DO_WRAP_CALLS
- ok = ReadFile(hFile, extPtr, cntWanted, &cntRead, 0 /* lpOverlapped */);
+ ok = ReadFile(hFile, extPtr, cntWanted, &cntRead, 0 /* lpOverlapped */);
#else
- ok = __STX_API_CALL5( "ReadFile", ReadFile, hFile, extPtr, cntWanted, &cntRead, 0 /* lpOverlapped */);
+ ok = __STX_API_CALL5( "ReadFile", ReadFile, hFile, extPtr, cntWanted, &cntRead, 0 /* lpOverlapped */);
#endif
} while(__threadErrno == EINTR);
if (ok == TRUE) {
- if (! bufferIsExternalBytes) {
- /* copy over */
- memcpy(__byteArrayVal(aByteBuffer)+offs, extPtr, cntRead);
- if (mustFreeBuffer) {
- free(extPtr);
- }
- }
- RETURN (__mkSmallInteger(cntRead));
+ if (! bufferIsExternalBytes) {
+ /* copy over */
+ memcpy(__byteArrayVal(aByteBuffer)+offs, extPtr, cntRead);
+ if (mustFreeBuffer) {
+ free(extPtr);
+ }
+ }
+ RETURN (__mkSmallInteger(cntRead));
}
errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
bad: ;
if (mustFreeBuffer) {
- free(extPtr);
+ free(extPtr);
}
%}.
errorNumber isNil ifTrue:[
- self error:'invalid argument(s): ', errSym.
+ self error:'invalid argument(s): ', errSym.
] ifFalse:[
- (OperatingSystem errorHolderForNumber:errorNumber) reportError
+ (OperatingSystem errorHolderForNumber:errorNumber) reportError
].
"
@@ -8984,48 +8984,48 @@
INT t;
if ((hFile == 0) || (hFile == INVALID_HANDLE_VALUE)) {
- errSym = @symbol(errorNotOpen);
- goto bad;
+ errSym = @symbol(errorNotOpen);
+ goto bad;
}
#if 0
if (ioctlsocket((SOCKET)hFile, FIONREAD, &res)==0) {
- /* its a socket */
- if (res > 0) {
- RETURN ( false );
- }
+ /* its a socket */
+ if (res > 0) {
+ RETURN ( false );
+ }
}
if (PeekNamedPipe(hFile, 0, 0, 0, &res, 0)) {
- /* its a namedPipe */
- if (res > 0) {
- RETURN ( false );
- }
+ /* its a namedPipe */
+ if (res > 0) {
+ RETURN ( false );
+ }
}
#endif
if (__isSmallInteger(millis)) {
- t = __intVal(millis);
+ t = __intVal(millis);
} else {
- t = INFINITE;
+ t = INFINITE;
}
do {
- __threadErrno = 0;
- res = WaitForSingleObject(hFile, t);
+ __threadErrno = 0;
+ res = WaitForSingleObject(hFile, t);
} while (__threadErrno == EINTR);
switch (res) {
- case WAIT_OBJECT_0:
- /* signalled */
- RETURN ( false );
-
- case WAIT_TIMEOUT:
- /* signalled */
- RETURN ( true );
-
- default:
- case WAIT_ABANDONED:
- errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
- goto bad;
+ case WAIT_OBJECT_0:
+ /* signalled */
+ RETURN ( false );
+
+ case WAIT_TIMEOUT:
+ /* signalled */
+ RETURN ( true );
+
+ default:
+ case WAIT_ABANDONED:
+ errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
+ goto bad;
}
bad: ;
@@ -9040,9 +9040,9 @@
seekTo:newPosition from:whence
"whence is one of:
- #begin
- #current
- #end
+ #begin
+ #current
+ #end
"
|errSym errorNumber|
@@ -9054,42 +9054,42 @@
__uint64__ pos64, newPos64;
if ((hFile == 0) || (hFile == INVALID_HANDLE_VALUE)) {
- errSym = @symbol(errorNotOpen);
- goto bad;
+ errSym = @symbol(errorNotOpen);
+ goto bad;
}
if (whence == @symbol(begin)) {
- moveHow = FILE_BEGIN;
+ moveHow = FILE_BEGIN;
} else if (whence == @symbol(current)) {
- moveHow = FILE_CURRENT;
+ moveHow = FILE_CURRENT;
} else if (whence == @symbol(end)) {
- moveHow = FILE_END;
+ moveHow = FILE_END;
} else {
- errSym = @symbol(badArgument2);
- goto bad;
+ errSym = @symbol(badArgument2);
+ goto bad;
}
if (__signedLong64IntVal(newPosition, &pos64) == 0) {
- errSym = @symbol(badArgument);
- goto bad;
+ errSym = @symbol(badArgument);
+ goto bad;
}
posLo = pos64.lo;
posHi = pos64.hi;
posLo = SetFilePointer(hFile, posLo, &posHi, moveHow);
if (posLo == 0xFFFFFFFF) {
- int lastError;
-
- /* can be either an error, or a valid low-word */
- lastError = GetLastError();
- if (lastError != NO_ERROR) {
- errorNumber = __mkSmallInteger( __WIN32_ERR(lastError) );
- goto bad;
- }
+ int lastError;
+
+ /* can be either an error, or a valid low-word */
+ lastError = GetLastError();
+ if (lastError != NO_ERROR) {
+ errorNumber = __mkSmallInteger( __WIN32_ERR(lastError) );
+ goto bad;
+ }
}
if (posHi == 0) {
- RETURN (__MKUINT( posLo ));
+ RETURN (__MKUINT( posLo ));
}
newPos64.lo = posLo;
newPos64.hi = posHi;
@@ -9100,9 +9100,9 @@
%}.
errorNumber isNil ifTrue:[
- self error:'invalid argument(s): ', errSym.
+ self error:'invalid argument(s): ', errSym.
] ifFalse:[
- (OperatingSystem errorHolderForNumber:errorNumber) reportError
+ (OperatingSystem errorHolderForNumber:errorNumber) reportError
].
!
@@ -9123,86 +9123,86 @@
BOOL ok;
if ((hFile == 0) || (hFile == INVALID_HANDLE_VALUE)) {
- errSym = @symbol(errorNotOpen);
- goto bad;
+ errSym = @symbol(errorNotOpen);
+ goto bad;
}
if (! __bothSmallInteger(count, firstIndex)) {
- errSym = @symbol(badArgument);
- goto bad;
+ errSym = @symbol(badArgument);
+ goto bad;
}
cntWanted = __smallIntegerVal(count);
if (cntWanted <= 0) {
- errSym = @symbol(badCount);
- goto bad;
+ errSym = @symbol(badCount);
+ goto bad;
}
offs = __smallIntegerVal(firstIndex) - 1;
if (offs < 0) {
- errSym = @symbol(badOffset);
- goto bad;
- }
-
- bufferIsExternalBytes = __isExternalBytes(aByteBuffer);
+ errSym = @symbol(badOffset);
+ goto bad;
+ }
+
+ bufferIsExternalBytes = __isExternalBytesLike(aByteBuffer);
if (! bufferIsExternalBytes) {
- if (__isByteArray(aByteBuffer)) {
- bufferSize = __byteArraySize(aByteBuffer);
- } else if (__isString(aByteBuffer)) {
- bufferSize = __stringSize(aByteBuffer);
- } else {
- errSym = @symbol(badBuffer);
- goto bad;
- }
- if (bufferSize < (cntWanted + offs)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- if (cntWanted <= sizeof(miniBuffer)) {
- extPtr = miniBuffer;
- } else {
- extPtr = malloc(cntWanted);
- mustFreeBuffer = 1;
- }
- memcpy(extPtr, __byteArrayVal(aByteBuffer)+offs, cntWanted);
+ if (__isByteArray(aByteBuffer)) {
+ bufferSize = __byteArraySize(aByteBuffer);
+ } else if (__isString(aByteBuffer)) {
+ bufferSize = __stringSize(aByteBuffer);
+ } else {
+ errSym = @symbol(badBuffer);
+ goto bad;
+ }
+ if (bufferSize < (cntWanted + offs)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ if (cntWanted <= sizeof(miniBuffer)) {
+ extPtr = miniBuffer;
+ } else {
+ extPtr = malloc(cntWanted);
+ mustFreeBuffer = 1;
+ }
+ memcpy(extPtr, __byteArrayVal(aByteBuffer)+offs, cntWanted);
} else {
- extPtr = (char *)(__externalBytesAddress(aByteBuffer));
- bufferSize = __externalBytesSize(aByteBuffer);
- if (! __isSmallInteger(bufferSize)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- bufferSize = __smallIntegerVal(bufferSize);
- if (bufferSize < (cntWanted + offs)) {
- errSym = @symbol(badBufferSize);
- goto bad;
- }
- extPtr = extPtr + offs;
+ extPtr = (char *)(__externalBytesAddress(aByteBuffer));
+ bufferSize = __externalBytesSize(aByteBuffer);
+ if (! __isSmallInteger(bufferSize)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ bufferSize = __smallIntegerVal(bufferSize);
+ if (bufferSize < (cntWanted + offs)) {
+ errSym = @symbol(badBufferSize);
+ goto bad;
+ }
+ extPtr = extPtr + offs;
}
do {
- __threadErrno = 0;
+ __threadErrno = 0;
#ifndef DO_WRAP_CALLS
- ok = WriteFile(hFile, extPtr, cntWanted, &cntWritten, 0 /* lpOverlapped */);
+ ok = WriteFile(hFile, extPtr, cntWanted, &cntWritten, 0 /* lpOverlapped */);
#else
- ok = __STX_API_CALL5( "WriteFile", WriteFile, hFile, extPtr, cntWanted, &cntWritten, 0 /* lpOverlapped */);
+ ok = __STX_API_CALL5( "WriteFile", WriteFile, hFile, extPtr, cntWanted, &cntWritten, 0 /* lpOverlapped */);
#endif
} while(__threadErrno == EINTR);
if (ok == TRUE) {
- if (mustFreeBuffer) {
- free(extPtr);
- }
- RETURN (__mkSmallInteger(cntWritten));
+ if (mustFreeBuffer) {
+ free(extPtr);
+ }
+ RETURN (__mkSmallInteger(cntWritten));
}
errorNumber = __mkSmallInteger( __WIN32_ERR(GetLastError()) );
bad: ;
if (mustFreeBuffer) {
- free(extPtr);
+ free(extPtr);
}
%}.
errorNumber isNil ifTrue:[
- self error:'invalid argument(s): ', errSym.
+ self error:'invalid argument(s): ', errSym.
] ifFalse:[
- (OperatingSystem errorHolderForNumber:errorNumber) reportError
+ (OperatingSystem errorHolderForNumber:errorNumber) reportError
].
"
@@ -9230,8 +9230,8 @@
HANDLE h = (HANDLE)(__externalAddressVal(self));
if (h) {
- __externalAddressVal(self) = (HANDLE)0;
- CloseHandle(h);
+ __externalAddressVal(self) = (HANDLE)0;
+ CloseHandle(h);
}
%}.
! !
@@ -9239,7 +9239,7 @@
!Win32OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.126 2003-04-01 15:17:39 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.127 2003-04-10 23:39:04 cg Exp $'
! !
Win32OperatingSystem initialize!