94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
handle->previous->next = handle->next;
if (handle->next != NULL)
handle->next->previous = handle->previous;
if (firstHandle == handle)
firstHandle = handle->next;
free(handle);
}
OF_DESTRUCTOR()
{
for (OFFileHandle iter = firstHandle; iter != NULL;
iter = iter->next)
Close(iter->handle);
|
|
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
handle->previous->next = handle->next;
if (handle->next != NULL)
handle->next->previous = handle->previous;
if (firstHandle == handle)
firstHandle = handle->next;
OFFreeMemory(handle);
}
OF_DESTRUCTOR()
{
for (OFFileHandle iter = firstHandle; iter != NULL;
iter = iter->next)
Close(iter->handle);
|
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
if (handle == -1)
@throw [OFOpenItemFailedException
exceptionWithPath: path
mode: mode
errNo: errno];
#else
handle = of_alloc(1, sizeof(*handle));
@try {
if ((flags = parseMode(mode.UTF8String,
&handle->append)) == -1)
@throw [OFInvalidArgumentException exception];
if ((handle->handle = Open([path cStringWithEncoding:
[OFLocale encoding]], flags)) == 0) {
|
|
|
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
if (handle == -1)
@throw [OFOpenItemFailedException
exceptionWithPath: path
mode: mode
errNo: errno];
#else
handle = OFAllocMemory(1, sizeof(*handle));
@try {
if ((flags = parseMode(mode.UTF8String,
&handle->append)) == -1)
@throw [OFInvalidArgumentException exception];
if ((handle->handle = Open([path cStringWithEncoding:
[OFLocale encoding]], flags)) == 0) {
|
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
handle->next = firstHandle;
if (firstHandle != NULL)
firstHandle->previous = handle;
firstHandle = handle;
} @catch (id e) {
free(handle);
@throw e;
}
#endif
objc_autoreleasePoolPop(pool);
} @catch (id e) {
[self release];
|
|
|
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
handle->next = firstHandle;
if (firstHandle != NULL)
firstHandle->previous = handle;
firstHandle = handle;
} @catch (id e) {
OFFreeMemory(handle);
@throw e;
}
#endif
objc_autoreleasePoolPop(pool);
} @catch (id e) {
[self release];
|