--- a/ExternalStream.st Fri Dec 16 17:49:30 2005 +0100
+++ b/ExternalStream.st Mon Dec 19 17:10:21 2005 +0100
@@ -105,6 +105,7 @@
# undef Set
# undef Signal
# undef Context
+# undef Message
# define NOATOM
# define NOGDICAPMASKS
@@ -158,6 +159,9 @@
# ifdef __DEF_Context
# define Context __DEF_Context
# endif
+# ifdef __DEF_Message
+# define Message __DEF_Message
+# endif
# define INT int
# define off_t long
@@ -2872,10 +2876,10 @@
|bufferSize|
OperatingSystem isMSDOSlike ifTrue:[
- "/ mhmh - NT hangs, when copying bigger blocks to a network drive - why ?
- bufferSize := 1 * 1024.
+ "/ mhmh - NT hangs, when copying bigger blocks to a network drive - why ?
+ bufferSize := 1 * 1024.
] ifFalse:[
- bufferSize := 8 * 1024.
+ bufferSize := 8 * 1024.
].
^ self copyToEndInto:outStream bufferSize:bufferSize
@@ -4109,30 +4113,30 @@
FILE *fdopen();
if (__isSmallInteger(aFileDescriptor) && __isStringLike(openmode)) {
- f = (FILEPOINTER) fdopen(__intVal(aFileDescriptor), (char *)__stringVal(openmode));
- if (f == NULL) {
- __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
- __INST(position) = nil;
- } else {
- if (@global(FileOpenTrace) == true) {
- fprintf(stderr, "fdopen [ExternalStream] %d -> %x\n", __intVal(aFileDescriptor), f);
- }
-
- fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
- __INST(position) = @global(PositionableStream:ZeroPosition);
- retVal = self;
- }
+ f = (FILEPOINTER) fdopen(__intVal(aFileDescriptor), (char *)__stringVal(openmode));
+ if (f == NULL) {
+ __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
+ __INST(position) = nil;
+ } else {
+ if (@global(FileOpenTrace) == true) {
+ fprintf(stderr, "fdopen [ExternalStream] %d -> %x\n", __intVal(aFileDescriptor), f);
+ }
+
+ fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
+ __INST(position) = @global(PositionableStream:ZeroPosition);
+ retVal = self;
+ }
}
%}.
retVal notNil ifTrue:[
- buffered := true. "default is buffered"
- Lobby register:self
+ buffered := true. "default is buffered"
+ Lobby register:self
].
lastErrorNumber notNil ifTrue:[
- "
- the open failed for some reason ...
- "
- ^ self openError
+ "
+ the open failed for some reason ...
+ "
+ ^ self openError
].
^ retVal
!
@@ -4153,35 +4157,35 @@
# ifdef NO_STDIO
f = fopen((char *) __stringVal(aPath), (char *) __stringVal(openModeString));
# else
- __BEGIN_INTERRUPTABLE__
- do {
- f = fopen((char *) __stringVal(aPath), (char *) __stringVal(openModeString));
- } while ((f == NULL) && (__threadErrno == EINTR));
- __END_INTERRUPTABLE__
+ __BEGIN_INTERRUPTABLE__
+ do {
+ f = fopen((char *) __stringVal(aPath), (char *) __stringVal(openModeString));
+ } while ((f == NULL) && (__threadErrno == EINTR));
+ __END_INTERRUPTABLE__
# endif
#else /* UNIX */
- __BEGIN_INTERRUPTABLE__
- do {
- f = fopen((char *) __stringVal(aPath), (char *) __stringVal(openModeString));
- } while ((f == NULL) && (__threadErrno == EINTR));
- __END_INTERRUPTABLE__
+ __BEGIN_INTERRUPTABLE__
+ do {
+ f = fopen((char *) __stringVal(aPath), (char *) __stringVal(openModeString));
+ } while ((f == NULL) && (__threadErrno == EINTR));
+ __END_INTERRUPTABLE__
#endif /* UNIX */
- if (f == NULL) {
- __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
- } else {
- if (@global(FileOpenTrace) == true) {
- fprintf(stderr, "fopen %s [ExternalStream] -> %x\n", __stringVal(aPath), f);
- }
- fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
- ok = true;
- }
+ if (f == NULL) {
+ __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
+ } else {
+ if (@global(FileOpenTrace) == true) {
+ fprintf(stderr, "fopen %s [ExternalStream] -> %x\n", __stringVal(aPath), f);
+ }
+ fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
+ ok = true;
+ }
}
%}.
ok ifFalse:[
- "
- the open failed for some reason ...
- "
- ^ self openError
+ "
+ the open failed for some reason ...
+ "
+ ^ self openError
].
position := ZeroPosition.
Lobby register:self.
@@ -4210,14 +4214,14 @@
FILE *fdopen();
if (__isSmallInteger(anInteger) &&
- __isStringLike(openMode) &&
- (f = fdopen(__intVal(anInteger), __stringVal(openMode))) != 0
+ __isStringLike(openMode) &&
+ (f = fdopen(__intVal(anInteger), __stringVal(openMode))) != 0
) {
- if (@global(FileOpenTrace) == true) {
- fprintf(stderr, "fdopen [ExternalStream] %d -> %x\n", __intVal(anInteger), f);
- }
- fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
- RETURN (self);
+ if (@global(FileOpenTrace) == true) {
+ fprintf(stderr, "fdopen [ExternalStream] %d -> %x\n", __intVal(anInteger), f);
+ }
+ fp = __MKFILEPOINTER(f); __INST(filePointer) = fp; __STORE(self, fp);
+ RETURN (self);
}
%}.
^ self primitiveFailed
@@ -5934,7 +5938,7 @@
!ExternalStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.294 2005-11-28 21:23:08 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.295 2005-12-19 16:10:21 cg Exp $'
! !
ExternalStream initialize!