Comment: | Use more native AmigaOS APIs on AmigaOS 3 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b16fc262c08fb554f7446e77f623295a |
User & Date: | js on 2018-04-23 22:19:10 |
Other Links: | manifest | tags |
2018-04-24
| ||
00:06 | Fix compilation for PSP check-in: ae0899ef7c user: js tags: trunk | |
2018-04-23
| ||
22:19 | Use more native AmigaOS APIs on AmigaOS 3 check-in: b16fc262c0 user: js tags: trunk | |
2018-04-22
| ||
23:42 | Make all tests pass on AmigaOS 3 check-in: 49cb6ada5f user: js tags: trunk | |
Modified src/OFFile.h from [1301722443] to [0217984244].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + - | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFSeekableStream.h" #import "OFKernelEventObserver.h" |
︙ |
Modified src/OFFile.m from [77e3c3a21e] to [8331bd9e6b].
︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + + + + - + | # include <fat.h> #endif #ifdef OF_NINTENDO_DS # include <stdbool.h> # include <filesystem.h> #endif #ifdef OF_AMIGAOS # ifdef OF_AMIGAOS3 # define INTUITION_CLASSES_H # endif # include <proto/dos.h> #endif #ifndef O_BINARY # define O_BINARY 0 #endif #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif #ifndef O_EXCL # define O_EXCL 0 #endif #ifndef O_EXLOCK # define O_EXLOCK 0 #endif |
︙ | |||
99 100 101 102 103 104 105 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | - + | { for (of_file_handle_t iter = firstHandle; iter != NULL; iter = iter->next) Close(iter->handle); } #endif |
︙ | |||
205 206 207 208 209 210 211 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + | { of_file_handle_t handle; @try { void *pool = objc_autoreleasePoolPush(); int flags; |
︙ | |||
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + + + + | @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: errNo]; } if (handle->append) { # ifdef OF_MORPHOS if (Seek64(handle->handle, 0, OFFSET_END) == -1) { # else if (Seek(handle->handle, 0, OFFSET_END) == -1) { # endif Close(handle->handle); @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: EIO]; } } |
︙ | |||
359 360 361 362 363 364 365 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | - + | if (length > UINT_MAX) @throw [OFOutOfRangeException exception]; if ((ret = read(_handle, buffer, (unsigned int)length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: errno]; |
︙ | |||
397 398 399 400 401 402 403 | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | - + + + + + | @throw [OFOutOfRangeException exception]; if ((bytesWritten = write(_handle, buffer, (int)length)) < 0) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: 0 errNo: errno]; |
︙ | |||
441 442 443 444 445 446 447 | 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 | - + + + - + - + - + + - - + + + + + + + - + | whence: (int)whence { of_offset_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; |
︙ |
Modified src/OFFileManager.h from [723dd40210] to [e4831219a2].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + - + - + - + | #import "OFDictionary.h" #import "OFSeekableStream.h" OF_ASSUME_NONNULL_BEGIN /*! @file */ |
︙ |
Modified src/OFFileManager.m from [96795739ab] to [6bf29cf1ec].
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + + + + + | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif |
︙ | |||
94 95 96 97 98 99 100 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | const of_file_type_t of_file_type_symbolic_link = @"of_file_type_symbolic_link"; const of_file_type_t of_file_type_fifo = @"of_file_type_fifo"; const of_file_type_t of_file_type_character_special = @"of_file_type_character_special"; const of_file_type_t of_file_type_block_special = @"of_file_type_block_special"; const of_file_type_t of_file_type_socket = @"of_file_type_socket"; |
︙ | |||
145 146 147 148 149 150 151 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - + | @try { ret = [OFString stringWithUTF16String: buffer]; } @finally { free(buffer); } return ret; |
︙ | |||
400 401 402 403 404 405 406 | 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | - + | @throw [OFInvalidArgumentException exception]; #if defined(OF_WINDOWS) if (_wchdir([path UTF16String]) != 0) @throw [OFChangeCurrentDirectoryPathFailedException exceptionWithPath: path errNo: errno]; |
︙ |
Modified src/OFLocalization.m from [72ae978ca9] to [16040a43d0].
︙ | |||
222 223 224 225 226 227 228 | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + - + + + | /* * Returns an empty string on MorphOS + libnix, but still * applies it so that printf etc. work as expected. */ setlocale(LC_ALL, ""); |
︙ |
Modified src/OFStdIOStream+Private.h from [636bb040e5] to [048a7a1142].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + | */ #import "OFStdIOStream.h" OF_ASSUME_NONNULL_BEGIN @interface OFStdIOStream () |
Modified src/OFStdIOStream.h from [230fa44006] to [25b6014eaa].
︙ | |||
14 15 16 17 18 19 20 | 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 48 49 50 51 52 53 54 55 56 | - + + + + + + + - + - + | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #import "OFKernelEventObserver.h" |
︙ |
Modified src/OFStdIOStream.m from [7f1468fef3] to [6647a44cbe].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - + + + + - + | #endif #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" |
︙ | |||
94 95 96 97 98 99 100 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | - + | objc_autoreleasePoolPop(pool); } @implementation OFStdIOStream #ifndef OF_WINDOWS + (void)load { |
︙ | |||
134 135 136 137 138 139 140 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + | #endif - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | |||
165 166 167 168 169 170 171 | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - + - + | [self close]; [super dealloc]; } - (bool)lowlevelIsAtEndOfStream { |
︙ | |||
220 221 222 223 224 225 226 | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - + | return ret; } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { |
︙ | |||
266 267 268 269 270 271 272 | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + - + | bytesWritten: 0 errNo: EIO]; #endif return (size_t)bytesWritten; } |
︙ | |||
316 317 318 319 320 321 322 | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | - + - + | - (unsigned int)retainCount { return OF_RETAIN_COUNT_MAX; } - (int)columns { |
Modified src/OFSystemInfo.m from [a6ae61b1e9] to [dad22dd462].
︙ | |||
212 213 214 215 216 217 218 219 220 221 222 223 224 225 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | + + | } # endif #elif defined(OF_ANDROID) /* TODO */ #elif defined(OF_MORPHOS) /* TODO */ #elif defined(OF_AMIGAOS4) /* TODO */ #elif defined(OF_AMIGAOS3) /* TODO */ #elif defined(OF_WII) || defined(NINTENDO_3DS) || defined(OF_NINTENDO_DS) || \ defined(OF_PSP) || defined(OF_MSDOS) /* Intentionally nothing */ #elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME) struct utsname utsname; |
︙ |
Modified src/OFThread.m from [6fbe74a9ed] to [19b90357c1].
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + + + + | #ifdef OF_HAVE_SCHED_YIELD # include <sched.h> #endif #include "unistd_wrapper.h" #include "platform.h" |
︙ | |||
80 81 82 83 84 85 86 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - - - | #ifdef OF_HAVE_ATOMIC_OPS # import "atomic.h" #endif #ifdef OF_DJGPP # define lrint(x) rint(x) #endif |
︙ | |||
204 205 206 207 208 209 210 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | - + | rqtp.tv_sec = (time_t)timeInterval; rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000); if (rqtp.tv_sec != floor(timeInterval)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); |
︙ |
Modified src/OFURLHandler_file.m from [398809665b] to [08b70171c7].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - + + + + - + - + - + | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif |
︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | + + + + + + + + | errno = 0; break; } return -1; } # ifdef OF_MORPHOS if (!Examine64(lock, &fib, TAG_DONE)) { # else if (!Examine(lock, &fib)) { # endif UnLock(lock); errno = 0; return -1; } UnLock(lock); # ifdef OF_MORPHOS buffer->st_size = fib.fib_Size64; # else buffer->st_size = fib.fib_Size; # endif buffer->st_mode = (fib.fib_DirEntryType > 0 ? S_IFDIR : S_IFREG); timeInterval = 252460800; /* 1978-01-01 */ locale = OpenLocale(NULL); /* * FIXME: This does not take DST into account. But unfortunately, there |
︙ | |||
168 169 170 171 172 173 174 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + | buffer); #endif } static int of_lstat(OFString *path, of_stat_t *buffer) { |
︙ | |||
656 657 658 659 660 661 662 | 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | - + | path = [URL fileSystemRepresentation]; #if defined(OF_WINDOWS) if (_wmkdir([path UTF16String]) != 0) @throw [OFCreateDirectoryFailedException exceptionWithURL: URL errNo: errno]; |
︙ | |||
758 759 760 761 762 763 764 | 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | - + | if (GetLastError() != ERROR_NO_MORE_FILES) @throw [OFReadFailedException exceptionWithObject: self requestedLength: 0 errNo: EIO]; } @finally { FindClose(handle); } |
︙ | |||
936 937 938 939 940 941 942 | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | - + | [self removeItemAtURL: [OFURL fileURLWithPath: [path stringByAppendingPathComponent: item]]]; objc_autoreleasePoolPop(pool2); } |
︙ | |||
959 960 961 962 963 964 965 | 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 | - + | # endif @throw [OFRemoveItemFailedException exceptionWithURL: URL errNo: errno]; #endif } |
︙ | |||
1095 1096 1097 1098 1099 1100 1101 | 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 | - + | #if defined(OF_WINDOWS) if (_wrename([[source fileSystemRepresentation] UTF16String], [[destination fileSystemRepresentation] UTF16String]) != 0) @throw [OFMoveItemFailedException exceptionWithSourceURL: source destinationURL: destination errNo: errno]; |
︙ |
Modified utils/ofhash/OFHash.m from [f021cb30da] to [58c7926b8d].
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - + | [OFApplication activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif |
︙ |
Modified utils/ofhttp/OFHTTP.m from [de7a31ac42] to [e2bb21d82f].
︙ | |||
392 393 394 395 396 397 398 | 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | - + | [OFApplication activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif |
︙ |
Modified utils/ofzip/OFZIP.m from [8e70d5c643] to [288d6fb85f].
︙ | |||
179 180 181 182 183 184 185 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + | [OFApplication activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif |
︙ |