Commits

Tuukka Norri  committed 0826f63

Initial import

  • Participants
  • Branches PGTS

Comments (0)

Files changed (128)

File Dependencies/TSDataTypes/Sources/NSInvocation+TSAdditions.h

+//
+// NSInvocation+TSAdditions.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSInvocation (TSAdditions)
+- (id) TSInvokeObjectReturn;
+- (BOOL) TSInvokeBoolReturn;
+@end

File Dependencies/TSDataTypes/Sources/NSInvocation+TSAdditions.m

+//
+// NSInvocation+TSAdditions.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "NSInvocation+TSAdditions.h"
+
+@implementation NSInvocation (TSAdditions)
+
+- (id) TSInvokeObjectReturn
+{
+    [self invoke];
+    id rval = nil;
+    [self getReturnValue: &rval];
+    return rval;
+}
+
+- (BOOL) TSInvokeBoolReturn
+{
+    [self invoke];
+    BOOL rval = nil;
+    [self getReturnValue: &rval];
+    return rval;
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSAbstractDictionary.h

+//
+// TSAbstractDictionary.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TSAbstractDictionary : NSObject <NSCopying>
+{
+    NSMapTable* map;
+    unsigned int count;
+}
+- (id) initWithCapacity: (unsigned) u;
+- (unsigned int) count;
++ (id) dictionary;
++ (id) dictionaryWithCapacity: (unsigned int) capacity;
+
+@end
+
+
+@interface TSAbstractEnumerator : NSEnumerator
+{
+    id collection;
+    NSMapEnumerator enumerator;
+}
+- (NSArray *) allObjects;
+- (id) nextObject;
+- (id) initWithCollection: (id) aDict 
+            mapEnumerator: (NSMapEnumerator) anEnumerator;
+@end

File Dependencies/TSDataTypes/Sources/TSAbstractDictionary.m

+//
+// TSAbstractDictionary.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSAbstractDictionary.h"
+
+
+@implementation TSAbstractDictionary
+
++ (id) dictionary
+{
+    return [self dictionaryWithCapacity: 0];
+}
+
++ (id) dictionaryWithCapacity: (unsigned int) capacity
+{
+    return [[[self alloc] initWithCapacity: capacity] autorelease];
+}
+
+- (id) initWithCapacity: (unsigned) u
+{
+    return nil;
+}
+
+- (void) dealloc
+{
+    NSFreeMapTable (map);
+    [super dealloc];
+}
+
+- (unsigned int) count
+{
+    return count;
+}
+
+- (id) copyWithZone: (NSZone *) zone
+{
+    TSAbstractDictionary* copy = [super init];
+    if (nil != copy)
+    {
+        copy->map = NSCopyMapTableWithZone (map, zone);
+        copy->count = count;
+    }
+    return copy;
+}
+
+@end
+
+
+@implementation TSAbstractEnumerator
+
+- (id) initWithCollection: (id) aDict 
+            mapEnumerator: (NSMapEnumerator) anEnumerator
+{
+    if ((self = [super init]))
+    {
+        collection = [aDict retain];
+        enumerator = anEnumerator;
+    }
+    return self;
+}
+
+- (void) dealloc
+{
+    NSEndMapTableEnumeration (&enumerator);
+    [collection release];
+    [super dealloc];
+}
+
+- (NSArray *) allObjects
+{
+    NSMutableArray* rval = [NSMutableArray array];
+    id value = nil;
+    while ((value = [self nextObject]))
+        [rval addObject: value];
+    return rval;
+}
+
+- (id) nextObject
+{
+    return nil;
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSDataTypes.h

+//
+// TSDataTypes.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <TSDataTypes/TSAbstractDictionary.h>
+#import <TSDataTypes/TSIndexDictionary.h>
+#import <TSDataTypes/TSObjectTagDictionary.h>
+#import <TSDataTypes/TSObjectDictionary.h>
+#import <TSDataTypes/TSNonRetainedObjectDictionary.h>
+#import <TSDataTypes/TSNonRetainedObjectSet.h>
+#import <TSDataTypes/TSInvocationRecorder.h>
+#import <TSDataTypes/TSInvocation.h>
+#import <TSDataTypes/NSInvocation+TSAdditions.h>

File Dependencies/TSDataTypes/Sources/TSDataTypes_Prefix.pch

+//
+// TSDataTypes_Prefix.pch
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#ifdef __OBJC__
+    #import <Foundation/Foundation.h>
+#endif

File Dependencies/TSDataTypes/Sources/TSIndexDictionary.h

+//
+// TSIndexDictionary.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <TSDataTypes/TSAbstractDictionary.h>
+
+@class TSIndexEnumerator;
+
+
+@interface TSIndexDictionary : TSAbstractDictionary
+{
+}
+
+- (id) initWithCapacity: (unsigned int) capacity;
+- (id) init;
+- (id) objectAtIndex: (unsigned int) anIndex;
+- (void) removeObjectAtIndex: (unsigned int) anIndex;
+- (void) setObject: (id) anObject atIndex: (unsigned int) anIndex;
+- (TSIndexEnumerator *) indexEnumerator;
+- (NSEnumerator *) objectEnumerator;
+- (NSArray *) allObjects;
+- (unsigned int *) indexVector;
+- (unsigned int *) indexVectorSortedByValue;
+- (unsigned int *) indexVectorSortedByValueUsingFunction: (int (*)(const void *, const void *)) compar;
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject;
+
+@end
+
+
+@interface TSIndexEnumerator : TSAbstractEnumerator
+{
+}
+- (unsigned int) nextIndex;
+@end

File Dependencies/TSDataTypes/Sources/TSIndexDictionary.m

+//
+// TSIndexDictionary.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSIndexDictionary.h"
+
+
+static int IndexCmp (const void *a, const void *b)
+{
+    int rval = 0;
+    if (*(int *) a < *(int *) b)
+        rval = -1;
+    else if (*(int *) a > *(int *) b)
+        rval = 1;
+    return rval;
+}
+
+
+@implementation TSIndexEnumerator : TSAbstractEnumerator;
+
+- (id) nextObject
+{
+    id rval = nil;
+    NSNextMapEnumeratorPair (&enumerator, NULL, (void *) &rval);
+    return rval;
+}
+
+- (unsigned int) nextIndex
+{
+    unsigned int rval = NSNotFound;
+    NSNextMapEnumeratorPair (&enumerator, (void *) &rval, NULL);
+    return rval;
+}
+
+@end
+
+
+@implementation TSIndexDictionary
+
+- (id) initWithCapacity: (unsigned int) capacity
+{
+    if ((self = [super init]))
+    {
+        count = 0;
+        map = NSCreateMapTable (NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, capacity);
+    }
+    return self;
+}
+
+- (id) init
+{
+    return [self initWithCapacity: 0];
+}
+
+- (id) objectAtIndex: (unsigned int) anIndex
+{
+    return NSMapGet (map, (void *) anIndex);
+}
+
+- (void) removeObjectAtIndex: (unsigned int) anIndex
+{
+    if (NULL != NSMapGet (map, (void *) anIndex))
+    {
+        count--;
+        NSMapRemove (map, (void *) anIndex);
+    }
+}
+
+- (void) setObject: (id) anObject atIndex: (unsigned int) anIndex
+{
+    if (NULL == NSMapGet (map, (void *) anIndex))
+        count++;
+    NSMapInsert (map, (void *) anIndex, anObject);
+}
+
+- (TSIndexEnumerator *) indexEnumerator
+{
+    return (TSIndexEnumerator *)[self objectEnumerator];
+}
+
+- (NSEnumerator *) objectEnumerator
+{
+    NSMapEnumerator e = NSEnumerateMapTable (map);
+    return [[[TSIndexEnumerator alloc] initWithCollection: self
+                                            mapEnumerator: e] autorelease];
+}
+
+- (unsigned int *) indexVector
+{
+    TSIndexEnumerator* e = [self indexEnumerator];
+    unsigned int* vector = calloc (count, sizeof (unsigned int));
+    for (int i = 0; i < count; i++)
+        vector [i] = [e nextIndex];
+    return vector;
+}
+
+- (unsigned int *) indexVectorSortedByValue
+{
+    return [self indexVectorSortedByValueUsingFunction: &IndexCmp];
+}
+
+- (unsigned int *) indexVectorSortedByValueUsingFunction: (int (*) (const void *, const void *)) compar;
+{
+    unsigned int* keys = [self indexVector];
+    qsort (keys, count, sizeof (unsigned int), compar);
+    return keys;
+}
+
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject
+{
+    NSEnumerator* e = [self objectEnumerator];
+    id currentObject = nil;
+    while ((currentObject = [e nextObject]))
+        [currentObject performSelector: aSelector withObject: anObject];
+}
+
+- (NSArray *) allObjects
+{
+    return NSAllMapTableValues (map);
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSInvocation.h

+//
+// TSInvocation.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TSInvocation : NSProxy
+{
+    NSInvocation* invocation;
+    id persistentTarget;
+}
+
++ (id) invocationWithInvocation: (NSInvocation *) invocation;
+- (void) setInvocation: (NSInvocation *) invocation;
+
+@end

File Dependencies/TSDataTypes/Sources/TSInvocation.m

+//
+// TSInvocation.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSInvocation.h"
+
+
+@implementation TSInvocation
+
++ (id) invocationWithInvocation: (NSInvocation *) anInvocation
+{
+    id rval = [[[self alloc] init] autorelease];
+    [rval setInvocation: anInvocation];
+    return rval;
+}
+
+- (id) init
+{
+    return self;
+}
+
+- (void) dealloc
+{
+    [invocation release];
+    [super dealloc];
+}
+
+- (NSMethodSignature *) methodSignatureForSelector: (SEL) aSelector
+{
+    return [NSInvocation instanceMethodSignatureForSelector: aSelector];
+}
+
+- (void) forwardInvocation: (NSInvocation *) anInvocation
+{
+    [anInvocation invokeWithTarget: invocation];
+}
+
+- (id) target
+{
+    return persistentTarget;
+}
+
+- (void) setTarget: (id) anObject
+{
+    persistentTarget = anObject;
+}
+
+- (void) invoke
+{
+    [invocation invokeWithTarget: persistentTarget];
+}
+
+- (void) setInvocation: (NSInvocation *) anInvocation
+{
+    if (invocation != anInvocation) 
+    {
+        [invocation release];
+        invocation = [anInvocation retain];
+        
+        [self setTarget: [invocation target]];
+        [invocation setTarget: nil];
+    }
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSInvocationRecorder.h

+//
+// TSInvocationRecorder.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TSInvocationRecorder : NSObject 
+{
+    NSMutableArray* recordedInvocations;
+    id recordingTarget; //Weak
+    BOOL retainsArguments;
+    BOOL invocationsRetainTarget;
+}
+
++ (id) recorder;
+- (NSInvocation *) recordedInvocation;
+- (NSArray *) recordedInvocations;
+- (id) recordWithTarget: (id) anObject;
+- (id) recordWithPersistentTarget: (id) anObject;
+
+@end

File Dependencies/TSDataTypes/Sources/TSInvocationRecorder.m

+//
+// TSInvocationRecorder.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSInvocationRecorder.h"
+#import "TSInvocation.h"
+
+
+/** Records invocations the same way as NSUndoManager. */
+@implementation TSInvocationRecorder
+
++ (id) recorder
+{
+    return [[[self alloc] init] autorelease];
+}
+
+- (id) init
+{
+    if ((self = [super init]))
+    {
+        recordedInvocations = [[NSMutableArray alloc] init];
+        retainsArguments = YES;
+        invocationsRetainTarget = YES;
+    }
+    return self;
+}
+
+- (void) dealloc
+{
+    [recordedInvocations release];
+    [super dealloc];
+}
+
+/** 
+ * Record an invocation.
+ * \attention   Does NOT work with variable argument lists on i386.
+ */
+- (id) recordWithTarget: (id) anObject
+{
+    invocationsRetainTarget = YES;
+    recordingTarget = anObject;
+    return self;
+}
+
+/**
+ * Record an invocation.
+ * \attention   Does NOT work with variable argument lists on i386.
+ * \param       anObject        An object that will not be retained.
+ */
+- (id) recordWithPersistentTarget: (id) anObject
+{
+    id rval = [self recordWithTarget: anObject];
+    invocationsRetainTarget = NO;
+    return rval;
+}
+
+- (NSInvocation *) recordedInvocation
+{
+    id rval = [recordedInvocations lastObject];
+    [recordedInvocations removeLastObject];
+    return rval;
+}
+
+- (NSArray *) recordedInvocations
+{
+    id rval = [[recordedInvocations copy] autorelease];
+    [recordedInvocations removeAllObjects];
+    return rval;
+}
+
+- (void) forwardInvocation: (NSInvocation *) invocation
+{
+    NSAssert (nil != invocation, @"Expected invocation not to be nil");
+    [invocation setTarget: recordingTarget];
+    if (YES == retainsArguments)
+    {
+        if (NO == invocationsRetainTarget)
+            invocation = [TSInvocation invocationWithInvocation: invocation];
+        [invocation retainArguments];
+    }
+    [recordedInvocations addObject: invocation];
+}
+
+- (NSMethodSignature *) methodSignatureForSelector: (SEL) aSelector
+{
+    NSMethodSignature* rval = nil;
+#if 0
+    //+[Class class] always returns self, right?
+    if ([recordingTarget class] == recordingTarget)
+        rval = [recordingTarget instanceMethodSignatureForSelector: aSelector];
+    else
+#endif
+        rval = [recordingTarget methodSignatureForSelector: aSelector];
+    return rval;
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSNonRetainedObjectDictionary.h

+//
+// TSNonRetainedObjectDictionary.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <TSDataTypes/TSAbstractDictionary.h>
+
+@class TSNonRetainedObjectDictionaryEnumerator;
+
+
+@interface TSNonRetainedObjectDictionary : TSAbstractDictionary
+{
+}
+
+- (id) initWithCapacity: (unsigned int) capacity;
+- (id) init;
+- (id) objectForKey: (id) aKey;
+- (void) removeObjectForKey: (id) aKey;
+- (void) setObject: (id) anObject forKey: (id) aKey;
+- (NSEnumerator *) keyEnumerator;
+- (NSEnumerator *) objectEnumerator;
+- (NSArray *) allObjects;
+- (NSArray *) allKeys;
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject;
+- (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) anObject;
+
+@end
+
+
+@interface TSNonRetainedObjectDictionaryEnumerator : TSAbstractEnumerator
+{
+    BOOL enumeratesKeys;
+}
+- (void) setEnumeratesKeys: (BOOL) aBool;
+@end

File Dependencies/TSDataTypes/Sources/TSNonRetainedObjectDictionary.m

+//
+// TSNonRetainedObjectDictionary.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSNonRetainedObjectDictionary.h"
+
+
+@implementation TSNonRetainedObjectDictionaryEnumerator
+
+- (id) initWithCollection: (id) aDict 
+            mapEnumerator: (NSMapEnumerator) anEnumerator
+{
+    if ((self = [super initWithCollection: aDict mapEnumerator: anEnumerator]))
+        enumeratesKeys = NO;
+    return self;
+}
+
+- (void) setEnumeratesKeys: (BOOL) aBool
+{
+    enumeratesKeys = aBool;
+}
+
+- (NSArray *) allObjects
+{
+    NSMutableArray* rval = [NSMutableArray array];
+    id value = nil;
+    while ((value = [self nextObject]))
+        [rval addObject: value];
+    return rval;
+}
+
+- (id) nextObject
+{
+    id rval = nil;
+
+    if (YES == enumeratesKeys)
+        NSNextMapEnumeratorPair (&enumerator, (void *) &rval, NULL);
+    else
+        NSNextMapEnumeratorPair (&enumerator, NULL, (void *) &rval);
+
+    return rval;
+}
+
+@end
+
+
+@implementation TSNonRetainedObjectDictionary
+
+- (id) initWithCapacity: (unsigned int) capacity
+{
+    if ((self = [super init]))
+    {
+        count = 0;
+        map = NSCreateMapTable (NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, capacity);
+    }
+    return self;
+}
+
+- (id) init
+{
+    return [self initWithCapacity: 0];
+}
+
+- (id) objectForKey: (id) aKey;
+{
+    return (id) NSMapGet (map, aKey);
+}
+
+- (void) removeObjectForKey: (id) anObject
+{
+    if (NULL != NSMapGet (map, anObject))
+    {
+        count--;
+        NSMapRemove (map, anObject);
+    }
+}
+
+- (void) setObject: (id) anObject forKey: (id) aKey
+{
+    if (NULL == NSMapGet (map, aKey))
+        count++;
+    NSMapInsert (map, aKey, anObject);
+}
+
+- (NSEnumerator *) keyEnumerator
+{
+    id rval = [self objectEnumerator];
+    [rval setEnumeratesKeys: YES];
+    return rval;
+}
+
+- (NSEnumerator *) objectEnumerator
+{
+    NSMapEnumerator e = NSEnumerateMapTable (map);
+    NSEnumerator* rval =  [[[TSNonRetainedObjectDictionaryEnumerator alloc] initWithCollection: self 
+                                                                                 mapEnumerator: e] autorelease];
+    return (TSNonRetainedObjectDictionaryEnumerator *) rval;
+}
+
+- (NSArray *) allKeys
+{
+    return NSAllMapTableKeys (map);
+}
+
+- (NSArray *) allObjects
+{
+    return NSAllMapTableValues (map);
+}
+
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject
+{
+    NSEnumerator* e = [self objectEnumerator];
+    id currentObject = nil;
+    while ((currentObject = [e nextObject]))
+        [currentObject performSelector: aSelector withObject: anObject];
+}
+
+- (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) anObject
+{
+    NSMutableArray* rval = [NSMutableArray array];
+    NSEnumerator* e = [keys objectEnumerator];
+    id currentKey = nil;
+    while ((currentKey = [e nextObject]))
+    {
+        id currentValue = [self objectForKey: currentKey];
+        if (nil != currentValue)
+            [rval addObject: currentValue];
+        else
+            [rval addObject: anObject];
+    }
+    return rval;
+}
+@end

File Dependencies/TSDataTypes/Sources/TSNonRetainedObjectSet.h

+//
+// TSNonRetainedObjectSet.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TSNonRetainedObjectSetEnumerator : NSEnumerator 
+{
+    NSHashEnumerator enumerator;
+    id collection;
+}
+- (id) initWithCollection: (id) aCollection enumerator: (NSHashEnumerator) anEnumerator;
+
+@end
+
+
+
+@interface TSNonRetainedObjectSet : NSObject {
+    NSHashTable* hash;
+    unsigned int count;
+}
+
+- (id) initWithCapacity: (unsigned int) capacity;
+- (unsigned int) count;
+- (void) addObject: (id) anObject;
+- (void) removeObject: (id) anObject;
+- (BOOL) containsObject: (id) anObject;
+- (id) member: (id) anObject;
+- (id) objectEnumerator;
+- (void) removeAllObjects;
+- (NSArray *) allObjects;
+
+@end

File Dependencies/TSDataTypes/Sources/TSNonRetainedObjectSet.m

+//
+// TSNonRetainedObjectSet.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSNonRetainedObjectSet.h"
+
+
+@implementation TSNonRetainedObjectSetEnumerator
+- (id) initWithCollection: (id) aCollection enumerator: (NSHashEnumerator) anEnumerator
+{
+    if ((self = [super init]))
+    {
+        enumerator = anEnumerator;
+        collection = [aCollection retain];
+    }
+    return self;
+}
+
+- (void) dealloc
+{
+    NSEndHashTableEnumeration (&enumerator);
+    [collection release];
+    [super dealloc];
+}
+
+- (id) nextObject
+{
+    return NSNextHashEnumeratorItem (&enumerator);
+}
+@end
+
+
+@implementation TSNonRetainedObjectSet
+- (id) initWithCapacity: (unsigned int) capacity
+{
+    if ((self = [super init]))
+    {
+        hash = NSCreateHashTableWithZone (NSNonRetainedObjectHashCallBacks, capacity, [self zone]);
+        count = 0;
+    }
+    return self;
+}
+
+- (id) init
+{
+    return [self initWithCapacity: count];
+}
+
+- (void) dealloc
+{
+    NSFreeHashTable (hash);
+    [super dealloc];
+}
+
+- (unsigned int) count
+{
+    return count;
+}
+
+- (void) addObject: (id) anObject
+{
+    NSHashInsert (hash, anObject);
+}
+
+
+- (void) removeObject: (id) anObject
+{
+    NSHashRemove (hash, anObject);
+}
+
+- (BOOL) containsObject: (id) anObject
+{
+    return (nil != [self member: anObject]);
+}
+
+- (id) member: (id) anObject
+{
+    return NSHashGet (hash, anObject);
+}
+
+- (id) description
+{
+    return [NSString stringWithFormat: @"<%@ %@>", [self class], NSAllHashTableObjects (hash)];
+}
+
+- (id) objectEnumerator
+{
+    return [[[TSNonRetainedObjectSetEnumerator alloc] initWithCollection: self 
+                                                              enumerator: NSEnumerateHashTable (hash)] 
+        autorelease];
+}
+
+- (void) removeAllObjects
+{
+    NSResetHashTable (hash);
+}
+
+- (NSArray *) allObjects
+{
+    return NSAllHashTableObjects (hash);
+}
+
+@end

File Dependencies/TSDataTypes/Sources/TSObjectDictionary.h

+//
+// TSObjectDictionary.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <TSDataTypes/TSAbstractDictionary.h>
+
+@interface TSObjectDictionary : TSAbstractDictionary
+{
+}
+
+- (id) initWithCapacity: (unsigned int) capacity;
+- (id) init;
+- (id) objectForKey: (id) aKey;
+- (void) removeObjectForKey: (id) aKey;
+- (void) setObject: (id) anObject forKey: (id) aKey;
+- (NSEnumerator *) keyEnumerator;
+- (NSEnumerator *) objectEnumerator;
+- (NSArray *) allObjects;
+- (NSArray *) allKeys;
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject;
+
+@end

File Dependencies/TSDataTypes/Sources/TSObjectDictionary.m

+//
+// TSObjectDictionary.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSObjectDictionary.h"
+
+
+@implementation TSObjectDictionary
+
+- (id) initWithCapacity: (unsigned int) capacity
+{
+    if ((self = [super init]))
+    {
+        count = 0;
+        map = NSCreateMapTable (NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, capacity);
+    }
+    return self;
+}
+
+- (id) init
+{
+    return [self initWithCapacity: 0];
+}
+
+- (id) objectForKey: (id) aKey;
+{
+    return (id) NSMapGet (map, aKey);
+}
+
+- (void) removeObjectForKey: (id) anObject
+{
+    if (NULL != NSMapGet (map, anObject))
+    {
+        count--;
+        NSMapRemove (map, anObject);
+    }
+}
+
+- (void) setObject: (id) anObject forKey: (id) aKey
+{
+    if (NULL == NSMapGet (map, aKey))
+        count++;
+    NSMapInsert (map, aKey, anObject);
+}
+
+- (NSEnumerator *) keyEnumerator
+{
+    return nil;
+}
+
+- (NSEnumerator *) objectEnumerator;
+{
+    return nil;
+}
+
+- (NSArray *) allKeys
+{
+    return NSAllMapTableKeys (map);
+}
+
+- (NSArray *) allObjects
+{
+    return NSAllMapTableValues (map);
+}
+
+- (void) makeObjectsPerformSelector: (SEL) aSelector withObject: (id) anObject
+{
+    NSEnumerator* e = [self objectEnumerator];
+    id currentObject = nil;
+    while ((currentObject = [e nextObject]))
+        [currentObject performSelector: aSelector withObject: anObject];
+}
+@end

File Dependencies/TSDataTypes/Sources/TSObjectTagDictionary.h

+//
+// TSIndexDictionary.h
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <TSDataTypes/TSAbstractDictionary.h>
+
+@class TSObjectTagEnumerator;
+
+
+@interface TSObjectTagDictionary : TSAbstractDictionary
+{
+}
+
++ (id) dictionaryWithCapacity: (unsigned int) capacity;
+- (id) initWithCapacity: (unsigned int) capacity;
+- (id) init;
+- (unsigned int) tagForKey: (id) anObject;
+- (void) removeTagForKey: (id) anObject;
+- (void) setTag: (unsigned int) aTag forKey: (id) anObject;
+- (NSEnumerator *) keyEnumerator;
+- (TSObjectTagEnumerator *) tagEnumerator;
+- (NSArray *) allKeys;
+- (unsigned int *) tagVector;
+- (unsigned int *) tagVectorSortedByValue;
+- (unsigned int *) tagVectorSortedByValueUsingFunction: (int (*)(const void *, const void *)) compar;
+
+@end
+
+
+@interface TSObjectTagEnumerator : TSAbstractEnumerator
+{
+}
+- (unsigned int) nextTag;
+@end

File Dependencies/TSDataTypes/Sources/TSObjectTagDictionary.m

+//
+// TSIndexDictionary.m
+// BaseTen
+//
+// Copyright (C) 2006 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "TSObjectTagDictionary.h"
+#import <assert.h>
+
+
+static int TagCmp (const void *a, const void *b)
+{
+    int rval = 0;
+    if (*(int *) a < *(int *) b)
+        rval = -1;
+    else if (*(int *) a > *(int *) b)
+        rval = 1;
+    return rval;
+}
+
+
+@implementation TSObjectTagEnumerator
+
+- (id) nextObject
+{
+    id rval = nil;
+    NSNextMapEnumeratorPair (&enumerator, (void *) &rval, NULL);
+    return rval;
+}
+
+- (unsigned int) nextTag
+{
+    unsigned int rval = NSNotFound;
+    NSNextMapEnumeratorPair (&enumerator, NULL, (void *) &rval);
+    return rval;
+}
+
+@end
+
+
+@implementation TSObjectTagDictionary
+
++ (id) dictionaryWithCapacity: (unsigned int) capacity
+{
+    return [[[self class] alloc] initWithCapacity: capacity];
+}
+
+- (id) initWithCapacity: (unsigned int) capacity
+{
+    if ((self = [super init]))
+    {
+        count = 0;
+        map = NSCreateMapTable (NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, capacity);
+    }
+    return self;
+}
+
+- (id) init
+{
+    return [self initWithCapacity: 0];
+}
+
+- (unsigned int) tagForKey: (id) anObject;
+{
+    unsigned int rval = NSNotFound;
+    if (NO == NSMapMember (map, anObject, NULL, (void **) &rval))
+        assert (NSNotFound == rval);
+    return rval;
+}
+
+- (void) removeTagForKey: (id) anObject
+{
+    if (NULL != NSMapGet (map, anObject))
+    {
+        count--;
+        NSMapRemove (map, anObject);
+    }
+}
+
+- (void) setTag: (unsigned int) aTag forKey: (id) anObject
+{
+    if (NULL == NSMapGet (map, anObject))
+        count++;
+    NSMapInsert (map, anObject, (void *) aTag);
+}
+
+- (NSEnumerator *) keyEnumerator
+{
+    return [self tagEnumerator];
+}
+
+- (TSObjectTagEnumerator *) tagEnumerator
+{
+    NSMapEnumerator e = NSEnumerateMapTable (map);
+    return [[[TSObjectTagEnumerator alloc] initWithCollection: self mapEnumerator: e] autorelease];
+}
+
+- (NSArray *) allKeys
+{
+    return NSAllMapTableKeys (map);
+}
+
+- (unsigned int *) tagVector
+{
+    TSObjectTagEnumerator* e = [self tagEnumerator];
+    unsigned int* vector = calloc (count, sizeof (unsigned int));
+    for (unsigned int i = 0; i < count; i++)
+        vector [i] = [e nextTag];
+    return vector;
+}
+
+- (unsigned int *) tagVectorSortedByValue
+{
+    return [self tagVectorSortedByValueUsingFunction: &TagCmp];
+}
+
+- (unsigned int *) tagVectorSortedByValueUsingFunction: (int (*)(const void *, const void *)) compar;
+{
+    unsigned int* keys = [self tagVector];
+    qsort (keys, count, sizeof (unsigned int), compar);
+    return keys;
+}
+
+@end

File Dependencies/TSDataTypes/TSDataTypes-Info.plist

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>TSDataTypes</string>
+	<key>CFBundleIdentifier</key>
+	<string>fi.karppinen.TSDataTypes</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+</dict>
+</plist>

File Dependencies/TSDataTypes/TSDataTypes.xcodeproj/project.pbxproj

+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 42;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		531741D3095A255F0098D3D5 /* TSObjectDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 531741D1095A255F0098D3D5 /* TSObjectDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		531741D4095A255F0098D3D5 /* TSObjectDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 531741D2095A255F0098D3D5 /* TSObjectDictionary.m */; };
+		53174299095AB4860098D3D5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
+		533A93D10A0BA68A00E46C4E /* TSInvocationRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 533A93CF0A0BA68A00E46C4E /* TSInvocationRecorder.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		533A93D20A0BA68A00E46C4E /* TSInvocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 533A93D00A0BA68A00E46C4E /* TSInvocationRecorder.m */; };
+		53657EAC0A36F97300CDEC90 /* TSAbstractDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 5383CEBB09F582D40044D8B6 /* TSAbstractDictionary.m */; };
+		53657EAD0A36F97400CDEC90 /* TSIndexDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B3838A08BF419D0071D224 /* TSIndexDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EAE0A36F97700CDEC90 /* TSNonRetainedObjectDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 537CB28C09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EAF0A36F97900CDEC90 /* TSObjectDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 531741D2095A255F0098D3D5 /* TSObjectDictionary.m */; };
+		53657EB10A36F97B00CDEC90 /* TSObjectTagDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3839008BF428C0071D224 /* TSObjectTagDictionary.m */; };
+		53657EB20A36F97C00CDEC90 /* TSObjectDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 531741D1095A255F0098D3D5 /* TSObjectDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EB40A36F99C00CDEC90 /* TSObjectTagDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B3838F08BF428C0071D224 /* TSObjectTagDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EB50A36F99C00CDEC90 /* TSIndexDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3838B08BF419D0071D224 /* TSIndexDictionary.m */; };
+		53657EB60A36F99D00CDEC90 /* TSAbstractDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 5383CEBA09F582D40044D8B6 /* TSAbstractDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EB70A36F99E00CDEC90 /* TSNonRetainedObjectDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 537CB28B09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.m */; };
+		53657EB80A36F99F00CDEC90 /* TSNonRetainedObjectSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 53DCDADE0A08D71F00906A83 /* TSNonRetainedObjectSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EB90A36F99F00CDEC90 /* TSNonRetainedObjectSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 53DCDADF0A08D71F00906A83 /* TSNonRetainedObjectSet.m */; };
+		53657EBC0A36F9A200CDEC90 /* TSInvocationRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 533A93CF0A0BA68A00E46C4E /* TSInvocationRecorder.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EBD0A36F9A200CDEC90 /* TSInvocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 533A93D00A0BA68A00E46C4E /* TSInvocationRecorder.m */; };
+		53657EBE0A36F9A300CDEC90 /* NSInvocation+TSAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C7FAF30A18B70400CFFB5A /* NSInvocation+TSAdditions.m */; };
+		53657EBF0A36F9A300CDEC90 /* NSInvocation+TSAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C7FAF20A18B70400CFFB5A /* NSInvocation+TSAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EC00A36F9A400CDEC90 /* TSInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C7FBF20A18C9AC00CFFB5A /* TSInvocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EC10A36F9A500CDEC90 /* TSInvocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C7FBF30A18C9AC00CFFB5A /* TSInvocation.m */; };
+		53657EC20A36F9AA00CDEC90 /* TSDataTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 5381AAB608C10CCB00BCE69F /* TSDataTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53657EC30A36F9AC00CDEC90 /* TSDataTypes_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF5E0370ADEE00C91783 /* TSDataTypes_Prefix.pch */; settings = {ATTRIBUTES = (Public, ); }; };
+		537CB28D09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 537CB28B09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.m */; };
+		537CB28E09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 537CB28C09F52B4F00E542E9 /* TSNonRetainedObjectDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		5381AAB708C10CCB00BCE69F /* TSDataTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 5381AAB608C10CCB00BCE69F /* TSDataTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		5383CEBC09F582D40044D8B6 /* TSAbstractDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 5383CEBA09F582D40044D8B6 /* TSAbstractDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		5383CEBD09F582D40044D8B6 /* TSAbstractDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 5383CEBB09F582D40044D8B6 /* TSAbstractDictionary.m */; };
+		53B3843408BF78950071D224 /* TSIndexDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B3838A08BF419D0071D224 /* TSIndexDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53B3843508BF78950071D224 /* TSIndexDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3838B08BF419D0071D224 /* TSIndexDictionary.m */; };
+		53B3843608BF78960071D224 /* TSObjectTagDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B3838F08BF428C0071D224 /* TSObjectTagDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53B3843708BF78960071D224 /* TSObjectTagDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3839008BF428C0071D224 /* TSObjectTagDictionary.m */; };
+		53C7FBF40A18C9AC00CFFB5A /* TSInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C7FBF20A18C9AC00CFFB5A /* TSInvocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53C7FBF50A18C9AC00CFFB5A /* TSInvocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C7FBF30A18C9AC00CFFB5A /* TSInvocation.m */; };
+		53C7FC0F0A18CB2200CFFB5A /* NSInvocation+TSAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C7FAF30A18B70400CFFB5A /* NSInvocation+TSAdditions.m */; };
+		53C7FC100A18CB2200CFFB5A /* NSInvocation+TSAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C7FAF20A18B70400CFFB5A /* NSInvocation+TSAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53DCDAE00A08D71F00906A83 /* TSNonRetainedObjectSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 53DCDADE0A08D71F00906A83 /* TSNonRetainedObjectSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		53DCDAE10A08D71F00906A83 /* TSNonRetainedObjectSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 53DCDADF0A08D71F00906A83 /* TSNonRetainedObjectSet.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		53174850095C1A420098D3D5 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5317484A095C1A420098D3D5 /* TSDataTypesUnitTests.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 53174802095C148D0098D3D5;
+			remoteInfo = TSDataTypesUnitTests;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+		32DBCF5E0370ADEE00C91783 /* TSDataTypes_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSDataTypes_Prefix.pch; path = Sources/TSDataTypes_Prefix.pch; sourceTree = "<group>"; };
+		531741D1095A255F0098D3D5 /* TSObjectDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.