@@ -60,60 +60,60 @@ [OFWin32ConsoleStdIOStream class]; } #endif #ifdef OF_AMIGAOS -# undef of_stdin -# undef of_stdout -# undef of_stderr +# undef OFStdIn +# undef OFStdOut +# undef OFStdErr #endif -OFStdIOStream *of_stdin = nil; -OFStdIOStream *of_stdout = nil; -OFStdIOStream *of_stderr = nil; +OFStdIOStream *OFStdIn = nil; +OFStdIOStream *OFStdOut = nil; +OFStdIOStream *OFStdErr = nil; #ifdef OF_AMIGAOS OFStdIOStream ** -of_stdin_ref(void) +OFStdInRef(void) { - return &of_stdin; + return &OFStdIn; } OFStdIOStream ** -of_stdout_ref(void) +OFStdOutRef(void) { - return &of_stdout; + return &OFStdOut; } OFStdIOStream ** -of_stderr_ref(void) +OFStdErrRef(void) { - return &of_stderr; + return &OFStdErr; } #endif #ifdef OF_AMIGAOS OF_DESTRUCTOR() { - [of_stdin dealloc]; - [of_stdout dealloc]; - [of_stderr dealloc]; + [OFStdIn dealloc]; + [OFStdOut dealloc]; + [OFStdErr dealloc]; } #endif void -of_log(OFConstantString *format, ...) +OFLog(OFConstantString *format, ...) { va_list arguments; va_start(arguments, format); - of_logv(format, arguments); + OFLogV(format, arguments); va_end(arguments); } void -of_logv(OFConstantString *format, va_list arguments) +OFLogV(OFConstantString *format, va_list arguments) { void *pool = objc_autoreleasePoolPush(); OFDate *date; OFString *dateString, *me, *msg; @@ -126,12 +126,12 @@ #endif msg = [[[OFString alloc] initWithFormat: format arguments: arguments] autorelease]; - [of_stderr writeFormat: @"[%@.%03d %@(%d)] %@\n", dateString, - date.microsecond / 1000, me, getpid(), msg]; + [OFStdErr writeFormat: @"[%@.%03d %@(%d)] %@\n", dateString, + date.microsecond / 1000, me, getpid(), msg]; objc_autoreleasePoolPop(pool); } #ifdef HAVE_ISATTY @@ -184,17 +184,16 @@ # ifndef OF_AMIGAOS int fd; if ((fd = fileno(stdin)) >= 0) - of_stdin = [[OFStdIOStream alloc] - of_initWithFileDescriptor: fd]; + OFStdIn = [[OFStdIOStream alloc] of_initWithFileDescriptor: fd]; if ((fd = fileno(stdout)) >= 0) - of_stdout = [[OFStdIOStream alloc] + OFStdOut = [[OFStdIOStream alloc] of_initWithFileDescriptor: fd]; if ((fd = fileno(stderr)) >= 0) - of_stderr = [[OFStdIOStream alloc] + OFStdErr = [[OFStdIOStream alloc] of_initWithFileDescriptor: fd]; # else BPTR input, output, error; bool inputClosable = false, outputClosable = false, errorClosable = false; @@ -216,16 +215,16 @@ if (error == 0) { error = Open("*", MODE_OLDFILE); errorClosable = true; } - of_stdin = [[OFStdIOStream alloc] of_initWithHandle: input - closable: inputClosable]; - of_stdout = [[OFStdIOStream alloc] of_initWithHandle: output - closable: outputClosable]; - of_stderr = [[OFStdIOStream alloc] of_initWithHandle: error - closable: errorClosable]; + OFStdIn = [[OFStdIOStream alloc] of_initWithHandle: input + closable: inputClosable]; + OFStdOut = [[OFStdIOStream alloc] of_initWithHandle: output + closable: outputClosable]; + OFStdErr = [[OFStdIOStream alloc] of_initWithHandle: error + closable: errorClosable]; # endif } #endif - (instancetype)init @@ -241,12 +240,11 @@ _fd = fd; return self; } #else -- (instancetype)of_initWithHandle: (BPTR)handle - closable: (bool)closable +- (instancetype)of_initWithHandle: (BPTR)handle closable: (bool)closable { self = [super init]; _handle = handle; _closable = closable; @@ -277,12 +275,11 @@ @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void *)buffer - length: (size_t)length +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; #ifndef OF_AMIGAOS if (_fd == -1) @@ -319,12 +316,11 @@ _atEndOfStream = true; return ret; } -- (size_t)lowlevelWriteBuffer: (const void *)buffer - length: (size_t)length +- (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { #ifndef OF_AMIGAOS if (_fd == -1) @throw [OFNotOpenException exceptionWithObject: self]; @@ -417,11 +413,11 @@ { } - (unsigned int)retainCount { - return OF_RETAIN_COUNT_MAX; + return OFMaxRetainCount; } - (bool)hasTerminal { #ifdef HAVE_ISATTY @@ -527,11 +523,11 @@ [self writeFormat: @"\033[%uG", column + 1]; #endif } -- (void)setCursorPosition: (of_point_t)position +- (void)setCursorPosition: (OFPoint)position { if (position.x < 0 || position.y < 0) @throw [OFInvalidArgumentException exception]; #ifdef HAVE_ISATTY @@ -541,11 +537,11 @@ [self writeFormat: @"\033[%u;%uH", (unsigned)position.y + 1, (unsigned)position.x + 1]; #endif } -- (void)setRelativeCursorPosition: (of_point_t)position +- (void)setRelativeCursorPosition: (OFPoint)position { #ifdef HAVE_ISATTY if (!isatty(_fd)) return;