Differences From Artifact [7b96bce1bd]:
- File
src/OFSeekableStream.m
— part of check-in
[efe7be259d]
at
2013-02-18 21:53:56
on branch trunk
— Rename -[OFStream pendingBytes].
It is now called -[numberOfBytesInReadBuffer].
Additionally, this commit renames OFStream's _cache to _readBuffer. (user: js, size: 1002) [annotate] [blame] [check-ins using]
To Artifact [7c51ea7ed3]:
- File
src/OFSeekableStream.m
— part of check-in
[d101b6f8b4]
at
2013-08-12 13:26:40
on branch trunk
— Fix OFSeekableStream.
-[seekToOffset:whence:] now works correctly when whence is SEEK_CUR.
Additionally, the new offset is returned now. (user: js, size: 1110) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <stdlib.h> #import "OFSeekableStream.h" @implementation OFSeekableStream | > | | | | > > > | | | > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <stdlib.h> #include <stdio.h> #import "OFSeekableStream.h" @implementation OFSeekableStream - (off_t)lowlevelSeekToOffset: (off_t)offset whence: (int)whence { [self doesNotRecognizeSelector: _cmd]; abort(); } - (off_t)seekToOffset: (off_t)offset whence: (int)whence { if (whence == SEEK_CUR) offset -= _readBufferLength; offset = [self lowlevelSeekToOffset: offset whence: whence]; [self freeMemory: _readBuffer]; _readBuffer = NULL; _readBufferLength = 0; return offset; } @end |