Changes In Branch 0.2 Through [c9a2f95a9c] Excluding Merge-Ins
This is equivalent to a diff from b6132938c0 to c9a2f95a9c
|
2010-02-03
| ||
| 10:39 | Fix VERSION in objfw-config.in in 0.2 branch. (check-in: 5b535655f8 user: js tags: 0.2, 0.2-release) | |
|
2010-02-01
| ||
| 18:11 | Merge latest changes from default branch into 0.2 branch. (check-in: c9a2f95a9c user: js tags: 0.2) | |
|
2010-01-31
| ||
| 21:51 | Move OFFastEnumeration protocol to OFEnumerator.h. (check-in: 8347c2ef5e user: js tags: trunk) | |
|
2010-01-30
| ||
| 21:07 | Create 0.2 branch and remove unfinished XML stuff from it. (check-in: 9a9211e963 user: js tags: 0.2) | |
| 20:54 | Remove TODO file as this is not a good way to keep track of things. (check-in: b6132938c0 user: js tags: trunk) | |
| 18:29 | Change how the Unicode table is stored. (check-in: 13f2a20288 user: js tags: trunk) | |
Modified ChangeLog from [825d836d59] to [68dbb909a3].
1 2 3 4 5 6 7 | ObjFW 0.1.1 -> 0.1.2, 15.01.2010 * Fix a bug in OFMutableArray's -[removeObject:] and -[removeObjectIdenticalTo:] that could lead to not removing all occurrences of the object from the array and to out of bounds reads. * Change the URL in the framework plist to the homepage. ObjFW 0.1 -> 0.1.1, 04.01.2010 | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | Legend: * Changes of existing features or bugfixes. + New features. ObjFW 0.1.2 -> 0.2, 01.02.2010 + Support for ObjC 2 Fast Enumerations on every platform which has compiler support for fast enumerations. + Support for ObjC 2 properties on every platform with compiler support. + Fast Enumeration through arrays and dictionaries. * OFIterator has been removed. + OFEnumerator was added to replace OFIterator, which is more general and works with arrays and dictionaries. + Portable implementation for atomic operations. + Portable implementation for spinlocks. They use atomic operations if available, if not they fall back to pthread spinlocks. If both are unavailable, mutexes are used as a last fallback. * -[retain] and -[release] are now atomic. If no atomic operations are available, spinlocks are used (which can fall back to mutexes, see above). * -[readLine] now handles \r\n without having the \r included in the returned line. + OFThread now has -[tryLock]. * Mutation methods have been removed from immutable interfaces, thus already giving an error at compilation instead of at runtime. * Dependencies between headers have been reduced, leading to faster compile times. * The interfaces of OFSocket and OFStream were cleaned up and some methods were moved to OFTCPSocket, as they make sense only there. * File methods unavailable on Windows don't throw an exception at runtime anymore, but instead are not even in the interface on Windows. This way, it is a compile time error instead of a runtime error. ObjFW 0.1.1 -> 0.1.2, 15.01.2010 * Fix a bug in OFMutableArray's -[removeObject:] and -[removeObjectIdenticalTo:] that could lead to not removing all occurrences of the object from the array and to out of bounds reads. * Change the URL in the framework plist to the homepage. ObjFW 0.1 -> 0.1.1, 04.01.2010 |
| ︙ | ︙ |
Modified src/Makefile from [cffb8debfd] to [b004a3e1eb].
| ︙ | ︙ | |||
27 28 29 30 31 32 33 |
${OFTHREAD_M} \
OFURLEncoding.m \
OFXMLElement.m \
OFXMLParser.m \
unicode.m
INCLUDES := ${SRCS:.m=.h} \
| < | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
${OFTHREAD_M} \
OFURLEncoding.m \
OFXMLElement.m \
OFXMLParser.m \
unicode.m
INCLUDES := ${SRCS:.m=.h} \
OFMacros.h \
ObjFW.h \
asprintf.h \
${ATOMIC_H} \
objfw-defs.h \
${THREADING_H}
|
| ︙ | ︙ |
Modified src/OFArray.h from [f31644bdce] to [3e0b6e88ce].
| ︙ | ︙ | |||
9 10 11 12 13 14 15 | * the packaging of this file. */ #include <stdarg.h> #import "OFObject.h" #import "OFEnumerator.h" | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | * the packaging of this file. */ #include <stdarg.h> #import "OFObject.h" #import "OFEnumerator.h" @class OFDataArray; @class OFString; /** * The OFArray class is a class for storing objects in an array. */ |
| ︙ | ︙ | |||
46 47 48 49 50 51 52 | * \return A new autoreleased OFArray */ + arrayWithObjects: (OFObject*)first, ...; /** * Creates a new OFArray with the objects from the specified C array. * | | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | * \return A new autoreleased OFArray */ + arrayWithObjects: (OFObject*)first, ...; /** * Creates a new OFArray with the objects from the specified C array. * * \param objs A C array of objects, terminated with nil * \return A new autoreleased OFArray */ + arrayWithCArray: (OFObject**)objs; /** * Initializes an OFArray with the specified object. * |
| ︙ | ︙ | |||
80 81 82 83 84 85 86 | */ - initWithObject: (OFObject*)first argList: (va_list)args; /** * Initializes an OFArray with the objects from the specified C array. * | | | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | */ - initWithObject: (OFObject*)first argList: (va_list)args; /** * Initializes an OFArray with the objects from the specified C array. * * \param objs A C array of objects, terminated with nil * \return An initialized OFArray */ - initWithCArray: (OFObject**)objs; /** * \return The number of objects in the array */ |
| ︙ | ︙ |
Modified src/OFDictionary.h from [520f646873] to [bbde3d4fc4].
| ︙ | ︙ | |||
9 10 11 12 13 14 15 | * the packaging of this file. */ #include <stdarg.h> #import "OFObject.h" #import "OFEnumerator.h" | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
* the packaging of this file.
*/
#include <stdarg.h>
#import "OFObject.h"
#import "OFEnumerator.h"
@class OFArray;
struct of_dictionary_bucket
{
OFObject <OFCopying> *key;
OFObject *object;
|
| ︙ | ︙ |
Modified src/OFEnumerator.h from [1e45836bf9] to [95bf700ece].
| ︙ | ︙ | |||
22 23 24 25 26 27 28 | /** * Resets the enumerator, so the next call to nextObject returns the first * object again. */ - reset; @end | > > > > > > > > > > > > > > > > > > > > > > > > > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
/**
* Resets the enumerator, so the next call to nextObject returns the first
* object again.
*/
- reset;
@end
/*
* 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
|
Deleted src/OFFastEnumeration.h version [7da30d91d4].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified src/OFMutableString.m from [5bfa0023ae] to [2a95dc6ba0].
| ︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 |
size_t i, j, d;
char *nstr;
if (!is_utf8) {
assert(table_size >= 1);
uint8_t *p = (uint8_t*)*string + *length;
while (--p >= (uint8_t*)*string)
| > | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
size_t i, j, d;
char *nstr;
if (!is_utf8) {
assert(table_size >= 1);
uint8_t *p = (uint8_t*)*string + *length;
uint8_t t;
while (--p >= (uint8_t*)*string)
if ((t = table[0][*p]) != 0)
*p = t;
return;
}
ulen = [self length];
ustr = [self allocMemoryForNItems: [self length]
withSize: ulen];
|
| ︙ | ︙ |
Modified src/OFObject.m from [695579ca2f] to [357eadb4d2].
| ︙ | ︙ | |||
27 28 29 30 31 32 33 | # import <objc/runtime.h> #endif #ifdef OF_GNU_RUNTIME # import <objc/sarray.h> #endif #ifdef OF_ATOMIC_OPS | | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# import <objc/runtime.h>
#endif
#ifdef OF_GNU_RUNTIME
# import <objc/sarray.h>
#endif
#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
|
| ︙ | ︙ |
Modified src/OFThread.m from [acb2745598] to [0239ec1e3d].
| ︙ | ︙ | |||
65 66 67 68 69 70 71 |
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
- initWithObject: (OFObject <OFCopying>*)obj
{
self = [super init];
| | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
- initWithObject: (OFObject <OFCopying>*)obj
{
self = [super init];
object = [obj retain];
if (!of_thread_new(&thread, call_main, self)) {
Class c = isa;
[object release];
[super dealloc];
@throw [OFInitializationFailedException newWithClass: c];
}
|
| ︙ | ︙ |
Modified src/OFXMLElement.h from [f359bb406c] 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 23 24 25 26 27 | /* * 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. * * \return A new autoreleased string */ - stringByXMLEscaping; @end |
Modified src/OFXMLElement.m from [d1cba33f72] to [8ba8e77a76].
| ︙ | ︙ | |||
13 14 15 16 17 18 19 | #include <assert.h> #include <stdlib.h> #include <string.h> #import "OFXMLElement.h" #import "OFString.h" | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#import "OFXMLElement.h"
#import "OFString.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 [9941ba9dfc] 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 [08dd8b2077] to [8d3fcc8d6d].
| ︙ | ︙ | |||
11 12 13 14 15 16 17 | #include "config.h" #include <string.h> #import "OFXMLParser.h" #import "OFString.h" | < < < < < < < < < < < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#include "config.h"
#include <string.h>
#import "OFXMLParser.h"
#import "OFString.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];
|
| ︙ | ︙ | |||
76 77 78 79 80 81 82 | return nil; buf[i] = 0; return [OFString stringWithCString: buf length: i]; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
return nil;
buf[i] = 0;
return [OFString stringWithCString: buf
length: i];
}
@implementation OFString (OFXMLUnescaping)
- stringByXMLUnescaping
{
return [self stringByXMLUnescapingWithHandler: nil];
}
- stringByXMLUnescapingWithHandler: (OFObject <OFXMLUnescapingDelegate>*)h
|
| ︙ | ︙ | |||
585 586 587 588 589 590 591 592 | @throw [OFInvalidEncodingException newWithClass: isa]; [ret appendCStringWithoutUTF8Checking: string + last length: i - last]; return ret; } @end | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 154 155 156 157 158 159 160 161 | @throw [OFInvalidEncodingException newWithClass: isa]; [ret appendCStringWithoutUTF8Checking: string + last length: i - last]; return ret; } @end |
Modified src/threading.h from [ec6d801a5e] to [bf0ea6d5c4].
| ︙ | ︙ | |||
12 13 14 15 16 17 18 | #import "OFMacros.h" #if !defined(OF_THREADS) || (!defined(OF_HAVE_PTHREADS) && !defined(_WIN32)) # error No threads available! #endif #if defined(OF_HAVE_PTHREADS) | | | | | 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 | #import "OFMacros.h" #if !defined(OF_THREADS) || (!defined(OF_HAVE_PTHREADS) && !defined(_WIN32)) # error No threads available! #endif #if defined(OF_HAVE_PTHREADS) # include <pthread.h> typedef pthread_t of_thread_t; typedef pthread_mutex_t of_mutex_t; typedef pthread_key_t of_tlskey_t; #elif defined(_WIN32) # include <windows.h> typedef HANDLE of_thread_t; typedef CRITICAL_SECTION of_mutex_t; typedef DWORD of_tlskey_t; #endif #if defined(OF_ATOMIC_OPS) # import "atomic.h" typedef int32_t of_spinlock_t; #elif defined(OF_HAVE_PTHREAD_SPINLOCKS) typedef pthread_spinlock_t of_spinlock_t; #else typedef pthread_mutex_t of_spinlock_t; #endif |
| ︙ | ︙ | |||
238 239 240 241 242 243 244 |
#endif
}
static OF_INLINE BOOL
of_spinlock_unlock(of_spinlock_t *s)
{
#if defined(OF_ATOMIC_OPS)
| | | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
#endif
}
static OF_INLINE BOOL
of_spinlock_unlock(of_spinlock_t *s)
{
#if defined(OF_ATOMIC_OPS)
of_atomic_and32((uint32_t*)s, 0);
return YES;
#elif defined(OF_HAVE_PTHREAD_SPINLOCKS)
return (pthread_spin_unlock(s) ? NO : YES);
#else
return of_mutex_unlock(s);
#endif
}
|
| ︙ | ︙ |
Modified tests/Makefile from [695657576d] to [b7dceb4ce1].
| ︙ | ︙ | |||
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 \
${PROPERTIES_M}
IPHONE_USER = mobile
IPHONE_TMP = /tmp/objfw-test
.PHONY: run run-tests run-on-iphone
|
| ︙ | ︙ |
Deleted tests/OFXMLElement.m version [f509f6be50].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/OFXMLParser.m version [bbebdfcead].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified tests/main.m from [6d0cbb749a] to [10ffb688e4].
| ︙ | ︙ | |||
32 33 34 35 36 37 38 | extern void properties_tests(); #endif extern void string_tests(); extern void tcpsocket_tests(); #ifdef OF_THREADS extern void thread_tests(); #endif | < < | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
extern void properties_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
|
| ︙ | ︙ | |||
109 110 111 112 113 114 115 | array_tests(); dictionary_tests(); list_tests(); tcpsocket_tests(); #ifdef OF_THREADS thread_tests(); #endif | < < | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | 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; } |