Comment: | Merge a few changesets from the default branch into the 0.2 branch.
Changesets: |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | 0.2 |
Files: | files | file ages | folders |
SHA3-256: |
b91a8283fe3028673ac690c3b4f2c739 |
User & Date: | js on 2010-03-05 11:52:18 |
Other Links: | branch diff | manifest | tags |
2010-03-14
| ||
12:20 | Remove 8782d412a4a6 from 0.2 branch as it would break the 0.2 API. check-in: d7233b1b30 user: js tags: 0.2 | |
2010-03-05
| ||
11:52 | Merge a few changesets from the default branch into the 0.2 branch. check-in: b91a8283fe user: js tags: 0.2 | |
2010-02-12
| ||
22:10 | Fix version in configure.ac in 0.2 branch. check-in: f8c1ad44a4 user: js tags: 0.2 | |
Modified Makefile from [541a9e3c5e] to [3cd5456a36].
︙ | ︙ | |||
28 29 30 31 32 33 34 | if rm -f ${DESTDIR}${bindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done | > > > > > > > > > > > > > > > > > > | 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 | if rm -f ${DESTDIR}${bindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done tarball: V=$$(fgrep VERSION= objfw-config.in | sed 's/VERSION="\(.*\)"/\1/'); \ V2=$$(fgrep AC_INIT configure.ac | \ sed 's/AC_INIT([^,]*,\([^,]*\),.*/\1/' | sed 's/ //'); \ if test x"$$V" != x"$$V2"; then \ echo "objfw-config.h.in and configure.ac version mismatch!"; \ exit 1; \ fi; \ echo "Generating tarball for version $$V..."; \ rm -f objfw-$$V.tar.gz; \ rm -fr objfw-$$V; \ hg archive objfw-$$V; \ cp configure config.h.in objfw-$$V; \ cd objfw-$$V && rm -f .hg_archival.txt .hgignore .hgtags && cd ..; \ tar cf objfw-$$V.tar objfw-$$V; \ gzip -9 objfw-$$V.tar; \ rm -fr objfw-$$V |
Modified generators/TableGenerator.h from [2450591494] to [01e4424f24].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified generators/TableGenerator.m from [20d7922a86] to [d89cfa703e].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified generators/copyright.h from [99948bfa61] to [f270ee9eeb].
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* * Copyright (c) 2008 - 2010 * 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" #define COPYRIGHT \ @"/*\n" \ @" * Copyright (c) 2008 - 2010\n" \ @" * Jonathan Schleifer <js@webkeks.org>\n" \ @" *\n" \ @" * All rights reserved.\n" \ @" *\n" \ @" * This file is part of ObjFW. It may be distributed under the terms " \ @"of the\n" \ @" * Q Public License 1.0, which can be found in the file LICENSE " \ |
︙ | ︙ |
Modified generators/main.m from [b95881268d] to [00dd64a59b].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFArray.h from [3e0b6e88ce] to [e488c32fdc].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 <stdarg.h> #import "OFObject.h" #import "OFEnumerator.h" @class OFDataArray; @class OFString; /** * \brief A class for storing objects in an array. */ @interface OFArray: OFObject <OFCopying, OFMutableCopying, OFFastEnumeration> { OFDataArray *array; } /** |
︙ | ︙ | |||
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | /** * \return An OFEnumerator to enumarate through the array's objects */ - (OFEnumerator*)enumerator; @end @interface OFArrayEnumerator: OFEnumerator { OFDataArray *array; size_t count; unsigned long mutations; unsigned long *mutations_ptr; size_t pos; } - initWithDataArray: (OFDataArray*)data mutationsPointer: (unsigned long*)mutations_ptr; @end #import "OFMutableArray.h" | > > | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /** * \return An OFEnumerator to enumarate through the array's objects */ - (OFEnumerator*)enumerator; @end /// \cond internal @interface OFArrayEnumerator: OFEnumerator { OFDataArray *array; size_t count; unsigned long mutations; unsigned long *mutations_ptr; size_t pos; } - initWithDataArray: (OFDataArray*)data mutationsPointer: (unsigned long*)mutations_ptr; @end /// \endcond #import "OFMutableArray.h" |
Modified src/OFArray.m from [56c9de1a04] to [323e66f686].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | 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); | > > | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | OFString *str; OFString **objs = [array cArray]; size_t i, count = [array count]; IMP append; if (count == 0) return @""; if (count == 1) return [objs[0] retain]; 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); |
︙ | ︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | [array release]; [super dealloc]; } @end @implementation OFArrayEnumerator - initWithDataArray: (OFDataArray*)array_ mutationsPointer: (unsigned long*)mutations_ptr_; { self = [super init]; array = array_; | > | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | [array release]; [super dealloc]; } @end /// \cond internal @implementation OFArrayEnumerator - initWithDataArray: (OFDataArray*)array_ mutationsPointer: (unsigned long*)mutations_ptr_; { self = [super init]; array = array_; |
︙ | ︙ | |||
354 355 356 357 358 359 360 | @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; return self; } @end | > | 357 358 359 360 361 362 363 364 | @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; return self; } @end /// \endcond |
Modified src/OFAutoreleasePool.h from [049148d03d] to [6a7b6de75c].
1 | /* | | > > | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" @class OFMutableArray; /** * \brief A pool that keeps track of objects to release. * * The OFAutoreleasePool class is a class that keeps track of objects that will * be released when the autorelease pool is released. * * Every thread has its own stack of autorelease pools. */ @interface OFAutoreleasePool: OFObject { |
︙ | ︙ |
Modified src/OFAutoreleasePool.m from [25082e063b] to [86ca3a0b16].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFConstString.h from [1fa39e7915] to [2d731ff292].
1 | /* | | | | 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 - 2010 * 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" #ifdef OF_APPLE_RUNTIME extern void *_OFConstStringClassReference; #endif /** * \brief A class for storing constant strings using the \@"" literal. */ @interface OFConstString: OFString {} @end |
Modified src/OFConstString.m from [d9b21f0f8e] to [c022cc131e].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFDataArray.h from [f2ebd3c096] to [fb357534a5].
1 | /* | | | | 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 - 2010 * 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 "OFObject.h" /** * \brief A class for storing arbitrary data in an array. * * If you plan to store large hunks of data, you should consider using * OFBigDataArray, which allocates the memory in pages rather than in bytes. */ @interface OFDataArray: OFObject <OFCopying> { char *data; |
︙ | ︙ | |||
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | * \param index The index at which the items are removed */ - removeNItems: (size_t)nitems atIndex: (size_t)index; @end /** * The OFBigDataArray class is a class for storing arbitrary data in an array * and is designed to store large hunks of data. Therefore, it allocates * memory in pages rather than a chunk of memory for each item. */ @interface OFBigDataArray: OFDataArray <OFCopying> { size_t size; } @end | > > | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | * \param index The index at which the items are removed */ - removeNItems: (size_t)nitems atIndex: (size_t)index; @end /** * \brief A class for storing arbitrary big data in an array. * * The OFBigDataArray class is a class for storing arbitrary data in an array * and is designed to store large hunks of data. Therefore, it allocates * memory in pages rather than a chunk of memory for each item. */ @interface OFBigDataArray: OFDataArray <OFCopying> { size_t size; } @end |
Modified src/OFDataArray.m from [b89c31d500] to [420dcbfc8c].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFDictionary.h from [bbde3d4fc4] to [21f4bb0265].
1 | /* | | > > | | 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 | /* * Copyright (c) 2008 - 2010 * 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 <stdarg.h> #import "OFObject.h" #import "OFEnumerator.h" @class OFArray; /// \cond internal struct of_dictionary_bucket { OFObject <OFCopying> *key; OFObject *object; uint32_t hash; }; /// \endcond /** * \brief A class for storing objects in a hash table. */ @interface OFDictionary: OFObject <OFCopying, OFMutableCopying, OFFastEnumeration> { struct of_dictionary_bucket *data; size_t size; size_t count; |
︙ | ︙ | |||
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 | /** * \return An OFEnumerator to enumerate through the dictionary's keys */ - (OFEnumerator*)keyEnumerator; @end @interface OFDictionaryEnumerator: OFEnumerator { struct of_dictionary_bucket *data; size_t size; unsigned long mutations; unsigned long *mutations_ptr; size_t pos; } - initWithData: (struct of_dictionary_bucket*)data size: (size_t)size mutationsPointer: (unsigned long*)mutations_ptr; @end @interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator @end @interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator @end #import "OFMutableDictionary.h" | > > | 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 | /** * \return An OFEnumerator to enumerate through the dictionary's keys */ - (OFEnumerator*)keyEnumerator; @end /// \cond internal @interface OFDictionaryEnumerator: OFEnumerator { struct of_dictionary_bucket *data; size_t size; unsigned long mutations; unsigned long *mutations_ptr; size_t pos; } - initWithData: (struct of_dictionary_bucket*)data size: (size_t)size mutationsPointer: (unsigned long*)mutations_ptr; @end @interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator @end @interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator @end /// \endcond #import "OFMutableDictionary.h" |
Modified src/OFDictionary.m from [c81ffb2e26] to [b35f643373].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
581 582 583 584 585 586 587 588 589 590 591 592 593 594 | OF_HASH_FINALIZE(hash); return hash; } @end @implementation OFDictionaryEnumerator - initWithData: (struct of_dictionary_bucket*)data_ size: (size_t)size_ mutationsPointer: (unsigned long*)mutations_ptr_ { self = [super init]; | > | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | OF_HASH_FINALIZE(hash); return hash; } @end /// \cond internal @implementation OFDictionaryEnumerator - initWithData: (struct of_dictionary_bucket*)data_ size: (size_t)size_ mutationsPointer: (unsigned long*)mutations_ptr_ { self = [super init]; |
︙ | ︙ | |||
636 637 638 639 640 641 642 | if (pos < size) return data[pos++].key; else return nil; } @end | > | 637 638 639 640 641 642 643 644 | if (pos < size) return data[pos++].key; else return nil; } @end /// \endcond |
Modified src/OFEnumerator.h from [95bf700ece] to [aacddc389e].
1 | /* | | | | 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 - 2010 * 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 "OFObject.h" /** * \brief A class which provides methods to enumerate through collections. */ @interface OFEnumerator: OFObject {} /** * \return The next object */ - (id)nextObject; |
︙ | ︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | * This needs to be exactly like this because it's hardcoded in the compiler. * * We need this bad check to see if we already imported Cocoa, which defines * this as well. */ #define of_fast_enumeration_state_t NSFastEnumerationState #ifndef NSINTEGER_DEFINED typedef struct __of_fast_enumeration_state { unsigned long state; id *itemsPtr; unsigned long *mutationsPtr; unsigned long extra[5]; } of_fast_enumeration_state_t; #endif /** * The OFFastEnumeration protocol needs to be implemented by all classes * supporting fast enumeration. */ @protocol OFFastEnumeration - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state objects: (id*)objects count: (int)count; @end | > > > > > > > > > | 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 57 58 59 60 61 62 63 | * This needs to be exactly like this because it's hardcoded in the compiler. * * We need this bad check to see if we already imported Cocoa, which defines * this as well. */ #define of_fast_enumeration_state_t NSFastEnumerationState #ifndef NSINTEGER_DEFINED /** * \brief State information for fast enumerations. */ typedef struct __of_fast_enumeration_state { /// Arbitrary state information for the enumeration unsigned long state; /// Pointer to a C array of objects to return id *itemsPtr; /// Arbitrary state information to detect mutations unsigned long *mutationsPtr; /// Additional arbitrary state information unsigned long extra[5]; } of_fast_enumeration_state_t; #endif /** * \brief A protocol for fast enumeration. * * The OFFastEnumeration protocol needs to be implemented by all classes * supporting fast enumeration. */ @protocol OFFastEnumeration - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state objects: (id*)objects count: (int)count; @end |
Modified src/OFEnumerator.m from [654fa1e987] to [34e5a244ab].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFExceptions.h from [84921b5752] to [55b101ef73].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 <sys/stat.h> #import "OFObject.h" @class OFString; /** * \brief An exception indicating an object could not be allocated. * * This exception is preallocated, as if there's no memory, no exception can * be allocated of course. That's why you shouldn't and even can't deallocate * it. * * This is the only exception that is not an OFException as it's special. * It does not know for which class allocation failed and it should not be |
︙ | ︙ | |||
37 38 39 40 41 42 43 | /** * \return An error message for the exception as a string */ - (OFString*)string; @end /** | > > | > | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | /** * \return An error message for the exception as a string */ - (OFString*)string; @end /** * \brief The base class for all exceptions in ObjFW * * The OFException class is the base class for all exceptions in ObjFW, except * the OFAllocFailedException. * * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased * either! You have to make sure to dealloc the exception in your \@catch block! */ @interface OFException: OFObject { Class class_; |
︙ | ︙ | |||
76 77 78 79 80 81 82 | /** * \return An error message for the exception as a string */ - (OFString*)string; @end /** | | | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | /** * \return An error message for the exception as a string */ - (OFString*)string; @end /** * \brief An exception indicating there is not enough memory available. */ @interface OFOutOfMemoryException: OFException { size_t req_size; } /** |
︙ | ︙ | |||
108 109 110 111 112 113 114 | /** * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @end /** | | > | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | /** * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @end /** * \brief An exception indicating that a mutation was detected while * enumerating. */ @interface OFEnumerationMutationException: OFException {} @end /** * \brief An exception indicating the given memory is not part of the object. */ @interface OFMemoryNotPartOfObjectException: OFException { void *pointer; } /** |
︙ | ︙ | |||
146 147 148 149 150 151 152 | /** * \return A pointer to the memory which is not part of the object */ - (void*)pointer; @end /** | | > | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | /** * \return A pointer to the memory which is not part of the object */ - (void*)pointer; @end /** * \brief An exception indicating that a method or part of it is not * implemented. */ @interface OFNotImplementedException: OFException { SEL selector; } /** |
︙ | ︙ | |||
173 174 175 176 177 178 179 | * \return An initialized not implemented exception */ - initWithClass: (Class)class_ selector: (SEL)selector; @end /** | | | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | * \return An initialized not implemented exception */ - initWithClass: (Class)class_ selector: (SEL)selector; @end /** * \brief An exception indicating the given value is out of range. */ @interface OFOutOfRangeException: OFException {} @end /** * \brief An exception indicating that the argument is invalid for this method. */ @interface OFInvalidArgumentException: OFException { SEL selector; } /** |
︙ | ︙ | |||
206 207 208 209 210 211 212 | * \return An initialized invalid argument exception */ - initWithClass: (Class)class_ selector: (SEL)selector; @end /** | | | | > | | | 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 246 247 248 249 250 | * \return An initialized invalid argument exception */ - initWithClass: (Class)class_ selector: (SEL)selector; @end /** * \brief An exception indicating that the encoding is invalid for this object. */ @interface OFInvalidEncodingException: OFException {} @end /** * \brief An exception indicating that the format is invalid. */ @interface OFInvalidFormatException: OFException {} @end /** * \brief An exception indicating that a parser encountered malformed or * invalid XML. */ @interface OFMalformedXMLException: OFException {} @end /** * \brief An exception indicating that initializing something failed. */ @interface OFInitializationFailedException: OFException {} @end /** * \brief An exception indicating the file couldn't be opened. */ @interface OFOpenFileFailedException: OFException { OFString *path; OFString *mode; int err; } |
︙ | ︙ | |||
278 279 280 281 282 283 284 | /** * \return A string of the mode in which the file should have been opened */ - (OFString*)mode; @end /** | | | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | /** * \return A string of the mode in which the file should have been opened */ - (OFString*)mode; @end /** * \brief An exception indicating a read or write to the file failed. */ @interface OFReadOrWriteFailedException: OFException { size_t req_size; int err; } |
︙ | ︙ | |||
316 317 318 319 320 321 322 | /** * \return The requested size of the data that couldn't be read / written */ - (size_t)requestedSize; @end /** | | | | | 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 | /** * \return The requested size of the data that couldn't be read / written */ - (size_t)requestedSize; @end /** * \brief An exception indicating a read on a file failed. */ @interface OFReadFailedException: OFReadOrWriteFailedException {} @end /** * \brief An exception indicating a write to a file failed. */ @interface OFWriteFailedException: OFReadOrWriteFailedException {} @end /** * \brief An exception indicating that changing the mode of a file failed. */ @interface OFChangeFileModeFailedException: OFException { OFString *path; mode_t mode; int err; } |
︙ | ︙ | |||
377 378 379 380 381 382 383 | * \return The new mode for the file */ - (mode_t)mode; @end #ifndef _WIN32 /** | | | 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | * \return The new mode for the file */ - (mode_t)mode; @end #ifndef _WIN32 /** * \brief An exception indicating that changing the owner of a file failed. */ @interface OFChangeFileOwnerFailedException: OFException { OFString *path; uid_t owner; gid_t group; int err; |
︙ | ︙ | |||
436 437 438 439 440 441 442 | * \return The new group for the file */ - (gid_t)group; @end #endif /** | | | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | * \return The new group for the file */ - (gid_t)group; @end #endif /** * \brief An exception indicating that renaming a file failed. */ @interface OFRenameFileFailedException: OFException { OFString *from; OFString *to; int err; } |
︙ | ︙ | |||
484 485 486 487 488 489 490 | /** * \return The new path */ - (OFString*)to; @end /** | | | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | /** * \return The new path */ - (OFString*)to; @end /** * \brief An exception indicating that deleting a file failed. */ @interface OFDeleteFileFailedException: OFException { OFString *path; int err; } |
︙ | ︙ | |||
523 524 525 526 527 528 529 | * \return The path of the file */ - (OFString*)path; @end #ifndef _WIN32 /** | | | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | * \return The path of the file */ - (OFString*)path; @end #ifndef _WIN32 /** * \brief An exception indicating that creating a link failed. */ @interface OFLinkFailedException: OFException { OFString *src; OFString *dest; int err; } |
︙ | ︙ | |||
571 572 573 574 575 576 577 | /** * \return A string of the destination for the link */ - (OFString*)destination; @end /** | | | 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | /** * \return A string of the destination for the link */ - (OFString*)destination; @end /** * \brief An exception indicating that creating a symlink failed. */ @interface OFSymlinkFailedException: OFException { OFString *src; OFString *dest; int err; } |
︙ | ︙ | |||
620 621 622 623 624 625 626 | * \return A string of the destination for the symlink */ - (OFString*)destination; @end #endif /** | | | | | | | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | * \return A string of the destination for the symlink */ - (OFString*)destination; @end #endif /** * \brief An exception indicating that setting an option failed. */ @interface OFSetOptionFailedException: OFException {} @end /** * \brief An exception indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException {} @end /** * \brief An exception indicating an attempt to connect or bind an already * connected or bound socket. */ @interface OFAlreadyConnectedException: OFException {} @end /** * \brief An exception indicating the translation of an address failed. */ @interface OFAddressTranslationFailedException: OFException { OFString *node; OFString *service; int err; } |
︙ | ︙ | |||
687 688 689 690 691 692 693 | /** * \return The service of the node for which translation was requested */ - (OFString*)service; @end /** | | | 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | /** * \return The service of the node for which translation was requested */ - (OFString*)service; @end /** * \brief An exception indicating that the connection could not be established. */ @interface OFConnectionFailedException: OFException { OFString *node; OFString *service; int err; } |
︙ | ︙ | |||
735 736 737 738 739 740 741 | /** * \return The service on the node to which the connection failed */ - (OFString*)service; @end /** | | | 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 | /** * \return The service on the node to which the connection failed */ - (OFString*)service; @end /** * \brief An exception indicating that binding the socket failed. */ @interface OFBindFailedException: OFException { OFString *node; OFString *service; int family; int err; |
︙ | ︙ | |||
793 794 795 796 797 798 799 | /** * \return The family for which binding failed */ - (int)family; @end /** | | | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | /** * \return The family for which binding failed */ - (int)family; @end /** * \brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException { int backlog; int err; } |
︙ | ︙ | |||
831 832 833 834 835 836 837 | /** * \return The requested back log. */ - (int)backLog; @end /** | | | | | | | 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 | /** * \return The requested back log. */ - (int)backLog; @end /** * \brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException { int err; } /** * \return The errno from when the exception was created */ - (int)errNo; @end /** * \brief An exception indicating that joining the thread failed. */ @interface OFThreadJoinFailedException: OFException {} @end /** * \brief An exception indicating that locking a mutex failed. */ @interface OFMutexLockFailedException: OFException {} @end /** * \brief An exception indicating that unlocking a mutex failed. */ @interface OFMutexUnlockFailedException: OFException {} @end /** * \brief An exception indicating that the hash has already been calculated. */ @interface OFHashAlreadyCalculatedException: OFException {} @end |
Modified src/OFExceptions.m from [ad416c1918] to [10534da3ea].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFFile.h from [4c7924139a] to [5e8cf7bcda].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 <stdio.h> #include <sys/types.h> #import "OFStream.h" @class OFString; /** * \brief A class which provides functions to read, write and manipulate files. */ @interface OFFile: OFStream { FILE *fp; BOOL close; } |
︙ | ︙ | |||
124 125 126 127 128 129 130 | * * \param fp A file pointer, returned from for example fopen(). * It is not closed when the OFFile object is deallocated! */ - initWithFilePointer: (FILE*)fp; @end | < < < | 124 125 126 127 128 129 130 131 132 133 134 135 136 | * * \param fp A file pointer, returned from for example fopen(). * It is not closed when the OFFile object is deallocated! */ - initWithFilePointer: (FILE*)fp; @end /// An OFFile object for stdin extern OFFile *of_stdin; /// An OFFile object for stdout extern OFFile *of_stdout; /// An OFFile object for stderr extern OFFile *of_stderr; |
Modified src/OFFile.m from [95e5eb4c36] to [9b7c94885a].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #ifdef _WIN32 # import <windows.h> #endif OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; @implementation OFFile + (void)load { if (self != [OFFile class]) return; | > > > > > | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #ifdef _WIN32 # import <windows.h> #endif OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; /// \cond internal @interface OFFileSingleton: OFFile @end /// \endcond @implementation OFFile + (void)load { if (self != [OFFile class]) return; |
︙ | ︙ | |||
220 221 222 223 224 225 226 227 228 229 230 231 232 233 | fclose(fp); fp = NULL; return self; } @end @implementation OFFileSingleton - initWithPath: (OFString*)path mode: (OFString*)mode { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } | > | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | fclose(fp); fp = NULL; return self; } @end /// \cond internal @implementation OFFileSingleton - initWithPath: (OFString*)path mode: (OFString*)mode { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } |
︙ | ︙ | |||
254 255 256 257 258 259 260 | - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; [super dealloc]; /* Get rid of stupid warning */ } @end | > | 260 261 262 263 264 265 266 267 | - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; [super dealloc]; /* Get rid of stupid warning */ } @end /// \endcond |
Modified src/OFHashes.h from [709542c883] to [4a1439959b].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" #import "OFString.h" #define OF_MD5_DIGEST_SIZE 16 #define OF_SHA1_DIGEST_SIZE 20 extern int _OFHashing_reference; /** * \brief A class which provides functions to create an MD5 hash. */ @interface OFMD5Hash: OFObject { uint32_t buf[4]; uint32_t bits[2]; uint8_t in[64]; |
︙ | ︙ | |||
47 48 49 50 51 52 53 | * \return A buffer containing the hash (OF_MD5_DIGEST_SIZE = 16 bytes). * The buffer is part of object's memory pool. */ - (uint8_t*)digest; @end /** | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | * \return A buffer containing the hash (OF_MD5_DIGEST_SIZE = 16 bytes). * The buffer is part of object's memory pool. */ - (uint8_t*)digest; @end /** * \brief A class which provides functions to create an SHA1 hash. */ @interface OFSHA1Hash: OFObject { uint32_t state[5]; uint64_t count; char buffer[64]; uint8_t digest[OF_SHA1_DIGEST_SIZE]; |
︙ | ︙ |
Modified src/OFHashes.m from [78b7e000bc] to [75fcedf747].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | #define R3(v, w, x, y, z, i) \ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + OF_ROL(v, 5); \ w = OF_ROL(w, 30); #define R4(v, w, x, y, z, i) \ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + OF_ROL(v, 5); \ w = OF_ROL(w, 30); typedef union { char c[64]; uint32_t l[16]; } sha1_c64l16_t; static inline void sha1_transform(uint32_t state[5], const char buffer[64]) { uint32_t a, b, c, d, e; char workspace[64]; sha1_c64l16_t *block; | > > | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | #define R3(v, w, x, y, z, i) \ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + OF_ROL(v, 5); \ w = OF_ROL(w, 30); #define R4(v, w, x, y, z, i) \ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + OF_ROL(v, 5); \ w = OF_ROL(w, 30); /// \cond internal typedef union { char c[64]; uint32_t l[16]; } sha1_c64l16_t; /// \endcond static inline void sha1_transform(uint32_t state[5], const char buffer[64]) { uint32_t a, b, c, d, e; char workspace[64]; sha1_c64l16_t *block; |
︙ | ︙ |
Modified src/OFList.h from [d1b99d4de4] to [17a82cf29c].
1 | /* | | > > | < | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" /** * \brief A list object. * * A struct that contains a pointer to the next list object, the previous list * object and the object. */ typedef struct __of_list_object { /// A pointer to the next list object in the list struct __of_list_object *next; /// A pointer to the previous list object in the list struct __of_list_object *prev; /// The object for the list object id object; } of_list_object_t; /** * \brief A class which provides easy to use double-linked lists. */ @interface OFList: OFObject <OFCopying> { of_list_object_t *first; of_list_object_t *last; size_t count; } |
︙ | ︙ |
Modified src/OFList.m from [157ed5cd6f] to [36cdba6072].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFMacros.h from [423a04e77c] to [2804045e97].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFMutableArray.h from [70b773a8e9] to [abd2603d66].
1 | /* | | | < | 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 - 2010 * 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 "OFArray.h" /** * \brief A class for storing, adding and removing objects in an array. */ @interface OFMutableArray: OFArray { unsigned long mutations; } /** |
︙ | ︙ |
Modified src/OFMutableArray.m from [1f2b88f8de] to [c1712cbaa7].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFMutableDictionary.h from [825c0561fc] to [486674aaa1].
1 | /* | | | | 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 - 2010 * 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 "OFDictionary.h" /** * \brief A class for using mutable hash tables. */ @interface OFMutableDictionary: OFDictionary { unsigned long mutations; } /** |
︙ | ︙ |
Modified src/OFMutableDictionary.m from [a965448013] to [cd9a17e8ee].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFMutableString.h from [cbc1131fbc] to [15868110aa].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 <stdio.h> #include <stdarg.h> #import "OFString.h" /** * \brief A class for storing and modifying strings. */ @interface OFMutableString: OFString {} /** * Sets the OFString to the specified UTF-8 encoded C string. * * \param str A UTF-8 encoded C string to set the OFString to. */ |
︙ | ︙ |
Modified src/OFMutableString.m from [2a95dc6ba0] to [6ba90ce87d].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFNumber.h from [fb94e23de6] to [b4de2a5a33].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
37 38 39 40 41 42 43 | OF_NUMBER_PTRDIFF, OF_NUMBER_INTPTR, OF_NUMBER_FLOAT, OF_NUMBER_DOUBLE, }; /** | | < | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | OF_NUMBER_PTRDIFF, OF_NUMBER_INTPTR, OF_NUMBER_FLOAT, OF_NUMBER_DOUBLE, }; /** * \brief provides a way to store a number in an object and to manipulate it. */ @interface OFNumber: OFObject { union { char char_; short short_; int int_; |
︙ | ︙ | |||
534 535 536 537 538 539 540 | /** * \return The OFNumber as a double */ - (double)asDouble; /** | < < > < < > < < > < < > | | | 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | /** * \return The OFNumber as a double */ - (double)asDouble; /** * \param num The OFNumber to add * \return The OFNumber added with the specified OFNumber */ - add: (OFNumber*)num; /** * \param num The OFNumber to substract * \return The OFNumber subtracted by the specified OFNumber */ - subtract: (OFNumber*)num; /** * \param num The OFNumber to multiply with * \return The OFNumber multiplied with the specified OFNumber */ - multiplyWith: (OFNumber*)num; /** * \param num The OFNumber to divide by * \return The OFNumber devided by the specified OFNumber */ - divideBy: (OFNumber*)num; /** * \return The OFNumber increased by one. */ - increase; /** * \return The OFNumber decreased by one. */ - decrease; @end |
Modified src/OFNumber.m from [7dc3a8f62d] to [ffc72bea33].
1 | /* | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* * Copyright (c) 2008 - 2010 * 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 "OFNumber.h" #import "OFExceptions.h" #import "OFMacros.h" #define RETURN_AS(t) \ switch (type) { \ case OF_NUMBER_CHAR: \ return (t)value.char_; \ case OF_NUMBER_SHORT: \ return (t)value.short_; \ |
︙ | ︙ | |||
63 64 65 66 67 68 69 | case OF_NUMBER_FLOAT: \ return (t)value.float_; \ case OF_NUMBER_DOUBLE: \ return (t)value.double_; \ default: \ @throw [OFInvalidFormatException newWithClass: isa]; \ } | | | > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < > | < | | | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | < | 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 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 192 193 194 195 196 197 198 199 200 201 202 203 204 | case OF_NUMBER_FLOAT: \ return (t)value.float_; \ case OF_NUMBER_DOUBLE: \ return (t)value.double_; \ default: \ @throw [OFInvalidFormatException newWithClass: isa]; \ } #define CALCULATE(o, n) \ switch (type) { \ case OF_NUMBER_CHAR: \ return [OFNumber numberWithChar: \ value.char_ o [n asChar]]; \ case OF_NUMBER_SHORT: \ return [OFNumber numberWithShort: \ value.short_ o [n asShort]]; \ case OF_NUMBER_INT: \ return [OFNumber numberWithInt: \ value.int_ o [n asInt]]; \ case OF_NUMBER_LONG: \ return [OFNumber numberWithLong: \ value.long_ o [n asLong]]; \ case OF_NUMBER_UCHAR: \ return [OFNumber numberWithUChar: \ value.uchar o [n asUChar]]; \ case OF_NUMBER_USHORT: \ return [OFNumber numberWithUShort: \ value.ushort o [n asUShort]]; \ case OF_NUMBER_UINT: \ return [OFNumber numberWithUInt: \ value.uint o [n asUInt]]; \ case OF_NUMBER_ULONG: \ return [OFNumber numberWithULong: \ value.ulong o [n asULong]]; \ case OF_NUMBER_INT8: \ return [OFNumber numberWithInt8: \ value.int8 o [n asInt8]]; \ case OF_NUMBER_INT16: \ return [OFNumber numberWithInt16: \ value.int16 o [n asInt16]]; \ case OF_NUMBER_INT32: \ return [OFNumber numberWithInt32: \ value.int32 o [n asInt32]]; \ case OF_NUMBER_INT64: \ return [OFNumber numberWithInt64: \ value.int64 o [n asInt64]]; \ case OF_NUMBER_UINT8: \ return [OFNumber numberWithUInt8: \ value.uint8 o [n asUInt8]]; \ case OF_NUMBER_UINT16: \ return [OFNumber numberWithUInt16: \ value.uint16 o [n asUInt16]]; \ case OF_NUMBER_UINT32: \ return [OFNumber numberWithUInt32: \ value.uint32 o [n asUInt32]]; \ case OF_NUMBER_UINT64: \ return [OFNumber numberWithUInt64: \ value.uint64 o [n asUInt64]]; \ case OF_NUMBER_SIZE: \ return [OFNumber numberWithSize: \ value.size o [n asSize]]; \ case OF_NUMBER_SSIZE: \ return [OFNumber numberWithSSize: \ value.ssize o [n asSSize]]; \ case OF_NUMBER_INTMAX: \ return [OFNumber numberWithIntMax: \ value.intmax o [n asIntMax]]; \ case OF_NUMBER_UINTMAX: \ return [OFNumber numberWithUIntMax: \ value.uintmax o [n asUIntMax]]; \ case OF_NUMBER_PTRDIFF: \ return [OFNumber numberWithPtrDiff: \ value.ptrdiff o [n asPtrDiff]]; \ case OF_NUMBER_INTPTR: \ return [OFNumber numberWithIntPtr: \ value.intptr o [n asIntPtr]]; \ case OF_NUMBER_FLOAT: \ return [OFNumber numberWithFloat: \ value.float_ o [n asFloat]]; \ case OF_NUMBER_DOUBLE: \ return [OFNumber numberWithDouble: \ value.double_ o [n asDouble]]; \ default: \ @throw [OFInvalidFormatException newWithClass: isa]; \ } #define CALCULATE2(o) \ switch (type) { \ case OF_NUMBER_CHAR: \ return [OFNumber numberWithChar: value.char_ o]; \ case OF_NUMBER_SHORT: \ return [OFNumber numberWithShort: value.short_ o]; \ case OF_NUMBER_INT: \ return [OFNumber numberWithInt: value.int_ o]; \ case OF_NUMBER_LONG: \ return [OFNumber numberWithLong: value.long_ o]; \ case OF_NUMBER_UCHAR: \ return [OFNumber numberWithUChar: value.uchar o]; \ case OF_NUMBER_USHORT: \ return [OFNumber numberWithUShort: value.ushort o]; \ case OF_NUMBER_UINT: \ return [OFNumber numberWithUInt: value.uint o]; \ case OF_NUMBER_ULONG: \ return [OFNumber numberWithULong: value.ulong o]; \ case OF_NUMBER_INT8: \ return [OFNumber numberWithInt8: value.int8 o]; \ case OF_NUMBER_INT16: \ return [OFNumber numberWithInt16: value.int16 o]; \ case OF_NUMBER_INT32: \ return [OFNumber numberWithInt32: value.int32 o]; \ case OF_NUMBER_INT64: \ return [OFNumber numberWithInt64: value.int64 o]; \ case OF_NUMBER_UINT8: \ return [OFNumber numberWithUInt8: value.uint8 o]; \ case OF_NUMBER_UINT16: \ return [OFNumber numberWithUInt16: value.uint16 o]; \ case OF_NUMBER_UINT32: \ return [OFNumber numberWithUInt32: value.uint32 o]; \ case OF_NUMBER_UINT64: \ return [OFNumber numberWithUInt64: value.uint64 o]; \ case OF_NUMBER_SIZE: \ return [OFNumber numberWithSize: value.size o]; \ case OF_NUMBER_SSIZE: \ return [OFNumber numberWithSSize: value.ssize o]; \ case OF_NUMBER_INTMAX: \ return [OFNumber numberWithIntMax: value.intmax o]; \ case OF_NUMBER_UINTMAX: \ return [OFNumber numberWithUIntMax: value.uintmax o]; \ case OF_NUMBER_PTRDIFF: \ return [OFNumber numberWithPtrDiff: value.ptrdiff o]; \ case OF_NUMBER_INTPTR: \ return [OFNumber numberWithIntPtr: value.intptr o]; \ case OF_NUMBER_FLOAT: \ return [OFNumber numberWithFloat: value.float_ o]; \ case OF_NUMBER_DOUBLE: \ return [OFNumber numberWithDouble: value.double_ o]; \ default: \ @throw [OFInvalidFormatException newWithClass: isa]; \ } @implementation OFNumber + numberWithChar: (char)char_ { |
︙ | ︙ | |||
754 755 756 757 758 759 760 | @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; } } - (uint32_t)hash { | > > > > > > > > > > > > > > > > > > > | > | < | < | < | < | < | < | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; } } - (uint32_t)hash { uint32_t hash; size_t i; switch (type) { case OF_NUMBER_FLOAT: OF_HASH_INIT(hash); for (i = 0; i < sizeof(float); i++) OF_HASH_ADD(hash, ((char*)&value.float_)[i]); OF_HASH_FINALIZE(hash); return hash; case OF_NUMBER_DOUBLE: OF_HASH_INIT(hash); for (i = 0; i < sizeof(double); i++) OF_HASH_ADD(hash, ((char*)&value.double_)[i]); OF_HASH_FINALIZE(hash); return hash; default: return [self asUInt32]; } } - add: (OFNumber*)num { CALCULATE(+, num) } - subtract: (OFNumber*)num { CALCULATE(-, num) } - multiplyWith: (OFNumber*)num { CALCULATE(*, num) } - divideBy: (OFNumber*)num { CALCULATE(/, num) } - increase { CALCULATE2(+ 1) } - decrease { CALCULATE2(- 1) } @end |
Modified src/OFObject.h from [9367c723f3] to [762d83757b].
1 | /* | | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "objfw-defs.h" #include <stddef.h> #include <stdint.h> #import <objc/objc.h> /** * \brief A result of a comparison. */ typedef enum { /// The left object is smaller than the right OF_ORDERED_ASCENDING = -1, /// Both objects are equal OF_ORDERED_SAME = 0, /// The left object is bigger than the right OF_ORDERED_DESCENDING = 1 } of_comparison_result_t; /** * \brief The root class for all other classes inside ObjFW. */ @interface OFObject { /// The class of the object Class isa; } |
︙ | ︙ | |||
287 288 289 290 291 292 293 | * * It is also called when the retain count reaches zero. */ - (void)dealloc; @end /** | | > > | 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | * * It is also called when the retain count reaches zero. */ - (void)dealloc; @end /** * \brief A protocol for creation of copies. */ @protocol OFCopying /** * \return A copy of the object */ - (id)copy; @end /** * \brief A protocol for creation of mutable copies. * * This protocol is implemented by objects that can be mutable and immutable * and allows returning a mutable copy. */ @protocol OFMutableCopying /** * \return A copy of the object */ - (id)mutableCopy; @end |
Modified src/OFObject.m from [357eadb4d2] to [3eb553ab40].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #ifdef OF_ATOMIC_OPS # import "atomic.h" #else # import "threading.h" #endif struct pre_ivar { void **memchunks; size_t memchunks_size; int32_t retain_count; /* int32_t because atomic ops use int32_t */ #ifndef OF_ATOMIC_OPS of_spinlock_t retain_spinlock; #endif }; /* Hopefully no arch needs more than 16 bytes padding */ #define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15) #define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN)) static struct { Class isa; | > > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #ifdef OF_ATOMIC_OPS # import "atomic.h" #else # import "threading.h" #endif /// \cond internal struct pre_ivar { void **memchunks; size_t memchunks_size; int32_t retain_count; /* int32_t because atomic ops use int32_t */ #ifndef OF_ATOMIC_OPS of_spinlock_t retain_spinlock; #endif }; /// \endcond /* Hopefully no arch needs more than 16 bytes padding */ #define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15) #define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN)) static struct { Class isa; |
︙ | ︙ |
Modified src/OFPlugin.h from [81328c5acf] to [a1fb2461f8].
1 | /* | | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" @class OFString; #ifndef _WIN32 typedef void* of_plugin_handle_t; #else # include <windows.h> typedef HMODULE of_plugin_handle_t; #endif /** * \brief Provides a system for loading plugins at runtime. */ @interface OFPlugin: OFObject { of_plugin_handle_t handle; } /** |
︙ | ︙ |
Modified src/OFPlugin.m from [fb2254b3a7] to [7906a08f5e].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFSocket.h from [63006eb928] to [353d35e521].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFStream.h" #ifdef _WIN32 # define _WIN32_WINNT 0x0501 # include <winsock2.h> #endif /** * \brief A class which provides functions to create and use sockets. */ @interface OFSocket: OFStream { #ifndef _WIN32 int sock; #else SOCKET sock; |
︙ | ︙ |
Modified src/OFSocket.m from [7c0069f9e8] to [76195a13fc].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFStream.h from [1635dfcf25] to [c1f2dd3939].
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" @class OFString; /** * \brief A base class for different types of streams. */ @interface OFStream: OFObject { char *cache; size_t cache_len; } |
︙ | ︙ |
Modified src/OFStream.m from [c12185893b] to [d552430548].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFString.h from [24fcd165e3] to [8df36d219e].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
28 29 30 31 32 33 34 | extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*); extern size_t of_string_position_to_index(const char*, size_t); extern size_t of_string_index_to_position(const char*, size_t, size_t); @class OFArray; /** | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | extern size_t of_string_utf8_to_unicode(const char*, size_t, of_unichar_t*); extern size_t of_string_position_to_index(const char*, size_t); extern size_t of_string_index_to_position(const char*, size_t, size_t); @class OFArray; /** * \brief A class for handling strings. */ @interface OFString: OFObject <OFCopying, OFMutableCopying> { char *string; unsigned int length; #if defined(OF_APPLE_RUNTIME) && __LP64__ int _unused; |
︙ | ︙ |
Modified src/OFString.m from [1aae4ffc35] to [a551f0c4fb].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFTCPSocket.h from [ee8abca60b] to [d46a3d4e4d].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
20 21 22 23 24 25 26 | #ifdef _WIN32 # include <ws2tcpip.h> #endif @class OFString; /** | | | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #ifdef _WIN32 # include <ws2tcpip.h> #endif @class OFString; /** * \brief A class which provides functions to create and use TCP sockets. */ @interface OFTCPSocket: OFSocket { struct sockaddr *saddr; socklen_t saddr_len; } |
︙ | ︙ |
Modified src/OFTCPSocket.m from [0a606f2f49] to [709f9ba347].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFThread.h from [24a798f944] to [bc1c5f6169].
1 | /* | | | | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFObject.h" #import "OFList.h" #import "threading.h" /** * \brief A class for Thread Local Storage keys. */ @interface OFTLSKey: OFObject { @public of_tlskey_t key; @protected void (*destructor)(id); |
︙ | ︙ | |||
48 49 50 51 52 53 54 | * \param destructor A destructor that is called when the thread is terminated * \return An initialized Thread Local Storage key */ - initWithDestructor: (void(*)(id))destructor; @end /** | | < | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | * \param destructor A destructor that is called when the thread is terminated * \return An initialized Thread Local Storage key */ - initWithDestructor: (void(*)(id))destructor; @end /** * \brief A class which provides portable threads. * * To use it, you should create a new class derived from it and reimplement * main. */ @interface OFThread: OFObject { id object; of_thread_t thread; BOOL running; @public id retval; } /** * \param obj An object that is passed to the main method as a copy or nil * \return A new autoreleased thread |
︙ | ︙ | |||
114 115 116 117 118 119 120 | * * \return The object returned by the main method of the thread. */ - join; @end /** | | | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | * * \return The object returned by the main method of the thread. */ - join; @end /** * \brief A class for creating mutual exclusions. */ @interface OFMutex: OFObject { of_mutex_t mutex; } /** |
︙ | ︙ |
Modified src/OFThread.m from [0239ec1e3d] to [6fc1e51add].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFURLEncoding.h from [5c77cce892] to [1262cd49d1].
1 | /* | | | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /* * Copyright (c) 2008 - 2010 * 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 _OFURLEncoding_reference; /** * \brief A category which provides URL encoding and decoding. */ @interface OFString (OFURLEncoding) /** * Encodes a string for use in a URL. * * \return A new autoreleased string */ |
︙ | ︙ |
Modified src/OFURLEncoding.m from [747bb8cf04] to [51165a76a2].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFXMLElement.h from [adf0f56cb4] to [3674f835a6].
1 | /* | | < | | 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 | /* * Copyright (c) 2008 - 2010 * 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; /** * \brief A category to escape strings for use in an XML document. */ @interface OFString (OFXMLEscaping) /** * Escapes a string for use in an XML document. * * \return A new autoreleased string */ - stringByXMLEscaping; @end |
Modified src/OFXMLElement.m from [8ba8e77a76] to [e6ae9a57dd].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/OFXMLParser.h from [58d6fa526d] to [e65ad11f9c].
1 | /* | | | | | < | 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 | /* * Copyright (c) 2008 - 2010 * 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; /** * \brief 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 /** * \brief A category for unescaping XML in strings. */ @interface OFString (OFXMLUnescaping) /** * Unescapes XML in the string. */ - stringByXMLUnescaping; |
︙ | ︙ |
Modified src/OFXMLParser.m from [8d3fcc8d6d] to [005f6b607e].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/ObjFW.h from [298408d0be] to [7a8403f46d].
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 | /* * Copyright (c) 2008 - 2010 * 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. */ |
︙ | ︙ |
Modified src/asprintf.h from [90697b51e3] to [41b1e213fe].
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* * Copyright (c) 2008 - 2010 * 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 "objfw-defs.h" #ifndef OF_HAVE_ASPRINTF # include <stdarg.h> extern int asprintf(char**, const char*, ...); extern int vasprintf(char**, const char*, va_list); #endif |
Modified src/asprintf.m from [0749226706] to [4d0a2b091d].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/atomic.h from [465cd0b0aa] to [3969906906].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/iso_8859_15.m from [4c05bf7c02] to [9ddf1853bd].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/objc_properties.m from [d54a221003] to [a1b9e73162].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/objc_sync.m from [f34c1be170] to [557c8959b1].
1 | /* | | > > | 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 | /* * Copyright (c) 2008 - 2010 * 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 <stdio.h> #include <stdlib.h> #include <assert.h> #import <objc/objc.h> #import "threading.h" /// \cond internal struct locks_s { id obj; size_t count; size_t recursion; of_thread_t thread; of_mutex_t mutex; }; /// \endcond static of_mutex_t mutex; static struct locks_s *locks = NULL; static size_t num_locks = 0; #define SYNC_ERR(f) \ { \ |
︙ | ︙ |
Modified src/threading.h from [bf0ea6d5c4] to [0b6953b2d5].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/unicode.h from [872df2bd24] to [3d606b60fa].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/unicode.m from [2dc3e56e6b] to [5008f26d71].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified src/windows_1252.m from [43c5fb5787] to [0e64abc174].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/Makefile from [b7dceb4ce1] to [a7640f0fb3].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | include ../extra.mk SUBDIRS = ${TESTPLUGIN} PROG_NOINST = tests${PROG_SUFFIX} SRCS = OFArray.m \ OFDataArray.m \ OFDictionary.m \ OFHashes.m \ OFList.m \ OFObject.m \ ${OFPLUGIN_M} \ OFString.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ main.m \ ${PROPERTIES_M} | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | include ../extra.mk SUBDIRS = ${TESTPLUGIN} PROG_NOINST = tests${PROG_SUFFIX} SRCS = OFArray.m \ OFDataArray.m \ OFDictionary.m \ OFHashes.m \ OFList.m \ OFNumber.m \ OFObject.m \ ${OFPLUGIN_M} \ OFString.m \ OFTCPSocket.m \ ${OFTHREAD_M} \ main.m \ ${PROPERTIES_M} |
︙ | ︙ |
Modified tests/OFArray.m from [a4eb61b01c] to [e574cdec74].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
114 115 116 117 118 119 120 | EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]", OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]]) EXPECT_EXCEPTION(@"Detect out of range in -[removeNItems:]", OFOutOfRangeException, [m[0] removeNObjects: [m[0] count] + 1]) | > | | > | | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]", OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]]) EXPECT_EXCEPTION(@"Detect out of range in -[removeNItems:]", OFOutOfRangeException, [m[0] removeNObjects: [m[0] count] + 1]) TEST(@"-[componentsJoinedByString:]", (a[1] = [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]) && [[a[1] componentsJoinedByString: @" "] isEqual: @"foo bar baz"] && (a[1] = [OFArray arrayWithObject: @"foo"]) && [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"]) m[0] = [[a[0] mutableCopy] autorelease]; ok = YES; i = 0; TEST(@"-[enumerator]", (enumerator = [m[0] enumerator])) |
︙ | ︙ |
Modified tests/OFDataArray.m from [5b41786ab9] to [f55dde2843].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFDictionary.m from [81a0cd4f6f] to [fc592aae5a].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFHashes.m from [0665970b7b] to [89c9cc43b6].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFList.m from [fd7f869c09] to [de1fa087bb].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Added tests/OFNumber.m version [eeaf3e0ae9].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008 - 2010 * 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 "OFNumber.h" #import "OFAutoreleasePool.h" #import "main.h" static OFString *module = @"OFNumber"; void number_tests() { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFNumber *num; TEST(@"+[numberWithIntMax:]", (num = [OFNumber numberWithIntMax: 123456789])) TEST(@"-[isEqual:]", [num isEqual: [OFNumber numberWithUInt32: 123456789]]) TEST(@"-[hash]", [num hash] == 123456789) TEST(@"-[asDouble]", [num asDouble] == 123456789.L) TEST(@"-[decrease]", [[num decrease] isEqual: [OFNumber numberWithInt32: 123456788]]) TEST(@"-[divideBy:]", [[num divideBy: [OFNumber numberWithInt: 2]] asInt] == 61728394) [pool drain]; } |
Modified tests/OFObject.m from [e9f067864e] to [e75c8eaf49].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFPlugin.m from [279405b90d] to [1ac0553021].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFString.m from [dc66a48561] to [24ab0d52a6].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFTCPSocket.m from [6b65fc55ca] to [0cea16a745].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/OFThread.m from [c32c5ecaa2] to [003a442993].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/main.h from [c731f9f0a9] to [17be4b9ff5].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |
Modified tests/main.m from [10ffb688e4] to [4b584f059f].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #import "OFAutoreleasePool.h" extern void array_tests(); extern void dataarray_tests(); extern void dictionary_tests(); extern void hashes_tests(); extern void list_tests(); extern void object_tests(); #ifdef OF_PLUGINS extern void plugin_tests(); #endif #ifdef OF_HAVE_PROPERTIES extern void properties_tests(); #endif | > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #import "OFAutoreleasePool.h" extern void array_tests(); extern void dataarray_tests(); extern void dictionary_tests(); extern void hashes_tests(); extern void list_tests(); extern void number_tests(); extern void object_tests(); #ifdef OF_PLUGINS extern void plugin_tests(); #endif #ifdef OF_HAVE_PROPERTIES extern void properties_tests(); #endif |
︙ | ︙ | |||
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | object_tests(); hashes_tests(); string_tests(); dataarray_tests(); array_tests(); dictionary_tests(); list_tests(); tcpsocket_tests(); #ifdef OF_THREADS thread_tests(); #endif #ifdef OF_PLUGINS plugin_tests(); #endif #ifdef OF_HAVE_PROPERTIES properties_tests(); #endif return fails; } | > | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | object_tests(); hashes_tests(); string_tests(); dataarray_tests(); array_tests(); dictionary_tests(); list_tests(); number_tests(); tcpsocket_tests(); #ifdef OF_THREADS thread_tests(); #endif #ifdef OF_PLUGINS plugin_tests(); #endif #ifdef OF_HAVE_PROPERTIES properties_tests(); #endif return fails; } |
Modified tests/properties.m from [42cc65144e] to [faa25cff7b].
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008 - 2010 * 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. |
︙ | ︙ |