Changes In Branch 0.1 Through [98f171212d] Excluding Merge-Ins
This is equivalent to a diff from 77092d1160 to 98f171212d
2010-01-04
| ||
14:36 | Add ChangeLog. check-in: 292eaf1b86 user: js tags: 0.1, 0.1.1-release | |
14:29 | Backport a few fixes from default branch to 0.1. check-in: 98f171212d user: js tags: 0.1 | |
2009-12-24
| ||
09:19 | Added tag 0.1-release for changeset 9d5a0c42ccbf check-in: 6e1e487368 user: js tags: trunk | |
09:19 | Merge latest changes from default branch to 0.1 branch. check-in: 80820d91b3 user: js tags: 0.1, 0.1-release | |
09:17 | Change type of object in OFThread to id. check-in: 77092d1160 user: js tags: trunk | |
2009-12-23
| ||
22:38 | Some minor build improvements. check-in: 66f00a133d user: js tags: trunk | |
Deleted TODO version [9b693cca2b].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified src/OFArray.m from [1587b7303a] to [7844cdc05f].
︙ | ︙ | |||
165 166 167 168 169 170 171 | [objs[i] retain]; return new; } - (id)objectAtIndex: (size_t)index { | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | [objs[i] retain]; return new; } - (id)objectAtIndex: (size_t)index { return [[*((OFObject**)[array itemAtIndex: index]) retain] autorelease]; } - (size_t)indexOfObject: (OFObject*)obj { id *objs = [array cArray]; size_t i, count = [array count]; |
︙ | ︙ | |||
202 203 204 205 206 207 208 | return SIZE_MAX; } - (id)firstObject { id *first = [array firstItem]; | | | | | < | | | | | | < < < | < | | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | return SIZE_MAX; } - (id)firstObject { id *first = [array firstItem]; return (first != NULL ? [[*first retain] autorelease] : nil); } - (id)lastObject { id *last = [array lastItem]; return (last != NULL ? [[*last retain] autorelease] : nil); } - (OFString*)componentsJoinedByString: (OFString*)separator { OFString *str; OFString **objs = [array cArray]; size_t i, count = [array count]; IMP append; if (count == 0) return @""; str = [OFMutableString string]; append = [str methodForSelector: @selector(appendString:)]; for (i = 0; i < count - 1; i++) { append(str, @selector(appendString:), objs[i]); append(str, @selector(appendString:), separator); } append(str, @selector(appendString:), objs[i]); return str; } - (BOOL)isEqual: (OFObject*)obj { OFObject **objs, **objs2; size_t i, count, count2; |
︙ | ︙ |
Modified src/OFDictionary.m from [67a9356465] to [7dfec004d5].
︙ | ︙ | |||
471 472 473 474 475 476 477 | for (i = 0; i < size && data[i].key != nil && ![data[i].key isEqual: key]; i++); /* Key not in dictionary */ if (i >= size || ![data[i].key isEqual: key]) return nil; | | | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | for (i = 0; i < size && data[i].key != nil && ![data[i].key isEqual: key]; i++); /* Key not in dictionary */ if (i >= size || ![data[i].key isEqual: key]) return nil; return [[data[i].object retain] autorelease]; } - (size_t)count { return count; } |
︙ | ︙ |
Modified src/OFMutableArray.m from [3bbaec8fd0] to [d5e78125eb].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" #import "OFMutableArray.h" #import "OFExceptions.h" @implementation OFMutableArray - (id)copy { | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" #include <string.h> #import "OFMutableArray.h" #import "OFExceptions.h" @implementation OFMutableArray - (id)copy { |
︙ | ︙ | |||
103 104 105 106 107 108 109 | - removeObject: (OFObject*)obj { OFObject **objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if ([objs[i] isEqual: obj]) { | | > < > | | | > > | > > > > > > | | | > | > | | > > > > > > | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | - removeObject: (OFObject*)obj { OFObject **objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if ([objs[i] isEqual: obj]) { OFObject *obj = objs[i]; [array removeItemAtIndex: i]; [obj release]; } } return self; } - removeObjectIdenticalTo: (OFObject*)obj { OFObject **objs = [array cArray]; size_t i, count = [array count]; for (i = 0; i < count; i++) { if (objs[i] == obj) { [array removeItemAtIndex: i]; [obj release]; } } return self; } - removeObjectAtIndex: (size_t)index { return [self removeNObjects: 1 atIndex: index]; } - removeNObjects: (size_t)nobjects { OFObject **objs = [array cArray], **copy; size_t i, count = [array count]; if (nobjects > count) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: nobjects withSize: sizeof(OFObject*)]; memcpy(copy, objs + (count - nobjects), nobjects * sizeof(OFObject*)); @try { [array removeNItems: nobjects]; for (i = 0; i < nobjects; i++) [copy[i] release]; } @finally { [self freeMemory: copy]; } return self; } - removeNObjects: (size_t)nobjects atIndex: (size_t)index { OFObject **objs = [array cArray], **copy; size_t i, count = [array count]; if (nobjects > count - index) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: nobjects withSize: sizeof(OFObject*)]; memcpy(copy, objs + index, nobjects * sizeof(OFObject*)); @try { [array removeNItems: nobjects atIndex: index]; for (i = 0; i < nobjects; i++) [copy[i] release]; } @finally { [self freeMemory: copy]; } return self; } @end |
Modified src/OFObject.m from [ff3d52f1b1] to [186b25418e].
︙ | ︙ | |||
552 553 554 555 556 557 558 559 560 | + (void)release { } + (void)dealloc { } @end | > > | 552 553 554 555 556 557 558 559 560 561 562 | + (void)release { } + (void)dealloc { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } @end |
Modified src/OFStream.m from [dff3658c98] to [a1881748df].
︙ | ︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | * the packaging of this file. */ #include "config.h" #include <string.h> #include <unistd.h> #import "OFStream.h" #import "OFExceptions.h" #import "OFMacros.h" #ifdef _WIN32 #include <windows.h> | > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | * the packaging of this file. */ #include "config.h" #include <string.h> #include <unistd.h> #include <assert.h> #import "OFStream.h" #import "OFExceptions.h" #import "OFMacros.h" #ifdef _WIN32 #include <windows.h> |
︙ | ︙ | |||
133 134 135 136 137 138 139 | } } } /* Read until we get a newline or \0 */ tmp = [self allocMemoryWithSize: pagesize]; | > | | < < | | | | | | | | | | < < < < | < | | | > | < < < < | | | | < > > > > > > > > > < < < < < | > | | | | | | | | < < < < < < < < < | | | | < < < < | < | | | | | | | | > > > > > > | 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 160 161 162 163 164 165 166 167 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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | } } } /* Read until we get a newline or \0 */ tmp = [self allocMemoryWithSize: pagesize]; @try { for (;;) { if ([self atEndOfStreamWithoutCache]) { if (cache == NULL) return nil; ret = [OFString stringWithCString: cache encoding: encoding length: cache_len]; [self freeMemory: cache]; cache = NULL; cache_len = 0; return ret; } len = [self readNBytesWithoutCache: pagesize intoBuffer: tmp]; /* Look if there's a newline or \0 */ for (i = 0; i < len; i++) { if (OF_UNLIKELY(tmp[i] == '\n' || tmp[i] == '\0')) { ret_len = cache_len + i; ret_c = [self allocMemoryWithSize: ret_len]; if (cache != NULL) memcpy(ret_c, cache, cache_len); memcpy(ret_c + cache_len, tmp, i); @try { ret = [OFString stringWithCString: ret_c encoding: encoding length: ret_len]; } @finally { [self freeMemory: ret_c]; } if (i < len) { tmp2 = [self allocMemoryWithSize: len - i - 1]; memcpy(tmp2, tmp + i + 1, len - i - 1); [self freeMemory: cache]; cache = tmp2; cache_len = len - i - 1; } else { [self freeMemory: cache]; cache = NULL; cache_len = 0; } return ret; } } /* There was no newline or \0 */ cache = [self resizeMemory: cache toSize: cache_len + len]; /* * It's possible that cache_len + len is 0 and thus * cache was set to NULL by resizeMemory:toSize:. */ if (cache != NULL) memcpy(cache + cache_len, tmp, len); cache_len += len; } } @finally { [self freeMemory: tmp]; } /* Get rid of a warning, never reached anyway */ assert(0); } - (size_t)writeNBytes: (size_t)size fromBuffer: (const char*)buf { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; |
︙ | ︙ |
Modified src/OFXMLElement.h from [4746e2975b] to [adf0f56cb4].
1 2 3 4 5 6 7 8 9 10 11 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import "OFString.h" extern int _OFXMLElement_reference; /** * The OFString (OFXMLEscaping) category provides an easy way to escape strings * for use in an XML document. */ @interface OFString (OFXMLEscaping) /** * Escapes a string for use in an XML document. |
︙ | ︙ |
Modified src/OFXMLElement.m from [a7741937ca] to [e26868cc31].
︙ | ︙ | |||
12 13 14 15 16 17 18 | #include "config.h" #include <assert.h> #include <stdlib.h> #include <string.h> #import "OFXMLElement.h" | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include "config.h" #include <assert.h> #include <stdlib.h> #include <string.h> #import "OFXMLElement.h" #import "OFExceptions.h" int _OFXMLElement_reference; @implementation OFString (OFXMLEscaping) - stringByXMLEscaping { char *str_c, *append, *tmp; size_t len, append_len; size_t i, j; OFString *ret; |
︙ | ︙ |
Modified src/OFXMLParser.h from [2d338a54e8] to [58d6fa526d].
1 2 3 4 5 6 7 8 9 10 11 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 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 48 49 50 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import "OFString.h" extern int _OFXMLParser_reference; /** * A protocol that needs to be implemented by delegates for * stringByXMLUnescapingWithHandler:. */ @protocol OFXMLUnescapingDelegate /** * This callback is called when an unknown entity was found while trying to * unescape XML. The callback is supposed to return a substitution for the * entity or nil if it is unknown to the callback as well, in which case an * exception will be thrown. * * \param entity The name of the entity that is unknown * \return A substitution for the entity or nil */ - (OFString*)foundUnknownEntityNamed: (OFString*)entity; @end /** * The OFString (OFXMLUnescaping) category provides methods to unescape XML in * strings. */ @interface OFString (OFXMLUnescaping) /** * Unescapes XML in the string. */ - stringByXMLUnescaping; /** * Unescapes XML in the string and uses the specified handler for unknown * entities. * * \param h An OFXMLUnescapingDelegate as a handler for unknown entities */ - stringByXMLUnescapingWithHandler: (OFObject <OFXMLUnescapingDelegate>*)h; @end |
Modified src/OFXMLParser.m from [a671740547] to [5cb302c78f].
︙ | ︙ | |||
16 17 18 19 20 21 22 | #import "OFXMLParser.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "OFMacros.h" int _OFXMLParser_reference; | < < < < < < < < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #import "OFXMLParser.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "OFMacros.h" int _OFXMLParser_reference; static OF_INLINE OFString* parse_numeric_entity(const char *entity, size_t length) { of_unichar_t c; size_t i; char buf[5]; |
︙ | ︙ | |||
73 74 75 76 77 78 79 | return nil; buf[i] = 0; return [OFString stringWithCString: buf length: i]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | return nil; buf[i] = 0; return [OFString stringWithCString: buf length: i]; } @implementation OFString (OFXMLUnescaping) - stringByXMLUnescaping { return [self stringByXMLUnescapingWithHandler: nil]; } - stringByXMLUnescapingWithHandler: (OFObject <OFXMLUnescapingDelegate>*)h |
︙ | ︙ | |||
582 583 584 585 586 587 588 589 | @throw [OFInvalidEncodingException newWithClass: isa]; [ret appendCStringWithoutUTF8Checking: string + last length: i - last]; return ret; } @end | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 153 154 155 156 157 158 159 160 | @throw [OFInvalidEncodingException newWithClass: isa]; [ret appendCStringWithoutUTF8Checking: string + last length: i - last]; return ret; } @end |
Modified tests/Makefile from [e320f93bcd] to [3171b4bd98].
︙ | ︙ | |||
9 10 11 12 13 14 15 | OFHashes.m \ OFList.m \ OFObject.m \ ${OFPLUGIN_M} \ OFString.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ | < < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | OFHashes.m \ OFList.m \ OFObject.m \ ${OFPLUGIN_M} \ OFString.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ main.m IPHONE_USER = mobile IPHONE_TMP = /tmp/objfw-test .PHONY: run run-tests run-on-iphone run: all |
︙ | ︙ |
Deleted tests/OFXMLElement.m version [b8335657fb].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/OFXMLParser.m version [0c5c8dbd56].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified tests/main.m from [7efaf05c3f] to [8f030396ae].
︙ | ︙ | |||
29 30 31 32 33 34 35 | extern void plugin_tests(); #endif extern void string_tests(); extern void tcpsocket_tests(); #ifdef OF_THREADS extern void thread_tests(); #endif | < < | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | extern void plugin_tests(); #endif extern void string_tests(); extern void tcpsocket_tests(); #ifdef OF_THREADS extern void thread_tests(); #endif static int fails = 0; static void output(OFString *str, int color) { #ifdef STDOUT |
︙ | ︙ | |||
106 107 108 109 110 111 112 | array_tests(); dictionary_tests(); list_tests(); tcpsocket_tests(); #ifdef OF_THREADS thread_tests(); #endif | < < | 104 105 106 107 108 109 110 111 112 113 114 115 116 | array_tests(); dictionary_tests(); list_tests(); tcpsocket_tests(); #ifdef OF_THREADS thread_tests(); #endif #ifdef OF_PLUGINS plugin_tests(); #endif return fails; } |