Differences From Artifact [6bda5c55f7]:
- File
src/OFFile.m
— part of check-in
[a30a0ab261]
at
2022-07-31 13:55:49
on branch nintendo-switch
— Add initial socket code for Nintendo Switch
This doesn't work yet (it crashes on recvfrom), so it's not enabled in
configure for now. (user: js, size: 11491) [annotate] [blame] [check-ins using] [more...]
To Artifact [57c941bba1]:
- File src/OFFile.m — part of check-in [e7ab06503c] at 2022-09-28 21:40:00 on branch trunk — Rename OFUR{L -> I} in preparation for URI support (user: js, size: 11913) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
29 30 31 32 33 34 35 | # include <sys/stat.h> #endif #import "OFFile.h" #import "OFLocale.h" #import "OFString.h" #import "OFSystemInfo.h" | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # include <sys/stat.h> #endif #import "OFFile.h" #import "OFLocale.h" #import "OFString.h" #import "OFSystemInfo.h" #import "OFURI.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFNotOpenException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" |
︙ | ︙ | |||
446 447 448 449 450 451 452 | bytesWritten: 0 errNo: errno]; #endif return (size_t)bytesWritten; } | | > | > > > > > > > > > > > > > > > > > > | | | | | | | 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | bytesWritten: 0 errNo: errno]; #endif return (size_t)bytesWritten; } - (OFStreamOffset)lowlevelSeekToOffset: (OFStreamOffset)offset whence: (OFSeekWhence)whence { OFStreamOffset ret; if (_handle == OFInvalidFileHandle) @throw [OFNotOpenException exceptionWithObject: self]; #ifndef OF_AMIGAOS int translatedWhence; switch (whence) { case OFSeekSet: translatedWhence = SEEK_SET; break; case OFSeekCurrent: translatedWhence = SEEK_CUR; break; case OFSeekEnd: translatedWhence = SEEK_END; break; default: @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence errNo: EINVAL]; } # if defined(OF_WINDOWS) ret = _lseeki64(_handle, offset, translatedWhence); # elif defined(HAVE_LSEEK64) ret = lseek64(_handle, offset, translatedWhence); # else ret = lseek(_handle, offset, translatedWhence); # endif if (ret == -1) @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence errNo: errno]; #else LONG translatedWhence; switch (whence) { case OFSeekSet: translatedWhence = OFFSET_BEGINNING; break; case OFSeekCurrent: translatedWhence = OFFSET_CURRENT; break; case OFSeekEnd: translatedWhence = OFFSET_END; break; default: @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence errNo: EINVAL]; |
︙ | ︙ |