changeset 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents 27e00625790b
children 9f0b49a2f64e
files dsss.conf dstep/corefoundation/CFArray.d dstep/corefoundation/CFAttributedString.d dstep/corefoundation/CFBag.d dstep/corefoundation/CFBase.d dstep/corefoundation/CFBinaryHeap.d dstep/corefoundation/CFBitVector.d dstep/corefoundation/CFBundle.d dstep/corefoundation/CFByteOrder.d dstep/corefoundation/CFCalendar.d dstep/corefoundation/CFCharacterSet.d dstep/corefoundation/CFData.d dstep/corefoundation/CFDate.d dstep/corefoundation/CFDateFormatter.d dstep/corefoundation/CFDictionary.d dstep/corefoundation/CFError.d dstep/corefoundation/CFFileDescriptor.d dstep/corefoundation/CFLocale.d dstep/corefoundation/CFMachPort.d dstep/corefoundation/CFMessagePort.d dstep/corefoundation/CFNotificationCenter.d dstep/corefoundation/CFNumber.d dstep/corefoundation/CFNumberFormatter.d dstep/corefoundation/CFPlugIn.d dstep/corefoundation/CFPlugInCOM.d dstep/corefoundation/CFPreferences.d dstep/corefoundation/CFPropertyList.d dstep/corefoundation/CFRunLoop.d dstep/corefoundation/CFSet.d dstep/corefoundation/CFSet_bindings.d dstep/corefoundation/CFSocket.d dstep/corefoundation/CFStream.d dstep/corefoundation/CFString.d dstep/corefoundation/CFStringEncodingExt.d dstep/corefoundation/CFStringTokenizer.d dstep/corefoundation/CFTimeZone.d dstep/corefoundation/CFTree.d dstep/corefoundation/CFURL.d dstep/corefoundation/CFURLAccess.d dstep/corefoundation/CFUUID.d dstep/corefoundation/CFUserNotification.d dstep/corefoundation/CFXMLNode.d dstep/corefoundation/CFXMLParser.d dstep/corefoundation/CoreFoundation.d dstep/coreservices/Components.d dstep/coreservices/CoreServices.d dstep/coreservices/ae/AE.d dstep/coreservices/ae/AEDataModel.d dstep/coreservices/ae/AEHelpers.d dstep/coreservices/ae/AEMach.d dstep/coreservices/ae/AEObjects.d dstep/coreservices/ae/AEPackObject.d dstep/coreservices/ae/AERegistry.d dstep/coreservices/ae/AEUserTermTypes.d dstep/coreservices/ae/AppleEvents.d dstep/coreservices/carboncore/AIFF.d dstep/coreservices/carboncore/AVLTree.d dstep/coreservices/carboncore/Aliases.d dstep/coreservices/carboncore/BackupCore.d dstep/coreservices/carboncore/CarbonCore.d dstep/coreservices/carboncore/CodeFragments.d dstep/coreservices/carboncore/Collections.d dstep/coreservices/carboncore/Components.d dstep/coreservices/carboncore/ConditionalMacros.d dstep/coreservices/carboncore/DateTimeUtils.d dstep/coreservices/carboncore/Debugging.d dstep/coreservices/carboncore/DriverServices.d dstep/coreservices/carboncore/DriverSynchronization.d dstep/coreservices/carboncore/Endian.d dstep/coreservices/carboncore/FSEvents.d dstep/coreservices/carboncore/Files.d dstep/coreservices/carboncore/Finder.d dstep/coreservices/carboncore/FixMath.d dstep/coreservices/carboncore/Folders.d dstep/coreservices/carboncore/Gestalt.d dstep/coreservices/carboncore/HFSVolumes.d dstep/coreservices/carboncore/IntlResources.d dstep/coreservices/carboncore/LowMem.d dstep/coreservices/carboncore/MacErrors.d dstep/coreservices/carboncore/MacLocales.d dstep/coreservices/carboncore/MacMemory.d dstep/coreservices/carboncore/MacTypes.d dstep/coreservices/carboncore/MachineExceptions.d dstep/coreservices/carboncore/Math64.d dstep/coreservices/carboncore/MixedMode.d dstep/coreservices/carboncore/Multiprocessing.d dstep/coreservices/carboncore/MultiprocessingInfo.d dstep/coreservices/carboncore/NumberFormatting.d dstep/coreservices/carboncore/OSUtils.d dstep/coreservices/carboncore/PEFBinaryFormat.d dstep/coreservices/carboncore/PLStringFuncs.d dstep/coreservices/carboncore/Resources.d dstep/coreservices/carboncore/Script.d dstep/coreservices/carboncore/StringCompare.d dstep/coreservices/carboncore/TextCommon.d dstep/coreservices/carboncore/TextEncodingConverter.d dstep/coreservices/carboncore/TextEncodingPlugin.d dstep/coreservices/carboncore/TextUtils.d dstep/coreservices/carboncore/Threads.d dstep/coreservices/carboncore/Timer.d dstep/coreservices/carboncore/ToolUtils.d dstep/coreservices/carboncore/UTCUtils.d dstep/coreservices/carboncore/UnicodeConverter.d dstep/coreservices/carboncore/UnicodeUtilities.d dstep/coreservices/carboncore/fp.d dstep/coreservices/cfnetwork/CFFTPStream.d dstep/coreservices/cfnetwork/CFHTTPAuthentication.d dstep/coreservices/cfnetwork/CFHTTPMessage.d dstep/coreservices/cfnetwork/CFHTTPStream.d dstep/coreservices/cfnetwork/CFHost.d dstep/coreservices/cfnetwork/CFNetDiagnostics.d dstep/coreservices/cfnetwork/CFNetServices.d dstep/coreservices/cfnetwork/CFNetwork.d dstep/coreservices/cfnetwork/CFNetworkDefs.d dstep/coreservices/cfnetwork/CFNetworkErrors.d dstep/coreservices/cfnetwork/CFProxySupport.d dstep/coreservices/cfnetwork/CFSocketStream.d dstep/coreservices/dictionaryservices/DictionaryServices.d dstep/coreservices/launchservices/IconsCore.d dstep/coreservices/launchservices/LSInfo.d dstep/coreservices/launchservices/LSOpen.d dstep/coreservices/launchservices/LSQuarantine.d dstep/coreservices/launchservices/LSSharedFileList.d dstep/coreservices/launchservices/LaunchServices.d dstep/coreservices/launchservices/UTCoreTypes.d dstep/coreservices/launchservices/UTType.d dstep/coreservices/osservices/AppleDiskPartitions.d dstep/coreservices/osservices/CSIdentity.d dstep/coreservices/osservices/CSIdentityAuthority.d dstep/coreservices/osservices/CSIdentityQuery.d dstep/coreservices/osservices/IconStorage.d dstep/coreservices/osservices/KeychainCore.d dstep/coreservices/osservices/NSLCore.d dstep/coreservices/osservices/OSServices.d dstep/coreservices/osservices/OT.d dstep/coreservices/osservices/OpenTransport.d dstep/coreservices/osservices/OpenTransportProtocol.d dstep/coreservices/osservices/OpenTransportProviders.d dstep/coreservices/osservices/Power.d dstep/coreservices/osservices/SCSI.d dstep/coreservices/osservices/SecurityCore.d dstep/coreservices/osservices/SystemSound.d dstep/coreservices/osservices/WSMethodInvocation.d dstep/coreservices/osservices/WSProtocolHandler.d dstep/coreservices/osservices/WSTypes.d dstep/coreservices/searchkit/SKAnalysis.d dstep/coreservices/searchkit/SKDocument.d dstep/coreservices/searchkit/SKIndex.d dstep/coreservices/searchkit/SKSearch.d dstep/coreservices/searchkit/SKSummary.d dstep/coreservices/searchkit/SearchKit.d dstep/diskarbitration/DADisk.d dstep/diskarbitration/DADissenter.d dstep/diskarbitration/DASession.d dstep/diskarbitration/DiskArbitration.d dstep/internal/Version.d dstep/objc/bridge/Bridge.d dstep/objc/bridge/TypeEncoding.d dstep/security/AuthSession.d dstep/security/Authorization.d dstep/security/AuthorizationDB.d dstep/security/AuthorizationPlugin.d dstep/security/AuthorizationTags.d dstep/security/CMSDecoder.d dstep/security/CMSEncoder.d dstep/security/CipherSuite.d dstep/security/SecACL.d dstep/security/SecAccess.d dstep/security/SecAsn1Coder.d dstep/security/SecAsn1Templates.d dstep/security/SecAsn1Types.d dstep/security/SecBase.d dstep/security/SecCertificate.d dstep/security/SecIdentity.d dstep/security/SecIdentitySearch.d dstep/security/SecImportExport.d dstep/security/SecKey.d dstep/security/SecKeychain.d dstep/security/SecKeychainItem.d dstep/security/SecKeychainSearch.d dstep/security/SecPolicy.d dstep/security/SecPolicySearch.d dstep/security/SecTrust.d dstep/security/SecTrustSettings.d dstep/security/SecTrustedApplication.d dstep/security/SecureDownload.d dstep/security/SecureTransport.d dstep/security/Security.d dstep/security/certextensions.d dstep/security/cssm.d dstep/security/cssmaci.d dstep/security/cssmapi.d dstep/security/cssmapple.d dstep/security/cssmcli.d dstep/security/cssmconfig.d dstep/security/cssmcspi.d dstep/security/cssmdli.d dstep/security/cssmerr.d dstep/security/cssmkrapi.d dstep/security/cssmkrspi.d dstep/security/cssmspi.d dstep/security/cssmtpi.d dstep/security/cssmtype.d dstep/security/eisl.d dstep/security/emmspi.d dstep/security/emmtype.d dstep/security/mds.d dstep/security/mds_schema.d dstep/security/oidsalg.d dstep/security/oidsattr.d dstep/security/oidsbase.d dstep/security/oidscert.d dstep/security/oidscrl.d dstep/security/x509defs.d scripts/dgen.rb scripts/dstepgen.rb
diffstat 216 files changed, 34276 insertions(+), 231 deletions(-) [+]
line wrap: on
line diff
--- a/dsss.conf	Thu Jul 09 23:25:18 2009 +0200
+++ b/dsss.conf	Sat Aug 01 15:03:28 2009 +0200
@@ -1,3 +1,2 @@
 [dstep]
-exlude += dstep/foundation
-exlude += dstep/appkit
\ No newline at end of file
+exclude += dstep/foundation
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFArray.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,68 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFArray;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFArray;
+alias __CFArray* CFArrayRef;
+alias __CFArray* CFMutableArrayRef;
+
+extern (C)
+{
+	alias void function (void*, void*) CFArrayApplierFunction;
+	alias ubyte function (void*, void*) CFArrayEqualCallBack;
+	alias CFStringRef function (void*) CFArrayCopyDescriptionCallBack;
+	alias void function (CFAllocatorRef, void*) CFArrayReleaseCallBack;
+	alias void* function (CFAllocatorRef, void*) CFArrayRetainCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFArrayCallBacks kCFTypeArrayCallBacks;
+	}
+}
+
+struct CFArrayCallBacks
+{
+	int version_;
+	CFArrayRetainCallBack* retain;
+	CFArrayReleaseCallBack* release;
+	CFArrayCopyDescriptionCallBack* copyDescription;
+	CFArrayEqualCallBack* equal;
+}
+
+extern (C)
+{
+	uint CFArrayGetTypeID ();
+	CFArrayRef CFArrayCreate (CFAllocatorRef allocator, void** values, int numValues, CFArrayCallBacks* callBacks);
+	CFArrayRef CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray);
+	CFMutableArrayRef CFArrayCreateMutable (CFAllocatorRef allocator, int capacity, CFArrayCallBacks* callBacks);
+	CFMutableArrayRef CFArrayCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFArrayRef theArray);
+	int CFArrayGetCount (CFArrayRef theArray);
+	int CFArrayGetCountOfValue (CFArrayRef theArray, CFRange range, void* value);
+	ubyte CFArrayContainsValue (CFArrayRef theArray, CFRange range, void* value);
+	void* CFArrayGetValueAtIndex (CFArrayRef theArray, int idx);
+	void CFArrayGetValues (CFArrayRef theArray, CFRange range, void** values);
+	void CFArrayApplyFunction (CFArrayRef theArray, CFRange range, CFArrayApplierFunction* applier, void* context);
+	int CFArrayGetFirstIndexOfValue (CFArrayRef theArray, CFRange range, void* value);
+	int CFArrayGetLastIndexOfValue (CFArrayRef theArray, CFRange range, void* value);
+	int CFArrayBSearchValues (CFArrayRef theArray, CFRange range, void* value, CFComparatorFunction* comparator, void* context);
+	void CFArrayAppendValue (CFMutableArrayRef theArray, void* value);
+	void CFArrayInsertValueAtIndex (CFMutableArrayRef theArray, int idx, void* value);
+	void CFArraySetValueAtIndex (CFMutableArrayRef theArray, int idx, void* value);
+	void CFArrayRemoveValueAtIndex (CFMutableArrayRef theArray, int idx);
+	void CFArrayRemoveAllValues (CFMutableArrayRef theArray);
+	void CFArrayReplaceValues (CFMutableArrayRef theArray, CFRange range, void** newValues, int newCount);
+	void CFArrayExchangeValuesAtIndices (CFMutableArrayRef theArray, int idx1, int idx2);
+	void CFArraySortValues (CFMutableArrayRef theArray, CFRange range, CFComparatorFunction* comparator, void* context);
+	void CFArrayAppendArray (CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFAttributedString.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,41 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFAttributedString;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFAttributedString;
+alias __CFAttributedString* CFAttributedStringRef;
+alias __CFAttributedString* CFMutableAttributedStringRef;
+
+extern (C)
+{
+	uint CFAttributedStringGetTypeID ();
+	CFAttributedStringRef CFAttributedStringCreate (CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes);
+	CFAttributedStringRef CFAttributedStringCreateWithSubstring (CFAllocatorRef alloc, CFAttributedStringRef aStr, CFRange range);
+	CFAttributedStringRef CFAttributedStringCreateCopy (CFAllocatorRef alloc, CFAttributedStringRef aStr);
+	CFStringRef CFAttributedStringGetString (CFAttributedStringRef aStr);
+	int CFAttributedStringGetLength (CFAttributedStringRef aStr);
+	CFDictionaryRef CFAttributedStringGetAttributes (CFAttributedStringRef aStr, int loc, CFRange* effectiveRange);
+	void* CFAttributedStringGetAttribute (CFAttributedStringRef aStr, int loc, CFStringRef attrName, CFRange* effectiveRange);
+	CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange (CFAttributedStringRef aStr, int loc, CFRange inRange, CFRange* longestEffectiveRange);
+	void* CFAttributedStringGetAttributeAndLongestEffectiveRange (CFAttributedStringRef aStr, int loc, CFStringRef attrName, CFRange inRange, CFRange* longestEffectiveRange);
+	CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy (CFAllocatorRef alloc, int maxLength, CFAttributedStringRef aStr);
+	CFMutableAttributedStringRef CFAttributedStringCreateMutable (CFAllocatorRef alloc, int maxLength);
+	void CFAttributedStringReplaceString (CFMutableAttributedStringRef aStr, CFRange range, CFStringRef replacement);
+	CFMutableStringRef CFAttributedStringGetMutableString (CFMutableAttributedStringRef aStr);
+	void CFAttributedStringSetAttributes (CFMutableAttributedStringRef aStr, CFRange range, CFDictionaryRef replacement, ubyte clearOtherAttributes);
+	void CFAttributedStringSetAttribute (CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, void* value);
+	void CFAttributedStringRemoveAttribute (CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName);
+	void CFAttributedStringReplaceAttributedString (CFMutableAttributedStringRef aStr, CFRange range, CFAttributedStringRef replacement);
+	void CFAttributedStringBeginEditing (CFMutableAttributedStringRef aStr);
+	void CFAttributedStringEndEditing (CFMutableAttributedStringRef aStr);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFBag.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,65 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFBag;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFBag;
+alias __CFBag* CFBagRef;
+alias __CFBag* CFMutableBagRef;
+
+extern (C)
+{
+	alias ubyte function (void*, void*) CFBagEqualCallBack;
+	alias void* function (CFAllocatorRef, void*) CFBagRetainCallBack;
+	alias uint function (void*) CFBagHashCallBack;
+	alias CFStringRef function (void*) CFBagCopyDescriptionCallBack;
+	alias void function (CFAllocatorRef, void*) CFBagReleaseCallBack;
+	alias void function (void*, void*) CFBagApplierFunction;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFBagCallBacks kCFTypeBagCallBacks;
+		const CFBagCallBacks kCFCopyStringBagCallBacks;
+	}
+}
+
+struct CFBagCallBacks
+{
+	int version_;
+	CFBagRetainCallBack* retain;
+	CFBagReleaseCallBack* release;
+	CFBagCopyDescriptionCallBack* copyDescription;
+	CFBagEqualCallBack* equal;
+	CFBagHashCallBack* hash;
+}
+
+extern (C)
+{
+	uint CFBagGetTypeID ();
+	CFBagRef CFBagCreate (CFAllocatorRef allocator, void** values, int numValues, CFBagCallBacks* callBacks);
+	CFBagRef CFBagCreateCopy (CFAllocatorRef allocator, CFBagRef theBag);
+	CFMutableBagRef CFBagCreateMutable (CFAllocatorRef allocator, int capacity, CFBagCallBacks* callBacks);
+	CFMutableBagRef CFBagCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFBagRef theBag);
+	int CFBagGetCount (CFBagRef theBag);
+	int CFBagGetCountOfValue (CFBagRef theBag, void* value);
+	ubyte CFBagContainsValue (CFBagRef theBag, void* value);
+	void* CFBagGetValue (CFBagRef theBag, void* value);
+	ubyte CFBagGetValueIfPresent (CFBagRef theBag, void* candidate, void** value);
+	void CFBagGetValues (CFBagRef theBag, void** values);
+	void CFBagApplyFunction (CFBagRef theBag, CFBagApplierFunction* applier, void* context);
+	void CFBagAddValue (CFMutableBagRef theBag, void* value);
+	void CFBagReplaceValue (CFMutableBagRef theBag, void* value);
+	void CFBagSetValue (CFMutableBagRef theBag, void* value);
+	void CFBagRemoveValue (CFMutableBagRef theBag, void* value);
+	void CFBagRemoveAllValues (CFMutableBagRef theBag);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFBase.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,117 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFBase;
+
+/*import dstep.AvailabilityMacros;
+import dstep.MacTypes;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.libkern.OSTypes;*/
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+/*import dstep.stdbool;
+import dstep.stdint;
+import dstep.windows;
+import dstep.winsock2;*/
+
+alias uint CFTypeID;
+alias uint CFOptionFlags;
+alias uint CFHashCode;
+alias int CFIndex;
+alias void* CFTypeRef;
+struct __CFString;
+alias __CFString* CFStringRef;
+alias __CFString* CFMutableStringRef;
+alias void* CFPropertyListRef;
+alias int CFComparisonResult;
+struct __CFNull;
+alias __CFNull* CFNullRef;
+struct __CFAllocator;
+alias __CFAllocator* CFAllocatorRef;
+
+extern (C)
+{
+	alias void function (void*, void*) CFAllocatorDeallocateCallBack;
+	alias void* function (void*, int, uint, void*) CFAllocatorReallocateCallBack;
+	alias void* function (void*) CFAllocatorRetainCallBack;
+	alias CFStringRef function (void*) CFAllocatorCopyDescriptionCallBack;
+	alias int function (void*, void*, void*) CFComparatorFunction;
+	alias void function (void*) CFAllocatorReleaseCallBack;
+	alias int function (int, uint, void*) CFAllocatorPreferredSizeCallBack;
+	alias void* function (int, uint, void*) CFAllocatorAllocateCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		double kCFCoreFoundationVersionNumber;
+		const CFNullRef kCFNull;
+		const CFAllocatorRef kCFAllocatorDefault;
+		const CFAllocatorRef kCFAllocatorSystemDefault;
+		const CFAllocatorRef kCFAllocatorMalloc;
+		const CFAllocatorRef kCFAllocatorMallocZone;
+		const CFAllocatorRef kCFAllocatorNull;
+		const CFAllocatorRef kCFAllocatorUseContext;
+	}
+}
+
+enum
+{
+	kCFCompareLessThan = -1,
+	kCFCompareEqualTo = 0,
+	kCFCompareGreaterThan = 1
+}
+
+enum
+{
+	kCFNotFound = -1
+}
+
+struct CFRange
+{
+	int location;
+	int length;
+}
+
+
+struct CFAllocatorContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack* retain;
+	CFAllocatorReleaseCallBack* release;
+	CFAllocatorCopyDescriptionCallBack* copyDescription;
+	CFAllocatorAllocateCallBack* allocate;
+	CFAllocatorReallocateCallBack* reallocate;
+	CFAllocatorDeallocateCallBack* deallocate;
+	CFAllocatorPreferredSizeCallBack* preferredSize;
+}
+
+extern (C)
+{
+	CFRange __CFRangeMake (int loc, int len);
+	uint CFNullGetTypeID ();
+	uint CFAllocatorGetTypeID ();
+	void CFAllocatorSetDefault (CFAllocatorRef allocator);
+	CFAllocatorRef CFAllocatorGetDefault ();
+	CFAllocatorRef CFAllocatorCreate (CFAllocatorRef allocator, CFAllocatorContext* context);
+	void* CFAllocatorAllocate (CFAllocatorRef allocator, int size, uint hint);
+	void* CFAllocatorReallocate (CFAllocatorRef allocator, void* ptr, int newsize, uint hint);
+	void CFAllocatorDeallocate (CFAllocatorRef allocator, void* ptr);
+	int CFAllocatorGetPreferredSizeForSize (CFAllocatorRef allocator, int size, uint hint);
+	void CFAllocatorGetContext (CFAllocatorRef allocator, CFAllocatorContext* context);
+	uint CFGetTypeID (void* cf);
+	CFStringRef CFCopyTypeIDDescription (uint type_id);
+	void* CFRetain (void* cf);
+	void CFRelease (void* cf);
+	int CFGetRetainCount (void* cf);
+	void* CFMakeCollectable (void* cf);
+	ubyte CFEqual (void* cf1, void* cf2);
+	uint CFHash (void* cf);
+	CFStringRef CFCopyDescription (void* cf);
+	CFAllocatorRef CFGetAllocator (void* cf);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFBinaryHeap.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,57 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFBinaryHeap;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFBinaryHeap;
+alias __CFBinaryHeap* CFBinaryHeapRef;
+
+extern (C)
+{
+	alias void function (void*, void*) CFBinaryHeapApplierFunction;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
+	}
+}
+
+struct CFBinaryHeapCompareContext
+{
+	int version_;
+	void* info;
+}
+
+
+struct CFBinaryHeapCallBacks
+{
+	int version_;
+	void* ptr2;
+}
+
+extern (C)
+{
+	uint CFBinaryHeapGetTypeID ();
+	CFBinaryHeapRef CFBinaryHeapCreate (CFAllocatorRef allocator, int capacity, CFBinaryHeapCallBacks* callBacks, CFBinaryHeapCompareContext* compareContext);
+	CFBinaryHeapRef CFBinaryHeapCreateCopy (CFAllocatorRef allocator, int capacity, CFBinaryHeapRef heap);
+	int CFBinaryHeapGetCount (CFBinaryHeapRef heap);
+	int CFBinaryHeapGetCountOfValue (CFBinaryHeapRef heap, void* value);
+	ubyte CFBinaryHeapContainsValue (CFBinaryHeapRef heap, void* value);
+	void* CFBinaryHeapGetMinimum (CFBinaryHeapRef heap);
+	ubyte CFBinaryHeapGetMinimumIfPresent (CFBinaryHeapRef heap, void** value);
+	void CFBinaryHeapGetValues (CFBinaryHeapRef heap, void** values);
+	void CFBinaryHeapApplyFunction (CFBinaryHeapRef heap, CFBinaryHeapApplierFunction* applier, void* context);
+	void CFBinaryHeapAddValue (CFBinaryHeapRef heap, void* value);
+	void CFBinaryHeapRemoveMinimumValue (CFBinaryHeapRef heap);
+	void CFBinaryHeapRemoveAllValues (CFBinaryHeapRef heap);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFBitVector.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,38 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFBitVector;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias uint CFBit;
+struct __CFBitVector;
+alias __CFBitVector* CFBitVectorRef;
+alias __CFBitVector* CFMutableBitVectorRef;
+
+extern (C)
+{
+	uint CFBitVectorGetTypeID ();
+	CFBitVectorRef CFBitVectorCreate (CFAllocatorRef allocator, char* bytes, int numBits);
+	CFBitVectorRef CFBitVectorCreateCopy (CFAllocatorRef allocator, CFBitVectorRef bv);
+	CFMutableBitVectorRef CFBitVectorCreateMutable (CFAllocatorRef allocator, int capacity);
+	CFMutableBitVectorRef CFBitVectorCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFBitVectorRef bv);
+	int CFBitVectorGetCount (CFBitVectorRef bv);
+	int CFBitVectorGetCountOfBit (CFBitVectorRef bv, CFRange range, uint value);
+	ubyte CFBitVectorContainsBit (CFBitVectorRef bv, CFRange range, uint value);
+	uint CFBitVectorGetBitAtIndex (CFBitVectorRef bv, int idx);
+	void CFBitVectorGetBits (CFBitVectorRef bv, CFRange range, char* bytes);
+	int CFBitVectorGetFirstIndexOfBit (CFBitVectorRef bv, CFRange range, uint value);
+	int CFBitVectorGetLastIndexOfBit (CFBitVectorRef bv, CFRange range, uint value);
+	void CFBitVectorSetCount (CFMutableBitVectorRef bv, int count);
+	void CFBitVectorFlipBitAtIndex (CFMutableBitVectorRef bv, int idx);
+	void CFBitVectorFlipBits (CFMutableBitVectorRef bv, CFRange range);
+	void CFBitVectorSetBitAtIndex (CFMutableBitVectorRef bv, int idx, uint value);
+	void CFBitVectorSetBits (CFMutableBitVectorRef bv, CFRange range, uint value);
+	void CFBitVectorSetAllBits (CFMutableBitVectorRef bv, uint value);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFBundle.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,98 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFBundle;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFError;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFBundle;
+alias __CFBundle* CFBundleRef;
+alias __CFBundle* CFPlugInRef;
+alias int CFBundleRefNum;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFBundleInfoDictionaryVersionKey;
+		const CFStringRef kCFBundleExecutableKey;
+		const CFStringRef kCFBundleIdentifierKey;
+		const CFStringRef kCFBundleVersionKey;
+		const CFStringRef kCFBundleDevelopmentRegionKey;
+		const CFStringRef kCFBundleNameKey;
+		const CFStringRef kCFBundleLocalizationsKey;
+	}
+}
+
+enum
+{
+	kCFBundleExecutableArchitectureI386 = 0x00000007,
+	kCFBundleExecutableArchitecturePPC = 0x00000012,
+	kCFBundleExecutableArchitectureX86_64 = 0x01000007,
+	kCFBundleExecutableArchitecturePPC64 = 0x01000012
+}
+
+extern (C)
+{
+	CFBundleRef CFBundleGetMainBundle ();
+	CFBundleRef CFBundleGetBundleWithIdentifier (CFStringRef bundleID);
+	CFArrayRef CFBundleGetAllBundles ();
+	uint CFBundleGetTypeID ();
+	CFBundleRef CFBundleCreate (CFAllocatorRef allocator, CFURLRef bundleURL);
+	CFArrayRef CFBundleCreateBundlesFromDirectory (CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType);
+	CFURLRef CFBundleCopyBundleURL (CFBundleRef bundle);
+	void* CFBundleGetValueForInfoDictionaryKey (CFBundleRef bundle, CFStringRef key);
+	CFDictionaryRef CFBundleGetInfoDictionary (CFBundleRef bundle);
+	CFDictionaryRef CFBundleGetLocalInfoDictionary (CFBundleRef bundle);
+	void CFBundleGetPackageInfo (CFBundleRef bundle, uint* packageType, uint* packageCreator);
+	CFStringRef CFBundleGetIdentifier (CFBundleRef bundle);
+	uint CFBundleGetVersionNumber (CFBundleRef bundle);
+	CFStringRef CFBundleGetDevelopmentRegion (CFBundleRef bundle);
+	CFURLRef CFBundleCopySupportFilesDirectoryURL (CFBundleRef bundle);
+	CFURLRef CFBundleCopyResourcesDirectoryURL (CFBundleRef bundle);
+	CFURLRef CFBundleCopyPrivateFrameworksURL (CFBundleRef bundle);
+	CFURLRef CFBundleCopySharedFrameworksURL (CFBundleRef bundle);
+	CFURLRef CFBundleCopySharedSupportURL (CFBundleRef bundle);
+	CFURLRef CFBundleCopyBuiltInPlugInsURL (CFBundleRef bundle);
+	CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory (CFURLRef bundleURL);
+	ubyte CFBundleGetPackageInfoInDirectory (CFURLRef url, uint* packageType, uint* packageCreator);
+	CFURLRef CFBundleCopyResourceURL (CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
+	CFArrayRef CFBundleCopyResourceURLsOfType (CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName);
+	CFStringRef CFBundleCopyLocalizedString (CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName);
+	CFURLRef CFBundleCopyResourceURLInDirectory (CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
+	CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory (CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName);
+	CFArrayRef CFBundleCopyBundleLocalizations (CFBundleRef bundle);
+	CFArrayRef CFBundleCopyPreferredLocalizationsFromArray (CFArrayRef locArray);
+	CFArrayRef CFBundleCopyLocalizationsForPreferences (CFArrayRef locArray, CFArrayRef prefArray);
+	CFURLRef CFBundleCopyResourceURLForLocalization (CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
+	CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization (CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
+	CFDictionaryRef CFBundleCopyInfoDictionaryForURL (CFURLRef url);
+	CFArrayRef CFBundleCopyLocalizationsForURL (CFURLRef url);
+	CFArrayRef CFBundleCopyExecutableArchitecturesForURL (CFURLRef url);
+	CFURLRef CFBundleCopyExecutableURL (CFBundleRef bundle);
+	CFArrayRef CFBundleCopyExecutableArchitectures (CFBundleRef bundle);
+	ubyte CFBundlePreflightExecutable (CFBundleRef bundle, CFErrorRef* error);
+	ubyte CFBundleLoadExecutableAndReturnError (CFBundleRef bundle, CFErrorRef* error);
+	ubyte CFBundleLoadExecutable (CFBundleRef bundle);
+	ubyte CFBundleIsExecutableLoaded (CFBundleRef bundle);
+	void CFBundleUnloadExecutable (CFBundleRef bundle);
+	void* CFBundleGetFunctionPointerForName (CFBundleRef bundle, CFStringRef functionName);
+	void CFBundleGetFunctionPointersForNames (CFBundleRef bundle, CFArrayRef functionNames, void** ftbl);
+	void* CFBundleGetDataPointerForName (CFBundleRef bundle, CFStringRef symbolName);
+	void CFBundleGetDataPointersForNames (CFBundleRef bundle, CFArrayRef symbolNames, void** stbl);
+	CFURLRef CFBundleCopyAuxiliaryExecutableURL (CFBundleRef bundle, CFStringRef executableName);
+	CFPlugInRef CFBundleGetPlugIn (CFBundleRef bundle);
+	short CFBundleOpenBundleResourceMap (CFBundleRef bundle);
+	int CFBundleOpenBundleResourceFiles (CFBundleRef bundle, short* refNum, short* localizedRefNum);
+	void CFBundleCloseBundleResourceMap (CFBundleRef bundle, short refNum);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFByteOrder.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,31 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFByteOrder;
+
+import dstep.corefoundation.CFBase;
+//import dstep.libkern.OSByteOrder;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+enum __CFByteOrder 
+{
+	CFByteOrderUnknown,
+	CFByteOrderLittleEndian,
+	CFByteOrderBigEndian
+}
+
+struct CFSwappedFloat32
+{
+	uint v;
+}
+
+
+struct CFSwappedFloat64
+{
+	ulong v;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFCalendar.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,62 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFCalendar;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFTimeZone;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFCalendar;
+alias __CFCalendar* CFCalendarRef;
+alias uint CFCalendarUnit;
+
+enum
+{
+	kCFCalendarUnitEra = (1 << 1),
+	kCFCalendarUnitYear = (1 << 2),
+	kCFCalendarUnitMonth = (1 << 3),
+	kCFCalendarUnitDay = (1 << 4),
+	kCFCalendarUnitHour = (1 << 5),
+	kCFCalendarUnitMinute = (1 << 6),
+	kCFCalendarUnitSecond = (1 << 7),
+	kCFCalendarUnitWeek = (1 << 8),
+	kCFCalendarUnitWeekday = (1 << 9),
+	kCFCalendarUnitWeekdayOrdinal = (1 << 10)
+}
+
+enum
+{
+	kCFCalendarComponentsWrap = (1 << 0)
+}
+
+extern (C)
+{
+	uint CFCalendarGetTypeID ();
+	CFCalendarRef CFCalendarCopyCurrent ();
+	CFCalendarRef CFCalendarCreateWithIdentifier (CFAllocatorRef allocator, CFStringRef identifier);
+	CFStringRef CFCalendarGetIdentifier (CFCalendarRef calendar);
+	CFLocaleRef CFCalendarCopyLocale (CFCalendarRef calendar);
+	void CFCalendarSetLocale (CFCalendarRef calendar, CFLocaleRef locale);
+	CFTimeZoneRef CFCalendarCopyTimeZone (CFCalendarRef calendar);
+	void CFCalendarSetTimeZone (CFCalendarRef calendar, CFTimeZoneRef tz);
+	int CFCalendarGetFirstWeekday (CFCalendarRef calendar);
+	void CFCalendarSetFirstWeekday (CFCalendarRef calendar, int wkdy);
+	int CFCalendarGetMinimumDaysInFirstWeek (CFCalendarRef calendar);
+	void CFCalendarSetMinimumDaysInFirstWeek (CFCalendarRef calendar, int mwd);
+	CFRange CFCalendarGetMinimumRangeOfUnit (CFCalendarRef calendar, uint unit);
+	CFRange CFCalendarGetMaximumRangeOfUnit (CFCalendarRef calendar, uint unit);
+	CFRange CFCalendarGetRangeOfUnit (CFCalendarRef calendar, uint smallerUnit, uint biggerUnit, double at);
+	int CFCalendarGetOrdinalityOfUnit (CFCalendarRef calendar, uint smallerUnit, uint biggerUnit, double at);
+	ubyte CFCalendarGetTimeRangeOfUnit (CFCalendarRef calendar, uint unit, double at, double* startp, double* tip);
+	ubyte CFCalendarComposeAbsoluteTime (CFCalendarRef calendar, double* at, char* componentDesc, ...);
+	ubyte CFCalendarDecomposeAbsoluteTime (CFCalendarRef calendar, double at, char* componentDesc, ...);
+	ubyte CFCalendarAddComponents (CFCalendarRef calendar, double* at, uint options, char* componentDesc, ...);
+	ubyte CFCalendarGetComponentDifference (CFCalendarRef calendar, double startingAT, double resultAT, uint options, char* componentDesc, ...);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFCharacterSet.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,61 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFCharacterSet;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFCharacterSet;
+alias __CFCharacterSet* CFCharacterSetRef;
+alias __CFCharacterSet* CFMutableCharacterSetRef;
+alias int CFCharacterSetPredefinedSet;
+
+enum
+{
+	kCFCharacterSetControl = 1,
+	kCFCharacterSetWhitespace,
+	kCFCharacterSetWhitespaceAndNewline,
+	kCFCharacterSetDecimalDigit,
+	kCFCharacterSetLetter,
+	kCFCharacterSetLowercaseLetter,
+	kCFCharacterSetUppercaseLetter,
+	kCFCharacterSetNonBase,
+	kCFCharacterSetDecomposable,
+	kCFCharacterSetAlphaNumeric,
+	kCFCharacterSetPunctuation,
+	kCFCharacterSetCapitalizedLetter = 13,
+	kCFCharacterSetSymbol = 14,
+	kCFCharacterSetNewline = 15,
+	kCFCharacterSetIllegal = 12
+}
+
+extern (C)
+{
+	uint CFCharacterSetGetTypeID ();
+	CFCharacterSetRef CFCharacterSetGetPredefined (int theSetIdentifier);
+	CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange (CFAllocatorRef alloc, CFRange theRange);
+	CFCharacterSetRef CFCharacterSetCreateWithCharactersInString (CFAllocatorRef alloc, CFStringRef theString);
+	CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation (CFAllocatorRef alloc, CFDataRef theData);
+	CFCharacterSetRef CFCharacterSetCreateInvertedSet (CFAllocatorRef alloc, CFCharacterSetRef theSet);
+	ubyte CFCharacterSetIsSupersetOfSet (CFCharacterSetRef theSet, CFCharacterSetRef theOtherset);
+	ubyte CFCharacterSetHasMemberInPlane (CFCharacterSetRef theSet, int thePlane);
+	CFMutableCharacterSetRef CFCharacterSetCreateMutable (CFAllocatorRef alloc);
+	CFCharacterSetRef CFCharacterSetCreateCopy (CFAllocatorRef alloc, CFCharacterSetRef theSet);
+	CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy (CFAllocatorRef alloc, CFCharacterSetRef theSet);
+	ubyte CFCharacterSetIsCharacterMember (CFCharacterSetRef theSet, wchar theChar);
+	ubyte CFCharacterSetIsLongCharacterMember (CFCharacterSetRef theSet, uint theChar);
+	CFDataRef CFCharacterSetCreateBitmapRepresentation (CFAllocatorRef alloc, CFCharacterSetRef theSet);
+	void CFCharacterSetAddCharactersInRange (CFMutableCharacterSetRef theSet, CFRange theRange);
+	void CFCharacterSetRemoveCharactersInRange (CFMutableCharacterSetRef theSet, CFRange theRange);
+	void CFCharacterSetAddCharactersInString (CFMutableCharacterSetRef theSet, CFStringRef theString);
+	void CFCharacterSetRemoveCharactersInString (CFMutableCharacterSetRef theSet, CFStringRef theString);
+	void CFCharacterSetUnion (CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
+	void CFCharacterSetIntersect (CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
+	void CFCharacterSetInvert (CFMutableCharacterSetRef theSet);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFData.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,34 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFData;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFData;
+alias __CFData* CFDataRef;
+alias __CFData* CFMutableDataRef;
+
+extern (C)
+{
+	uint CFDataGetTypeID ();
+	CFDataRef CFDataCreate (CFAllocatorRef allocator, char* bytes, int length);
+	CFDataRef CFDataCreateWithBytesNoCopy (CFAllocatorRef allocator, char* bytes, int length, CFAllocatorRef bytesDeallocator);
+	CFDataRef CFDataCreateCopy (CFAllocatorRef allocator, CFDataRef theData);
+	CFMutableDataRef CFDataCreateMutable (CFAllocatorRef allocator, int capacity);
+	CFMutableDataRef CFDataCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFDataRef theData);
+	int CFDataGetLength (CFDataRef theData);
+	char* CFDataGetBytePtr (CFDataRef theData);
+	char* CFDataGetMutableBytePtr (CFMutableDataRef theData);
+	void CFDataGetBytes (CFDataRef theData, CFRange range, char* buffer);
+	void CFDataSetLength (CFMutableDataRef theData, int length);
+	void CFDataIncreaseLength (CFMutableDataRef theData, int extraLength);
+	void CFDataAppendBytes (CFMutableDataRef theData, char* bytes, int length);
+	void CFDataReplaceBytes (CFMutableDataRef theData, CFRange range, char* newBytes, int newLength);
+	void CFDataDeleteBytes (CFMutableDataRef theData, CFRange range);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFDate.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,78 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFDate;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias double CFTimeInterval;
+alias double CFAbsoluteTime;
+struct __CFDate;
+alias __CFDate* CFDateRef;
+struct __CFTimeZone;
+alias __CFTimeZone* CFTimeZoneRef;
+alias uint CFGregorianUnitFlags;
+
+extern (C)
+{
+	extern
+	{
+		const double kCFAbsoluteTimeIntervalSince1970;
+		const double kCFAbsoluteTimeIntervalSince1904;
+	}
+}
+
+enum
+{
+	kCFGregorianUnitsYears = (1 << 0),
+	kCFGregorianUnitsMonths = (1 << 1),
+	kCFGregorianUnitsDays = (1 << 2),
+	kCFGregorianUnitsHours = (1 << 3),
+	kCFGregorianUnitsMinutes = (1 << 4),
+	kCFGregorianUnitsSeconds = (1 << 5),
+	kCFGregorianAllUnits = 0x00FFFFFF
+}
+
+struct CFGregorianDate
+{
+	int year;
+	byte month;
+	byte day;
+	byte hour;
+	byte minute;
+	double second;
+}
+
+
+struct CFGregorianUnits
+{
+	int years;
+	int months;
+	int days;
+	int hours;
+	int minutes;
+	double seconds;
+}
+
+extern (C)
+{
+	double CFAbsoluteTimeGetCurrent ();
+	uint CFDateGetTypeID ();
+	CFDateRef CFDateCreate (CFAllocatorRef allocator, double at);
+	double CFDateGetAbsoluteTime (CFDateRef theDate);
+	double CFDateGetTimeIntervalSinceDate (CFDateRef theDate, CFDateRef otherDate);
+	int CFDateCompare (CFDateRef theDate, CFDateRef otherDate, void* context);
+	ubyte CFGregorianDateIsValid (CFGregorianDate gdate, uint unitFlags);
+	double CFGregorianDateGetAbsoluteTime (CFGregorianDate gdate, CFTimeZoneRef tz);
+	CFGregorianDate CFAbsoluteTimeGetGregorianDate (double at, CFTimeZoneRef tz);
+	double CFAbsoluteTimeAddGregorianUnits (double at, CFTimeZoneRef tz, CFGregorianUnits units);
+	CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits (double at1, double at2, CFTimeZoneRef tz, uint unitFlags);
+	int CFAbsoluteTimeGetDayOfWeek (double at, CFTimeZoneRef tz);
+	int CFAbsoluteTimeGetDayOfYear (double at, CFTimeZoneRef tz);
+	int CFAbsoluteTimeGetWeekOfYear (double at, CFTimeZoneRef tz);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFDateFormatter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,78 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFDateFormatter;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFLocale;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFDateFormatter;
+alias __CFDateFormatter* CFDateFormatterRef;
+alias int CFDateFormatterStyle;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFDateFormatterIsLenient;
+		const CFStringRef kCFDateFormatterTimeZone;
+		const CFStringRef kCFDateFormatterCalendarName;
+		const CFStringRef kCFDateFormatterDefaultFormat;
+		const CFStringRef kCFDateFormatterTwoDigitStartDate;
+		const CFStringRef kCFDateFormatterDefaultDate;
+		const CFStringRef kCFDateFormatterCalendar;
+		const CFStringRef kCFDateFormatterEraSymbols;
+		const CFStringRef kCFDateFormatterMonthSymbols;
+		const CFStringRef kCFDateFormatterShortMonthSymbols;
+		const CFStringRef kCFDateFormatterWeekdaySymbols;
+		const CFStringRef kCFDateFormatterShortWeekdaySymbols;
+		const CFStringRef kCFDateFormatterAMSymbol;
+		const CFStringRef kCFDateFormatterPMSymbol;
+		const CFStringRef kCFDateFormatterLongEraSymbols;
+		const CFStringRef kCFDateFormatterVeryShortMonthSymbols;
+		const CFStringRef kCFDateFormatterStandaloneMonthSymbols;
+		const CFStringRef kCFDateFormatterShortStandaloneMonthSymbols;
+		const CFStringRef kCFDateFormatterVeryShortStandaloneMonthSymbols;
+		const CFStringRef kCFDateFormatterVeryShortWeekdaySymbols;
+		const CFStringRef kCFDateFormatterStandaloneWeekdaySymbols;
+		const CFStringRef kCFDateFormatterShortStandaloneWeekdaySymbols;
+		const CFStringRef kCFDateFormatterVeryShortStandaloneWeekdaySymbols;
+		const CFStringRef kCFDateFormatterQuarterSymbols;
+		const CFStringRef kCFDateFormatterShortQuarterSymbols;
+		const CFStringRef kCFDateFormatterStandaloneQuarterSymbols;
+		const CFStringRef kCFDateFormatterShortStandaloneQuarterSymbols;
+		const CFStringRef kCFDateFormatterGregorianStartDate;
+	}
+}
+
+enum
+{
+	kCFDateFormatterNoStyle = 0,
+	kCFDateFormatterShortStyle = 1,
+	kCFDateFormatterMediumStyle = 2,
+	kCFDateFormatterLongStyle = 3,
+	kCFDateFormatterFullStyle = 4
+}
+
+extern (C)
+{
+	uint CFDateFormatterGetTypeID ();
+	CFDateFormatterRef CFDateFormatterCreate (CFAllocatorRef allocator, CFLocaleRef locale, int dateStyle, int timeStyle);
+	CFLocaleRef CFDateFormatterGetLocale (CFDateFormatterRef formatter);
+	int CFDateFormatterGetDateStyle (CFDateFormatterRef formatter);
+	int CFDateFormatterGetTimeStyle (CFDateFormatterRef formatter);
+	CFStringRef CFDateFormatterGetFormat (CFDateFormatterRef formatter);
+	void CFDateFormatterSetFormat (CFDateFormatterRef formatter, CFStringRef formatString);
+	CFStringRef CFDateFormatterCreateStringWithDate (CFAllocatorRef allocator, CFDateFormatterRef formatter, CFDateRef date);
+	CFStringRef CFDateFormatterCreateStringWithAbsoluteTime (CFAllocatorRef allocator, CFDateFormatterRef formatter, double at);
+	CFDateRef CFDateFormatterCreateDateFromString (CFAllocatorRef allocator, CFDateFormatterRef formatter, CFStringRef string, CFRange* rangep);
+	ubyte CFDateFormatterGetAbsoluteTimeFromString (CFDateFormatterRef formatter, CFStringRef string, CFRange* rangep, double* atp);
+	void CFDateFormatterSetProperty (CFDateFormatterRef formatter, CFStringRef key, void* value);
+	void* CFDateFormatterCopyProperty (CFDateFormatterRef formatter, CFStringRef key);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFDictionary.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,78 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFDictionary;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFDictionary;
+alias __CFDictionary* CFDictionaryRef;
+alias __CFDictionary* CFMutableDictionaryRef;
+
+extern (C)
+{
+	alias ubyte function (void*, void*) CFDictionaryEqualCallBack;
+	alias uint function (void*) CFDictionaryHashCallBack;
+	alias void* function (CFAllocatorRef, void*) CFDictionaryRetainCallBack;
+	alias CFStringRef function (void*) CFDictionaryCopyDescriptionCallBack;
+	alias void function (CFAllocatorRef, void*) CFDictionaryReleaseCallBack;
+	alias void function (void*, void*, void*) CFDictionaryApplierFunction;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
+		const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
+		const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
+	}
+}
+
+struct CFDictionaryKeyCallBacks
+{
+	int version_;
+	CFDictionaryRetainCallBack* retain;
+	CFDictionaryReleaseCallBack* release;
+	CFDictionaryCopyDescriptionCallBack* copyDescription;
+	CFDictionaryEqualCallBack* equal;
+	CFDictionaryHashCallBack* hash;
+}
+
+
+struct CFDictionaryValueCallBacks
+{
+	int version_;
+	CFDictionaryRetainCallBack* retain;
+	CFDictionaryReleaseCallBack* release;
+	CFDictionaryCopyDescriptionCallBack* copyDescription;
+	CFDictionaryEqualCallBack* equal;
+}
+
+extern (C)
+{
+	uint CFDictionaryGetTypeID ();
+	CFDictionaryRef CFDictionaryCreate (CFAllocatorRef allocator, void** keys, void** values, int numValues, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks);
+	CFDictionaryRef CFDictionaryCreateCopy (CFAllocatorRef allocator, CFDictionaryRef theDict);
+	CFMutableDictionaryRef CFDictionaryCreateMutable (CFAllocatorRef allocator, int capacity, CFDictionaryKeyCallBacks* keyCallBacks, CFDictionaryValueCallBacks* valueCallBacks);
+	CFMutableDictionaryRef CFDictionaryCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFDictionaryRef theDict);
+	int CFDictionaryGetCount (CFDictionaryRef theDict);
+	int CFDictionaryGetCountOfKey (CFDictionaryRef theDict, void* key);
+	int CFDictionaryGetCountOfValue (CFDictionaryRef theDict, void* value);
+	ubyte CFDictionaryContainsKey (CFDictionaryRef theDict, void* key);
+	ubyte CFDictionaryContainsValue (CFDictionaryRef theDict, void* value);
+	void* CFDictionaryGetValue (CFDictionaryRef theDict, void* key);
+	ubyte CFDictionaryGetValueIfPresent (CFDictionaryRef theDict, void* key, void** value);
+	void CFDictionaryGetKeysAndValues (CFDictionaryRef theDict, void** keys, void** values);
+	void CFDictionaryApplyFunction (CFDictionaryRef theDict, CFDictionaryApplierFunction* applier, void* context);
+	void CFDictionaryAddValue (CFMutableDictionaryRef theDict, void* key, void* value);
+	void CFDictionarySetValue (CFMutableDictionaryRef theDict, void* key, void* value);
+	void CFDictionaryReplaceValue (CFMutableDictionaryRef theDict, void* key, void* value);
+	void CFDictionaryRemoveValue (CFMutableDictionaryRef theDict, void* key);
+	void CFDictionaryRemoveAllValues (CFMutableDictionaryRef theDict);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFError.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,45 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFError;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFError;
+alias __CFError* CFErrorRef;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFErrorDomainPOSIX;
+		const CFStringRef kCFErrorDomainOSStatus;
+		const CFStringRef kCFErrorDomainMach;
+		const CFStringRef kCFErrorDomainCocoa;
+		const CFStringRef kCFErrorLocalizedDescriptionKey;
+		const CFStringRef kCFErrorLocalizedFailureReasonKey;
+		const CFStringRef kCFErrorLocalizedRecoverySuggestionKey;
+		const CFStringRef kCFErrorDescriptionKey;
+		const CFStringRef kCFErrorUnderlyingErrorKey;
+	}
+}
+
+extern (C)
+{
+	uint CFErrorGetTypeID ();
+	CFErrorRef CFErrorCreate (CFAllocatorRef allocator, CFStringRef domain, int code, CFDictionaryRef userInfo);
+	CFErrorRef CFErrorCreateWithUserInfoKeysAndValues (CFAllocatorRef allocator, CFStringRef domain, int code, void** userInfoKeys, void** userInfoValues, int numUserInfoValues);
+	CFStringRef CFErrorGetDomain (CFErrorRef err);
+	int CFErrorGetCode (CFErrorRef err);
+	CFDictionaryRef CFErrorCopyUserInfo (CFErrorRef err);
+	CFStringRef CFErrorCopyDescription (CFErrorRef err);
+	CFStringRef CFErrorCopyFailureReason (CFErrorRef err);
+	CFStringRef CFErrorCopyRecoverySuggestion (CFErrorRef err);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFFileDescriptor.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,46 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFFileDescriptor;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFRunLoop;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFFileDescriptorNativeDescriptor;
+struct __CFFileDescriptor;
+alias __CFFileDescriptor* CFFileDescriptorRef;
+
+extern (C)
+{
+	alias void function (CFFileDescriptorRef, uint, void*) CFFileDescriptorCallBack;
+}
+
+enum
+{
+	kCFFileDescriptorReadCallBack = 1 << 0,
+	kCFFileDescriptorWriteCallBack = 1 << 1
+}
+
+struct CFFileDescriptorContext
+{
+	int version_;
+	void* info;
+}
+
+extern (C)
+{
+	uint CFFileDescriptorGetTypeID ();
+	CFFileDescriptorRef CFFileDescriptorCreate (CFAllocatorRef allocator, int fd, ubyte closeOnInvalidate, CFFileDescriptorCallBack* callout, CFFileDescriptorContext* context);
+	int CFFileDescriptorGetNativeDescriptor (CFFileDescriptorRef f);
+	void CFFileDescriptorGetContext (CFFileDescriptorRef f, CFFileDescriptorContext* context);
+	void CFFileDescriptorEnableCallBacks (CFFileDescriptorRef f, uint callBackTypes);
+	void CFFileDescriptorDisableCallBacks (CFFileDescriptorRef f, uint callBackTypes);
+	void CFFileDescriptorInvalidate (CFFileDescriptorRef f);
+	ubyte CFFileDescriptorIsValid (CFFileDescriptorRef f);
+	CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource (CFAllocatorRef allocator, CFFileDescriptorRef f, int order);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFLocale.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,69 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFLocale;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFLocale;
+alias __CFLocale* CFLocaleRef;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFLocaleCurrentLocaleDidChangeNotification;
+		const CFStringRef kCFLocaleIdentifier;
+		const CFStringRef kCFLocaleLanguageCode;
+		const CFStringRef kCFLocaleCountryCode;
+		const CFStringRef kCFLocaleScriptCode;
+		const CFStringRef kCFLocaleVariantCode;
+		const CFStringRef kCFLocaleExemplarCharacterSet;
+		const CFStringRef kCFLocaleCalendarIdentifier;
+		const CFStringRef kCFLocaleCalendar;
+		const CFStringRef kCFLocaleCollationIdentifier;
+		const CFStringRef kCFLocaleUsesMetricSystem;
+		const CFStringRef kCFLocaleMeasurementSystem;
+		const CFStringRef kCFLocaleDecimalSeparator;
+		const CFStringRef kCFLocaleGroupingSeparator;
+		const CFStringRef kCFLocaleCurrencySymbol;
+		const CFStringRef kCFLocaleCurrencyCode;
+		const CFStringRef kCFGregorianCalendar;
+		const CFStringRef kCFBuddhistCalendar;
+		const CFStringRef kCFChineseCalendar;
+		const CFStringRef kCFHebrewCalendar;
+		const CFStringRef kCFIslamicCalendar;
+		const CFStringRef kCFIslamicCivilCalendar;
+		const CFStringRef kCFJapaneseCalendar;
+	}
+}
+
+extern (C)
+{
+	uint CFLocaleGetTypeID ();
+	CFLocaleRef CFLocaleGetSystem ();
+	CFLocaleRef CFLocaleCopyCurrent ();
+	CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers ();
+	CFArrayRef CFLocaleCopyISOLanguageCodes ();
+	CFArrayRef CFLocaleCopyISOCountryCodes ();
+	CFArrayRef CFLocaleCopyISOCurrencyCodes ();
+	CFArrayRef CFLocaleCopyCommonISOCurrencyCodes ();
+	CFArrayRef CFLocaleCopyPreferredLanguages ();
+	CFStringRef CFLocaleCreateCanonicalLanguageIdentifierFromString (CFAllocatorRef allocator, CFStringRef localeIdentifier);
+	CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromString (CFAllocatorRef allocator, CFStringRef localeIdentifier);
+	CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes (CFAllocatorRef allocator, short lcode, short rcode);
+	CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier (CFAllocatorRef allocator, CFStringRef localeID);
+	CFStringRef CFLocaleCreateLocaleIdentifierFromComponents (CFAllocatorRef allocator, CFDictionaryRef dictionary);
+	CFLocaleRef CFLocaleCreate (CFAllocatorRef allocator, CFStringRef localeIdentifier);
+	CFLocaleRef CFLocaleCreateCopy (CFAllocatorRef allocator, CFLocaleRef locale);
+	CFStringRef CFLocaleGetIdentifier (CFLocaleRef locale);
+	void* CFLocaleGetValue (CFLocaleRef locale, CFStringRef key);
+	CFStringRef CFLocaleCopyDisplayNameForPropertyValue (CFLocaleRef displayLocale, CFStringRef key, CFStringRef value);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFMachPort.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,43 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFMachPort;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFRunLoop;
+//import dstep.mach.port;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFMachPort;
+alias __CFMachPort* CFMachPortRef;
+
+extern (C)
+{
+	alias void function (CFMachPortRef, void*, int, void*) CFMachPortCallBack;
+	alias void function (CFMachPortRef, void*) CFMachPortInvalidationCallBack;
+}
+
+struct CFMachPortContext
+{
+	int version_;
+	void* info;
+}
+
+extern (C)
+{
+	uint CFMachPortGetTypeID ();
+	CFMachPortRef CFMachPortCreate (CFAllocatorRef allocator, CFMachPortCallBack* callout, CFMachPortContext* context, char* shouldFreeInfo);
+	CFMachPortRef CFMachPortCreateWithPort (CFAllocatorRef allocator, uint portNum, CFMachPortCallBack* callout, CFMachPortContext* context, char* shouldFreeInfo);
+	uint CFMachPortGetPort (CFMachPortRef port);
+	void CFMachPortGetContext (CFMachPortRef port, CFMachPortContext* context);
+	void CFMachPortInvalidate (CFMachPortRef port);
+	ubyte CFMachPortIsValid (CFMachPortRef port);
+	CFMachPortInvalidationCallBack* CFMachPortGetInvalidationCallBack (CFMachPortRef port);
+	void CFMachPortSetInvalidationCallBack (CFMachPortRef port, CFMachPortInvalidationCallBack* callout);
+	CFRunLoopSourceRef CFMachPortCreateRunLoopSource (CFAllocatorRef allocator, CFMachPortRef port, int order);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFMessagePort.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,56 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFMessagePort;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFMessagePort;
+alias __CFMessagePort* CFMessagePortRef;
+
+extern (C)
+{
+	alias void function (CFMessagePortRef, void*) CFMessagePortInvalidationCallBack;
+	alias CFDataRef function (CFMessagePortRef, int, CFDataRef, void*) CFMessagePortCallBack;
+}
+
+enum
+{
+	kCFMessagePortSuccess = 0,
+	kCFMessagePortSendTimeout = -1,
+	kCFMessagePortReceiveTimeout = -2,
+	kCFMessagePortIsInvalid = -3,
+	kCFMessagePortTransportError = -4
+}
+
+struct CFMessagePortContext
+{
+	int version_;
+	void* info;
+}
+
+extern (C)
+{
+	uint CFMessagePortGetTypeID ();
+	CFMessagePortRef CFMessagePortCreateLocal (CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack* callout, CFMessagePortContext* context, char* shouldFreeInfo);
+	CFMessagePortRef CFMessagePortCreateRemote (CFAllocatorRef allocator, CFStringRef name);
+	ubyte CFMessagePortIsRemote (CFMessagePortRef ms);
+	CFStringRef CFMessagePortGetName (CFMessagePortRef ms);
+	ubyte CFMessagePortSetName (CFMessagePortRef ms, CFStringRef newName);
+	void CFMessagePortGetContext (CFMessagePortRef ms, CFMessagePortContext* context);
+	void CFMessagePortInvalidate (CFMessagePortRef ms);
+	ubyte CFMessagePortIsValid (CFMessagePortRef ms);
+	CFMessagePortInvalidationCallBack* CFMessagePortGetInvalidationCallBack (CFMessagePortRef ms);
+	void CFMessagePortSetInvalidationCallBack (CFMessagePortRef ms, CFMessagePortInvalidationCallBack* callout);
+	int CFMessagePortSendRequest (CFMessagePortRef remote, int msgid, CFDataRef data, double sendTimeout, double rcvTimeout, CFStringRef replyMode, CFDataRef* returnData);
+	CFRunLoopSourceRef CFMessagePortCreateRunLoopSource (CFAllocatorRef allocator, CFMessagePortRef local, int order);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFNotificationCenter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,48 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFNotificationCenter;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFNotificationCenter;
+alias __CFNotificationCenter* CFNotificationCenterRef;
+alias int CFNotificationSuspensionBehavior;
+
+extern (C)
+{
+	alias void function (CFNotificationCenterRef, void*, CFStringRef, void*, CFDictionaryRef) CFNotificationCallback;
+}
+
+enum
+{
+	CFNotificationSuspensionBehaviorDrop = 1,
+	CFNotificationSuspensionBehaviorCoalesce = 2,
+	CFNotificationSuspensionBehaviorHold = 3,
+	CFNotificationSuspensionBehaviorDeliverImmediately = 4
+}
+
+enum
+{
+	kCFNotificationDeliverImmediately = (1 << 0),
+	kCFNotificationPostToAllSessions = (1 << 1)
+}
+
+extern (C)
+{
+	uint CFNotificationCenterGetTypeID ();
+	CFNotificationCenterRef CFNotificationCenterGetLocalCenter ();
+	CFNotificationCenterRef CFNotificationCenterGetDistributedCenter ();
+	CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter ();
+	void CFNotificationCenterAddObserver (CFNotificationCenterRef center, void* observer, CFNotificationCallback* callBack, CFStringRef name, void* object, int suspensionBehavior);
+	void CFNotificationCenterRemoveObserver (CFNotificationCenterRef center, void* observer, CFStringRef name, void* object);
+	void CFNotificationCenterRemoveEveryObserver (CFNotificationCenterRef center, void* observer);
+	void CFNotificationCenterPostNotification (CFNotificationCenterRef center, CFStringRef name, void* object, CFDictionaryRef userInfo, ubyte deliverImmediately);
+	void CFNotificationCenterPostNotificationWithOptions (CFNotificationCenterRef center, CFStringRef name, void* object, CFDictionaryRef userInfo, uint options);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFNumber.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,63 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFNumber;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFBoolean;
+alias __CFBoolean* CFBooleanRef;
+alias int CFNumberType;
+struct __CFNumber;
+alias __CFNumber* CFNumberRef;
+
+extern (C)
+{
+	extern
+	{
+		const CFBooleanRef kCFBooleanTrue;
+		const CFBooleanRef kCFBooleanFalse;
+		const CFNumberRef kCFNumberPositiveInfinity;
+		const CFNumberRef kCFNumberNegativeInfinity;
+		const CFNumberRef kCFNumberNaN;
+	}
+}
+
+enum
+{
+	kCFNumberSInt8Type = 1,
+	kCFNumberSInt16Type = 2,
+	kCFNumberSInt32Type = 3,
+	kCFNumberSInt64Type = 4,
+	kCFNumberFloat32Type = 5,
+	kCFNumberFloat64Type = 6,
+	kCFNumberCharType = 7,
+	kCFNumberShortType = 8,
+	kCFNumberIntType = 9,
+	kCFNumberLongType = 10,
+	kCFNumberLongLongType = 11,
+	kCFNumberFloatType = 12,
+	kCFNumberDoubleType = 13,
+	kCFNumberCFIndexType = 14,
+	kCFNumberNSIntegerType = 15,
+	kCFNumberCGFloatType = 16,
+	kCFNumberMaxType = 16
+}
+
+extern (C)
+{
+	uint CFBooleanGetTypeID ();
+	ubyte CFBooleanGetValue (CFBooleanRef boolean);
+	uint CFNumberGetTypeID ();
+	CFNumberRef CFNumberCreate (CFAllocatorRef allocator, int theType, void* valuePtr);
+	int CFNumberGetType (CFNumberRef number);
+	int CFNumberGetByteSize (CFNumberRef number);
+	ubyte CFNumberIsFloatType (CFNumberRef number);
+	ubyte CFNumberGetValue (CFNumberRef number, int theType, void* valuePtr);
+	int CFNumberCompare (CFNumberRef number, CFNumberRef otherNumber, void* context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFNumberFormatter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,116 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFNumberFormatter;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFNumber;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFNumberFormatter;
+alias __CFNumberFormatter* CFNumberFormatterRef;
+alias int CFNumberFormatterStyle;
+alias uint CFNumberFormatterOptionFlags;
+alias int CFNumberFormatterRoundingMode;
+alias int CFNumberFormatterPadPosition;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFNumberFormatterCurrencyCode;
+		const CFStringRef kCFNumberFormatterDecimalSeparator;
+		const CFStringRef kCFNumberFormatterCurrencyDecimalSeparator;
+		const CFStringRef kCFNumberFormatterAlwaysShowDecimalSeparator;
+		const CFStringRef kCFNumberFormatterGroupingSeparator;
+		const CFStringRef kCFNumberFormatterUseGroupingSeparator;
+		const CFStringRef kCFNumberFormatterPercentSymbol;
+		const CFStringRef kCFNumberFormatterZeroSymbol;
+		const CFStringRef kCFNumberFormatterNaNSymbol;
+		const CFStringRef kCFNumberFormatterInfinitySymbol;
+		const CFStringRef kCFNumberFormatterMinusSign;
+		const CFStringRef kCFNumberFormatterPlusSign;
+		const CFStringRef kCFNumberFormatterCurrencySymbol;
+		const CFStringRef kCFNumberFormatterExponentSymbol;
+		const CFStringRef kCFNumberFormatterMinIntegerDigits;
+		const CFStringRef kCFNumberFormatterMaxIntegerDigits;
+		const CFStringRef kCFNumberFormatterMinFractionDigits;
+		const CFStringRef kCFNumberFormatterMaxFractionDigits;
+		const CFStringRef kCFNumberFormatterGroupingSize;
+		const CFStringRef kCFNumberFormatterSecondaryGroupingSize;
+		const CFStringRef kCFNumberFormatterRoundingMode;
+		const CFStringRef kCFNumberFormatterRoundingIncrement;
+		const CFStringRef kCFNumberFormatterFormatWidth;
+		const CFStringRef kCFNumberFormatterPaddingPosition;
+		const CFStringRef kCFNumberFormatterPaddingCharacter;
+		const CFStringRef kCFNumberFormatterDefaultFormat;
+		const CFStringRef kCFNumberFormatterMultiplier;
+		const CFStringRef kCFNumberFormatterPositivePrefix;
+		const CFStringRef kCFNumberFormatterPositiveSuffix;
+		const CFStringRef kCFNumberFormatterNegativePrefix;
+		const CFStringRef kCFNumberFormatterNegativeSuffix;
+		const CFStringRef kCFNumberFormatterPerMillSymbol;
+		const CFStringRef kCFNumberFormatterInternationalCurrencySymbol;
+		const CFStringRef kCFNumberFormatterCurrencyGroupingSeparator;
+		const CFStringRef kCFNumberFormatterIsLenient;
+		const CFStringRef kCFNumberFormatterUseSignificantDigits;
+		const CFStringRef kCFNumberFormatterMinSignificantDigits;
+		const CFStringRef kCFNumberFormatterMaxSignificantDigits;
+	}
+}
+
+enum
+{
+	kCFNumberFormatterNoStyle = 0,
+	kCFNumberFormatterDecimalStyle = 1,
+	kCFNumberFormatterCurrencyStyle = 2,
+	kCFNumberFormatterPercentStyle = 3,
+	kCFNumberFormatterScientificStyle = 4,
+	kCFNumberFormatterSpellOutStyle = 5
+}
+
+enum
+{
+	kCFNumberFormatterParseIntegersOnly = 1
+}
+
+enum
+{
+	kCFNumberFormatterRoundCeiling = 0,
+	kCFNumberFormatterRoundFloor = 1,
+	kCFNumberFormatterRoundDown = 2,
+	kCFNumberFormatterRoundUp = 3,
+	kCFNumberFormatterRoundHalfEven = 4,
+	kCFNumberFormatterRoundHalfDown = 5,
+	kCFNumberFormatterRoundHalfUp = 6
+}
+
+enum
+{
+	kCFNumberFormatterPadBeforePrefix = 0,
+	kCFNumberFormatterPadAfterPrefix = 1,
+	kCFNumberFormatterPadBeforeSuffix = 2,
+	kCFNumberFormatterPadAfterSuffix = 3
+}
+
+extern (C)
+{
+	uint CFNumberFormatterGetTypeID ();
+	CFNumberFormatterRef CFNumberFormatterCreate (CFAllocatorRef allocator, CFLocaleRef locale, int style);
+	CFLocaleRef CFNumberFormatterGetLocale (CFNumberFormatterRef formatter);
+	int CFNumberFormatterGetStyle (CFNumberFormatterRef formatter);
+	CFStringRef CFNumberFormatterGetFormat (CFNumberFormatterRef formatter);
+	void CFNumberFormatterSetFormat (CFNumberFormatterRef formatter, CFStringRef formatString);
+	CFStringRef CFNumberFormatterCreateStringWithNumber (CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberRef number);
+	CFStringRef CFNumberFormatterCreateStringWithValue (CFAllocatorRef allocator, CFNumberFormatterRef formatter, int numberType, void* valuePtr);
+	CFNumberRef CFNumberFormatterCreateNumberFromString (CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFStringRef string, CFRange* rangep, uint options);
+	ubyte CFNumberFormatterGetValueFromString (CFNumberFormatterRef formatter, CFStringRef string, CFRange* rangep, int numberType, void* valuePtr);
+	void CFNumberFormatterSetProperty (CFNumberFormatterRef formatter, CFStringRef key, void* value);
+	void* CFNumberFormatterCopyProperty (CFNumberFormatterRef formatter, CFStringRef key);
+	ubyte CFNumberFormatterGetDecimalInfoForCurrencyCode (CFStringRef currencyCode, int* defaultFractionDigits, double* roundingIncrement);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFPlugIn.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,65 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFPlugIn;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFBundle;
+import dstep.corefoundation.CFPlugInCOM;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.corefoundation.CFUUID;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFPlugInInstance;
+alias __CFPlugInInstance* CFPlugInInstanceRef;
+
+extern (C)
+{
+	alias void function (CFPlugInRef) CFPlugInUnloadFunction;
+	alias void function (void*) CFPlugInInstanceDeallocateInstanceDataFunction;
+	alias void* function (CFAllocatorRef, CFUUIDRef) CFPlugInFactoryFunction;
+	alias void function (CFPlugInRef) CFPlugInDynamicRegisterFunction;
+	alias ubyte function (CFPlugInInstanceRef, CFStringRef, void**) CFPlugInInstanceGetInterfaceFunction;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFPlugInDynamicRegistrationKey;
+		const CFStringRef kCFPlugInDynamicRegisterFunctionKey;
+		const CFStringRef kCFPlugInUnloadFunctionKey;
+		const CFStringRef kCFPlugInFactoriesKey;
+		const CFStringRef kCFPlugInTypesKey;
+	}
+}
+
+extern (C)
+{
+	uint CFPlugInGetTypeID ();
+	CFPlugInRef CFPlugInCreate (CFAllocatorRef allocator, CFURLRef plugInURL);
+	CFBundleRef CFPlugInGetBundle (CFPlugInRef plugIn);
+	void CFPlugInSetLoadOnDemand (CFPlugInRef plugIn, ubyte flag);
+	ubyte CFPlugInIsLoadOnDemand (CFPlugInRef plugIn);
+	CFArrayRef CFPlugInFindFactoriesForPlugInType (CFUUIDRef typeUUID);
+	CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn (CFUUIDRef typeUUID, CFPlugInRef plugIn);
+	void* CFPlugInInstanceCreate (CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
+	ubyte CFPlugInRegisterFactoryFunction (CFUUIDRef factoryUUID, CFPlugInFactoryFunction* func);
+	ubyte CFPlugInRegisterFactoryFunctionByName (CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName);
+	ubyte CFPlugInUnregisterFactory (CFUUIDRef factoryUUID);
+	ubyte CFPlugInRegisterPlugInType (CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
+	ubyte CFPlugInUnregisterPlugInType (CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
+	void CFPlugInAddInstanceForFactory (CFUUIDRef factoryID);
+	void CFPlugInRemoveInstanceForFactory (CFUUIDRef factoryID);
+	ubyte CFPlugInInstanceGetInterfaceFunctionTable (CFPlugInInstanceRef instance, CFStringRef interfaceName, void** ftbl);
+	CFStringRef CFPlugInInstanceGetFactoryName (CFPlugInInstanceRef instance);
+	void* CFPlugInInstanceGetInstanceData (CFPlugInInstanceRef instance);
+	uint CFPlugInInstanceGetTypeID ();
+	CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize (CFAllocatorRef allocator, int instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction* deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction* getInterfaceFunction);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFPlugInCOM.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,24 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFPlugInCOM;
+
+import dstep.corefoundation.CFPlugIn;
+import dstep.corefoundation.CFUUID;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int HRESULT;
+alias uint ULONG;
+alias void* LPVOID;
+alias CFUUIDBytes REFIID;
+
+struct IUnknownVTbl
+{
+	void* _reserved;
+	REFIID iid;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFPreferences.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,46 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFPreferences;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFPreferencesAnyApplication;
+		const CFStringRef kCFPreferencesCurrentApplication;
+		const CFStringRef kCFPreferencesAnyHost;
+		const CFStringRef kCFPreferencesCurrentHost;
+		const CFStringRef kCFPreferencesAnyUser;
+		const CFStringRef kCFPreferencesCurrentUser;
+	}
+}
+
+extern (C)
+{
+	void* CFPreferencesCopyAppValue (CFStringRef key, CFStringRef applicationID);
+	ubyte CFPreferencesGetAppBooleanValue (CFStringRef key, CFStringRef applicationID, char* keyExistsAndHasValidFormat);
+	int CFPreferencesGetAppIntegerValue (CFStringRef key, CFStringRef applicationID, char* keyExistsAndHasValidFormat);
+	void CFPreferencesSetAppValue (CFStringRef key, void* value, CFStringRef applicationID);
+	void CFPreferencesAddSuitePreferencesToApp (CFStringRef applicationID, CFStringRef suiteID);
+	void CFPreferencesRemoveSuitePreferencesFromApp (CFStringRef applicationID, CFStringRef suiteID);
+	ubyte CFPreferencesAppSynchronize (CFStringRef applicationID);
+	void* CFPreferencesCopyValue (CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	CFDictionaryRef CFPreferencesCopyMultiple (CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	void CFPreferencesSetValue (CFStringRef key, void* value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	void CFPreferencesSetMultiple (CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	ubyte CFPreferencesSynchronize (CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	CFArrayRef CFPreferencesCopyApplicationList (CFStringRef userName, CFStringRef hostName);
+	CFArrayRef CFPreferencesCopyKeyList (CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
+	ubyte CFPreferencesAppValueIsForced (CFStringRef key, CFStringRef applicationID);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFPropertyList.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,41 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFPropertyList;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFStream;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias uint CFPropertyListMutabilityOptions;
+alias int CFPropertyListFormat;
+
+enum
+{
+	kCFPropertyListImmutable = 0,
+	kCFPropertyListMutableContainers,
+	kCFPropertyListMutableContainersAndLeaves
+}
+
+enum
+{
+	kCFPropertyListOpenStepFormat = 1,
+	kCFPropertyListXMLFormat_v1_0 = 100,
+	kCFPropertyListBinaryFormat_v1_0 = 200
+}
+
+extern (C)
+{
+	void* CFPropertyListCreateFromXMLData (CFAllocatorRef allocator, CFDataRef xmlData, uint mutabilityOption, CFStringRef* errorString);
+	CFDataRef CFPropertyListCreateXMLData (CFAllocatorRef allocator, void* propertyList);
+	void* CFPropertyListCreateDeepCopy (CFAllocatorRef allocator, void* propertyList, uint mutabilityOption);
+	ubyte CFPropertyListIsValid (void* plist, int format);
+	int CFPropertyListWriteToStream (void* propertyList, CFWriteStreamRef stream, int format, CFStringRef* errorString);
+	void* CFPropertyListCreateFromStream (CFAllocatorRef allocator, CFReadStreamRef stream, int streamLength, uint mutabilityOption, int* format, CFStringRef* errorString);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFRunLoop.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,138 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFRunLoop;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFRunLoop;
+alias __CFRunLoop* CFRunLoopRef;
+struct __CFRunLoopSource;
+alias __CFRunLoopSource* CFRunLoopSourceRef;
+struct __CFRunLoopObserver;
+alias __CFRunLoopObserver* CFRunLoopObserverRef;
+struct __CFRunLoopTimer;
+alias __CFRunLoopTimer* CFRunLoopTimerRef;
+alias uint CFRunLoopActivity;
+
+extern (C)
+{
+	alias void function (CFRunLoopObserverRef, uint, void*) CFRunLoopObserverCallBack;
+	alias void function (CFRunLoopTimerRef, void*) CFRunLoopTimerCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFRunLoopDefaultMode;
+		const CFStringRef kCFRunLoopCommonModes;
+	}
+}
+
+enum
+{
+	kCFRunLoopRunFinished = 1,
+	kCFRunLoopRunStopped = 2,
+	kCFRunLoopRunTimedOut = 3,
+	kCFRunLoopRunHandledSource = 4
+}
+
+enum
+{
+	kCFRunLoopEntry = (1 << 0),
+	kCFRunLoopBeforeTimers = (1 << 1),
+	kCFRunLoopBeforeSources = (1 << 2),
+	kCFRunLoopBeforeWaiting = (1 << 5),
+	kCFRunLoopAfterWaiting = (1 << 6),
+	kCFRunLoopExit = (1 << 7),
+	kCFRunLoopAllActivities = 0x0FFFFFFFU
+}
+
+struct CFRunLoopSourceContext
+{
+	int version_;
+	void* info;
+	CFRunLoopRef rl;
+}
+
+
+struct CFRunLoopSourceContext1
+{
+	int version_;
+	void* info;
+	int size;
+	CFAllocatorRef allocator;
+}
+
+
+struct CFRunLoopObserverContext
+{
+	int version_;
+	void* info;
+}
+
+
+struct CFRunLoopTimerContext
+{
+	int version_;
+	void* info;
+}
+
+extern (C)
+{
+	uint CFRunLoopGetTypeID ();
+	CFRunLoopRef CFRunLoopGetCurrent ();
+	CFRunLoopRef CFRunLoopGetMain ();
+	CFStringRef CFRunLoopCopyCurrentMode (CFRunLoopRef rl);
+	CFArrayRef CFRunLoopCopyAllModes (CFRunLoopRef rl);
+	void CFRunLoopAddCommonMode (CFRunLoopRef rl, CFStringRef mode);
+	double CFRunLoopGetNextTimerFireDate (CFRunLoopRef rl, CFStringRef mode);
+	void CFRunLoopRun ();
+	int CFRunLoopRunInMode (CFStringRef mode, double seconds, ubyte returnAfterSourceHandled);
+	ubyte CFRunLoopIsWaiting (CFRunLoopRef rl);
+	void CFRunLoopWakeUp (CFRunLoopRef rl);
+	void CFRunLoopStop (CFRunLoopRef rl);
+	ubyte CFRunLoopContainsSource (CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
+	void CFRunLoopAddSource (CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
+	void CFRunLoopRemoveSource (CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
+	ubyte CFRunLoopContainsObserver (CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
+	void CFRunLoopAddObserver (CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
+	void CFRunLoopRemoveObserver (CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
+	ubyte CFRunLoopContainsTimer (CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
+	void CFRunLoopAddTimer (CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
+	void CFRunLoopRemoveTimer (CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
+	uint CFRunLoopSourceGetTypeID ();
+	CFRunLoopSourceRef CFRunLoopSourceCreate (CFAllocatorRef allocator, int order, CFRunLoopSourceContext* context);
+	int CFRunLoopSourceGetOrder (CFRunLoopSourceRef source);
+	void CFRunLoopSourceInvalidate (CFRunLoopSourceRef source);
+	ubyte CFRunLoopSourceIsValid (CFRunLoopSourceRef source);
+	void CFRunLoopSourceGetContext (CFRunLoopSourceRef source, CFRunLoopSourceContext* context);
+	void CFRunLoopSourceSignal (CFRunLoopSourceRef source);
+	uint CFRunLoopObserverGetTypeID ();
+	CFRunLoopObserverRef CFRunLoopObserverCreate (CFAllocatorRef allocator, uint activities, ubyte repeats, int order, CFRunLoopObserverCallBack* callout, CFRunLoopObserverContext* context);
+	uint CFRunLoopObserverGetActivities (CFRunLoopObserverRef observer);
+	ubyte CFRunLoopObserverDoesRepeat (CFRunLoopObserverRef observer);
+	int CFRunLoopObserverGetOrder (CFRunLoopObserverRef observer);
+	void CFRunLoopObserverInvalidate (CFRunLoopObserverRef observer);
+	ubyte CFRunLoopObserverIsValid (CFRunLoopObserverRef observer);
+	void CFRunLoopObserverGetContext (CFRunLoopObserverRef observer, CFRunLoopObserverContext* context);
+	uint CFRunLoopTimerGetTypeID ();
+	CFRunLoopTimerRef CFRunLoopTimerCreate (CFAllocatorRef allocator, double fireDate, double interval, uint flags, int order, CFRunLoopTimerCallBack* callout, CFRunLoopTimerContext* context);
+	double CFRunLoopTimerGetNextFireDate (CFRunLoopTimerRef timer);
+	void CFRunLoopTimerSetNextFireDate (CFRunLoopTimerRef timer, double fireDate);
+	double CFRunLoopTimerGetInterval (CFRunLoopTimerRef timer);
+	ubyte CFRunLoopTimerDoesRepeat (CFRunLoopTimerRef timer);
+	int CFRunLoopTimerGetOrder (CFRunLoopTimerRef timer);
+	void CFRunLoopTimerInvalidate (CFRunLoopTimerRef timer);
+	ubyte CFRunLoopTimerIsValid (CFRunLoopTimerRef timer);
+	void CFRunLoopTimerGetContext (CFRunLoopTimerRef timer, CFRunLoopTimerContext* context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFSet.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,66 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFSet;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+import bindings = dstep.corefoundation.CFSet_bindings;
+
+struct __CFSet;
+alias __CFSet* CFSetRef;
+alias __CFSet* CFMutableSetRef;
+
+extern (C)
+{
+	alias uint function (void*) CFSetHashCallBack;
+	alias CFStringRef function (void*) CFSetCopyDescriptionCallBack;
+	alias void function (CFAllocatorRef, void*) CFSetReleaseCallBack;
+	alias void* function (CFAllocatorRef, void*) CFSetRetainCallBack;
+	alias void function (void*, void*) CFSetApplierFunction;
+	alias ubyte function (void*, void*) CFSetEqualCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFSetCallBacks kCFTypeSetCallBacks;
+		const CFSetCallBacks kCFCopyStringSetCallBacks;
+	}
+}
+
+struct CFSetCallBacks
+{
+	int version_;
+	CFSetRetainCallBack* retain;
+	CFSetReleaseCallBack* release;
+	CFSetCopyDescriptionCallBack* copyDescription;
+	CFSetEqualCallBack* equal;
+	CFSetHashCallBack* hash;
+}
+
+extern (C)
+{
+	uint CFSetGetTypeID ();
+	CFSetRef CFSetCreate (CFAllocatorRef allocator, void** values, int numValues, CFSetCallBacks* callBacks);
+	CFSetRef CFSetCreateCopy (CFAllocatorRef allocator, CFSetRef theSet);
+	CFMutableSetRef CFSetCreateMutable (CFAllocatorRef allocator, int capacity, CFSetCallBacks* callBacks);
+	CFMutableSetRef CFSetCreateMutableCopy (CFAllocatorRef allocator, int capacity, CFSetRef theSet);
+	int CFSetGetCount (CFSetRef theSet);
+	int CFSetGetCountOfValue (CFSetRef theSet, void* value);
+	ubyte CFSetContainsValue (CFSetRef theSet, void* value);
+	void* CFSetGetValue (CFSetRef theSet, void* value);
+	ubyte CFSetGetValueIfPresent (CFSetRef theSet, void* candidate, void** value);
+	void CFSetGetValues (CFSetRef theSet, void** values);
+	void CFSetApplyFunction (CFSetRef theSet, CFSetApplierFunction* applier, void* context);
+	void CFSetAddValue (CFMutableSetRef theSet, void* value);
+	void CFSetReplaceValue (CFMutableSetRef theSet, void* value);
+	void CFSetSetValue (CFMutableSetRef theSet, void* value);
+	void CFSetRemoveValue (CFMutableSetRef theSet, void* value);
+	void CFSetRemoveAllValues (CFMutableSetRef theSet);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFSet_bindings.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,16 @@
+module dstep.corefoundation.CFSet_bindings;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+extern (C)
+{
+	extern
+	{
+	}
+}
+
+extern (C)
+{
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFSocket.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,110 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFSocket;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFRunLoop;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+//import dstep.winsock2;
+
+alias int CFSocketNativeHandle;
+struct __CFSocket;
+alias __CFSocket* CFSocketRef;
+alias int CFSocketError;
+alias uint CFSocketCallBackType;
+
+extern (C)
+{
+	alias void function (CFSocketRef, uint, CFDataRef, void*, void*) CFSocketCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFSocketCommandKey;
+		const CFStringRef kCFSocketNameKey;
+		const CFStringRef kCFSocketValueKey;
+		const CFStringRef kCFSocketResultKey;
+		const CFStringRef kCFSocketErrorKey;
+		const CFStringRef kCFSocketRegisterCommand;
+		const CFStringRef kCFSocketRetrieveCommand;
+	}
+}
+
+enum
+{
+	kCFSocketSuccess = 0,
+	kCFSocketError = -1,
+	kCFSocketTimeout = -2
+}
+
+enum
+{
+	kCFSocketNoCallBack = 0,
+	kCFSocketReadCallBack = 1,
+	kCFSocketAcceptCallBack = 2,
+	kCFSocketDataCallBack = 3,
+	kCFSocketConnectCallBack = 4,
+	kCFSocketWriteCallBack = 8
+}
+
+enum
+{
+	kCFSocketAutomaticallyReenableReadCallBack = 1,
+	kCFSocketAutomaticallyReenableAcceptCallBack = 2,
+	kCFSocketAutomaticallyReenableDataCallBack = 3,
+	kCFSocketAutomaticallyReenableWriteCallBack = 8,
+	kCFSocketCloseOnInvalidate = 128
+}
+
+struct CFSocketSignature
+{
+	int protocolFamily;
+	int socketType;
+	int protocol;
+	CFDataRef address;
+}
+
+
+struct CFSocketContext
+{
+	int version_;
+	void* info;
+}
+
+extern (C)
+{
+	uint CFSocketGetTypeID ();
+	CFSocketRef CFSocketCreate (CFAllocatorRef allocator, int protocolFamily, int socketType, int protocol, uint callBackTypes, CFSocketCallBack* callout, CFSocketContext* context);
+	CFSocketRef CFSocketCreateWithNative (CFAllocatorRef allocator, int sock, uint callBackTypes, CFSocketCallBack* callout, CFSocketContext* context);
+	CFSocketRef CFSocketCreateWithSocketSignature (CFAllocatorRef allocator, CFSocketSignature* signature, uint callBackTypes, CFSocketCallBack* callout, CFSocketContext* context);
+	CFSocketRef CFSocketCreateConnectedToSocketSignature (CFAllocatorRef allocator, CFSocketSignature* signature, uint callBackTypes, CFSocketCallBack* callout, CFSocketContext* context, double timeout);
+	int CFSocketSetAddress (CFSocketRef s, CFDataRef address);
+	int CFSocketConnectToAddress (CFSocketRef s, CFDataRef address, double timeout);
+	void CFSocketInvalidate (CFSocketRef s);
+	ubyte CFSocketIsValid (CFSocketRef s);
+	CFDataRef CFSocketCopyAddress (CFSocketRef s);
+	CFDataRef CFSocketCopyPeerAddress (CFSocketRef s);
+	void CFSocketGetContext (CFSocketRef s, CFSocketContext* context);
+	int CFSocketGetNative (CFSocketRef s);
+	CFRunLoopSourceRef CFSocketCreateRunLoopSource (CFAllocatorRef allocator, CFSocketRef s, int order);
+	uint CFSocketGetSocketFlags (CFSocketRef s);
+	void CFSocketSetSocketFlags (CFSocketRef s, uint flags);
+	void CFSocketDisableCallBacks (CFSocketRef s, uint callBackTypes);
+	void CFSocketEnableCallBacks (CFSocketRef s, uint callBackTypes);
+	int CFSocketSendData (CFSocketRef s, CFDataRef address, CFDataRef data, double timeout);
+	int CFSocketRegisterValue (CFSocketSignature* nameServerSignature, double timeout, CFStringRef name, void* value);
+	int CFSocketCopyRegisteredValue (CFSocketSignature* nameServerSignature, double timeout, CFStringRef name, CFPropertyListRef* value, CFDataRef* nameServerAddress);
+	int CFSocketRegisterSocketSignature (CFSocketSignature* nameServerSignature, double timeout, CFStringRef name, CFSocketSignature* signature);
+	int CFSocketCopyRegisteredSocketSignature (CFSocketSignature* nameServerSignature, double timeout, CFStringRef name, CFSocketSignature* signature, CFDataRef* nameServerAddress);
+	int CFSocketUnregister (CFSocketSignature* nameServerSignature, double timeout, CFStringRef name);
+	void CFSocketSetDefaultNameRegistryPortNumber (ushort port);
+	ushort CFSocketGetDefaultNameRegistryPortNumber ();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFStream.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,126 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFStream;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFError;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFSocket;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFStreamStatus;
+alias uint CFStreamEventType;
+struct __CFReadStream;
+alias __CFReadStream* CFReadStreamRef;
+struct __CFWriteStream;
+alias __CFWriteStream* CFWriteStreamRef;
+alias int CFStreamErrorDomain;
+
+extern (C)
+{
+	alias void function (CFWriteStreamRef, uint, void*) CFWriteStreamClientCallBack;
+	alias void function (CFReadStreamRef, uint, void*) CFReadStreamClientCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFStreamPropertyDataWritten;
+		const CFStringRef kCFStreamPropertyAppendToFile;
+		const CFStringRef kCFStreamPropertyFileCurrentOffset;
+		const CFStringRef kCFStreamPropertySocketNativeHandle;
+		const CFStringRef kCFStreamPropertySocketRemoteHostName;
+		const CFStringRef kCFStreamPropertySocketRemotePortNumber;
+	}
+}
+
+enum
+{
+	kCFStreamStatusNotOpen = 0,
+	kCFStreamStatusOpening,
+	kCFStreamStatusOpen,
+	kCFStreamStatusReading,
+	kCFStreamStatusWriting,
+	kCFStreamStatusAtEnd,
+	kCFStreamStatusClosed,
+	kCFStreamStatusError
+}
+
+enum
+{
+	kCFStreamEventNone = 0,
+	kCFStreamEventOpenCompleted = 1,
+	kCFStreamEventHasBytesAvailable = 2,
+	kCFStreamEventCanAcceptBytes = 4,
+	kCFStreamEventErrorOccurred = 8,
+	kCFStreamEventEndEncountered = 16
+}
+
+enum
+{
+	kCFStreamErrorDomainCustom = -1,
+	kCFStreamErrorDomainPOSIX = 1,
+	kCFStreamErrorDomainMacOSStatus
+}
+
+struct CFStreamClientContext
+{
+	int version_;
+	void* info;
+}
+
+
+struct CFStreamError
+{
+	int domain;
+	int error;
+}
+
+extern (C)
+{
+	uint CFReadStreamGetTypeID ();
+	uint CFWriteStreamGetTypeID ();
+	CFReadStreamRef CFReadStreamCreateWithBytesNoCopy (CFAllocatorRef alloc, char* bytes, int length, CFAllocatorRef bytesDeallocator);
+	CFWriteStreamRef CFWriteStreamCreateWithBuffer (CFAllocatorRef alloc, char* buffer, int bufferCapacity);
+	CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers (CFAllocatorRef alloc, CFAllocatorRef bufferAllocator);
+	CFReadStreamRef CFReadStreamCreateWithFile (CFAllocatorRef alloc, CFURLRef fileURL);
+	CFWriteStreamRef CFWriteStreamCreateWithFile (CFAllocatorRef alloc, CFURLRef fileURL);
+	void CFStreamCreateBoundPair (CFAllocatorRef alloc, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream, int transferBufferSize);
+	void CFStreamCreatePairWithSocket (CFAllocatorRef alloc, int sock, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream);
+	void CFStreamCreatePairWithSocketToHost (CFAllocatorRef alloc, CFStringRef host, uint port, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream);
+	void CFStreamCreatePairWithPeerSocketSignature (CFAllocatorRef alloc, CFSocketSignature* signature, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream);
+	int CFReadStreamGetStatus (CFReadStreamRef stream);
+	int CFWriteStreamGetStatus (CFWriteStreamRef stream);
+	CFErrorRef CFReadStreamCopyError (CFReadStreamRef stream);
+	CFErrorRef CFWriteStreamCopyError (CFWriteStreamRef stream);
+	ubyte CFReadStreamOpen (CFReadStreamRef stream);
+	ubyte CFWriteStreamOpen (CFWriteStreamRef stream);
+	void CFReadStreamClose (CFReadStreamRef stream);
+	void CFWriteStreamClose (CFWriteStreamRef stream);
+	ubyte CFReadStreamHasBytesAvailable (CFReadStreamRef stream);
+	int CFReadStreamRead (CFReadStreamRef stream, char* buffer, int bufferLength);
+	char* CFReadStreamGetBuffer (CFReadStreamRef stream, int maxBytesToRead, int* numBytesRead);
+	ubyte CFWriteStreamCanAcceptBytes (CFWriteStreamRef stream);
+	int CFWriteStreamWrite (CFWriteStreamRef stream, char* buffer, int bufferLength);
+	void* CFReadStreamCopyProperty (CFReadStreamRef stream, CFStringRef propertyName);
+	void* CFWriteStreamCopyProperty (CFWriteStreamRef stream, CFStringRef propertyName);
+	ubyte CFReadStreamSetProperty (CFReadStreamRef stream, CFStringRef propertyName, void* propertyValue);
+	ubyte CFWriteStreamSetProperty (CFWriteStreamRef stream, CFStringRef propertyName, void* propertyValue);
+	ubyte CFReadStreamSetClient (CFReadStreamRef stream, uint streamEvents, CFReadStreamClientCallBack* clientCB, CFStreamClientContext* clientContext);
+	ubyte CFWriteStreamSetClient (CFWriteStreamRef stream, uint streamEvents, CFWriteStreamClientCallBack* clientCB, CFStreamClientContext* clientContext);
+	void CFReadStreamScheduleWithRunLoop (CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFWriteStreamScheduleWithRunLoop (CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFReadStreamUnscheduleFromRunLoop (CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFWriteStreamUnscheduleFromRunLoop (CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	CFStreamError CFReadStreamGetError (CFReadStreamRef stream);
+	CFStreamError CFWriteStreamGetError (CFWriteStreamRef stream);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFString.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,183 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFString;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFCharacterSet;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFLocale;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+//import dstep.stdarg;
+
+alias uint CFStringEncoding;
+alias uint CFStringBuiltInEncodings;
+alias uint CFStringCompareFlags;
+alias int CFStringNormalizationForm;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFStringTransformStripCombiningMarks;
+		const CFStringRef kCFStringTransformToLatin;
+		const CFStringRef kCFStringTransformFullwidthHalfwidth;
+		const CFStringRef kCFStringTransformLatinKatakana;
+		const CFStringRef kCFStringTransformLatinHiragana;
+		const CFStringRef kCFStringTransformHiraganaKatakana;
+		const CFStringRef kCFStringTransformMandarinLatin;
+		const CFStringRef kCFStringTransformLatinHangul;
+		const CFStringRef kCFStringTransformLatinArabic;
+		const CFStringRef kCFStringTransformLatinHebrew;
+		const CFStringRef kCFStringTransformLatinThai;
+		const CFStringRef kCFStringTransformLatinCyrillic;
+		const CFStringRef kCFStringTransformLatinGreek;
+		const CFStringRef kCFStringTransformToXMLHex;
+		const CFStringRef kCFStringTransformToUnicodeName;
+		const CFStringRef kCFStringTransformStripDiacritics;
+	}
+}
+
+enum
+{
+	kCFStringEncodingMacRoman = 0,
+	kCFStringEncodingWindowsLatin1 = 0x0500,
+	kCFStringEncodingISOLatin1 = 0x0201,
+	kCFStringEncodingNextStepLatin = 0x0B01,
+	kCFStringEncodingASCII = 0x0600,
+	kCFStringEncodingUnicode = 0x0100,
+	kCFStringEncodingUTF8 = 0x08000100,
+	kCFStringEncodingNonLossyASCII = 0x0BFF,
+	kCFStringEncodingUTF16 = 0x0100,
+	kCFStringEncodingUTF16BE = 0x10000100,
+	kCFStringEncodingUTF16LE = 0x14000100,
+	kCFStringEncodingUTF32 = 0x0c000100,
+	kCFStringEncodingUTF32BE = 0x18000100,
+	kCFStringEncodingUTF32LE = 0x1c000100
+}
+
+enum
+{
+	kCFCompareCaseInsensitive = 1,
+	kCFCompareBackwards = 4,
+	kCFCompareAnchored = 8,
+	kCFCompareNonliteral = 16,
+	kCFCompareLocalized = 32,
+	kCFCompareNumerically = 64,
+	kCFCompareDiacriticInsensitive = 128,
+	kCFCompareWidthInsensitive = 256,
+	kCFCompareForcedOrdering = 512
+}
+
+enum
+{
+	kCFStringNormalizationFormD = 0,
+	kCFStringNormalizationFormKD,
+	kCFStringNormalizationFormC,
+	kCFStringNormalizationFormKC
+}
+
+struct CFStringInlineBuffer
+{
+	wchar* buffer;
+	CFStringRef theString;
+	wchar* directBuffer;
+	CFRange rangeToBuffer;
+	int bufferedRangeStart;
+	int bufferedRangeEnd;
+}
+
+extern (C)
+{
+	uint CFStringGetTypeID ();
+	CFStringRef CFStringCreateWithPascalString (CFAllocatorRef alloc, char* pStr, uint encoding);
+	CFStringRef CFStringCreateWithCString (CFAllocatorRef alloc, char* cStr, uint encoding);
+	CFStringRef CFStringCreateWithBytes (CFAllocatorRef alloc, char* bytes, int numBytes, uint encoding, ubyte isExternalRepresentation);
+	CFStringRef CFStringCreateWithCharacters (CFAllocatorRef alloc, wchar* chars, int numChars);
+	CFStringRef CFStringCreateWithPascalStringNoCopy (CFAllocatorRef alloc, char* pStr, uint encoding, CFAllocatorRef contentsDeallocator);
+	CFStringRef CFStringCreateWithCStringNoCopy (CFAllocatorRef alloc, char* cStr, uint encoding, CFAllocatorRef contentsDeallocator);
+	CFStringRef CFStringCreateWithBytesNoCopy (CFAllocatorRef alloc, char* bytes, int numBytes, uint encoding, ubyte isExternalRepresentation, CFAllocatorRef contentsDeallocator);
+	CFStringRef CFStringCreateWithCharactersNoCopy (CFAllocatorRef alloc, wchar* chars, int numChars, CFAllocatorRef contentsDeallocator);
+	CFStringRef CFStringCreateWithSubstring (CFAllocatorRef alloc, CFStringRef str, CFRange range);
+	CFStringRef CFStringCreateCopy (CFAllocatorRef alloc, CFStringRef theString);
+	CFStringRef CFStringCreateWithFormat (CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...);
+	CFStringRef CFStringCreateWithFormatAndArguments (CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, char* arguments);
+	CFMutableStringRef CFStringCreateMutable (CFAllocatorRef alloc, int maxLength);
+	CFMutableStringRef CFStringCreateMutableCopy (CFAllocatorRef alloc, int maxLength, CFStringRef theString);
+	CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy (CFAllocatorRef alloc, wchar* chars, int numChars, int capacity, CFAllocatorRef externalCharactersAllocator);
+	int CFStringGetLength (CFStringRef theString);
+	wchar CFStringGetCharacterAtIndex (CFStringRef theString, int idx);
+	void CFStringGetCharacters (CFStringRef theString, CFRange range, wchar* buffer);
+	ubyte CFStringGetPascalString (CFStringRef theString, char* buffer, int bufferSize, uint encoding);
+	ubyte CFStringGetCString (CFStringRef theString, char* buffer, int bufferSize, uint encoding);
+	char* CFStringGetPascalStringPtr (CFStringRef theString, uint encoding);
+	char* CFStringGetCStringPtr (CFStringRef theString, uint encoding);
+	wchar* CFStringGetCharactersPtr (CFStringRef theString);
+	int CFStringGetBytes (CFStringRef theString, CFRange range, uint encoding, ubyte lossByte, ubyte isExternalRepresentation, char* buffer, int maxBufLen, int* usedBufLen);
+	CFStringRef CFStringCreateFromExternalRepresentation (CFAllocatorRef alloc, CFDataRef data, uint encoding);
+	CFDataRef CFStringCreateExternalRepresentation (CFAllocatorRef alloc, CFStringRef theString, uint encoding, ubyte lossByte);
+	uint CFStringGetSmallestEncoding (CFStringRef theString);
+	uint CFStringGetFastestEncoding (CFStringRef theString);
+	uint CFStringGetSystemEncoding ();
+	int CFStringGetMaximumSizeForEncoding (int length, uint encoding);
+	ubyte CFStringGetFileSystemRepresentation (CFStringRef string, char* buffer, int maxBufLen);
+	int CFStringGetMaximumSizeOfFileSystemRepresentation (CFStringRef string);
+	CFStringRef CFStringCreateWithFileSystemRepresentation (CFAllocatorRef alloc, char* buffer);
+	int CFStringCompareWithOptionsAndLocale (CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, uint compareOptions, CFLocaleRef locale);
+	int CFStringCompareWithOptions (CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, uint compareOptions);
+	int CFStringCompare (CFStringRef theString1, CFStringRef theString2, uint compareOptions);
+	ubyte CFStringFindWithOptionsAndLocale (CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, uint searchOptions, CFLocaleRef locale, CFRange* result);
+	ubyte CFStringFindWithOptions (CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, uint searchOptions, CFRange* result);
+	CFArrayRef CFStringCreateArrayWithFindResults (CFAllocatorRef alloc, CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, uint compareOptions);
+	CFRange CFStringFind (CFStringRef theString, CFStringRef stringToFind, uint compareOptions);
+	ubyte CFStringHasPrefix (CFStringRef theString, CFStringRef prefix);
+	ubyte CFStringHasSuffix (CFStringRef theString, CFStringRef suffix);
+	CFRange CFStringGetRangeOfComposedCharactersAtIndex (CFStringRef theString, int theIndex);
+	ubyte CFStringFindCharacterFromSet (CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, uint searchOptions, CFRange* result);
+	void CFStringGetLineBounds (CFStringRef theString, CFRange range, int* lineBeginIndex, int* lineEndIndex, int* contentsEndIndex);
+	void CFStringGetParagraphBounds (CFStringRef string, CFRange range, int* parBeginIndex, int* parEndIndex, int* contentsEndIndex);
+	CFStringRef CFStringCreateByCombiningStrings (CFAllocatorRef alloc, CFArrayRef theArray, CFStringRef separatorString);
+	CFArrayRef CFStringCreateArrayBySeparatingStrings (CFAllocatorRef alloc, CFStringRef theString, CFStringRef separatorString);
+	int CFStringGetIntValue (CFStringRef str);
+	double CFStringGetDoubleValue (CFStringRef str);
+	void CFStringAppend (CFMutableStringRef theString, CFStringRef appendedString);
+	void CFStringAppendCharacters (CFMutableStringRef theString, wchar* chars, int numChars);
+	void CFStringAppendPascalString (CFMutableStringRef theString, char* pStr, uint encoding);
+	void CFStringAppendCString (CFMutableStringRef theString, char* cStr, uint encoding);
+	void CFStringAppendFormat (CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, ...);
+	void CFStringAppendFormatAndArguments (CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, char* arguments);
+	void CFStringInsert (CFMutableStringRef str, int idx, CFStringRef insertedStr);
+	void CFStringDelete (CFMutableStringRef theString, CFRange range);
+	void CFStringReplace (CFMutableStringRef theString, CFRange range, CFStringRef replacement);
+	void CFStringReplaceAll (CFMutableStringRef theString, CFStringRef replacement);
+	int CFStringFindAndReplace (CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, uint compareOptions);
+	void CFStringSetExternalCharactersNoCopy (CFMutableStringRef theString, wchar* chars, int length, int capacity);
+	void CFStringPad (CFMutableStringRef theString, CFStringRef padString, int length, int indexIntoPad);
+	void CFStringTrim (CFMutableStringRef theString, CFStringRef trimString);
+	void CFStringTrimWhitespace (CFMutableStringRef theString);
+	void CFStringLowercase (CFMutableStringRef theString, CFLocaleRef locale);
+	void CFStringUppercase (CFMutableStringRef theString, CFLocaleRef locale);
+	void CFStringCapitalize (CFMutableStringRef theString, CFLocaleRef locale);
+	void CFStringNormalize (CFMutableStringRef theString, int theForm);
+	void CFStringFold (CFMutableStringRef theString, uint theFlags, CFLocaleRef theLocale);
+	ubyte CFStringTransform (CFMutableStringRef string, CFRange* range, CFStringRef transform, ubyte reverse);
+	ubyte CFStringIsEncodingAvailable (uint encoding);
+	uint* CFStringGetListOfAvailableEncodings ();
+	CFStringRef CFStringGetNameOfEncoding (uint encoding);
+	uint CFStringConvertEncodingToNSStringEncoding (uint encoding);
+	uint CFStringConvertNSStringEncodingToEncoding (uint encoding);
+	uint CFStringConvertEncodingToWindowsCodepage (uint encoding);
+	uint CFStringConvertWindowsCodepageToEncoding (uint codepage);
+	uint CFStringConvertIANACharSetNameToEncoding (CFStringRef theString);
+	CFStringRef CFStringConvertEncodingToIANACharSetName (uint encoding);
+	uint CFStringGetMostCompatibleMacStringEncoding (uint encoding);
+	void CFShow (void* obj);
+	void CFShowStr (CFStringRef str);
+	CFStringRef __CFStringMakeConstantString (char* cStr);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFStringEncodingExt.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,145 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFStringEncodingExt;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFStringEncodings;
+
+enum
+{
+	kCFStringEncodingMacJapanese = 1,
+	kCFStringEncodingMacChineseTrad = 2,
+	kCFStringEncodingMacKorean = 3,
+	kCFStringEncodingMacArabic = 4,
+	kCFStringEncodingMacHebrew = 5,
+	kCFStringEncodingMacGreek = 6,
+	kCFStringEncodingMacCyrillic = 7,
+	kCFStringEncodingMacDevanagari = 9,
+	kCFStringEncodingMacGurmukhi = 10,
+	kCFStringEncodingMacGujarati = 11,
+	kCFStringEncodingMacOriya = 12,
+	kCFStringEncodingMacBengali = 13,
+	kCFStringEncodingMacTamil = 14,
+	kCFStringEncodingMacTelugu = 15,
+	kCFStringEncodingMacKannada = 16,
+	kCFStringEncodingMacMalayalam = 17,
+	kCFStringEncodingMacSinhalese = 18,
+	kCFStringEncodingMacBurmese = 19,
+	kCFStringEncodingMacKhmer = 20,
+	kCFStringEncodingMacThai = 21,
+	kCFStringEncodingMacLaotian = 22,
+	kCFStringEncodingMacGeorgian = 23,
+	kCFStringEncodingMacArmenian = 24,
+	kCFStringEncodingMacChineseSimp = 25,
+	kCFStringEncodingMacTibetan = 26,
+	kCFStringEncodingMacMongolian = 27,
+	kCFStringEncodingMacEthiopic = 28,
+	kCFStringEncodingMacCentralEurRoman = 29,
+	kCFStringEncodingMacVietnamese = 30,
+	kCFStringEncodingMacExtArabic = 31,
+	kCFStringEncodingMacSymbol = 33,
+	kCFStringEncodingMacDingbats = 34,
+	kCFStringEncodingMacTurkish = 35,
+	kCFStringEncodingMacCroatian = 36,
+	kCFStringEncodingMacIcelandic = 37,
+	kCFStringEncodingMacRomanian = 38,
+	kCFStringEncodingMacCeltic = 39,
+	kCFStringEncodingMacGaelic = 40,
+	kCFStringEncodingMacFarsi = 0x8C,
+	kCFStringEncodingMacUkrainian = 0x98,
+	kCFStringEncodingMacInuit = 0xEC,
+	kCFStringEncodingMacVT100 = 0xFC,
+	kCFStringEncodingMacHFS = 0xFF,
+	kCFStringEncodingISOLatin2 = 0x0202,
+	kCFStringEncodingISOLatin3 = 0x0203,
+	kCFStringEncodingISOLatin4 = 0x0204,
+	kCFStringEncodingISOLatinCyrillic = 0x0205,
+	kCFStringEncodingISOLatinArabic = 0x0206,
+	kCFStringEncodingISOLatinGreek = 0x0207,
+	kCFStringEncodingISOLatinHebrew = 0x0208,
+	kCFStringEncodingISOLatin5 = 0x0209,
+	kCFStringEncodingISOLatin6 = 0x020A,
+	kCFStringEncodingISOLatinThai = 0x020B,
+	kCFStringEncodingISOLatin7 = 0x020D,
+	kCFStringEncodingISOLatin8 = 0x020E,
+	kCFStringEncodingISOLatin9 = 0x020F,
+	kCFStringEncodingISOLatin10 = 0x0210,
+	kCFStringEncodingDOSLatinUS = 0x0400,
+	kCFStringEncodingDOSGreek = 0x0405,
+	kCFStringEncodingDOSBalticRim = 0x0406,
+	kCFStringEncodingDOSLatin1 = 0x0410,
+	kCFStringEncodingDOSGreek1 = 0x0411,
+	kCFStringEncodingDOSLatin2 = 0x0412,
+	kCFStringEncodingDOSCyrillic = 0x0413,
+	kCFStringEncodingDOSTurkish = 0x0414,
+	kCFStringEncodingDOSPortuguese = 0x0415,
+	kCFStringEncodingDOSIcelandic = 0x0416,
+	kCFStringEncodingDOSHebrew = 0x0417,
+	kCFStringEncodingDOSCanadianFrench = 0x0418,
+	kCFStringEncodingDOSArabic = 0x0419,
+	kCFStringEncodingDOSNordic = 0x041A,
+	kCFStringEncodingDOSRussian = 0x041B,
+	kCFStringEncodingDOSGreek2 = 0x041C,
+	kCFStringEncodingDOSThai = 0x041D,
+	kCFStringEncodingDOSJapanese = 0x0420,
+	kCFStringEncodingDOSChineseSimplif = 0x0421,
+	kCFStringEncodingDOSKorean = 0x0422,
+	kCFStringEncodingDOSChineseTrad = 0x0423,
+	kCFStringEncodingWindowsLatin2 = 0x0501,
+	kCFStringEncodingWindowsCyrillic = 0x0502,
+	kCFStringEncodingWindowsGreek = 0x0503,
+	kCFStringEncodingWindowsLatin5 = 0x0504,
+	kCFStringEncodingWindowsHebrew = 0x0505,
+	kCFStringEncodingWindowsArabic = 0x0506,
+	kCFStringEncodingWindowsBalticRim = 0x0507,
+	kCFStringEncodingWindowsVietnamese = 0x0508,
+	kCFStringEncodingWindowsKoreanJohab = 0x0510,
+	kCFStringEncodingANSEL = 0x0601,
+	kCFStringEncodingJIS_X0201_76 = 0x0620,
+	kCFStringEncodingJIS_X0208_83 = 0x0621,
+	kCFStringEncodingJIS_X0208_90 = 0x0622,
+	kCFStringEncodingJIS_X0212_90 = 0x0623,
+	kCFStringEncodingJIS_C6226_78 = 0x0624,
+	kCFStringEncodingShiftJIS_X0213 = 0x0628,
+	kCFStringEncodingShiftJIS_X0213_MenKuTen = 0x0629,
+	kCFStringEncodingGB_2312_80 = 0x0630,
+	kCFStringEncodingGBK_95 = 0x0631,
+	kCFStringEncodingGB_18030_2000 = 0x0632,
+	kCFStringEncodingKSC_5601_87 = 0x0640,
+	kCFStringEncodingKSC_5601_92_Johab = 0x0641,
+	kCFStringEncodingCNS_11643_92_P1 = 0x0651,
+	kCFStringEncodingCNS_11643_92_P2 = 0x0652,
+	kCFStringEncodingCNS_11643_92_P3 = 0x0653,
+	kCFStringEncodingISO_2022_JP = 0x0820,
+	kCFStringEncodingISO_2022_JP_2 = 0x0821,
+	kCFStringEncodingISO_2022_JP_1 = 0x0822,
+	kCFStringEncodingISO_2022_JP_3 = 0x0823,
+	kCFStringEncodingISO_2022_CN = 0x0830,
+	kCFStringEncodingISO_2022_CN_EXT = 0x0831,
+	kCFStringEncodingISO_2022_KR = 0x0840,
+	kCFStringEncodingEUC_JP = 0x0920,
+	kCFStringEncodingEUC_CN = 0x0930,
+	kCFStringEncodingEUC_TW = 0x0931,
+	kCFStringEncodingEUC_KR = 0x0940,
+	kCFStringEncodingShiftJIS = 0x0A01,
+	kCFStringEncodingKOI8_R = 0x0A02,
+	kCFStringEncodingBig5 = 0x0A03,
+	kCFStringEncodingMacRomanLatin1 = 0x0A04,
+	kCFStringEncodingHZ_GB_2312 = 0x0A05,
+	kCFStringEncodingBig5_HKSCS_1999 = 0x0A06,
+	kCFStringEncodingVISCII = 0x0A07,
+	kCFStringEncodingKOI8_U = 0x0A08,
+	kCFStringEncodingBig5_E = 0x0A09,
+	kCFStringEncodingNextStepJapanese = 0x0B02,
+	kCFStringEncodingEBCDIC_US = 0x0C01,
+	kCFStringEncodingEBCDIC_CP037 = 0x0C02,
+	kCFStringEncodingShiftJIS_X0213_00 = 0x0628
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFStringTokenizer.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,53 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFStringTokenizer;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFStringTokenizer;
+alias __CFStringTokenizer* CFStringTokenizerRef;
+alias uint CFStringTokenizerTokenType;
+
+enum
+{
+	kCFStringTokenizerUnitWord = 0,
+	kCFStringTokenizerUnitSentence = 1,
+	kCFStringTokenizerUnitParagraph = 2,
+	kCFStringTokenizerUnitLineBreak = 3,
+	kCFStringTokenizerUnitWordBoundary = 4,
+	kCFStringTokenizerAttributeLatinTranscription = 1L << 16,
+	kCFStringTokenizerAttributeLanguage = 1L << 17
+}
+
+enum
+{
+	kCFStringTokenizerTokenNone = 0,
+	kCFStringTokenizerTokenNormal = 1,
+	kCFStringTokenizerTokenHasSubTokensMask = 1L << 1,
+	kCFStringTokenizerTokenHasDerivedSubTokensMask = 1L << 2,
+	kCFStringTokenizerTokenHasHasNumbersMask = 1L << 3,
+	kCFStringTokenizerTokenHasNonLettersMask = 1L << 4,
+	kCFStringTokenizerTokenIsCJWordMask = 1L << 5
+}
+
+extern (C)
+{
+	CFStringRef CFStringTokenizerCopyBestStringLanguage (CFStringRef string, CFRange range);
+	uint CFStringTokenizerGetTypeID ();
+	CFStringTokenizerRef CFStringTokenizerCreate (CFAllocatorRef alloc, CFStringRef string, CFRange range, uint options, CFLocaleRef locale);
+	void CFStringTokenizerSetString (CFStringTokenizerRef tokenizer, CFStringRef string, CFRange range);
+	uint CFStringTokenizerGoToTokenAtIndex (CFStringTokenizerRef tokenizer, int index);
+	uint CFStringTokenizerAdvanceToNextToken (CFStringTokenizerRef tokenizer);
+	CFRange CFStringTokenizerGetCurrentTokenRange (CFStringTokenizerRef tokenizer);
+	void* CFStringTokenizerCopyCurrentTokenAttribute (CFStringTokenizerRef tokenizer, uint attribute);
+	int CFStringTokenizerGetCurrentSubTokens (CFStringTokenizerRef tokenizer, CFRange* ranges, int maxRangeLength, CFMutableArrayRef derivedSubTokens);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFTimeZone.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,58 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFTimeZone;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFTimeZoneNameStyle;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFTimeZoneSystemTimeZoneDidChangeNotification;
+	}
+}
+
+enum
+{
+	kCFTimeZoneNameStyleStandard,
+	kCFTimeZoneNameStyleShortStandard,
+	kCFTimeZoneNameStyleDaylightSaving,
+	kCFTimeZoneNameStyleShortDaylightSaving
+}
+
+extern (C)
+{
+	uint CFTimeZoneGetTypeID ();
+	CFTimeZoneRef CFTimeZoneCopySystem ();
+	void CFTimeZoneResetSystem ();
+	CFTimeZoneRef CFTimeZoneCopyDefault ();
+	void CFTimeZoneSetDefault (CFTimeZoneRef tz);
+	CFArrayRef CFTimeZoneCopyKnownNames ();
+	CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary ();
+	void CFTimeZoneSetAbbreviationDictionary (CFDictionaryRef dict);
+	CFTimeZoneRef CFTimeZoneCreate (CFAllocatorRef allocator, CFStringRef name, CFDataRef data);
+	CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT (CFAllocatorRef allocator, double ti);
+	CFTimeZoneRef CFTimeZoneCreateWithName (CFAllocatorRef allocator, CFStringRef name, ubyte tryAbbrev);
+	CFStringRef CFTimeZoneGetName (CFTimeZoneRef tz);
+	CFDataRef CFTimeZoneGetData (CFTimeZoneRef tz);
+	double CFTimeZoneGetSecondsFromGMT (CFTimeZoneRef tz, double at);
+	CFStringRef CFTimeZoneCopyAbbreviation (CFTimeZoneRef tz, double at);
+	ubyte CFTimeZoneIsDaylightSavingTime (CFTimeZoneRef tz, double at);
+	double CFTimeZoneGetDaylightSavingTimeOffset (CFTimeZoneRef tz, double at);
+	double CFTimeZoneGetNextDaylightSavingTimeTransition (CFTimeZoneRef tz, double at);
+	CFStringRef CFTimeZoneCopyLocalizedName (CFTimeZoneRef tz, int style, CFLocaleRef locale);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFTree.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,53 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFTree;
+
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFTree;
+alias __CFTree* CFTreeRef;
+
+extern (C)
+{
+	alias void function (void*) CFTreeReleaseCallBack;
+	alias void* function (void*) CFTreeRetainCallBack;
+	alias CFStringRef function (void*) CFTreeCopyDescriptionCallBack;
+	alias void function (void*, void*) CFTreeApplierFunction;
+}
+
+struct CFTreeContext
+{
+	int version_;
+	void* info;
+	CFTreeRetainCallBack* retain;
+	CFTreeReleaseCallBack* release;
+	CFTreeCopyDescriptionCallBack* copyDescription;
+}
+
+extern (C)
+{
+	uint CFTreeGetTypeID ();
+	CFTreeRef CFTreeCreate (CFAllocatorRef allocator, CFTreeContext* context);
+	CFTreeRef CFTreeGetParent (CFTreeRef tree);
+	CFTreeRef CFTreeGetNextSibling (CFTreeRef tree);
+	CFTreeRef CFTreeGetFirstChild (CFTreeRef tree);
+	void CFTreeGetContext (CFTreeRef tree, CFTreeContext* context);
+	int CFTreeGetChildCount (CFTreeRef tree);
+	CFTreeRef CFTreeGetChildAtIndex (CFTreeRef tree, int idx);
+	void CFTreeGetChildren (CFTreeRef tree, CFTreeRef* children);
+	void CFTreeApplyFunctionToChildren (CFTreeRef tree, CFTreeApplierFunction* applier, void* context);
+	CFTreeRef CFTreeFindRoot (CFTreeRef tree);
+	void CFTreeSetContext (CFTreeRef tree, CFTreeContext* context);
+	void CFTreePrependChild (CFTreeRef tree, CFTreeRef newChild);
+	void CFTreeAppendChild (CFTreeRef tree, CFTreeRef newChild);
+	void CFTreeInsertSibling (CFTreeRef tree, CFTreeRef newSibling);
+	void CFTreeRemove (CFTreeRef tree);
+	void CFTreeRemoveAllChildren (CFTreeRef tree);
+	void CFTreeSortChildren (CFTreeRef tree, CFComparatorFunction* comparator, void* context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFURL.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,87 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFURL;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFString;
+import dstep.coreservices.carboncore.Files : FSRef;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFURLPathStyle;
+struct __CFURL;
+alias __CFURL* CFURLRef;
+alias int CFURLComponentType;
+
+enum
+{
+	kCFURLPOSIXPathStyle = 0,
+	kCFURLHFSPathStyle,
+	kCFURLWindowsPathStyle
+}
+
+enum
+{
+	kCFURLComponentScheme = 1,
+	kCFURLComponentNetLocation = 2,
+	kCFURLComponentPath = 3,
+	kCFURLComponentResourceSpecifier = 4,
+	kCFURLComponentUser = 5,
+	kCFURLComponentPassword = 6,
+	kCFURLComponentUserInfo = 7,
+	kCFURLComponentHost = 8,
+	kCFURLComponentPort = 9,
+	kCFURLComponentParameterString = 10,
+	kCFURLComponentQuery = 11,
+	kCFURLComponentFragment = 12
+}
+
+extern (C)
+{
+	uint CFURLGetTypeID ();
+	CFURLRef CFURLCreateWithBytes (CFAllocatorRef allocator, char* URLBytes, int length, uint encoding, CFURLRef baseURL);
+	CFDataRef CFURLCreateData (CFAllocatorRef allocator, CFURLRef url, uint encoding, ubyte escapeWhitespace);
+	CFURLRef CFURLCreateWithString (CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL);
+	CFURLRef CFURLCreateAbsoluteURLWithBytes (CFAllocatorRef alloc, char* relativeURLBytes, int length, uint encoding, CFURLRef baseURL, ubyte useCompatibilityMode);
+	CFURLRef CFURLCreateWithFileSystemPath (CFAllocatorRef allocator, CFStringRef filePath, int pathStyle, ubyte isDirectory);
+	CFURLRef CFURLCreateFromFileSystemRepresentation (CFAllocatorRef allocator, char* buffer, int bufLen, ubyte isDirectory);
+	CFURLRef CFURLCreateWithFileSystemPathRelativeToBase (CFAllocatorRef allocator, CFStringRef filePath, int pathStyle, ubyte isDirectory, CFURLRef baseURL);
+	CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase (CFAllocatorRef allocator, char* buffer, int bufLen, ubyte isDirectory, CFURLRef baseURL);
+	ubyte CFURLGetFileSystemRepresentation (CFURLRef url, ubyte resolveAgainstBase, char* buffer, int maxBufLen);
+	CFURLRef CFURLCopyAbsoluteURL (CFURLRef relativeURL);
+	CFStringRef CFURLGetString (CFURLRef anURL);
+	CFURLRef CFURLGetBaseURL (CFURLRef anURL);
+	ubyte CFURLCanBeDecomposed (CFURLRef anURL);
+	CFStringRef CFURLCopyScheme (CFURLRef anURL);
+	CFStringRef CFURLCopyNetLocation (CFURLRef anURL);
+	CFStringRef CFURLCopyPath (CFURLRef anURL);
+	CFStringRef CFURLCopyStrictPath (CFURLRef anURL, char* isAbsolute);
+	CFStringRef CFURLCopyFileSystemPath (CFURLRef anURL, int pathStyle);
+	ubyte CFURLHasDirectoryPath (CFURLRef anURL);
+	CFStringRef CFURLCopyResourceSpecifier (CFURLRef anURL);
+	CFStringRef CFURLCopyHostName (CFURLRef anURL);
+	int CFURLGetPortNumber (CFURLRef anURL);
+	CFStringRef CFURLCopyUserName (CFURLRef anURL);
+	CFStringRef CFURLCopyPassword (CFURLRef anURL);
+	CFStringRef CFURLCopyParameterString (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
+	CFStringRef CFURLCopyQueryString (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
+	CFStringRef CFURLCopyFragment (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
+	CFStringRef CFURLCopyLastPathComponent (CFURLRef url);
+	CFStringRef CFURLCopyPathExtension (CFURLRef url);
+	CFURLRef CFURLCreateCopyAppendingPathComponent (CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, ubyte isDirectory);
+	CFURLRef CFURLCreateCopyDeletingLastPathComponent (CFAllocatorRef allocator, CFURLRef url);
+	CFURLRef CFURLCreateCopyAppendingPathExtension (CFAllocatorRef allocator, CFURLRef url, CFStringRef extension);
+	CFURLRef CFURLCreateCopyDeletingPathExtension (CFAllocatorRef allocator, CFURLRef url);
+	int CFURLGetBytes (CFURLRef url, char* buffer, int bufferLength);
+	CFRange CFURLGetByteRangeForComponent (CFURLRef url, int component, CFRange* rangeIncludingSeparators);
+	CFStringRef CFURLCreateStringByReplacingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped);
+	CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding (CFAllocatorRef allocator, CFStringRef origString, CFStringRef charsToLeaveEscaped, uint encoding);
+	CFStringRef CFURLCreateStringByAddingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, uint encoding);
+	CFURLRef CFURLCreateFromFSRef (CFAllocatorRef allocator, FSRef* fsRef);
+	ubyte CFURLGetFSRef (CFURLRef url, FSRef* fsRef);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFURLAccess.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,54 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFURLAccess;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+alias int CFURLError;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFURLFileExists;
+		const CFStringRef kCFURLFileDirectoryContents;
+		const CFStringRef kCFURLFileLength;
+		const CFStringRef kCFURLFileLastModificationTime;
+		const CFStringRef kCFURLFilePOSIXMode;
+		const CFStringRef kCFURLFileOwnerID;
+		const CFStringRef kCFURLHTTPStatusCode;
+		const CFStringRef kCFURLHTTPStatusLine;
+	}
+}
+
+enum
+{
+	kCFURLUnknownError = -10,
+	kCFURLUnknownSchemeError = -11,
+	kCFURLResourceNotFoundError = -12,
+	kCFURLResourceAccessViolationError = -13,
+	kCFURLRemoteHostUnavailableError = -14,
+	kCFURLImproperArgumentsError = -15,
+	kCFURLUnknownPropertyKeyError = -16,
+	kCFURLPropertyKeyUnavailableError = -17,
+	kCFURLTimeoutError = -18
+}
+
+extern (C)
+{
+	ubyte CFURLCreateDataAndPropertiesFromResource (CFAllocatorRef alloc, CFURLRef url, CFDataRef* resourceData, CFDictionaryRef* properties, CFArrayRef desiredProperties, int* errorCode);
+	ubyte CFURLWriteDataAndPropertiesToResource (CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, int* errorCode);
+	ubyte CFURLDestroyResource (CFURLRef url, int* errorCode);
+	void* CFURLCreatePropertyFromResource (CFAllocatorRef alloc, CFURLRef url, CFStringRef property, int* errorCode);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFUUID.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,47 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFUUID;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFUUID;
+alias __CFUUID* CFUUIDRef;
+
+struct CFUUIDBytes
+{
+	ubyte byte0;
+	ubyte byte1;
+	ubyte byte2;
+	ubyte byte3;
+	ubyte byte4;
+	ubyte byte5;
+	ubyte byte6;
+	ubyte byte7;
+	ubyte byte8;
+	ubyte byte9;
+	ubyte byte10;
+	ubyte byte11;
+	ubyte byte12;
+	ubyte byte13;
+	ubyte byte14;
+	ubyte byte15;
+}
+
+extern (C)
+{
+	uint CFUUIDGetTypeID ();
+	CFUUIDRef CFUUIDCreate (CFAllocatorRef alloc);
+	CFUUIDRef CFUUIDCreateWithBytes (CFAllocatorRef alloc, ubyte byte0, ubyte byte1, ubyte byte2, ubyte byte3, ubyte byte4, ubyte byte5, ubyte byte6, ubyte byte7, ubyte byte8, ubyte byte9, ubyte byte10, ubyte byte11, ubyte byte12, ubyte byte13, ubyte byte14, ubyte byte15);
+	CFUUIDRef CFUUIDCreateFromString (CFAllocatorRef alloc, CFStringRef uuidStr);
+	CFStringRef CFUUIDCreateString (CFAllocatorRef alloc, CFUUIDRef uuid);
+	CFUUIDRef CFUUIDGetConstantUUIDWithBytes (CFAllocatorRef alloc, ubyte byte0, ubyte byte1, ubyte byte2, ubyte byte3, ubyte byte4, ubyte byte5, ubyte byte6, ubyte byte7, ubyte byte8, ubyte byte9, ubyte byte10, ubyte byte11, ubyte byte12, ubyte byte13, ubyte byte14, ubyte byte15);
+	CFUUIDBytes CFUUIDGetUUIDBytes (CFUUIDRef uuid);
+	CFUUIDRef CFUUIDCreateFromUUIDBytes (CFAllocatorRef alloc, CFUUIDBytes bytes);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFUserNotification.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,81 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFUserNotification;
+
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFUserNotification;
+alias __CFUserNotification* CFUserNotificationRef;
+
+extern (C)
+{
+	alias void function (CFUserNotificationRef, uint) CFUserNotificationCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFUserNotificationIconURLKey;
+		const CFStringRef kCFUserNotificationSoundURLKey;
+		const CFStringRef kCFUserNotificationLocalizationURLKey;
+		const CFStringRef kCFUserNotificationAlertHeaderKey;
+		const CFStringRef kCFUserNotificationAlertMessageKey;
+		const CFStringRef kCFUserNotificationDefaultButtonTitleKey;
+		const CFStringRef kCFUserNotificationAlternateButtonTitleKey;
+		const CFStringRef kCFUserNotificationOtherButtonTitleKey;
+		const CFStringRef kCFUserNotificationProgressIndicatorValueKey;
+		const CFStringRef kCFUserNotificationPopUpTitlesKey;
+		const CFStringRef kCFUserNotificationTextFieldTitlesKey;
+		const CFStringRef kCFUserNotificationCheckBoxTitlesKey;
+		const CFStringRef kCFUserNotificationTextFieldValuesKey;
+		const CFStringRef kCFUserNotificationPopUpSelectionKey;
+	}
+}
+
+enum
+{
+	kCFUserNotificationStopAlertLevel = 0,
+	kCFUserNotificationNoteAlertLevel = 1,
+	kCFUserNotificationCautionAlertLevel = 2,
+	kCFUserNotificationPlainAlertLevel = 3
+}
+
+enum
+{
+	kCFUserNotificationDefaultResponse = 0,
+	kCFUserNotificationAlternateResponse = 1,
+	kCFUserNotificationOtherResponse = 2,
+	kCFUserNotificationCancelResponse = 3
+}
+
+enum
+{
+	kCFUserNotificationNoDefaultButtonFlag = (1 << 5),
+	kCFUserNotificationUseRadioButtonsFlag = (1 << 6)
+}
+
+extern (C)
+{
+	uint CFUserNotificationGetTypeID ();
+	CFUserNotificationRef CFUserNotificationCreate (CFAllocatorRef allocator, double timeout, uint flags, int* error, CFDictionaryRef dictionary);
+	int CFUserNotificationReceiveResponse (CFUserNotificationRef userNotification, double timeout, uint* responseFlags);
+	CFStringRef CFUserNotificationGetResponseValue (CFUserNotificationRef userNotification, CFStringRef key, int idx);
+	CFDictionaryRef CFUserNotificationGetResponseDictionary (CFUserNotificationRef userNotification);
+	int CFUserNotificationUpdate (CFUserNotificationRef userNotification, double timeout, uint flags, CFDictionaryRef dictionary);
+	int CFUserNotificationCancel (CFUserNotificationRef userNotification);
+	CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource (CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack* callout, int order);
+	int CFUserNotificationDisplayNotice (double timeout, uint flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle);
+	int CFUserNotificationDisplayAlert (double timeout, uint flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, uint* responseFlags);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFXMLNode.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,144 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFXMLNode;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFTree;
+import dstep.corefoundation.CFURL;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFXMLNode;
+alias __CFXMLNode* CFXMLNodeRef;
+alias CFTreeRef CFXMLTreeRef;
+alias int CFXMLNodeTypeCode;
+alias int CFXMLEntityTypeCode;
+
+enum
+{
+	kCFXMLNodeCurrentVersion = 1
+}
+
+enum
+{
+	kCFXMLNodeTypeDocument = 1,
+	kCFXMLNodeTypeElement = 2,
+	kCFXMLNodeTypeAttribute = 3,
+	kCFXMLNodeTypeProcessingInstruction = 4,
+	kCFXMLNodeTypeComment = 5,
+	kCFXMLNodeTypeText = 6,
+	kCFXMLNodeTypeCDATASection = 7,
+	kCFXMLNodeTypeDocumentFragment = 8,
+	kCFXMLNodeTypeEntity = 9,
+	kCFXMLNodeTypeEntityReference = 10,
+	kCFXMLNodeTypeDocumentType = 11,
+	kCFXMLNodeTypeWhitespace = 12,
+	kCFXMLNodeTypeNotation = 13,
+	kCFXMLNodeTypeElementTypeDeclaration = 14,
+	kCFXMLNodeTypeAttributeListDeclaration = 15
+}
+
+enum
+{
+	kCFXMLEntityTypeParameter,
+	kCFXMLEntityTypeParsedInternal,
+	kCFXMLEntityTypeParsedExternal,
+	kCFXMLEntityTypeUnparsed,
+	kCFXMLEntityTypeCharacter
+}
+
+struct CFXMLElementInfo
+{
+	CFDictionaryRef attributes;
+	CFArrayRef attributeOrder;
+	ubyte isEmpty;
+	char* _reserved;
+}
+
+
+struct CFXMLProcessingInstructionInfo
+{
+	CFStringRef dataString;
+}
+
+
+struct CFXMLDocumentInfo
+{
+	CFURLRef sourceURL;
+	uint encoding;
+}
+
+
+struct CFXMLExternalID
+{
+	CFURLRef systemID;
+	CFStringRef publicID;
+}
+
+
+struct CFXMLDocumentTypeInfo
+{
+	CFXMLExternalID externalID;
+}
+
+
+struct CFXMLNotationInfo
+{
+	CFXMLExternalID externalID;
+}
+
+
+struct CFXMLElementTypeDeclarationInfo
+{
+	CFStringRef contentDescription;
+}
+
+
+struct CFXMLAttributeDeclarationInfo
+{
+	CFStringRef attributeName;
+	CFStringRef typeString;
+	CFStringRef defaultString;
+}
+
+
+struct CFXMLAttributeListDeclarationInfo
+{
+	int numberOfAttributes;
+	CFXMLAttributeDeclarationInfo* attributes;
+}
+
+
+struct CFXMLEntityInfo
+{
+	int entityType;
+	CFStringRef replacementText;
+	CFXMLExternalID entityID;
+	CFStringRef notationName;
+}
+
+
+struct CFXMLEntityReferenceInfo
+{
+	int entityType;
+}
+
+extern (C)
+{
+	uint CFXMLNodeGetTypeID ();
+	CFXMLNodeRef CFXMLNodeCreate (CFAllocatorRef alloc, int xmlType, CFStringRef dataString, void* additionalInfoPtr, int version_);
+	CFXMLNodeRef CFXMLNodeCreateCopy (CFAllocatorRef alloc, CFXMLNodeRef origNode);
+	int CFXMLNodeGetTypeCode (CFXMLNodeRef node);
+	CFStringRef CFXMLNodeGetString (CFXMLNodeRef node);
+	void* CFXMLNodeGetInfoPtr (CFXMLNodeRef node);
+	int CFXMLNodeGetVersion (CFXMLNodeRef node);
+	CFXMLTreeRef CFXMLTreeCreateWithNode (CFAllocatorRef allocator, CFXMLNodeRef node);
+	CFXMLNodeRef CFXMLTreeGetNode (CFXMLTreeRef xmlTree);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CFXMLParser.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,122 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CFXMLParser;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFTree;
+import dstep.corefoundation.CFURL;
+import dstep.corefoundation.CFXMLNode;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+
+struct __CFXMLParser;
+alias __CFXMLParser* CFXMLParserRef;
+alias uint CFXMLParserOptions;
+alias int CFXMLParserStatusCode;
+
+extern (C)
+{
+	alias void* function (void*) CFXMLParserRetainCallBack;
+	alias CFDataRef function (CFXMLParserRef, CFXMLExternalID*, void*) CFXMLParserResolveExternalEntityCallBack;
+	alias void function (CFXMLParserRef, void*, void*, void*) CFXMLParserAddChildCallBack;
+	alias void function (CFXMLParserRef, void*, void*) CFXMLParserEndXMLStructureCallBack;
+	alias CFStringRef function (void*) CFXMLParserCopyDescriptionCallBack;
+	alias void function (void*) CFXMLParserReleaseCallBack;
+	alias ubyte function (CFXMLParserRef, int, void*) CFXMLParserHandleErrorCallBack;
+	alias void* function (CFXMLParserRef, CFXMLNodeRef, void*) CFXMLParserCreateXMLStructureCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFXMLTreeErrorDescription;
+		const CFStringRef kCFXMLTreeErrorLineNumber;
+		const CFStringRef kCFXMLTreeErrorLocation;
+		const CFStringRef kCFXMLTreeErrorStatusCode;
+	}
+}
+
+enum
+{
+	kCFXMLParserValidateDocument = (1 << 0),
+	kCFXMLParserSkipMetaData = (1 << 1),
+	kCFXMLParserReplacePhysicalEntities = (1 << 2),
+	kCFXMLParserSkipWhitespace = (1 << 3),
+	kCFXMLParserResolveExternalEntities = (1 << 4),
+	kCFXMLParserAddImpliedAttributes = (1 << 5),
+	kCFXMLParserAllOptions = 0x00FFFFFF,
+	kCFXMLParserNoOptions = 0
+}
+
+enum
+{
+	kCFXMLStatusParseNotBegun = -2,
+	kCFXMLStatusParseInProgress = -1,
+	kCFXMLStatusParseSuccessful = 0,
+	kCFXMLErrorUnexpectedEOF = 1,
+	kCFXMLErrorUnknownEncoding,
+	kCFXMLErrorEncodingConversionFailure,
+	kCFXMLErrorMalformedProcessingInstruction,
+	kCFXMLErrorMalformedDTD,
+	kCFXMLErrorMalformedName,
+	kCFXMLErrorMalformedCDSect,
+	kCFXMLErrorMalformedCloseTag,
+	kCFXMLErrorMalformedStartTag,
+	kCFXMLErrorMalformedDocument,
+	kCFXMLErrorElementlessDocument,
+	kCFXMLErrorMalformedComment,
+	kCFXMLErrorMalformedCharacterReference,
+	kCFXMLErrorMalformedParsedCharacterData,
+	kCFXMLErrorNoData
+}
+
+struct CFXMLParserCallBacks
+{
+	int version_;
+	CFXMLParserCreateXMLStructureCallBack* createXMLStructure;
+	CFXMLParserAddChildCallBack* addChild;
+	CFXMLParserEndXMLStructureCallBack* endXMLStructure;
+	CFXMLParserResolveExternalEntityCallBack* resolveExternalEntity;
+	CFXMLParserHandleErrorCallBack* handleError;
+}
+
+
+struct CFXMLParserContext
+{
+	int version_;
+	void* info;
+	CFXMLParserRetainCallBack* retain;
+	CFXMLParserReleaseCallBack* release;
+	CFXMLParserCopyDescriptionCallBack* copyDescription;
+}
+
+extern (C)
+{
+	uint CFXMLParserGetTypeID ();
+	CFXMLParserRef CFXMLParserCreate (CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, uint parseOptions, int versionOfNodes, CFXMLParserCallBacks* callBacks, CFXMLParserContext* context);
+	CFXMLParserRef CFXMLParserCreateWithDataFromURL (CFAllocatorRef allocator, CFURLRef dataSource, uint parseOptions, int versionOfNodes, CFXMLParserCallBacks* callBacks, CFXMLParserContext* context);
+	void CFXMLParserGetContext (CFXMLParserRef parser, CFXMLParserContext* context);
+	void CFXMLParserGetCallBacks (CFXMLParserRef parser, CFXMLParserCallBacks* callBacks);
+	CFURLRef CFXMLParserGetSourceURL (CFXMLParserRef parser);
+	int CFXMLParserGetLocation (CFXMLParserRef parser);
+	int CFXMLParserGetLineNumber (CFXMLParserRef parser);
+	void* CFXMLParserGetDocument (CFXMLParserRef parser);
+	int CFXMLParserGetStatusCode (CFXMLParserRef parser);
+	CFStringRef CFXMLParserCopyErrorDescription (CFXMLParserRef parser);
+	void CFXMLParserAbort (CFXMLParserRef parser, int errorCode, CFStringRef errorDescription);
+	ubyte CFXMLParserParse (CFXMLParserRef parser);
+	CFXMLTreeRef CFXMLTreeCreateFromData (CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, uint parseOptions, int versionOfNodes);
+	CFXMLTreeRef CFXMLTreeCreateFromDataWithError (CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, uint parseOptions, int versionOfNodes, CFDictionaryRef* errorDict);
+	CFXMLTreeRef CFXMLTreeCreateWithDataFromURL (CFAllocatorRef allocator, CFURLRef dataSource, uint parseOptions, int versionOfNodes);
+	CFDataRef CFXMLTreeCreateXMLData (CFAllocatorRef allocator, CFXMLTreeRef xmlTree);
+	CFStringRef CFXMLCreateStringByEscapingEntities (CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary);
+	CFStringRef CFXMLCreateStringByUnescapingEntities (CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/corefoundation/CoreFoundation.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,72 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 12, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.corefoundation.CoreFoundation;
+
+public:
+
+//import dstep.assert;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFAttributedString;
+import dstep.corefoundation.CFBag;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFBinaryHeap;
+import dstep.corefoundation.CFBitVector;
+import dstep.corefoundation.CFBundle;
+import dstep.corefoundation.CFByteOrder;
+import dstep.corefoundation.CFCalendar;
+import dstep.corefoundation.CFCharacterSet;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFDateFormatter;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFError;
+import dstep.corefoundation.CFFileDescriptor;
+import dstep.corefoundation.CFLocale;
+import dstep.corefoundation.CFMachPort;
+import dstep.corefoundation.CFMessagePort;
+import dstep.corefoundation.CFNotificationCenter;
+import dstep.corefoundation.CFNumber;
+import dstep.corefoundation.CFNumberFormatter;
+import dstep.corefoundation.CFPlugIn;
+import dstep.corefoundation.CFPreferences;
+import dstep.corefoundation.CFPropertyList;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFSet;
+import dstep.corefoundation.CFSocket;
+import dstep.corefoundation.CFStream;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFStringEncodingExt;
+import dstep.corefoundation.CFStringTokenizer;
+import dstep.corefoundation.CFTimeZone;
+import dstep.corefoundation.CFTree;
+import dstep.corefoundation.CFURL;
+import dstep.corefoundation.CFURLAccess;
+import dstep.corefoundation.CFUUID;
+import dstep.corefoundation.CFUserNotification;
+import dstep.corefoundation.CFXMLNode;
+import dstep.corefoundation.CFXMLParser;
+/*import dstep.ctype;
+import dstep.errno;
+import dstep.float;
+import dstep.inttypes;
+import dstep.limits;
+import dstep.locale;
+import dstep.math;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.objc : id;
+import dstep.setjmp;
+import dstep.signal;
+import dstep.stdarg;
+import dstep.stdbool;
+import dstep.stddef;
+import dstep.stdint;
+import dstep.stdio;
+import dstep.stdlib;
+import dstep.string;
+import dstep.sys.types;
+import dstep.time;*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/Components.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,11 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.Components;
+
+public:
+import dstep.coreservices.carboncore.Components;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/CoreServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,20 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.CoreServices;
+
+public:
+
+import dstep.coreservices.ae.AE;
+import dstep.coreservices.carboncore.CarbonCore;
+/*import dstep.cfnetwork.CFNetwork;
+import dstep.corefoundation.CoreFoundation;
+import dstep.dictionaryservices.DictionaryServices;
+import dstep.launchservices.LaunchServices;
+import dstep.metadata.Metadata;
+import dstep.osservices.OSServices;
+import dstep.searchkit.SearchKit;*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AE.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,20 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AE;
+
+public:
+
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.ae.AEHelpers;
+import dstep.coreservices.ae.AEMach;
+import dstep.coreservices.ae.AEObjects;
+import dstep.coreservices.ae.AEPackObject;
+import dstep.coreservices.ae.AERegistry;
+import dstep.coreservices.ae.AEUserTermTypes;
+import dstep.coreservices.ae.AppleEvents;
+import dstep.coreservices.carboncore.CarbonCore;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEDataModel.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,478 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEDataModel;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+
+struct OpaqueAEDataStorageType;
+
+struct AEDesc
+{
+	uint descriptorType;
+	AEDataStorage dataHandle;
+}
+
+
+struct AEKeyDesc
+{
+	uint descKey;
+	AEDesc descContent;
+}
+
+alias uint DescType;
+alias uint AEKeyword;
+alias OpaqueAEDataStorageType* AEDataStorageType;
+alias AEDataStorageType* AEDataStorage;
+alias AEDesc* AEDescPtr;
+alias AEDesc AEDescList;
+alias AEDescList AERecord;
+alias AEDesc AEAddressDesc;
+alias AERecord AppleEvent;
+alias AppleEvent* AppleEventPtr;
+alias short AEReturnID;
+alias int AETransactionID;
+alias uint AEEventClass;
+alias uint AEEventID;
+alias byte AEArrayType;
+alias short AESendPriority;
+alias int AESendMode;
+alias AECoerceDescProcPtr AECoerceDescUPP;
+alias AECoercePtrProcPtr AECoercePtrUPP;
+alias AECoerceDescUPP AECoercionHandlerUPP;
+alias AEDisposeExternalProcPtr AEDisposeExternalUPP;
+alias AEEventHandlerProcPtr AEEventHandlerUPP;
+alias AEArrayData* AEArrayDataPointer;
+
+extern (C)
+{
+	alias void function (void*, int, int) AEDisposeExternalProcPtr;
+	alias short function (uint, void*, int, uint, int, AEDesc*) AECoercePtrProcPtr;
+	alias short function (AppleEvent*, AppleEvent*, int) AEEventHandlerProcPtr;
+	alias short function (AEDesc*, uint, int, AEDesc*) AECoerceDescProcPtr;
+}
+
+//This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeBoolean = getOSType!("bool");
+		const __typeChar = getOSType!("TEXT");
+		const __typeStyledUnicodeText = getOSType!("sutx");
+		const __typeEncodedString = getOSType!("encs");
+		const __typeUnicodeText = getOSType!("utxt");
+		const __typeCString = getOSType!("cstr");
+		const __typePString = getOSType!("pstr");
+		const __typeUTF16ExternalRepresentation = getOSType!("ut16");
+		const __typeUTF8Text = getOSType!("utf8");
+		const __typeSInt16 = getOSType!("shor");
+		const __typeUInt16 = getOSType!("ushr");
+		const __typeSInt32 = getOSType!("long");
+		const __typeUInt32 = getOSType!("magn");
+		const __typeSInt64 = getOSType!("comp");
+		const __typeUInt64 = getOSType!("ucom");
+		const __typeIEEE32BitFloatingPoint = getOSType!("sing");
+		const __typeIEEE64BitFloatingPoint = getOSType!("doub");
+		const __type128BitFloatingPoint = getOSType!("ldbl");
+		const __typeDecimalStruct = getOSType!("decm");
+		const __typeAEList = getOSType!("list");
+		const __typeAERecord = getOSType!("reco");
+		const __typeAppleEvent = getOSType!("aevt");
+		const __typeEventRecord = getOSType!("evrc");
+		const __typeTrue = getOSType!("true");
+		const __typeFalse = getOSType!("fals");
+		const __typeAlias = getOSType!("alis");
+		const __typeEnumerated = getOSType!("enum");
+		const __typeType = getOSType!("type");
+		const __typeAppParameters = getOSType!("appa");
+		const __typeProperty = getOSType!("prop");
+		const __typeFSRef = getOSType!("fsrf");
+		const __typeFileURL = getOSType!("furl");
+		const __typeKeyword = getOSType!("keyw");
+		const __typeSectionH = getOSType!("sect");
+		const __typeWildCard = getOSType!("****");
+		const __typeApplSignature = getOSType!("sign");
+		const __typeQDRectangle = getOSType!("qdrt");
+		const __typeFixed = getOSType!("fixd");
+		const __typeProcessSerialNumber = getOSType!("psn ");
+		const __typeApplicationURL = getOSType!("aprl");
+		const __typeNull = getOSType!("null");
+		const __typeCFAttributedStringRef = getOSType!("cfas");
+		const __typeCFMutableAttributedStringRef = getOSType!("cfaa");
+		const __typeCFStringRef = getOSType!("cfst");
+		const __typeCFMutableStringRef = getOSType!("cfms");
+		const __typeCFArrayRef = getOSType!("cfar");
+		const __typeCFMutableArrayRef = getOSType!("cfma");
+		const __typeCFDictionaryRef = getOSType!("cfdc");
+		const __typeCFMutableDictionaryRef = getOSType!("cfmd");
+		const __typeCFNumberRef = getOSType!("cfnb");
+		const __typeCFBooleanRef = getOSType!("cftf");
+		const __typeCFTypeRef = getOSType!("cfty");
+		const __typeKernelProcessID = getOSType!("kpid");
+		const __typeMachPort = getOSType!("port");
+		const __typeApplicationBundleID = getOSType!("bund");
+		const __keyTransactionIDAttr = getOSType!("tran");
+		const __keyReturnIDAttr = getOSType!("rtid");
+		const __keyEventClassAttr = getOSType!("evcl");
+		const __keyEventIDAttr = getOSType!("evid");
+		const __keyAddressAttr = getOSType!("addr");
+		const __keyOptionalKeywordAttr = getOSType!("optk");
+		const __keyTimeoutAttr = getOSType!("timo");
+		const __keyInteractLevelAttr = getOSType!("inte");
+		const __keyEventSourceAttr = getOSType!("esrc");
+		const __keyMissedKeywordAttr = getOSType!("miss");
+		const __keyOriginalAddressAttr = getOSType!("from");
+		const __keyAcceptTimeoutAttr = getOSType!("actm");
+		const __keyReplyRequestedAttr = getOSType!("repq");
+		const __kSOAP1999Schema = getOSType!("ss99");
+		const __kSOAP2001Schema = getOSType!("ss01");
+		const __keyUserNameAttr = getOSType!("unam");
+		const __keyUserPasswordAttr = getOSType!("pass");
+		const __keyDisableAuthenticationAttr = getOSType!("auth");
+		const __keyXMLDebuggingAttr = getOSType!("xdbg");
+		const __kAERPCClass = getOSType!("rpc ");
+		const __kAEXMLRPCScheme = getOSType!("RPC2");
+		const __kAESOAPScheme = getOSType!("SOAP");
+		const __kAESharedScriptHandler = getOSType!("wscp");
+		const __keyRPCMethodName = getOSType!("meth");
+		const __keyRPCMethodParam = getOSType!("parm");
+		const __keyRPCMethodParamOrder = getOSType!("/ord");
+		const __keyAEPOSTHeaderData = getOSType!("phed");
+		const __keyAEReplyHeaderData = getOSType!("rhed");
+		const __keyAEXMLRequestData = getOSType!("xreq");
+		const __keyAEXMLReplyData = getOSType!("xrep");
+		const __keyAdditionalHTTPHeaders = getOSType!("ahed");
+		const __keySOAPAction = getOSType!("sact");
+		const __keySOAPMethodNameSpace = getOSType!("mspc");
+		const __keySOAPMethodNameSpaceURI = getOSType!("mspu");
+		const __keySOAPSchemaVersion = getOSType!("ssch");
+		const __keySOAPStructureMetaData = getOSType!("/smd");
+		const __keySOAPSMDNamespace = getOSType!("ssns");
+		const __keySOAPSMDNamespaceURI = getOSType!("ssnu");
+		const __keySOAPSMDType = getOSType!("sstp");
+		const __kAEUseHTTPProxyAttr = getOSType!("xupr");
+		const __kAEHTTPProxyPortAttr = getOSType!("xhtp");
+		const __kAEHTTPProxyHostAttr = getOSType!("xhth");
+		const __kAEUseSocksAttr = getOSType!("xscs");
+		const __kAESocksProxyAttr = getOSType!("xsok");
+		const __kAESocksHostAttr = getOSType!("xshs");
+		const __kAESocksPortAttr = getOSType!("xshp");
+		const __kAESocksUserAttr = getOSType!("xshu");
+		const __kAESocksPasswordAttr = getOSType!("xshw");
+	}
+}
+
+enum
+{
+	typeBoolean = getOSType!("bool"),
+	typeChar = getOSType!("TEXT")
+}
+
+enum
+{
+	typeStyledUnicodeText = getOSType!("sutx"),
+	typeEncodedString = getOSType!("encs"),
+	typeUnicodeText = getOSType!("utxt"),
+	typeCString = getOSType!("cstr"),
+	typePString = getOSType!("pstr")
+}
+
+enum
+{
+	typeUTF16ExternalRepresentation = getOSType!("ut16"),
+	typeUTF8Text = getOSType!("utf8")
+}
+
+enum
+{
+	typeSInt16 = getOSType!("shor"),
+	typeUInt16 = getOSType!("ushr"),
+	typeSInt32 = getOSType!("long"),
+	typeUInt32 = getOSType!("magn"),
+	typeSInt64 = getOSType!("comp"),
+	typeUInt64 = getOSType!("ucom"),
+	typeIEEE32BitFloatingPoint = getOSType!("sing"),
+	typeIEEE64BitFloatingPoint = getOSType!("doub"),
+	type128BitFloatingPoint = getOSType!("ldbl"),
+	typeDecimalStruct = getOSType!("decm")
+}
+
+enum
+{
+	typeAEList = getOSType!("list"),
+	typeAERecord = getOSType!("reco"),
+	typeAppleEvent = getOSType!("aevt"),
+	typeEventRecord = getOSType!("evrc"),
+	typeTrue = getOSType!("true"),
+	typeFalse = getOSType!("fals"),
+	typeAlias = getOSType!("alis"),
+	typeEnumerated = getOSType!("enum"),
+	typeType = getOSType!("type"),
+	typeAppParameters = getOSType!("appa"),
+	typeProperty = getOSType!("prop"),
+	typeFSRef = getOSType!("fsrf"),
+	typeFileURL = getOSType!("furl"),
+	typeKeyword = getOSType!("keyw"),
+	typeSectionH = getOSType!("sect"),
+	typeWildCard = getOSType!("****"),
+	typeApplSignature = getOSType!("sign"),
+	typeQDRectangle = getOSType!("qdrt"),
+	typeFixed = getOSType!("fixd"),
+	typeProcessSerialNumber = getOSType!("psn "),
+	typeApplicationURL = getOSType!("aprl"),
+	typeNull = getOSType!("null")
+}
+
+enum
+{
+	typeCFAttributedStringRef = getOSType!("cfas"),
+	typeCFMutableAttributedStringRef = getOSType!("cfaa"),
+	typeCFStringRef = getOSType!("cfst"),
+	typeCFMutableStringRef = getOSType!("cfms"),
+	typeCFArrayRef = getOSType!("cfar"),
+	typeCFMutableArrayRef = getOSType!("cfma"),
+	typeCFDictionaryRef = getOSType!("cfdc"),
+	typeCFMutableDictionaryRef = getOSType!("cfmd"),
+	typeCFNumberRef = getOSType!("cfnb"),
+	typeCFBooleanRef = getOSType!("cftf"),
+	typeCFTypeRef = getOSType!("cfty")
+}
+
+enum
+{
+	typeKernelProcessID = getOSType!("kpid"),
+	typeMachPort = getOSType!("port")
+}
+
+enum
+{
+	typeApplicationBundleID = getOSType!("bund")
+}
+
+enum
+{
+	keyTransactionIDAttr = getOSType!("tran"),
+	keyReturnIDAttr = getOSType!("rtid"),
+	keyEventClassAttr = getOSType!("evcl"),
+	keyEventIDAttr = getOSType!("evid"),
+	keyAddressAttr = getOSType!("addr"),
+	keyOptionalKeywordAttr = getOSType!("optk"),
+	keyTimeoutAttr = getOSType!("timo"),
+	keyInteractLevelAttr = getOSType!("inte"),
+	keyEventSourceAttr = getOSType!("esrc"),
+	keyMissedKeywordAttr = getOSType!("miss"),
+	keyOriginalAddressAttr = getOSType!("from"),
+	keyAcceptTimeoutAttr = getOSType!("actm"),
+	keyReplyRequestedAttr = getOSType!("repq")
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		kAEDebugPOSTHeader = (1 << 0),
+		kAEDebugReplyHeader = (1 << 1),
+		kAEDebugXMLRequest = (1 << 2),
+		kAEDebugXMLResponse = (1 << 3),
+		kAEDebugXMLDebugAll = 0xFFFFFFFF
+	}
+}
+
+else
+{
+	enum
+	{
+		kAEDebugPOSTHeader = (1 << 0),
+		kAEDebugReplyHeader = (1 << 1),
+		kAEDebugXMLRequest = (1 << 2),
+		kAEDebugXMLResponse = (1 << 3),
+		kAEDebugXMLDebugAll = 0xFFFFFFFF
+	}
+}
+
+enum
+{
+	kSOAP1999Schema = getOSType!("ss99"),
+	kSOAP2001Schema = getOSType!("ss01")
+}
+
+enum
+{
+	keyUserNameAttr = getOSType!("unam"),
+	keyUserPasswordAttr = getOSType!("pass"),
+	keyDisableAuthenticationAttr = getOSType!("auth"),
+	keyXMLDebuggingAttr = getOSType!("xdbg"),
+	kAERPCClass = getOSType!("rpc "),
+	kAEXMLRPCScheme = getOSType!("RPC2"),
+	kAESOAPScheme = getOSType!("SOAP"),
+	kAESharedScriptHandler = getOSType!("wscp"),
+	keyRPCMethodName = getOSType!("meth"),
+	keyRPCMethodParam = getOSType!("parm"),
+	keyRPCMethodParamOrder = getOSType!("/ord"),
+	keyAEPOSTHeaderData = getOSType!("phed"),
+	keyAEReplyHeaderData = getOSType!("rhed"),
+	keyAEXMLRequestData = getOSType!("xreq"),
+	keyAEXMLReplyData = getOSType!("xrep"),
+	keyAdditionalHTTPHeaders = getOSType!("ahed"),
+	keySOAPAction = getOSType!("sact"),
+	keySOAPMethodNameSpace = getOSType!("mspc"),
+	keySOAPMethodNameSpaceURI = getOSType!("mspu"),
+	keySOAPSchemaVersion = getOSType!("ssch")
+}
+
+enum
+{
+	keySOAPStructureMetaData = getOSType!("/smd"),
+	keySOAPSMDNamespace = getOSType!("ssns"),
+	keySOAPSMDNamespaceURI = getOSType!("ssnu"),
+	keySOAPSMDType = getOSType!("sstp")
+}
+
+enum
+{
+	kAEUseHTTPProxyAttr = getOSType!("xupr"),
+	kAEHTTPProxyPortAttr = getOSType!("xhtp"),
+	kAEHTTPProxyHostAttr = getOSType!("xhth")
+}
+
+enum
+{
+	kAESocks4Protocol = 4,
+	kAESocks5Protocol = 5
+}
+
+enum
+{
+	kAEUseSocksAttr = getOSType!("xscs"),
+	kAESocksProxyAttr = getOSType!("xsok"),
+	kAESocksHostAttr = getOSType!("xshs"),
+	kAESocksPortAttr = getOSType!("xshp"),
+	kAESocksUserAttr = getOSType!("xshu"),
+	kAESocksPasswordAttr = getOSType!("xshw")
+}
+
+enum
+{
+	kAEDescListFactorNone = 0,
+	kAEDescListFactorType = 4,
+	kAEDescListFactorTypeAndSize = 8
+}
+
+enum
+{
+	kAutoGenerateReturnID = -1,
+	kAnyTransactionID = 0
+}
+
+enum
+{
+	kAEDataArray = 0,
+	kAEPackedArray = 1,
+	kAEDescArray = 3,
+	kAEKeyDescArray = 4
+}
+
+enum
+{
+	kAEHandleArray = 2
+}
+
+enum
+{
+	kAENormalPriority = 0x00000000,
+	kAEHighPriority = 0x00000001
+}
+
+enum
+{
+	kAENoReply = 0x00000001,
+	kAEQueueReply = 0x00000002,
+	kAEWaitReply = 0x00000003,
+	kAEDontReconnect = 0x00000080,
+	kAEWantReceipt = 0x00000200,
+	kAENeverInteract = 0x00000010,
+	kAECanInteract = 0x00000020,
+	kAEAlwaysInteract = 0x00000030,
+	kAECanSwitchLayer = 0x00000040,
+	kAEDontRecord = 0x00001000,
+	kAEDontExecute = 0x00002000,
+	kAEProcessNonReplyEvents = 0x00008000
+}
+
+enum
+{
+	kAEDefaultTimeout = -1,
+	kNoTimeOut = -2
+}
+
+union AEArrayData
+{
+	short[1] kAEDataArray;
+	char[1] kAEPackedArray;
+	Handle[1] kAEHandleArray;
+	AEDesc[1] kAEDescArray;
+	AEKeyDesc[1] kAEKeyDescArray;
+}
+
+extern (C)
+{
+	AECoerceDescUPP NewAECoerceDescUPP (AECoerceDescProcPtr userRoutine);
+	AECoercePtrUPP NewAECoercePtrUPP (AECoercePtrProcPtr userRoutine);
+	void DisposeAECoerceDescUPP (AECoerceDescUPP userUPP);
+	void DisposeAECoercePtrUPP (AECoercePtrUPP userUPP);
+	short InvokeAECoerceDescUPP (AEDesc* fromDesc, uint toType, int handlerRefcon, AEDesc* toDesc, AECoerceDescUPP userUPP);
+	short InvokeAECoercePtrUPP (uint typeCode, void* dataPtr, int dataSize, uint toType, int handlerRefcon, AEDesc* result, AECoercePtrUPP userUPP);
+	short AEInstallCoercionHandler (uint fromType, uint toType, AECoercionHandlerUPP handler, int handlerRefcon, ubyte fromTypeIsDesc, ubyte isSysHandler);
+	short AERemoveCoercionHandler (uint fromType, uint toType, AECoercionHandlerUPP handler, ubyte isSysHandler);
+	short AEGetCoercionHandler (uint fromType, uint toType, AECoercionHandlerUPP* handler, SRefCon* handlerRefcon, char* fromTypeIsDesc, ubyte isSysHandler);
+	short AECoercePtr (uint typeCode, void* dataPtr, int dataSize, uint toType, AEDesc* result);
+	short AECoerceDesc (AEDesc* theAEDesc, uint toType, AEDesc* result);
+	void AEInitializeDesc (AEDesc* desc);
+	short AECreateDesc (uint typeCode, void* dataPtr, int dataSize, AEDesc* result);
+	short AEDisposeDesc (AEDesc* theAEDesc);
+	short AEDuplicateDesc (AEDesc* theAEDesc, AEDesc* result);
+	int AECreateDescFromExternalPtr (uint descriptorType, void* dataPtr, int dataLength, AEDisposeExternalUPP disposeCallback, int disposeRefcon, AEDesc* theDesc);
+	short AECreateList (void* factoringPtr, int factoredSize, ubyte isRecord, AEDescList* resultList);
+	short AECountItems (AEDescList* theAEDescList, long* theCount);
+	short AEPutPtr (AEDescList* theAEDescList, int index, uint typeCode, void* dataPtr, int dataSize);
+	short AEPutDesc (AEDescList* theAEDescList, int index, AEDesc* theAEDesc);
+	short AEGetNthPtr (AEDescList* theAEDescList, int index, uint desiredType, AEKeyword* theAEKeyword, DescType* typeCode, void* dataPtr, int maximumSize, Size* actualSize);
+	short AEGetNthDesc (AEDescList* theAEDescList, int index, uint desiredType, AEKeyword* theAEKeyword, AEDesc* result);
+	short AESizeOfNthItem (AEDescList* theAEDescList, int index, DescType* typeCode, Size* dataSize);
+	short AEGetArray (AEDescList* theAEDescList, byte arrayType, AEArrayDataPointer arrayPtr, int maximumSize, DescType* itemType, Size* itemSize, long* itemCount);
+	short AEPutArray (AEDescList* theAEDescList, byte arrayType, AEArrayData* arrayPtr, uint itemType, int itemSize, int itemCount);
+	short AEDeleteItem (AEDescList* theAEDescList, int index);
+	ubyte AECheckIsRecord (AEDesc* theDesc);
+	short AECreateAppleEvent (uint theAEEventClass, uint theAEEventID, AEAddressDesc* target, short returnID, int transactionID, AppleEvent* result);
+	short AEPutParamPtr (AppleEvent* theAppleEvent, uint theAEKeyword, uint typeCode, void* dataPtr, int dataSize);
+	short AEPutParamDesc (AppleEvent* theAppleEvent, uint theAEKeyword, AEDesc* theAEDesc);
+	short AEGetParamPtr (AppleEvent* theAppleEvent, uint theAEKeyword, uint desiredType, DescType* actualType, void* dataPtr, int maximumSize, Size* actualSize);
+	short AEGetParamDesc (AppleEvent* theAppleEvent, uint theAEKeyword, uint desiredType, AEDesc* result);
+	short AESizeOfParam (AppleEvent* theAppleEvent, uint theAEKeyword, DescType* typeCode, Size* dataSize);
+	short AEDeleteParam (AppleEvent* theAppleEvent, uint theAEKeyword);
+	short AEGetAttributePtr (AppleEvent* theAppleEvent, uint theAEKeyword, uint desiredType, DescType* typeCode, void* dataPtr, int maximumSize, Size* actualSize);
+	short AEGetAttributeDesc (AppleEvent* theAppleEvent, uint theAEKeyword, uint desiredType, AEDesc* result);
+	short AESizeOfAttribute (AppleEvent* theAppleEvent, uint theAEKeyword, DescType* typeCode, Size* dataSize);
+	short AEPutAttributePtr (AppleEvent* theAppleEvent, uint theAEKeyword, uint typeCode, void* dataPtr, int dataSize);
+	short AEPutAttributeDesc (AppleEvent* theAppleEvent, uint theAEKeyword, AEDesc* theAEDesc);
+	int AESizeOfFlattenedDesc (AEDesc* theAEDesc);
+	int AEFlattenDesc (AEDesc* theAEDesc, char* buffer, int bufferSize, Size* actualSize);
+	int AEUnflattenDesc (void* buffer, AEDesc* result);
+	short AEGetDescData (AEDesc* theAEDesc, void* dataPtr, int maximumSize);
+	int AEGetDescDataSize (AEDesc* theAEDesc);
+	short AEReplaceDescData (uint typeCode, void* dataPtr, int dataSize, AEDesc* theAEDesc);
+	int AEGetDescDataRange (AEDesc* dataDesc, void* buffer, int offset, int length);
+	AEDisposeExternalUPP NewAEDisposeExternalUPP (AEDisposeExternalProcPtr userRoutine);
+	AEEventHandlerUPP NewAEEventHandlerUPP (AEEventHandlerProcPtr userRoutine);
+	void DisposeAEDisposeExternalUPP (AEDisposeExternalUPP userUPP);
+	void DisposeAEEventHandlerUPP (AEEventHandlerUPP userUPP);
+	void InvokeAEDisposeExternalUPP (void* dataPtr, int dataLength, int refcon, AEDisposeExternalUPP userUPP);
+	short InvokeAEEventHandlerUPP (AppleEvent* theAppleEvent, AppleEvent* reply, int handlerRefcon, AEEventHandlerUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEHelpers.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,78 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEHelpers;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.ae.AppleEvents;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.corefoundation.CFString;
+//import dstep.stdarg;
+
+struct OpaqueAEStreamRef;
+
+alias uint AEBuildErrorCode;
+alias OpaqueAEStreamRef* AEStreamRef;
+
+enum
+{
+	aeBuildSyntaxNoErr = 0,
+	aeBuildSyntaxBadToken = 1,
+	aeBuildSyntaxBadEOF = 2,
+	aeBuildSyntaxNoEOF = 3,
+	aeBuildSyntaxBadNegative = 4,
+	aeBuildSyntaxMissingQuote = 5,
+	aeBuildSyntaxBadHex = 6,
+	aeBuildSyntaxOddHex = 7,
+	aeBuildSyntaxNoCloseHex = 8,
+	aeBuildSyntaxUncoercedHex = 9,
+	aeBuildSyntaxNoCloseString = 10,
+	aeBuildSyntaxBadDesc = 11,
+	aeBuildSyntaxBadData = 12,
+	aeBuildSyntaxNoCloseParen = 13,
+	aeBuildSyntaxNoCloseBracket = 14,
+	aeBuildSyntaxNoCloseBrace = 15,
+	aeBuildSyntaxNoKey = 16,
+	aeBuildSyntaxNoColon = 17,
+	aeBuildSyntaxCoercedList = 18,
+	aeBuildSyntaxUncoercedDoubleAt = 19
+}
+
+struct AEBuildError
+{
+	uint fError;
+	uint fErrorPos;
+}
+
+extern (C)
+{
+	int AEBuildDesc (AEDesc* dst, AEBuildError* error, char* src, ...);
+	int vAEBuildDesc (AEDesc* dst, AEBuildError* error, char* src, char* args);
+	int AEBuildParameters (AppleEvent* event, AEBuildError* error, char* format, ...);
+	int vAEBuildParameters (AppleEvent* event, AEBuildError* error, char* format, char* args);
+	int AEBuildAppleEvent (uint theClass, uint theID, uint addressType, void* addressData, int addressLength, short returnID, int transactionID, AppleEvent* result, AEBuildError* error, char* paramsFmt, ...);
+	int vAEBuildAppleEvent (uint theClass, uint theID, uint addressType, void* addressData, int addressLength, short returnID, int transactionID, AppleEvent* resultEvt, AEBuildError* error, char* paramsFmt, char* args);
+	int AEPrintDescToHandle (AEDesc* desc, Handle* result);
+	AEStreamRef AEStreamOpen ();
+	int AEStreamClose (AEStreamRef ref_, AEDesc* desc);
+	int AEStreamOpenDesc (AEStreamRef ref_, uint newType);
+	int AEStreamWriteData (AEStreamRef ref_, void* data, int length);
+	int AEStreamCloseDesc (AEStreamRef ref_);
+	int AEStreamWriteDesc (AEStreamRef ref_, uint newType, void* data, int length);
+	int AEStreamWriteAEDesc (AEStreamRef ref_, AEDesc* desc);
+	int AEStreamOpenList (AEStreamRef ref_);
+	int AEStreamCloseList (AEStreamRef ref_);
+	int AEStreamOpenRecord (AEStreamRef ref_, uint newType);
+	int AEStreamSetRecordType (AEStreamRef ref_, uint newType);
+	int AEStreamCloseRecord (AEStreamRef ref_);
+	int AEStreamWriteKeyDesc (AEStreamRef ref_, uint key, uint newType, void* data, int length);
+	int AEStreamOpenKeyDesc (AEStreamRef ref_, uint key, uint newType);
+	int AEStreamWriteKey (AEStreamRef ref_, uint key);
+	AEStreamRef AEStreamCreateEvent (uint clazz, uint id, uint targetType, void* targetData, int targetLength, short returnID, int transactionID);
+	AEStreamRef AEStreamOpenEvent (AppleEvent* event);
+	int AEStreamOptionalParam (AEStreamRef ref_, uint key);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEMach.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,58 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEMach;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.carboncore.CarbonCore;
+//import dstep.mach.message;
+import dstep.objc.bridge.TypeEncoding;
+
+// mach/message.h
+alias uint mach_msg_bits_t;
+alias int mach_msg_id_t;
+alias uint mach_msg_size_t;
+
+struct ipc_port;
+alias ipc_port* mach_port_t;
+
+struct mach_msg_header_t
+{
+	mach_msg_bits_t msgh_bits;
+	mach_msg_size_t msgh_size;
+	mach_port_t msgh_remote_port;
+	mach_port_t msgh_local_port;
+	mach_msg_size_t msgh_reserved;
+	mach_msg_id_t msgh_id;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyReplyPortAttr = getOSType!("repp");
+	}
+}
+
+enum
+{
+	keyReplyPortAttr = getOSType!("repp")
+}
+
+enum
+{
+	typeReplyPortAttr = keyReplyPortAttr
+}
+
+extern (C)
+{
+	uint AEGetRegisteredMachPort ();
+	int AEDecodeMessage (mach_msg_header_t* header, AppleEvent* event, AppleEvent* reply);
+	int AEProcessMessage (mach_msg_header_t* header);
+	int AESendMessage (AppleEvent* event, AppleEvent* reply, int sendMode, int timeOutInTicks);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEObjects.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,247 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEObjects;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.ae.AppleEvents;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.objc.bridge.TypeEncoding;
+
+alias ccntTokenRecord* ccntTokenRecPtr;
+alias ccntTokenRecPtr* ccntTokenRecHandle;
+alias OSLAccessorProcPtr OSLAccessorUPP;
+alias OSLCompareProcPtr OSLCompareUPP;
+alias OSLCountProcPtr OSLCountUPP;
+alias OSLDisposeTokenProcPtr OSLDisposeTokenUPP;
+alias OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP;
+alias OSLGetErrDescProcPtr OSLGetErrDescUPP;
+alias OSLMarkProcPtr OSLMarkUPP;
+alias OSLAdjustMarksProcPtr OSLAdjustMarksUPP;
+
+extern (C)
+{
+	alias short function (int, int, AEDesc*) OSLAdjustMarksProcPtr;
+	alias short function (AEDesc*, AEDesc*, int) OSLMarkProcPtr;
+	alias short function (AEDesc*, uint, AEDesc*) OSLGetMarkTokenProcPtr;
+	alias short function (AEDesc*) OSLDisposeTokenProcPtr;
+	alias short function (AEDesc**) OSLGetErrDescProcPtr;
+	alias short function (uint, AEDesc*, AEDesc*, char*) OSLCompareProcPtr;
+	alias short function (uint, AEDesc*, uint, uint, AEDesc*, AEDesc*, int) OSLAccessorProcPtr;
+	alias short function (uint, uint, AEDesc*, long*) OSLCountProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEAND = getOSType!("AND ");
+		const __kAEOR = getOSType!("OR  ");
+		const __kAENOT = getOSType!("NOT ");
+		const __kAEFirst = getOSType!("firs");
+		const __kAELast = getOSType!("last");
+		const __kAEMiddle = getOSType!("midd");
+		const __kAEAny = getOSType!("any ");
+		const __kAEAll = getOSType!("all ");
+		const __kAENext = getOSType!("next");
+		const __kAEPrevious = getOSType!("prev");
+		const __keyAECompOperator = getOSType!("relo");
+		const __keyAELogicalTerms = getOSType!("term");
+		const __keyAELogicalOperator = getOSType!("logc");
+		const __keyAEObject1 = getOSType!("obj1");
+		const __keyAEObject2 = getOSType!("obj2");
+		const __keyAEDesiredClass = getOSType!("want");
+		const __keyAEContainer = getOSType!("from");
+		const __keyAEKeyForm = getOSType!("form");
+		const __keyAEKeyData = getOSType!("seld");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAERangeStart = getOSType!("star");
+		const __keyAERangeStop = getOSType!("stop");
+		const __keyDisposeTokenProc = getOSType!("xtok");
+		const __keyAECompareProc = getOSType!("cmpr");
+		const __keyAECountProc = getOSType!("cont");
+		const __keyAEMarkTokenProc = getOSType!("mkid");
+		const __keyAEMarkProc = getOSType!("mark");
+		const __keyAEAdjustMarksProc = getOSType!("adjm");
+		const __keyAEGetErrDescProc = getOSType!("indc");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __formAbsolutePosition = getOSType!("indx");
+		const __formRelativePosition = getOSType!("rele");
+		const __formTest = getOSType!("test");
+		const __formRange = getOSType!("rang");
+		const __formPropertyID = getOSType!("prop");
+		const __formName = getOSType!("name");
+		const __formUniqueID = getOSType!("ID  ");
+		const __typeObjectSpecifier = getOSType!("obj ");
+		const __typeObjectBeingExamined = getOSType!("exmn");
+		const __typeCurrentContainer = getOSType!("ccnt");
+		const __typeToken = getOSType!("toke");
+		const __typeRelativeDescriptor = getOSType!("rel ");
+		const __typeAbsoluteOrdinal = getOSType!("abso");
+		const __typeIndexDescriptor = getOSType!("inde");
+		const __typeRangeDescriptor = getOSType!("rang");
+		const __typeLogicalDescriptor = getOSType!("logi");
+		const __typeCompDescriptor = getOSType!("cmpd");
+		const __typeOSLTokenList = getOSType!("ostl");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeWhoseDescriptor = getOSType!("whos");
+		const __formWhose = getOSType!("whos");
+		const __typeWhoseRange = getOSType!("wrng");
+		const __keyAEWhoseRangeStart = getOSType!("wstr");
+		const __keyAEWhoseRangeStop = getOSType!("wstp");
+		const __keyAEIndex = getOSType!("kidx");
+		const __keyAETest = getOSType!("ktst");
+
+	}
+}
+
+enum
+{
+	kAEAND = getOSType!("AND "),
+	kAEOR = getOSType!("OR  "),
+	kAENOT = getOSType!("NOT "),
+	kAEFirst = getOSType!("firs"),
+	kAELast = getOSType!("last"),
+	kAEMiddle = getOSType!("midd"),
+	kAEAny = getOSType!("any "),
+	kAEAll = getOSType!("all "),
+	kAENext = getOSType!("next"),
+	kAEPrevious = getOSType!("prev"),
+	keyAECompOperator = getOSType!("relo"),
+	keyAELogicalTerms = getOSType!("term"),
+	keyAELogicalOperator = getOSType!("logc"),
+	keyAEObject1 = getOSType!("obj1"),
+	keyAEObject2 = getOSType!("obj2"),
+	keyAEDesiredClass = getOSType!("want"),
+	keyAEContainer = getOSType!("from"),
+	keyAEKeyForm = getOSType!("form"),
+	keyAEKeyData = getOSType!("seld")
+}
+
+enum
+{
+	keyAERangeStart = getOSType!("star"),
+	keyAERangeStop = getOSType!("stop"),
+	keyDisposeTokenProc = getOSType!("xtok"),
+	keyAECompareProc = getOSType!("cmpr"),
+	keyAECountProc = getOSType!("cont"),
+	keyAEMarkTokenProc = getOSType!("mkid"),
+	keyAEMarkProc = getOSType!("mark"),
+	keyAEAdjustMarksProc = getOSType!("adjm"),
+	keyAEGetErrDescProc = getOSType!("indc")
+}
+
+enum
+{
+	formAbsolutePosition = getOSType!("indx"),
+	formRelativePosition = getOSType!("rele"),
+	formTest = getOSType!("test"),
+	formRange = getOSType!("rang"),
+	formPropertyID = getOSType!("prop"),
+	formName = getOSType!("name"),
+	formUniqueID = getOSType!("ID  "),
+	typeObjectSpecifier = getOSType!("obj "),
+	typeObjectBeingExamined = getOSType!("exmn"),
+	typeCurrentContainer = getOSType!("ccnt"),
+	typeToken = getOSType!("toke"),
+	typeRelativeDescriptor = getOSType!("rel "),
+	typeAbsoluteOrdinal = getOSType!("abso"),
+	typeIndexDescriptor = getOSType!("inde"),
+	typeRangeDescriptor = getOSType!("rang"),
+	typeLogicalDescriptor = getOSType!("logi"),
+	typeCompDescriptor = getOSType!("cmpd"),
+	typeOSLTokenList = getOSType!("ostl")
+}
+
+enum
+{
+	kAEIDoMinimum = 0x0000,
+	kAEIDoWhose = 0x0001,
+	kAEIDoMarking = 0x0004,
+	kAEPassSubDescs = 0x0008,
+	kAEResolveNestedLists = 0x0010,
+	kAEHandleSimpleRanges = 0x0020,
+	kAEUseRelativeIterators = 0x0040
+}
+
+enum
+{
+	typeWhoseDescriptor = getOSType!("whos"),
+	formWhose = getOSType!("whos"),
+	typeWhoseRange = getOSType!("wrng"),
+	keyAEWhoseRangeStart = getOSType!("wstr"),
+	keyAEWhoseRangeStop = getOSType!("wstp"),
+	keyAEIndex = getOSType!("kidx"),
+	keyAETest = getOSType!("ktst")
+}
+
+struct ccntTokenRecord
+{
+	uint tokenClass;
+	AEDesc token;
+}
+
+extern (C)
+{
+	OSLAccessorUPP NewOSLAccessorUPP (OSLAccessorProcPtr userRoutine);
+	OSLCompareUPP NewOSLCompareUPP (OSLCompareProcPtr userRoutine);
+	OSLCountUPP NewOSLCountUPP (OSLCountProcPtr userRoutine);
+	OSLDisposeTokenUPP NewOSLDisposeTokenUPP (OSLDisposeTokenProcPtr userRoutine);
+	OSLGetMarkTokenUPP NewOSLGetMarkTokenUPP (OSLGetMarkTokenProcPtr userRoutine);
+	OSLGetErrDescUPP NewOSLGetErrDescUPP (OSLGetErrDescProcPtr userRoutine);
+	OSLMarkUPP NewOSLMarkUPP (OSLMarkProcPtr userRoutine);
+	OSLAdjustMarksUPP NewOSLAdjustMarksUPP (OSLAdjustMarksProcPtr userRoutine);
+	void DisposeOSLAccessorUPP (OSLAccessorUPP userUPP);
+	void DisposeOSLCompareUPP (OSLCompareUPP userUPP);
+	void DisposeOSLCountUPP (OSLCountUPP userUPP);
+	void DisposeOSLDisposeTokenUPP (OSLDisposeTokenUPP userUPP);
+	void DisposeOSLGetMarkTokenUPP (OSLGetMarkTokenUPP userUPP);
+	void DisposeOSLGetErrDescUPP (OSLGetErrDescUPP userUPP);
+	void DisposeOSLMarkUPP (OSLMarkUPP userUPP);
+	void DisposeOSLAdjustMarksUPP (OSLAdjustMarksUPP userUPP);
+	short InvokeOSLAccessorUPP (uint desiredClass, AEDesc* container, uint containerClass, uint form, AEDesc* selectionData, AEDesc* value, int accessorRefcon, OSLAccessorUPP userUPP);
+	short InvokeOSLCompareUPP (uint oper, AEDesc* obj1, AEDesc* obj2, char* result, OSLCompareUPP userUPP);
+	short InvokeOSLCountUPP (uint desiredType, uint containerClass, AEDesc* container, long* result, OSLCountUPP userUPP);
+	short InvokeOSLDisposeTokenUPP (AEDesc* unneededToken, OSLDisposeTokenUPP userUPP);
+	short InvokeOSLGetMarkTokenUPP (AEDesc* dContainerToken, uint containerClass, AEDesc* result, OSLGetMarkTokenUPP userUPP);
+	short InvokeOSLGetErrDescUPP (AEDesc** appDescPtr, OSLGetErrDescUPP userUPP);
+	short InvokeOSLMarkUPP (AEDesc* dToken, AEDesc* markToken, int index, OSLMarkUPP userUPP);
+	short InvokeOSLAdjustMarksUPP (int newStart, int newStop, AEDesc* markToken, OSLAdjustMarksUPP userUPP);
+	short AEObjectInit ();
+	short AESetObjectCallbacks (OSLCompareUPP myCompareProc, OSLCountUPP myCountProc, OSLDisposeTokenUPP myDisposeTokenProc, OSLGetMarkTokenUPP myGetMarkTokenProc, OSLMarkUPP myMarkProc, OSLAdjustMarksUPP myAdjustMarksProc, OSLGetErrDescUPP myGetErrDescProcPtr);
+	short AEResolve (AEDesc* objectSpecifier, short callbackFlags, AEDesc* theToken);
+	short AEInstallObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP theAccessor, int accessorRefcon, ubyte isSysHandler);
+	short AERemoveObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP theAccessor, ubyte isSysHandler);
+	short AEGetObjectAccessor (uint desiredClass, uint containerType, OSLAccessorUPP* accessor, SRefCon* accessorRefcon, ubyte isSysHandler);
+	short AEDisposeToken (AEDesc* theToken);
+	short AECallObjectAccessor (uint desiredClass, AEDesc* containerToken, uint containerClass, uint keyForm, AEDesc* keyData, AEDesc* token);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEPackObject.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,20 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEPackObject;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.ae.AppleEvents;
+
+extern (C)
+{
+	short CreateOffsetDescriptor (int theOffset, AEDesc* theDescriptor);
+	short CreateCompDescriptor (uint comparisonOperator, AEDesc* operand1, AEDesc* operand2, ubyte disposeInputs, AEDesc* theDescriptor);
+	short CreateLogicalDescriptor (AEDescList* theLogicalTerms, uint theLogicOperator, ubyte disposeInputs, AEDesc* theDescriptor);
+	short CreateObjSpecifier (uint desiredClass, AEDesc* theContainer, uint keyForm, AEDesc* keyData, ubyte disposeInputs, AEDesc* objSpecifier);
+	short CreateRangeDescriptor (AEDesc* rangeStart, AEDesc* rangeStop, ubyte disposeInputs, AEDesc* theDescriptor);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AERegistry.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,2175 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AERegistry;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AppleEvents;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.objc.bridge.TypeEncoding;
+
+alias TextRange* TextRangePtr;
+alias TextRangePtr* TextRangeHandle;
+alias TextRangeArray* TextRangeArrayPtr;
+alias TextRangeArrayPtr* TextRangeArrayHandle;
+alias OffsetArray*[][] OffsetArrayPtr;
+alias OffsetArrayPtr* OffsetArrayHandle;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cAEList = getOSType!("list");
+		const __cApplication = getOSType!("capp");
+		const __cArc = getOSType!("carc");
+		const __cBoolean = getOSType!("bool");
+		const __cCell = getOSType!("ccel");
+		const __cChar = getOSType!("cha ");
+		const __cColorTable = getOSType!("clrt");
+		const __cColumn = getOSType!("ccol");
+		const __cDocument = getOSType!("docu");
+		const __cDrawingArea = getOSType!("cdrw");
+		const __cEnumeration = getOSType!("enum");
+		const __cFile = getOSType!("file");
+		const __cFixed = getOSType!("fixd");
+		const __cFixedPoint = getOSType!("fpnt");
+		const __cFixedRectangle = getOSType!("frct");
+		const __cGraphicLine = getOSType!("glin");
+		const __cGraphicObject = getOSType!("cgob");
+		const __cGraphicShape = getOSType!("cgsh");
+		const __cGraphicText = getOSType!("cgtx");
+		const __cGroupedGraphic = getOSType!("cpic");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cInsertionLoc = getOSType!("insl");
+		const __cInsertionPoint = getOSType!("cins");
+		const __cIntlText = getOSType!("itxt");
+		const __cIntlWritingCode = getOSType!("intl");
+		const __cItem = getOSType!("citm");
+		const __cLine = getOSType!("clin");
+		const __cLongDateTime = getOSType!("ldt ");
+		const __cLongFixed = getOSType!("lfxd");
+		const __cLongFixedPoint = getOSType!("lfpt");
+		const __cLongFixedRectangle = getOSType!("lfrc");
+		const __cLongInteger = getOSType!("long");
+		const __cLongPoint = getOSType!("lpnt");
+		const __cLongRectangle = getOSType!("lrct");
+		const __cMachineLoc = getOSType!("mLoc");
+		const __cMenu = getOSType!("cmnu");
+		const __cMenuItem = getOSType!("cmen");
+		const __cObject = getOSType!("cobj");
+		const __cObjectSpecifier = getOSType!("obj ");
+		const __cOpenableObject = getOSType!("coob");
+		const __cOval = getOSType!("covl");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cParagraph = getOSType!("cpar");
+		const __cPICT = getOSType!("PICT");
+		const __cPixel = getOSType!("cpxl");
+		const __cPixelMap = getOSType!("cpix");
+		const __cPolygon = getOSType!("cpgn");
+		const __cProperty = getOSType!("prop");
+		const __cQDPoint = getOSType!("QDpt");
+		const __cQDRectangle = getOSType!("qdrt");
+		const __cRectangle = getOSType!("crec");
+		const __cRGBColor = getOSType!("cRGB");
+		const __cRotation = getOSType!("trot");
+		const __cRoundedRectangle = getOSType!("crrc");
+		const __cRow = getOSType!("crow");
+		const __cSelection = getOSType!("csel");
+		const __cShortInteger = getOSType!("shor");
+		const __cTable = getOSType!("ctbl");
+		const __cText = getOSType!("ctxt");
+		const __cTextFlow = getOSType!("cflo");
+		const __cTextStyles = getOSType!("tsty");
+		const __cType = getOSType!("type");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cVersion = getOSType!("vers");
+		const __cWindow = getOSType!("cwin");
+		const __cWord = getOSType!("cwor");
+		const __enumArrows = getOSType!("arro");
+		const __enumJustification = getOSType!("just");
+		const __enumKeyForm = getOSType!("kfrm");
+		const __enumPosition = getOSType!("posi");
+		const __enumProtection = getOSType!("prtn");
+		const __enumQuality = getOSType!("qual");
+		const __enumSaveOptions = getOSType!("savo");
+		const __enumStyle = getOSType!("styl");
+		const __enumTransferMode = getOSType!("tran");
+		const __kAEAbout = getOSType!("abou");
+		const __kAEAfter = getOSType!("afte");
+		const __kAEAliasSelection = getOSType!("sali");
+		const __kAEAllCaps = getOSType!("alcp");
+		const __kAEArrowAtEnd = getOSType!("aren");
+		const __kAEArrowAtStart = getOSType!("arst");
+		const __kAEArrowBothEnds = getOSType!("arbo");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEAsk = getOSType!("ask ");
+		const __kAEBefore = getOSType!("befo");
+		const __kAEBeginning = getOSType!("bgng");
+		const __kAEBeginsWith = getOSType!("bgwt");
+		const __kAEBeginTransaction = getOSType!("begi");
+		const __kAEBold = getOSType!("bold");
+		const __kAECaseSensEquals = getOSType!("cseq");
+		const __kAECentered = getOSType!("cent");
+		const __kAEChangeView = getOSType!("view");
+		const __kAEClone = getOSType!("clon");
+		const __kAEClose = getOSType!("clos");
+		const __kAECondensed = getOSType!("cond");
+		const __kAEContains = getOSType!("cont");
+		const __kAECopy = getOSType!("copy");
+		const __kAECoreSuite = getOSType!("core");
+		const __kAECountElements = getOSType!("cnte");
+		const __kAECreateElement = getOSType!("crel");
+		const __kAECreatePublisher = getOSType!("cpub");
+		const __kAECut = getOSType!("cut ");
+		const __kAEDelete = getOSType!("delo");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEDoObjectsExist = getOSType!("doex");
+		const __kAEDoScript = getOSType!("dosc");
+		const __kAEDrag = getOSType!("drag");
+		const __kAEDuplicateSelection = getOSType!("sdup");
+		const __kAEEditGraphic = getOSType!("edit");
+		const __kAEEmptyTrash = getOSType!("empt");
+		const __kAEEnd = getOSType!("end ");
+		const __kAEEndsWith = getOSType!("ends");
+		const __kAEEndTransaction = getOSType!("endt");
+		const __kAEEquals = getOSType!("=   ");
+		const __kAEExpanded = getOSType!("pexp");
+		const __kAEFast = getOSType!("fast");
+		const __kAEFinderEvents = getOSType!("FNDR");
+		const __kAEFormulaProtect = getOSType!("fpro");
+		const __kAEFullyJustified = getOSType!("full");
+		const __kAEGetClassInfo = getOSType!("qobj");
+		const __kAEGetData = getOSType!("getd");
+		const __kAEGetDataSize = getOSType!("dsiz");
+		const __kAEGetEventInfo = getOSType!("gtei");
+		const __kAEGetInfoSelection = getOSType!("sinf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEGetPrivilegeSelection = getOSType!("sprv");
+		const __kAEGetSuiteInfo = getOSType!("gtsi");
+		const __kAEGreaterThan = getOSType!(">   ");
+		const __kAEGreaterThanEquals = getOSType!(">=  ");
+		const __kAEGrow = getOSType!("grow");
+		const __kAEHidden = getOSType!("hidn");
+		const __kAEHiQuality = getOSType!("hiqu");
+		const __kAEImageGraphic = getOSType!("imgr");
+		const __kAEIsUniform = getOSType!("isun");
+		const __kAEItalic = getOSType!("ital");
+		const __kAELeftJustified = getOSType!("left");
+		const __kAELessThan = getOSType!("<   ");
+		const __kAELessThanEquals = getOSType!("<=  ");
+		const __kAELowercase = getOSType!("lowc");
+		const __kAEMakeObjectsVisible = getOSType!("mvis");
+		const __kAEMiscStandards = getOSType!("misc");
+		const __kAEModifiable = getOSType!("modf");
+		const __kAEMove = getOSType!("move");
+		const __kAENo = getOSType!("no  ");
+		const __kAENoArrow = getOSType!("arno");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAENonmodifiable = getOSType!("nmod");
+		const __kAEOpen = getOSType!("odoc");
+		const __kAEOpenSelection = getOSType!("sope");
+		const __kAEOutline = getOSType!("outl");
+		const __kAEPageSetup = getOSType!("pgsu");
+		const __kAEPaste = getOSType!("past");
+		const __kAEPlain = getOSType!("plan");
+		const __kAEPrint = getOSType!("pdoc");
+		const __kAEPrintSelection = getOSType!("spri");
+		const __kAEPrintWindow = getOSType!("pwin");
+		const __kAEPutAwaySelection = getOSType!("sput");
+		const __kAEQDAddOver = getOSType!("addo");
+		const __kAEQDAddPin = getOSType!("addp");
+		const __kAEQDAdMax = getOSType!("admx");
+		const __kAEQDAdMin = getOSType!("admn");
+		const __kAEQDBic = getOSType!("bic ");
+		const __kAEQDBlend = getOSType!("blnd");
+		const __kAEQDCopy = getOSType!("cpy ");
+		const __kAEQDNotBic = getOSType!("nbic");
+		const __kAEQDNotCopy = getOSType!("ncpy");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEQDNotOr = getOSType!("ntor");
+		const __kAEQDNotXor = getOSType!("nxor");
+		const __kAEQDOr = getOSType!("or  ");
+		const __kAEQDSubOver = getOSType!("subo");
+		const __kAEQDSubPin = getOSType!("subp");
+		const __kAEQDSupplementalSuite = getOSType!("qdsp");
+		const __kAEQDXor = getOSType!("xor ");
+		const __kAEQuickdrawSuite = getOSType!("qdrw");
+		const __kAEQuitAll = getOSType!("quia");
+		const __kAERedo = getOSType!("redo");
+		const __kAERegular = getOSType!("regl");
+		const __kAEReopenApplication = getOSType!("rapp");
+		const __kAEReplace = getOSType!("rplc");
+		const __kAERequiredSuite = getOSType!("reqd");
+		const __kAERestart = getOSType!("rest");
+		const __kAERevealSelection = getOSType!("srev");
+		const __kAERevert = getOSType!("rvrt");
+		const __kAERightJustified = getOSType!("rght");
+		const __kAESave = getOSType!("save");
+		const __kAESelect = getOSType!("slct");
+		const __kAESetData = getOSType!("setd");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAESetPosition = getOSType!("posn");
+		const __kAEShadow = getOSType!("shad");
+		const __kAEShowClipboard = getOSType!("shcl");
+		const __kAEShutDown = getOSType!("shut");
+		const __kAESleep = getOSType!("slep");
+		const __kAESmallCaps = getOSType!("smcp");
+		const __kAESpecialClassProperties = getOSType!("c@#!");
+		const __kAEStrikethrough = getOSType!("strk");
+		const __kAESubscript = getOSType!("sbsc");
+		const __kAESuperscript = getOSType!("spsc");
+		const __kAETableSuite = getOSType!("tbls");
+		const __kAETextSuite = getOSType!("TEXT");
+		const __kAETransactionTerminated = getOSType!("ttrm");
+		const __kAEUnderline = getOSType!("undl");
+		const __kAEUndo = getOSType!("undo");
+		const __kAEWholeWordEquals = getOSType!("wweq");
+		const __kAEYes = getOSType!("yes ");
+		const __kAEZoom = getOSType!("zoom");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAELogOut = getOSType!("logo");
+		const __kAEReallyLogOut = getOSType!("rlgo");
+		const __kAEShowRestartDialog = getOSType!("rrst");
+		const __kAEShowShutdownDialog = getOSType!("rsdn");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEMouseClass = getOSType!("mous");
+		const __kAEDown = getOSType!("down");
+		const __kAEUp = getOSType!("up  ");
+		const __kAEMoved = getOSType!("move");
+		const __kAEStoppedMoving = getOSType!("stop");
+		const __kAEWindowClass = getOSType!("wind");
+		const __kAEUpdate = getOSType!("updt");
+		const __kAEActivate = getOSType!("actv");
+		const __kAEDeactivate = getOSType!("dact");
+		const __kAECommandClass = getOSType!("cmnd");
+		const __kAEKeyClass = getOSType!("keyc");
+		const __kAERawKey = getOSType!("rkey");
+		const __kAEVirtualKey = getOSType!("keyc");
+		const __kAENavigationKey = getOSType!("nave");
+		const __kAEAutoDown = getOSType!("auto");
+		const __kAEApplicationClass = getOSType!("appl");
+		const __kAESuspend = getOSType!("susp");
+		const __kAEResume = getOSType!("rsme");
+		const __kAEDiskEvent = getOSType!("disk");
+		const __kAENullEvent = getOSType!("null");
+		const __kAEWakeUpEvent = getOSType!("wake");
+		const __kAEScrapEvent = getOSType!("scrp");
+		const __kAEHighLevel = getOSType!("high");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEAngle = getOSType!("kang");
+		const __keyAEArcAngle = getOSType!("parc");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEBaseAddr = getOSType!("badd");
+		const __keyAEBestType = getOSType!("pbst");
+		const __keyAEBgndColor = getOSType!("kbcl");
+		const __keyAEBgndPattern = getOSType!("kbpt");
+		const __keyAEBounds = getOSType!("pbnd");
+		const __keyAECellList = getOSType!("kclt");
+		const __keyAEClassID = getOSType!("clID");
+		const __keyAEColor = getOSType!("colr");
+		const __keyAEColorTable = getOSType!("cltb");
+		const __keyAECurveHeight = getOSType!("kchd");
+		const __keyAECurveWidth = getOSType!("kcwd");
+		const __keyAEDashStyle = getOSType!("pdst");
+		const __keyAEData = getOSType!("data");
+		const __keyAEDefaultType = getOSType!("deft");
+		const __keyAEDefinitionRect = getOSType!("pdrt");
+		const __keyAEDescType = getOSType!("dstp");
+		const __keyAEDestination = getOSType!("dest");
+		const __keyAEDoAntiAlias = getOSType!("anta");
+		const __keyAEDoDithered = getOSType!("gdit");
+		const __keyAEDoRotate = getOSType!("kdrt");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEDoScale = getOSType!("ksca");
+		const __keyAEDoTranslate = getOSType!("ktra");
+		const __keyAEEditionFileLoc = getOSType!("eloc");
+		const __keyAEElements = getOSType!("elms");
+		const __keyAEEndPoint = getOSType!("pend");
+		const __keyAEEventClass = getOSType!("evcl");
+		const __keyAEEventID = getOSType!("evti");
+		const __keyAEFile = getOSType!("kfil");
+		const __keyAEFileType = getOSType!("fltp");
+		const __keyAEFillColor = getOSType!("flcl");
+		const __keyAEFillPattern = getOSType!("flpt");
+		const __keyAEFlipHorizontal = getOSType!("kfho");
+		const __keyAEFlipVertical = getOSType!("kfvt");
+		const __keyAEFont = getOSType!("font");
+		const __keyAEFormula = getOSType!("pfor");
+		const __keyAEGraphicObjects = getOSType!("gobs");
+		const __keyAEID = getOSType!("ID  ");
+		const __keyAEImageQuality = getOSType!("gqua");
+		const __keyAEInsertHere = getOSType!("insh");
+		const __keyAEKeyForms = getOSType!("keyf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEKeyword = getOSType!("kywd");
+		const __keyAELevel = getOSType!("levl");
+		const __keyAELineArrow = getOSType!("arro");
+		const __keyAEName = getOSType!("pnam");
+		const __keyAENewElementLoc = getOSType!("pnel");
+		const __keyAEObject = getOSType!("kobj");
+		const __keyAEObjectClass = getOSType!("kocl");
+		const __keyAEOffStyles = getOSType!("ofst");
+		const __keyAEOnStyles = getOSType!("onst");
+		const __keyAEParameters = getOSType!("prms");
+		const __keyAEParamFlags = getOSType!("pmfg");
+		const __keyAEPenColor = getOSType!("ppcl");
+		const __keyAEPenPattern = getOSType!("pppa");
+		const __keyAEPenWidth = getOSType!("ppwd");
+		const __keyAEPixelDepth = getOSType!("pdpt");
+		const __keyAEPixMapMinus = getOSType!("kpmm");
+		const __keyAEPMTable = getOSType!("kpmt");
+		const __keyAEPointList = getOSType!("ptlt");
+		const __keyAEPointSize = getOSType!("ptsz");
+		const __keyAEPosition = getOSType!("kpos");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEPropData = getOSType!("prdt");
+		const __keyAEProperties = getOSType!("qpro");
+		const __keyAEProperty = getOSType!("kprp");
+		const __keyAEPropFlags = getOSType!("prfg");
+		const __keyAEPropID = getOSType!("prop");
+		const __keyAEProtection = getOSType!("ppro");
+		const __keyAERenderAs = getOSType!("kren");
+		const __keyAERequestedType = getOSType!("rtyp");
+		const __keyAEResult = getOSType!("----");
+		const __keyAEResultInfo = getOSType!("rsin");
+		const __keyAERotation = getOSType!("prot");
+		const __keyAERotPoint = getOSType!("krtp");
+		const __keyAERowList = getOSType!("krls");
+		const __keyAESaveOptions = getOSType!("savo");
+		const __keyAEScale = getOSType!("pscl");
+		const __keyAEScriptTag = getOSType!("psct");
+		const __keyAESearchText = getOSType!("stxt");
+		const __keyAEShowWhere = getOSType!("show");
+		const __keyAEStartAngle = getOSType!("pang");
+		const __keyAEStartPoint = getOSType!("pstp");
+		const __keyAEStyles = getOSType!("ksty");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAESuiteID = getOSType!("suit");
+		const __keyAEText = getOSType!("ktxt");
+		const __keyAETextColor = getOSType!("ptxc");
+		const __keyAETextFont = getOSType!("ptxf");
+		const __keyAETextPointSize = getOSType!("ptps");
+		const __keyAETextStyles = getOSType!("txst");
+		const __keyAETextLineHeight = getOSType!("ktlh");
+		const __keyAETextLineAscent = getOSType!("ktas");
+		const __keyAETheText = getOSType!("thtx");
+		const __keyAETransferMode = getOSType!("pptm");
+		const __keyAETranslation = getOSType!("ptrs");
+		const __keyAETryAsStructGraf = getOSType!("toog");
+		const __keyAEUniformStyles = getOSType!("ustl");
+		const __keyAEUpdateOn = getOSType!("pupd");
+		const __keyAEUserTerm = getOSType!("utrm");
+		const __keyAEWindow = getOSType!("wndw");
+		const __keyAEWritingCode = getOSType!("wrcd");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyMiscellaneous = getOSType!("fmsc");
+		const __keySelection = getOSType!("fsel");
+		const __keyWindow = getOSType!("kwnd");
+		const __keyWhen = getOSType!("when");
+		const __keyWhere = getOSType!("wher");
+		const __keyModifiers = getOSType!("mods");
+		const __keyKey = getOSType!("key ");
+		const __keyKeyCode = getOSType!("code");
+		const __keyKeyboard = getOSType!("keyb");
+		const __keyDriveNumber = getOSType!("drv#");
+		const __keyErrorCode = getOSType!("err#");
+		const __keyHighLevelClass = getOSType!("hcls");
+		const __keyHighLevelID = getOSType!("hid ");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __pArcAngle = getOSType!("parc");
+		const __pBackgroundColor = getOSType!("pbcl");
+		const __pBackgroundPattern = getOSType!("pbpt");
+		const __pBestType = getOSType!("pbst");
+		const __pBounds = getOSType!("pbnd");
+		const __pClass = getOSType!("pcls");
+		const __pClipboard = getOSType!("pcli");
+		const __pColor = getOSType!("colr");
+		const __pColorTable = getOSType!("cltb");
+		const __pContents = getOSType!("pcnt");
+		const __pCornerCurveHeight = getOSType!("pchd");
+		const __pCornerCurveWidth = getOSType!("pcwd");
+		const __pDashStyle = getOSType!("pdst");
+		const __pDefaultType = getOSType!("deft");
+		const __pDefinitionRect = getOSType!("pdrt");
+		const __pEnabled = getOSType!("enbl");
+		const __pEndPoint = getOSType!("pend");
+		const __pFillColor = getOSType!("flcl");
+		const __pFillPattern = getOSType!("flpt");
+		const __pFont = getOSType!("font");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __pFormula = getOSType!("pfor");
+		const __pGraphicObjects = getOSType!("gobs");
+		const __pHasCloseBox = getOSType!("hclb");
+		const __pHasTitleBar = getOSType!("ptit");
+		const __pID = getOSType!("ID  ");
+		const __pIndex = getOSType!("pidx");
+		const __pInsertionLoc = getOSType!("pins");
+		const __pIsFloating = getOSType!("isfl");
+		const __pIsFrontProcess = getOSType!("pisf");
+		const __pIsModal = getOSType!("pmod");
+		const __pIsModified = getOSType!("imod");
+		const __pIsResizable = getOSType!("prsz");
+		const __pIsStationeryPad = getOSType!("pspd");
+		const __pIsZoomable = getOSType!("iszm");
+		const __pIsZoomed = getOSType!("pzum");
+		const __pItemNumber = getOSType!("itmn");
+		const __pJustification = getOSType!("pjst");
+		const __pLineArrow = getOSType!("arro");
+		const __pMenuID = getOSType!("mnid");
+		const __pName = getOSType!("pnam");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __pNewElementLoc = getOSType!("pnel");
+		const __pPenColor = getOSType!("ppcl");
+		const __pPenPattern = getOSType!("pppa");
+		const __pPenWidth = getOSType!("ppwd");
+		const __pPixelDepth = getOSType!("pdpt");
+		const __pPointList = getOSType!("ptlt");
+		const __pPointSize = getOSType!("ptsz");
+		const __pProtection = getOSType!("ppro");
+		const __pRotation = getOSType!("prot");
+		const __pScale = getOSType!("pscl");
+		const __pScript = getOSType!("scpt");
+		const __pScriptTag = getOSType!("psct");
+		const __pSelected = getOSType!("selc");
+		const __pSelection = getOSType!("sele");
+		const __pStartAngle = getOSType!("pang");
+		const __pStartPoint = getOSType!("pstp");
+		const __pTextColor = getOSType!("ptxc");
+		const __pTextFont = getOSType!("ptxf");
+		const __pTextItemDelimiters = getOSType!("txdl");
+		const __pTextPointSize = getOSType!("ptps");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __pTextStyles = getOSType!("txst");
+		const __pTransferMode = getOSType!("pptm");
+		const __pTranslation = getOSType!("ptrs");
+		const __pUniformStyles = getOSType!("ustl");
+		const __pUpdateOn = getOSType!("pupd");
+		const __pUserSelection = getOSType!("pusl");
+		const __pVersion = getOSType!("vers");
+		const __pVisible = getOSType!("pvis");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeAEText = getOSType!("tTXT");
+		const __typeArc = getOSType!("carc");
+		const __typeBest = getOSType!("best");
+		const __typeCell = getOSType!("ccel");
+		const __typeClassInfo = getOSType!("gcli");
+		const __typeColorTable = getOSType!("clrt");
+		const __typeColumn = getOSType!("ccol");
+		const __typeDashStyle = getOSType!("tdas");
+		const __typeData = getOSType!("tdta");
+		const __typeDrawingArea = getOSType!("cdrw");
+		const __typeElemInfo = getOSType!("elin");
+		const __typeEnumeration = getOSType!("enum");
+		const __typeEPS = getOSType!("EPS ");
+		const __typeEventInfo = getOSType!("evin");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeFinderWindow = getOSType!("fwin");
+		const __typeFixedPoint = getOSType!("fpnt");
+		const __typeFixedRectangle = getOSType!("frct");
+		const __typeGraphicLine = getOSType!("glin");
+		const __typeGraphicText = getOSType!("cgtx");
+		const __typeGroupedGraphic = getOSType!("cpic");
+		const __typeInsertionLoc = getOSType!("insl");
+		const __typeIntlText = getOSType!("itxt");
+		const __typeIntlWritingCode = getOSType!("intl");
+		const __typeLongDateTime = getOSType!("ldt ");
+		const __typeCFAbsoluteTime = getOSType!("cfat");
+		const __typeISO8601DateTime = getOSType!("isot");
+		const __typeLongFixed = getOSType!("lfxd");
+		const __typeLongFixedPoint = getOSType!("lfpt");
+		const __typeLongFixedRectangle = getOSType!("lfrc");
+		const __typeLongPoint = getOSType!("lpnt");
+		const __typeLongRectangle = getOSType!("lrct");
+		const __typeMachineLoc = getOSType!("mLoc");
+		const __typeOval = getOSType!("covl");
+		const __typeParamInfo = getOSType!("pmin");
+		const __typePict = getOSType!("PICT");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typePixelMap = getOSType!("cpix");
+		const __typePixMapMinus = getOSType!("tpmm");
+		const __typePolygon = getOSType!("cpgn");
+		const __typePropInfo = getOSType!("pinf");
+		const __typePtr = getOSType!("ptr ");
+		const __typeQDPoint = getOSType!("QDpt");
+		const __typeQDRegion = getOSType!("Qrgn");
+		const __typeRectangle = getOSType!("crec");
+		const __typeRGB16 = getOSType!("tr16");
+		const __typeRGB96 = getOSType!("tr96");
+		const __typeRGBColor = getOSType!("cRGB");
+		const __typeRotation = getOSType!("trot");
+		const __typeRoundedRectangle = getOSType!("crrc");
+		const __typeRow = getOSType!("crow");
+		const __typeScrapStyles = getOSType!("styl");
+		const __typeScript = getOSType!("scpt");
+		const __typeStyledText = getOSType!("STXT");
+		const __typeSuiteInfo = getOSType!("suin");
+		const __typeTable = getOSType!("ctbl");
+		const __typeTextStyles = getOSType!("tsty");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeTIFF = getOSType!("TIFF");
+		const __typeJPEG = getOSType!("JPEG");
+		const __typeGIF = getOSType!("GIFf");
+		const __typeVersion = getOSType!("vers");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEMenuClass = getOSType!("menu");
+		const __kAEMenuSelect = getOSType!("mhit");
+		const __kAEMouseDown = getOSType!("mdwn");
+		const __kAEMouseDownInBack = getOSType!("mdbk");
+		const __kAEKeyDown = getOSType!("kdwn");
+		const __kAEResized = getOSType!("rsiz");
+		const __kAEPromise = getOSType!("prom");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyMenuID = getOSType!("mid ");
+		const __keyMenuItem = getOSType!("mitm");
+		const __keyCloseAllWindows = getOSType!("caw ");
+		const __keyOriginalBounds = getOSType!("obnd");
+		const __keyNewBounds = getOSType!("nbnd");
+		const __keyLocalWhere = getOSType!("lwhr");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeHIMenu = getOSType!("mobj");
+		const __typeHIWindow = getOSType!("wobj");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kTextServiceClass = getOSType!("tsvc");
+		const __kUpdateActiveInputArea = getOSType!("updt");
+		const __kShowHideInputWindow = getOSType!("shiw");
+		const __kPos2Offset = getOSType!("p2st");
+		const __kOffset2Pos = getOSType!("st2p");
+		const __kUnicodeNotFromInputMethod = getOSType!("unim");
+		const __kGetSelectedText = getOSType!("gtxt");
+		const __keyAETSMDocumentRefcon = getOSType!("refc");
+		const __keyAEServerInstance = getOSType!("srvi");
+		const __keyAETheData = getOSType!("kdat");
+		const __keyAEFixLength = getOSType!("fixl");
+		const __keyAEUpdateRange = getOSType!("udng");
+		const __keyAECurrentPoint = getOSType!("cpos");
+		const __keyAEBufferSize = getOSType!("buff");
+		const __keyAEMoveView = getOSType!("mvvw");
+		const __keyAENextBody = getOSType!("nxbd");
+		const __keyAETSMScriptTag = getOSType!("sclg");
+		const __keyAETSMTextFont = getOSType!("ktxf");
+		const __keyAETSMTextFMFont = getOSType!("ktxm");
+		const __keyAETSMTextPointSize = getOSType!("ktps");
+		const __keyAETSMEventRecord = getOSType!("tevt");
+		const __keyAETSMEventRef = getOSType!("tevr");
+		const __keyAETextServiceEncoding = getOSType!("tsen");
+		const __keyAETextServiceMacEncoding = getOSType!("tmen");
+		const __keyAETSMGlyphInfoArray = getOSType!("tgia");
+		const __typeTextRange = getOSType!("txrn");
+		const __typeComponentInstance = getOSType!("cmpi");
+		const __typeOffsetArray = getOSType!("ofay");
+		const __typeTextRangeArray = getOSType!("tray");
+		const __typeLowLevelEventRecord = getOSType!("evtr");
+		const __typeGlyphInfoArray = getOSType!("glia");
+		const __typeEventRef = getOSType!("evrf");
+		const __typeText = getOSType!("ypeCha");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAEHiliteRange = getOSType!("hrng");
+		const __keyAEPinRange = getOSType!("pnrg");
+		const __keyAEClauseOffsets = getOSType!("clau");
+		const __keyAEOffset = getOSType!("ofst");
+		const __keyAEPoint = getOSType!("gpos");
+		const __keyAELeftSide = getOSType!("klef");
+		const __keyAERegionClass = getOSType!("rgnc");
+		const __keyAEDragging = getOSType!("bool");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __typeMeters = getOSType!("metr");
+		const __typeInches = getOSType!("inch");
+		const __typeFeet = getOSType!("feet");
+		const __typeYards = getOSType!("yard");
+		const __typeMiles = getOSType!("mile");
+		const __typeKilometers = getOSType!("kmtr");
+		const __typeCentimeters = getOSType!("cmtr");
+		const __typeSquareMeters = getOSType!("sqrm");
+		const __typeSquareFeet = getOSType!("sqft");
+		const __typeSquareYards = getOSType!("sqyd");
+		const __typeSquareMiles = getOSType!("sqmi");
+		const __typeSquareKilometers = getOSType!("sqkm");
+		const __typeLiters = getOSType!("litr");
+		const __typeQuarts = getOSType!("qrts");
+		const __typeGallons = getOSType!("galn");
+		const __typeCubicMeters = getOSType!("cmet");
+		const __typeCubicFeet = getOSType!("cfet");
+		const __typeCubicInches = getOSType!("cuin");
+		const __typeCubicCentimeter = getOSType!("ccmt");
+		const __typeCubicYards = getOSType!("cyrd");
+		const __typeKilograms = getOSType!("kgrm");
+		const __typeGrams = getOSType!("gram");
+		const __typeOunces = getOSType!("ozs ");
+		const __typePounds = getOSType!("lbs ");
+		const __typeDegreesC = getOSType!("degc");
+		const __typeDegreesF = getOSType!("degf");
+		const __typeDegreesK = getOSType!("degk");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kFAServerApp = getOSType!("ssrv");
+		const __kDoFolderActionEvent = getOSType!("fola");
+		const __kFolderActionCode = getOSType!("actn");
+		const __kFolderOpenedEvent = getOSType!("fopn");
+		const __kFolderClosedEvent = getOSType!("fclo");
+		const __kFolderWindowMovedEvent = getOSType!("fsiz");
+		const __kFolderItemsAddedEvent = getOSType!("fget");
+		const __kFolderItemsRemovedEvent = getOSType!("flos");
+		const __kItemList = getOSType!("flst");
+		const __kNewSizeParameter = getOSType!("fnsz");
+		const __kFASuiteCode = getOSType!("faco");
+		const __kFAAttachCommand = getOSType!("atfa");
+		const __kFARemoveCommand = getOSType!("rmfa");
+		const __kFAEditCommand = getOSType!("edfa");
+		const __kFAFileParam = getOSType!("faal");
+		const __kFAIndexParam = getOSType!("indx");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEInternetSuite = getOSType!("gurl");
+		const __kAEISWebStarSuite = getOSType!("x575757B");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEISGetURL = getOSType!("gurl");
+		const __KAEISHandleCGI = getOSType!("sdoc");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cURL = getOSType!("url ");
+		const __cInternetAddress = getOSType!("IPAD");
+		const __cHTML = getOSType!("html");
+		const __cFTPItem = getOSType!("ftp ");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEISHTTPSearchArgs = getOSType!("kfor");
+		const __kAEISPostArgs = getOSType!("post");
+		const __kAEISMethod = getOSType!("meth");
+		const __kAEISClientAddress = getOSType!("addr");
+		const __kAEISUserName = getOSType!("user");
+		const __kAEISPassword = getOSType!("pass");
+		const __kAEISFromUser = getOSType!("frmu");
+		const __kAEISServerName = getOSType!("svnm");
+		const __kAEISServerPort = getOSType!("svpt");
+		const __kAEISScriptName = getOSType!("scnm");
+		const __kAEISContentType = getOSType!("ctyp");
+		const __kAEISReferrer = getOSType!("refr");
+		const __kAEISUserAgent = getOSType!("Agnt");
+		const __kAEISAction = getOSType!("Kact");
+		const __kAEISActionPath = getOSType!("Kapt");
+		const __kAEISClientIP = getOSType!("Kcip");
+		const __kAEISFullRequest = getOSType!("Kfrq");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __pScheme = getOSType!("pusc");
+		const __pHost = getOSType!("HOST");
+		const __pPath = getOSType!("FTPc");
+		const __pUserName = getOSType!("RAun");
+		const __pUserPassword = getOSType!("RApw");
+		const __pDNSForm = getOSType!("pDNS");
+		const __pURL = getOSType!("pURL");
+		const __pTextEncoding = getOSType!("ptxe");
+		const __pFTPKind = getOSType!("kind");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __eScheme = getOSType!("esch");
+		const __eurlHTTP = getOSType!("http");
+		const __eurlHTTPS = getOSType!("htps");
+		const __eurlFTP = getOSType!("ftp ");
+		const __eurlMail = getOSType!("mail");
+		const __eurlFile = getOSType!("file");
+		const __eurlGopher = getOSType!("gphr");
+		const __eurlTelnet = getOSType!("tlnt");
+		const __eurlNews = getOSType!("news");
+		const __eurlSNews = getOSType!("snws");
+		const __eurlNNTP = getOSType!("nntp");
+		const __eurlMessage = getOSType!("mess");
+		const __eurlMailbox = getOSType!("mbox");
+		const __eurlMulti = getOSType!("mult");
+		const __eurlLaunch = getOSType!("laun");
+		const __eurlAFP = getOSType!("afp ");
+		const __eurlAT = getOSType!("at  ");
+		const __eurlEPPC = getOSType!("eppc");
+		const __eurlRTSP = getOSType!("rtsp");
+		const __eurlIMAP = getOSType!("imap");
+		const __eurlNFS = getOSType!("unfs");
+		const __eurlPOP = getOSType!("upop");
+		const __eurlLDAP = getOSType!("uldp");
+		const __eurlUnknown = getOSType!("url?");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kConnSuite = getOSType!("macc");
+		const __cDevSpec = getOSType!("cdev");
+		const __cAddressSpec = getOSType!("cadr");
+		const __cADBAddress = getOSType!("cadb");
+		const __cAppleTalkAddress = getOSType!("cat ");
+		const __cBusAddress = getOSType!("cbus");
+		const __cEthernetAddress = getOSType!("cen ");
+		const __cFireWireAddress = getOSType!("cfw ");
+		const __cIPAddress = getOSType!("cip ");
+		const __cLocalTalkAddress = getOSType!("clt ");
+		const __cSCSIAddress = getOSType!("cscs");
+		const __cTokenRingAddress = getOSType!("ctok");
+		const __cUSBAddress = getOSType!("cusb");
+		const __pDeviceType = getOSType!("pdvt");
+		const __pDeviceAddress = getOSType!("pdva");
+		const __pConduit = getOSType!("pcon");
+		const __pProtocol = getOSType!("pprt");
+		const __pATMachine = getOSType!("patm");
+		const __pATZone = getOSType!("patz");
+		const __pATType = getOSType!("patt");
+		const __pDottedDecimal = getOSType!("pipd");
+		const __pDNS = getOSType!("pdns");
+		const __pPort = getOSType!("ppor");
+		const __pNetwork = getOSType!("pnet");
+		const __pNode = getOSType!("pnod");
+		const __pSocket = getOSType!("psoc");
+		const __pSCSIBus = getOSType!("pscb");
+		const __pSCSILUN = getOSType!("pslu");
+		const __eDeviceType = getOSType!("edvt");
+		const __eAddressSpec = getOSType!("eads");
+		const __eConduit = getOSType!("econ");
+		const __eProtocol = getOSType!("epro");
+		const __eADB = getOSType!("eadb");
+		const __eAnalogAudio = getOSType!("epau");
+		const __eAppleTalk = getOSType!("epat");
+		const __eAudioLineIn = getOSType!("ecai");
+		const __eAudioLineOut = getOSType!("ecal");
+		const __eAudioOut = getOSType!("ecao");
+		const __eBus = getOSType!("ebus");
+		const __eCDROM = getOSType!("ecd ");
+		const __eCommSlot = getOSType!("eccm");
+		const __eDigitalAudio = getOSType!("epda");
+		const __eDisplay = getOSType!("edds");
+		const __eDVD = getOSType!("edvd");
+		const __eEthernet = getOSType!("ecen");
+		const __eFireWire = getOSType!("ecfw");
+		const __eFloppy = getOSType!("efd ");
+		const __eHD = getOSType!("ehd ");
+		const __eInfrared = getOSType!("ecir");
+		const __eIP = getOSType!("epip");
+		const __eIrDA = getOSType!("epir");
+		const __eIRTalk = getOSType!("epit");
+		const __eKeyboard = getOSType!("ekbd");
+		const __eLCD = getOSType!("edlc");
+		const __eLocalTalk = getOSType!("eclt");
+		const __eMacIP = getOSType!("epmi");
+		const __eMacVideo = getOSType!("epmv");
+		const __eMicrophone = getOSType!("ecmi");
+		const __eModemPort = getOSType!("ecmp");
+		const __eModemPrinterPort = getOSType!("empp");
+		const __eModem = getOSType!("edmm");
+		const __eMonitorOut = getOSType!("ecmn");
+		const __eMouse = getOSType!("emou");
+		const __eNuBusCard = getOSType!("ednb");
+		const __eNuBus = getOSType!("enub");
+		const __ePCcard = getOSType!("ecpc");
+		const __ePCIbus = getOSType!("ecpi");
+		const __ePCIcard = getOSType!("edpi");
+		const __ePDSslot = getOSType!("ecpd");
+		const __ePDScard = getOSType!("epds");
+		const __ePointingDevice = getOSType!("edpd");
+		const __ePostScript = getOSType!("epps");
+		const __ePPP = getOSType!("eppp");
+		const __ePrinterPort = getOSType!("ecpp");
+		const __ePrinter = getOSType!("edpr");
+		const __eSvideo = getOSType!("epsv");
+		const __eSCSI = getOSType!("ecsc");
+		const __eSerial = getOSType!("epsr");
+		const __eSpeakers = getOSType!("edsp");
+		const __eStorageDevice = getOSType!("edst");
+		const __eSVGA = getOSType!("epsg");
+		const __eTokenRing = getOSType!("etok");
+		const __eTrackball = getOSType!("etrk");
+		const __eTrackpad = getOSType!("edtp");
+		const __eUSB = getOSType!("ecus");
+		const __eVideoIn = getOSType!("ecvi");
+		const __eVideoMonitor = getOSType!("edvm");
+		const __eVideoOut = getOSType!("ecvo");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __cKeystroke = getOSType!("kprs");
+		const __pKeystrokeKey = getOSType!("kMsg");
+		const __pModifiers = getOSType!("kMod");
+		const __pKeyKind = getOSType!("kknd");
+		const __eModifiers = getOSType!("eMds");
+		const __eOptionDown = getOSType!("Kopt");
+		const __eCommandDown = getOSType!("Kcmd");
+		const __eControlDown = getOSType!("Kctl");
+		const __eShiftDown = getOSType!("Ksft");
+		const __eCapsLockDown = getOSType!("Kclk");
+		const __eKeyKind = getOSType!("ekst");
+		const __eEscapeKey = getOSType!("x6B73350");
+		const __eDeleteKey = getOSType!("x6B73330");
+		const __eTabKey = getOSType!("x6B73300");
+		const __eReturnKey = getOSType!("x6B73240");
+		const __eClearKey = getOSType!("x6B73470");
+		const __eEnterKey = getOSType!("x6B734C0");
+		const __eUpArrowKey = getOSType!("x6B737E0");
+		const __eDownArrowKey = getOSType!("x6B737D0");
+		const __eLeftArrowKey = getOSType!("x6B737B0");
+		const __eRightArrowKey = getOSType!("x6B737C0");
+		const __eHelpKey = getOSType!("x6B73720");
+		const __eHomeKey = getOSType!("x6B73730");
+		const __ePageUpKey = getOSType!("x6B73740");
+		const __ePageDownKey = getOSType!("x6B73790");
+		const __eForwardDelKey = getOSType!("x6B73750");
+		const __eEndKey = getOSType!("x6B73770");
+		const __eF1Key = getOSType!("x6B737A0");
+		const __eF2Key = getOSType!("x6B73780");
+		const __eF3Key = getOSType!("x6B73630");
+		const __eF4Key = getOSType!("x6B73760");
+		const __eF5Key = getOSType!("x6B73600");
+		const __eF6Key = getOSType!("x6B73610");
+		const __eF7Key = getOSType!("x6B73620");
+		const __eF8Key = getOSType!("x6B73640");
+		const __eF9Key = getOSType!("x6B73650");
+		const __eF10Key = getOSType!("x6B736D0");
+		const __eF11Key = getOSType!("x6B73670");
+		const __eF12Key = getOSType!("x6B736F0");
+		const __eF13Key = getOSType!("x6B73690");
+		const __eF14Key = getOSType!("x6B736B0");
+		const __eF15Key = getOSType!("x6B73710");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyAELaunchedAsLogInItem = getOSType!("lgit");
+		const __keyAELaunchedAsServiceItem = getOSType!("svit");
+
+	}
+}
+
+enum
+{
+	cAEList = getOSType!("list"),
+	cApplication = getOSType!("capp"),
+	cArc = getOSType!("carc"),
+	cBoolean = getOSType!("bool"),
+	cCell = getOSType!("ccel"),
+	cChar = getOSType!("cha "),
+	cColorTable = getOSType!("clrt"),
+	cColumn = getOSType!("ccol"),
+	cDocument = getOSType!("docu"),
+	cDrawingArea = getOSType!("cdrw"),
+	cEnumeration = getOSType!("enum"),
+	cFile = getOSType!("file"),
+	cFixed = getOSType!("fixd"),
+	cFixedPoint = getOSType!("fpnt"),
+	cFixedRectangle = getOSType!("frct"),
+	cGraphicLine = getOSType!("glin"),
+	cGraphicObject = getOSType!("cgob"),
+	cGraphicShape = getOSType!("cgsh"),
+	cGraphicText = getOSType!("cgtx"),
+	cGroupedGraphic = getOSType!("cpic")
+}
+
+enum
+{
+	cInsertionLoc = getOSType!("insl"),
+	cInsertionPoint = getOSType!("cins"),
+	cIntlText = getOSType!("itxt"),
+	cIntlWritingCode = getOSType!("intl"),
+	cItem = getOSType!("citm"),
+	cLine = getOSType!("clin"),
+	cLongDateTime = getOSType!("ldt "),
+	cLongFixed = getOSType!("lfxd"),
+	cLongFixedPoint = getOSType!("lfpt"),
+	cLongFixedRectangle = getOSType!("lfrc"),
+	cLongInteger = getOSType!("long"),
+	cLongPoint = getOSType!("lpnt"),
+	cLongRectangle = getOSType!("lrct"),
+	cMachineLoc = getOSType!("mLoc"),
+	cMenu = getOSType!("cmnu"),
+	cMenuItem = getOSType!("cmen"),
+	cObject = getOSType!("cobj"),
+	cObjectSpecifier = getOSType!("obj "),
+	cOpenableObject = getOSType!("coob"),
+	cOval = getOSType!("covl")
+}
+
+enum
+{
+	cParagraph = getOSType!("cpar"),
+	cPICT = getOSType!("PICT"),
+	cPixel = getOSType!("cpxl"),
+	cPixelMap = getOSType!("cpix"),
+	cPolygon = getOSType!("cpgn"),
+	cProperty = getOSType!("prop"),
+	cQDPoint = getOSType!("QDpt"),
+	cQDRectangle = getOSType!("qdrt"),
+	cRectangle = getOSType!("crec"),
+	cRGBColor = getOSType!("cRGB"),
+	cRotation = getOSType!("trot"),
+	cRoundedRectangle = getOSType!("crrc"),
+	cRow = getOSType!("crow"),
+	cSelection = getOSType!("csel"),
+	cShortInteger = getOSType!("shor"),
+	cTable = getOSType!("ctbl"),
+	cText = getOSType!("ctxt"),
+	cTextFlow = getOSType!("cflo"),
+	cTextStyles = getOSType!("tsty"),
+	cType = getOSType!("type")
+}
+
+enum
+{
+	cVersion = getOSType!("vers"),
+	cWindow = getOSType!("cwin"),
+	cWord = getOSType!("cwor"),
+	enumArrows = getOSType!("arro"),
+	enumJustification = getOSType!("just"),
+	enumKeyForm = getOSType!("kfrm"),
+	enumPosition = getOSType!("posi"),
+	enumProtection = getOSType!("prtn"),
+	enumQuality = getOSType!("qual"),
+	enumSaveOptions = getOSType!("savo"),
+	enumStyle = getOSType!("styl"),
+	enumTransferMode = getOSType!("tran"),
+	kAEAbout = getOSType!("abou"),
+	kAEAfter = getOSType!("afte"),
+	kAEAliasSelection = getOSType!("sali"),
+	kAEAllCaps = getOSType!("alcp"),
+	kAEArrowAtEnd = getOSType!("aren"),
+	kAEArrowAtStart = getOSType!("arst"),
+	kAEArrowBothEnds = getOSType!("arbo")
+}
+
+enum
+{
+	kAEAsk = getOSType!("ask "),
+	kAEBefore = getOSType!("befo"),
+	kAEBeginning = getOSType!("bgng"),
+	kAEBeginsWith = getOSType!("bgwt"),
+	kAEBeginTransaction = getOSType!("begi"),
+	kAEBold = getOSType!("bold"),
+	kAECaseSensEquals = getOSType!("cseq"),
+	kAECentered = getOSType!("cent"),
+	kAEChangeView = getOSType!("view"),
+	kAEClone = getOSType!("clon"),
+	kAEClose = getOSType!("clos"),
+	kAECondensed = getOSType!("cond"),
+	kAEContains = getOSType!("cont"),
+	kAECopy = getOSType!("copy"),
+	kAECoreSuite = getOSType!("core"),
+	kAECountElements = getOSType!("cnte"),
+	kAECreateElement = getOSType!("crel"),
+	kAECreatePublisher = getOSType!("cpub"),
+	kAECut = getOSType!("cut "),
+	kAEDelete = getOSType!("delo")
+}
+
+enum
+{
+	kAEDoObjectsExist = getOSType!("doex"),
+	kAEDoScript = getOSType!("dosc"),
+	kAEDrag = getOSType!("drag"),
+	kAEDuplicateSelection = getOSType!("sdup"),
+	kAEEditGraphic = getOSType!("edit"),
+	kAEEmptyTrash = getOSType!("empt"),
+	kAEEnd = getOSType!("end "),
+	kAEEndsWith = getOSType!("ends"),
+	kAEEndTransaction = getOSType!("endt"),
+	kAEEquals = getOSType!("=   "),
+	kAEExpanded = getOSType!("pexp"),
+	kAEFast = getOSType!("fast"),
+	kAEFinderEvents = getOSType!("FNDR"),
+	kAEFormulaProtect = getOSType!("fpro"),
+	kAEFullyJustified = getOSType!("full"),
+	kAEGetClassInfo = getOSType!("qobj"),
+	kAEGetData = getOSType!("getd"),
+	kAEGetDataSize = getOSType!("dsiz"),
+	kAEGetEventInfo = getOSType!("gtei"),
+	kAEGetInfoSelection = getOSType!("sinf")
+}
+
+enum
+{
+	kAEGetPrivilegeSelection = getOSType!("sprv"),
+	kAEGetSuiteInfo = getOSType!("gtsi"),
+	kAEGreaterThan = getOSType!(">   "),
+	kAEGreaterThanEquals = getOSType!(">=  "),
+	kAEGrow = getOSType!("grow"),
+	kAEHidden = getOSType!("hidn"),
+	kAEHiQuality = getOSType!("hiqu"),
+	kAEImageGraphic = getOSType!("imgr"),
+	kAEIsUniform = getOSType!("isun"),
+	kAEItalic = getOSType!("ital"),
+	kAELeftJustified = getOSType!("left"),
+	kAELessThan = getOSType!("<   "),
+	kAELessThanEquals = getOSType!("<=  "),
+	kAELowercase = getOSType!("lowc"),
+	kAEMakeObjectsVisible = getOSType!("mvis"),
+	kAEMiscStandards = getOSType!("misc"),
+	kAEModifiable = getOSType!("modf"),
+	kAEMove = getOSType!("move"),
+	kAENo = getOSType!("no  "),
+	kAENoArrow = getOSType!("arno")
+}
+
+enum
+{
+	kAENonmodifiable = getOSType!("nmod"),
+	kAEOpen = getOSType!("odoc"),
+	kAEOpenSelection = getOSType!("sope"),
+	kAEOutline = getOSType!("outl"),
+	kAEPageSetup = getOSType!("pgsu"),
+	kAEPaste = getOSType!("past"),
+	kAEPlain = getOSType!("plan"),
+	kAEPrint = getOSType!("pdoc"),
+	kAEPrintSelection = getOSType!("spri"),
+	kAEPrintWindow = getOSType!("pwin"),
+	kAEPutAwaySelection = getOSType!("sput"),
+	kAEQDAddOver = getOSType!("addo"),
+	kAEQDAddPin = getOSType!("addp"),
+	kAEQDAdMax = getOSType!("admx"),
+	kAEQDAdMin = getOSType!("admn"),
+	kAEQDBic = getOSType!("bic "),
+	kAEQDBlend = getOSType!("blnd"),
+	kAEQDCopy = getOSType!("cpy "),
+	kAEQDNotBic = getOSType!("nbic"),
+	kAEQDNotCopy = getOSType!("ncpy")
+}
+
+enum
+{
+	kAEQDNotOr = getOSType!("ntor"),
+	kAEQDNotXor = getOSType!("nxor"),
+	kAEQDOr = getOSType!("or  "),
+	kAEQDSubOver = getOSType!("subo"),
+	kAEQDSubPin = getOSType!("subp"),
+	kAEQDSupplementalSuite = getOSType!("qdsp"),
+	kAEQDXor = getOSType!("xor "),
+	kAEQuickdrawSuite = getOSType!("qdrw"),
+	kAEQuitAll = getOSType!("quia"),
+	kAERedo = getOSType!("redo"),
+	kAERegular = getOSType!("regl"),
+	kAEReopenApplication = getOSType!("rapp"),
+	kAEReplace = getOSType!("rplc"),
+	kAERequiredSuite = getOSType!("reqd"),
+	kAERestart = getOSType!("rest"),
+	kAERevealSelection = getOSType!("srev"),
+	kAERevert = getOSType!("rvrt"),
+	kAERightJustified = getOSType!("rght"),
+	kAESave = getOSType!("save"),
+	kAESelect = getOSType!("slct"),
+	kAESetData = getOSType!("setd")
+}
+
+enum
+{
+	kAESetPosition = getOSType!("posn"),
+	kAEShadow = getOSType!("shad"),
+	kAEShowClipboard = getOSType!("shcl"),
+	kAEShutDown = getOSType!("shut"),
+	kAESleep = getOSType!("slep"),
+	kAESmallCaps = getOSType!("smcp"),
+	kAESpecialClassProperties = getOSType!("c@#!"),
+	kAEStrikethrough = getOSType!("strk"),
+	kAESubscript = getOSType!("sbsc"),
+	kAESuperscript = getOSType!("spsc"),
+	kAETableSuite = getOSType!("tbls"),
+	kAETextSuite = getOSType!("TEXT"),
+	kAETransactionTerminated = getOSType!("ttrm"),
+	kAEUnderline = getOSType!("undl"),
+	kAEUndo = getOSType!("undo"),
+	kAEWholeWordEquals = getOSType!("wweq"),
+	kAEYes = getOSType!("yes "),
+	kAEZoom = getOSType!("zoom")
+}
+
+enum
+{
+	kAELogOut = getOSType!("logo"),
+	kAEReallyLogOut = getOSType!("rlgo"),
+	kAEShowRestartDialog = getOSType!("rrst"),
+	kAEShowShutdownDialog = getOSType!("rsdn")
+}
+
+enum
+{
+	kAEMouseClass = getOSType!("mous"),
+	kAEDown = getOSType!("down"),
+	kAEUp = getOSType!("up  "),
+	kAEMoved = getOSType!("move"),
+	kAEStoppedMoving = getOSType!("stop"),
+	kAEWindowClass = getOSType!("wind"),
+	kAEUpdate = getOSType!("updt"),
+	kAEActivate = getOSType!("actv"),
+	kAEDeactivate = getOSType!("dact"),
+	kAECommandClass = getOSType!("cmnd"),
+	kAEKeyClass = getOSType!("keyc"),
+	kAERawKey = getOSType!("rkey"),
+	kAEVirtualKey = getOSType!("keyc"),
+	kAENavigationKey = getOSType!("nave"),
+	kAEAutoDown = getOSType!("auto"),
+	kAEApplicationClass = getOSType!("appl"),
+	kAESuspend = getOSType!("susp"),
+	kAEResume = getOSType!("rsme"),
+	kAEDiskEvent = getOSType!("disk"),
+	kAENullEvent = getOSType!("null"),
+	kAEWakeUpEvent = getOSType!("wake"),
+	kAEScrapEvent = getOSType!("scrp"),
+	kAEHighLevel = getOSType!("high")
+}
+
+enum
+{
+	keyAEAngle = getOSType!("kang"),
+	keyAEArcAngle = getOSType!("parc")
+}
+
+enum
+{
+	keyAEBaseAddr = getOSType!("badd"),
+	keyAEBestType = getOSType!("pbst"),
+	keyAEBgndColor = getOSType!("kbcl"),
+	keyAEBgndPattern = getOSType!("kbpt"),
+	keyAEBounds = getOSType!("pbnd"),
+	keyAECellList = getOSType!("kclt"),
+	keyAEClassID = getOSType!("clID"),
+	keyAEColor = getOSType!("colr"),
+	keyAEColorTable = getOSType!("cltb"),
+	keyAECurveHeight = getOSType!("kchd"),
+	keyAECurveWidth = getOSType!("kcwd"),
+	keyAEDashStyle = getOSType!("pdst"),
+	keyAEData = getOSType!("data"),
+	keyAEDefaultType = getOSType!("deft"),
+	keyAEDefinitionRect = getOSType!("pdrt"),
+	keyAEDescType = getOSType!("dstp"),
+	keyAEDestination = getOSType!("dest"),
+	keyAEDoAntiAlias = getOSType!("anta"),
+	keyAEDoDithered = getOSType!("gdit"),
+	keyAEDoRotate = getOSType!("kdrt")
+}
+
+enum
+{
+	keyAEDoScale = getOSType!("ksca"),
+	keyAEDoTranslate = getOSType!("ktra"),
+	keyAEEditionFileLoc = getOSType!("eloc"),
+	keyAEElements = getOSType!("elms"),
+	keyAEEndPoint = getOSType!("pend"),
+	keyAEEventClass = getOSType!("evcl"),
+	keyAEEventID = getOSType!("evti"),
+	keyAEFile = getOSType!("kfil"),
+	keyAEFileType = getOSType!("fltp"),
+	keyAEFillColor = getOSType!("flcl"),
+	keyAEFillPattern = getOSType!("flpt"),
+	keyAEFlipHorizontal = getOSType!("kfho"),
+	keyAEFlipVertical = getOSType!("kfvt"),
+	keyAEFont = getOSType!("font"),
+	keyAEFormula = getOSType!("pfor"),
+	keyAEGraphicObjects = getOSType!("gobs"),
+	keyAEID = getOSType!("ID  "),
+	keyAEImageQuality = getOSType!("gqua"),
+	keyAEInsertHere = getOSType!("insh"),
+	keyAEKeyForms = getOSType!("keyf")
+}
+
+enum
+{
+	keyAEKeyword = getOSType!("kywd"),
+	keyAELevel = getOSType!("levl"),
+	keyAELineArrow = getOSType!("arro"),
+	keyAEName = getOSType!("pnam"),
+	keyAENewElementLoc = getOSType!("pnel"),
+	keyAEObject = getOSType!("kobj"),
+	keyAEObjectClass = getOSType!("kocl"),
+	keyAEOffStyles = getOSType!("ofst"),
+	keyAEOnStyles = getOSType!("onst"),
+	keyAEParameters = getOSType!("prms"),
+	keyAEParamFlags = getOSType!("pmfg"),
+	keyAEPenColor = getOSType!("ppcl"),
+	keyAEPenPattern = getOSType!("pppa"),
+	keyAEPenWidth = getOSType!("ppwd"),
+	keyAEPixelDepth = getOSType!("pdpt"),
+	keyAEPixMapMinus = getOSType!("kpmm"),
+	keyAEPMTable = getOSType!("kpmt"),
+	keyAEPointList = getOSType!("ptlt"),
+	keyAEPointSize = getOSType!("ptsz"),
+	keyAEPosition = getOSType!("kpos")
+}
+
+enum
+{
+	keyAEPropData = getOSType!("prdt"),
+	keyAEProperties = getOSType!("qpro"),
+	keyAEProperty = getOSType!("kprp"),
+	keyAEPropFlags = getOSType!("prfg"),
+	keyAEPropID = getOSType!("prop"),
+	keyAEProtection = getOSType!("ppro"),
+	keyAERenderAs = getOSType!("kren"),
+	keyAERequestedType = getOSType!("rtyp"),
+	keyAEResult = getOSType!("----"),
+	keyAEResultInfo = getOSType!("rsin"),
+	keyAERotation = getOSType!("prot"),
+	keyAERotPoint = getOSType!("krtp"),
+	keyAERowList = getOSType!("krls"),
+	keyAESaveOptions = getOSType!("savo"),
+	keyAEScale = getOSType!("pscl"),
+	keyAEScriptTag = getOSType!("psct"),
+	keyAESearchText = getOSType!("stxt"),
+	keyAEShowWhere = getOSType!("show"),
+	keyAEStartAngle = getOSType!("pang"),
+	keyAEStartPoint = getOSType!("pstp"),
+	keyAEStyles = getOSType!("ksty")
+}
+
+enum
+{
+	keyAESuiteID = getOSType!("suit"),
+	keyAEText = getOSType!("ktxt"),
+	keyAETextColor = getOSType!("ptxc"),
+	keyAETextFont = getOSType!("ptxf"),
+	keyAETextPointSize = getOSType!("ptps"),
+	keyAETextStyles = getOSType!("txst"),
+	keyAETextLineHeight = getOSType!("ktlh"),
+	keyAETextLineAscent = getOSType!("ktas"),
+	keyAETheText = getOSType!("thtx"),
+	keyAETransferMode = getOSType!("pptm"),
+	keyAETranslation = getOSType!("ptrs"),
+	keyAETryAsStructGraf = getOSType!("toog"),
+	keyAEUniformStyles = getOSType!("ustl"),
+	keyAEUpdateOn = getOSType!("pupd"),
+	keyAEUserTerm = getOSType!("utrm"),
+	keyAEWindow = getOSType!("wndw"),
+	keyAEWritingCode = getOSType!("wrcd")
+}
+
+enum
+{
+	keyMiscellaneous = getOSType!("fmsc"),
+	keySelection = getOSType!("fsel"),
+	keyWindow = getOSType!("kwnd"),
+	keyWhen = getOSType!("when"),
+	keyWhere = getOSType!("wher"),
+	keyModifiers = getOSType!("mods"),
+	keyKey = getOSType!("key "),
+	keyKeyCode = getOSType!("code"),
+	keyKeyboard = getOSType!("keyb"),
+	keyDriveNumber = getOSType!("drv#"),
+	keyErrorCode = getOSType!("err#"),
+	keyHighLevelClass = getOSType!("hcls"),
+	keyHighLevelID = getOSType!("hid ")
+}
+
+enum
+{
+	pArcAngle = getOSType!("parc"),
+	pBackgroundColor = getOSType!("pbcl"),
+	pBackgroundPattern = getOSType!("pbpt"),
+	pBestType = getOSType!("pbst"),
+	pBounds = getOSType!("pbnd"),
+	pClass = getOSType!("pcls"),
+	pClipboard = getOSType!("pcli"),
+	pColor = getOSType!("colr"),
+	pColorTable = getOSType!("cltb"),
+	pContents = getOSType!("pcnt"),
+	pCornerCurveHeight = getOSType!("pchd"),
+	pCornerCurveWidth = getOSType!("pcwd"),
+	pDashStyle = getOSType!("pdst"),
+	pDefaultType = getOSType!("deft"),
+	pDefinitionRect = getOSType!("pdrt"),
+	pEnabled = getOSType!("enbl"),
+	pEndPoint = getOSType!("pend"),
+	pFillColor = getOSType!("flcl"),
+	pFillPattern = getOSType!("flpt"),
+	pFont = getOSType!("font")
+}
+
+enum
+{
+	pFormula = getOSType!("pfor"),
+	pGraphicObjects = getOSType!("gobs"),
+	pHasCloseBox = getOSType!("hclb"),
+	pHasTitleBar = getOSType!("ptit"),
+	pID = getOSType!("ID  "),
+	pIndex = getOSType!("pidx"),
+	pInsertionLoc = getOSType!("pins"),
+	pIsFloating = getOSType!("isfl"),
+	pIsFrontProcess = getOSType!("pisf"),
+	pIsModal = getOSType!("pmod"),
+	pIsModified = getOSType!("imod"),
+	pIsResizable = getOSType!("prsz"),
+	pIsStationeryPad = getOSType!("pspd"),
+	pIsZoomable = getOSType!("iszm"),
+	pIsZoomed = getOSType!("pzum"),
+	pItemNumber = getOSType!("itmn"),
+	pJustification = getOSType!("pjst"),
+	pLineArrow = getOSType!("arro"),
+	pMenuID = getOSType!("mnid"),
+	pName = getOSType!("pnam")
+}
+
+enum
+{
+	pNewElementLoc = getOSType!("pnel"),
+	pPenColor = getOSType!("ppcl"),
+	pPenPattern = getOSType!("pppa"),
+	pPenWidth = getOSType!("ppwd"),
+	pPixelDepth = getOSType!("pdpt"),
+	pPointList = getOSType!("ptlt"),
+	pPointSize = getOSType!("ptsz"),
+	pProtection = getOSType!("ppro"),
+	pRotation = getOSType!("prot"),
+	pScale = getOSType!("pscl"),
+	pScript = getOSType!("scpt"),
+	pScriptTag = getOSType!("psct"),
+	pSelected = getOSType!("selc"),
+	pSelection = getOSType!("sele"),
+	pStartAngle = getOSType!("pang"),
+	pStartPoint = getOSType!("pstp"),
+	pTextColor = getOSType!("ptxc"),
+	pTextFont = getOSType!("ptxf"),
+	pTextItemDelimiters = getOSType!("txdl"),
+	pTextPointSize = getOSType!("ptps")
+}
+
+enum
+{
+	pTextStyles = getOSType!("txst"),
+	pTransferMode = getOSType!("pptm"),
+	pTranslation = getOSType!("ptrs"),
+	pUniformStyles = getOSType!("ustl"),
+	pUpdateOn = getOSType!("pupd"),
+	pUserSelection = getOSType!("pusl"),
+	pVersion = getOSType!("vers"),
+	pVisible = getOSType!("pvis")
+}
+
+enum
+{
+	typeAEText = getOSType!("tTXT"),
+	typeArc = getOSType!("carc"),
+	typeBest = getOSType!("best"),
+	typeCell = getOSType!("ccel"),
+	typeClassInfo = getOSType!("gcli"),
+	typeColorTable = getOSType!("clrt"),
+	typeColumn = getOSType!("ccol"),
+	typeDashStyle = getOSType!("tdas"),
+	typeData = getOSType!("tdta"),
+	typeDrawingArea = getOSType!("cdrw"),
+	typeElemInfo = getOSType!("elin"),
+	typeEnumeration = getOSType!("enum"),
+	typeEPS = getOSType!("EPS "),
+	typeEventInfo = getOSType!("evin")
+}
+
+enum
+{
+	typeFinderWindow = getOSType!("fwin"),
+	typeFixedPoint = getOSType!("fpnt"),
+	typeFixedRectangle = getOSType!("frct"),
+	typeGraphicLine = getOSType!("glin"),
+	typeGraphicText = getOSType!("cgtx"),
+	typeGroupedGraphic = getOSType!("cpic"),
+	typeInsertionLoc = getOSType!("insl"),
+	typeIntlText = getOSType!("itxt"),
+	typeIntlWritingCode = getOSType!("intl"),
+	typeLongDateTime = getOSType!("ldt "),
+	typeCFAbsoluteTime = getOSType!("cfat"),
+	typeISO8601DateTime = getOSType!("isot"),
+	typeLongFixed = getOSType!("lfxd"),
+	typeLongFixedPoint = getOSType!("lfpt"),
+	typeLongFixedRectangle = getOSType!("lfrc"),
+	typeLongPoint = getOSType!("lpnt"),
+	typeLongRectangle = getOSType!("lrct"),
+	typeMachineLoc = getOSType!("mLoc"),
+	typeOval = getOSType!("covl"),
+	typeParamInfo = getOSType!("pmin"),
+	typePict = getOSType!("PICT")
+}
+
+enum
+{
+	typePixelMap = getOSType!("cpix"),
+	typePixMapMinus = getOSType!("tpmm"),
+	typePolygon = getOSType!("cpgn"),
+	typePropInfo = getOSType!("pinf"),
+	typePtr = getOSType!("ptr "),
+	typeQDPoint = getOSType!("QDpt"),
+	typeQDRegion = getOSType!("Qrgn"),
+	typeRectangle = getOSType!("crec"),
+	typeRGB16 = getOSType!("tr16"),
+	typeRGB96 = getOSType!("tr96"),
+	typeRGBColor = getOSType!("cRGB"),
+	typeRotation = getOSType!("trot"),
+	typeRoundedRectangle = getOSType!("crrc"),
+	typeRow = getOSType!("crow"),
+	typeScrapStyles = getOSType!("styl"),
+	typeScript = getOSType!("scpt"),
+	typeStyledText = getOSType!("STXT"),
+	typeSuiteInfo = getOSType!("suin"),
+	typeTable = getOSType!("ctbl"),
+	typeTextStyles = getOSType!("tsty")
+}
+
+enum
+{
+	typeTIFF = getOSType!("TIFF"),
+	typeJPEG = getOSType!("JPEG"),
+	typeGIF = getOSType!("GIFf"),
+	typeVersion = getOSType!("vers")
+}
+
+enum
+{
+	kAEMenuClass = getOSType!("menu"),
+	kAEMenuSelect = getOSType!("mhit"),
+	kAEMouseDown = getOSType!("mdwn"),
+	kAEMouseDownInBack = getOSType!("mdbk"),
+	kAEKeyDown = getOSType!("kdwn"),
+	kAEResized = getOSType!("rsiz"),
+	kAEPromise = getOSType!("prom")
+}
+
+enum
+{
+	keyMenuID = getOSType!("mid "),
+	keyMenuItem = getOSType!("mitm"),
+	keyCloseAllWindows = getOSType!("caw "),
+	keyOriginalBounds = getOSType!("obnd"),
+	keyNewBounds = getOSType!("nbnd"),
+	keyLocalWhere = getOSType!("lwhr")
+}
+
+enum
+{
+	typeHIMenu = getOSType!("mobj"),
+	typeHIWindow = getOSType!("wobj")
+}
+
+enum
+{
+	kBySmallIcon = 0,
+	kByIconView = 1,
+	kByNameView = 2,
+	kByDateView = 3,
+	kBySizeView = 4,
+	kByKindView = 5,
+	kByCommentView = 6,
+	kByLabelView = 7,
+	kByVersionView = 8
+}
+
+enum
+{
+	kAEInfo = 11,
+	kAEMain = 0,
+	kAESharing = 13
+}
+
+enum
+{
+	kAEZoomIn = 7,
+	kAEZoomOut = 8
+}
+
+enum
+{
+	kTextServiceClass = getOSType!("tsvc"),
+	kUpdateActiveInputArea = getOSType!("updt"),
+	kShowHideInputWindow = getOSType!("shiw"),
+	kPos2Offset = getOSType!("p2st"),
+	kOffset2Pos = getOSType!("st2p"),
+	kUnicodeNotFromInputMethod = getOSType!("unim"),
+	kGetSelectedText = getOSType!("gtxt"),
+	keyAETSMDocumentRefcon = getOSType!("refc"),
+	keyAEServerInstance = getOSType!("srvi"),
+	keyAETheData = getOSType!("kdat"),
+	keyAEFixLength = getOSType!("fixl"),
+	keyAEUpdateRange = getOSType!("udng"),
+	keyAECurrentPoint = getOSType!("cpos"),
+	keyAEBufferSize = getOSType!("buff"),
+	keyAEMoveView = getOSType!("mvvw"),
+	keyAENextBody = getOSType!("nxbd"),
+	keyAETSMScriptTag = getOSType!("sclg"),
+	keyAETSMTextFont = getOSType!("ktxf"),
+	keyAETSMTextFMFont = getOSType!("ktxm"),
+	keyAETSMTextPointSize = getOSType!("ktps"),
+	keyAETSMEventRecord = getOSType!("tevt"),
+	keyAETSMEventRef = getOSType!("tevr"),
+	keyAETextServiceEncoding = getOSType!("tsen"),
+	keyAETextServiceMacEncoding = getOSType!("tmen"),
+	keyAETSMGlyphInfoArray = getOSType!("tgia"),
+	typeTextRange = getOSType!("txrn"),
+	typeComponentInstance = getOSType!("cmpi"),
+	typeOffsetArray = getOSType!("ofay"),
+	typeTextRangeArray = getOSType!("tray"),
+	typeLowLevelEventRecord = getOSType!("evtr"),
+	typeGlyphInfoArray = getOSType!("glia"),
+	typeEventRef = getOSType!("evrf"),
+	typeText = getOSType!("ypeCha")
+}
+
+enum
+{
+	kTSMOutsideOfBody = 1,
+	kTSMInsideOfBody = 2,
+	kTSMInsideOfActiveInputArea = 3
+}
+
+enum
+{
+	kNextBody = 1,
+	kPreviousBody = 2
+}
+
+enum
+{
+	kTSMHiliteCaretPosition = 1,
+	kTSMHiliteRawText = 2,
+	kTSMHiliteSelectedRawText = 3,
+	kTSMHiliteConvertedText = 4,
+	kTSMHiliteSelectedConvertedText = 5,
+	kTSMHiliteBlockFillText = 6,
+	kTSMHiliteOutlineText = 7,
+	kTSMHiliteSelectedText = 8,
+	kTSMHiliteNoHilite = 9
+}
+
+enum
+{
+	keyAEHiliteRange = getOSType!("hrng"),
+	keyAEPinRange = getOSType!("pnrg"),
+	keyAEClauseOffsets = getOSType!("clau"),
+	keyAEOffset = getOSType!("ofst"),
+	keyAEPoint = getOSType!("gpos"),
+	keyAELeftSide = getOSType!("klef"),
+	keyAERegionClass = getOSType!("rgnc"),
+	keyAEDragging = getOSType!("bool")
+}
+
+enum
+{
+	typeMeters = getOSType!("metr"),
+	typeInches = getOSType!("inch"),
+	typeFeet = getOSType!("feet"),
+	typeYards = getOSType!("yard"),
+	typeMiles = getOSType!("mile"),
+	typeKilometers = getOSType!("kmtr"),
+	typeCentimeters = getOSType!("cmtr"),
+	typeSquareMeters = getOSType!("sqrm"),
+	typeSquareFeet = getOSType!("sqft"),
+	typeSquareYards = getOSType!("sqyd"),
+	typeSquareMiles = getOSType!("sqmi"),
+	typeSquareKilometers = getOSType!("sqkm"),
+	typeLiters = getOSType!("litr"),
+	typeQuarts = getOSType!("qrts"),
+	typeGallons = getOSType!("galn"),
+	typeCubicMeters = getOSType!("cmet"),
+	typeCubicFeet = getOSType!("cfet"),
+	typeCubicInches = getOSType!("cuin"),
+	typeCubicCentimeter = getOSType!("ccmt"),
+	typeCubicYards = getOSType!("cyrd"),
+	typeKilograms = getOSType!("kgrm"),
+	typeGrams = getOSType!("gram"),
+	typeOunces = getOSType!("ozs "),
+	typePounds = getOSType!("lbs "),
+	typeDegreesC = getOSType!("degc"),
+	typeDegreesF = getOSType!("degf"),
+	typeDegreesK = getOSType!("degk")
+}
+
+enum
+{
+	kFAServerApp = getOSType!("ssrv"),
+	kDoFolderActionEvent = getOSType!("fola"),
+	kFolderActionCode = getOSType!("actn"),
+	kFolderOpenedEvent = getOSType!("fopn"),
+	kFolderClosedEvent = getOSType!("fclo"),
+	kFolderWindowMovedEvent = getOSType!("fsiz"),
+	kFolderItemsAddedEvent = getOSType!("fget"),
+	kFolderItemsRemovedEvent = getOSType!("flos"),
+	kItemList = getOSType!("flst"),
+	kNewSizeParameter = getOSType!("fnsz"),
+	kFASuiteCode = getOSType!("faco"),
+	kFAAttachCommand = getOSType!("atfa"),
+	kFARemoveCommand = getOSType!("rmfa"),
+	kFAEditCommand = getOSType!("edfa"),
+	kFAFileParam = getOSType!("faal"),
+	kFAIndexParam = getOSType!("indx")
+}
+
+enum
+{
+	kAEInternetSuite = getOSType!("gurl"),
+	kAEISWebStarSuite = getOSType!("x575757B")
+}
+
+enum
+{
+	kAEISGetURL = getOSType!("gurl"),
+	KAEISHandleCGI = getOSType!("sdoc")
+}
+
+enum
+{
+	cURL = getOSType!("url "),
+	cInternetAddress = getOSType!("IPAD"),
+	cHTML = getOSType!("html"),
+	cFTPItem = getOSType!("ftp ")
+}
+
+enum
+{
+	kAEISHTTPSearchArgs = getOSType!("kfor"),
+	kAEISPostArgs = getOSType!("post"),
+	kAEISMethod = getOSType!("meth"),
+	kAEISClientAddress = getOSType!("addr"),
+	kAEISUserName = getOSType!("user"),
+	kAEISPassword = getOSType!("pass"),
+	kAEISFromUser = getOSType!("frmu"),
+	kAEISServerName = getOSType!("svnm"),
+	kAEISServerPort = getOSType!("svpt"),
+	kAEISScriptName = getOSType!("scnm"),
+	kAEISContentType = getOSType!("ctyp"),
+	kAEISReferrer = getOSType!("refr"),
+	kAEISUserAgent = getOSType!("Agnt"),
+	kAEISAction = getOSType!("Kact"),
+	kAEISActionPath = getOSType!("Kapt"),
+	kAEISClientIP = getOSType!("Kcip"),
+	kAEISFullRequest = getOSType!("Kfrq")
+}
+
+enum
+{
+	pScheme = getOSType!("pusc"),
+	pHost = getOSType!("HOST"),
+	pPath = getOSType!("FTPc"),
+	pUserName = getOSType!("RAun"),
+	pUserPassword = getOSType!("RApw"),
+	pDNSForm = getOSType!("pDNS"),
+	pURL = getOSType!("pURL"),
+	pTextEncoding = getOSType!("ptxe"),
+	pFTPKind = getOSType!("kind")
+}
+
+enum
+{
+	eScheme = getOSType!("esch"),
+	eurlHTTP = getOSType!("http"),
+	eurlHTTPS = getOSType!("htps"),
+	eurlFTP = getOSType!("ftp "),
+	eurlMail = getOSType!("mail"),
+	eurlFile = getOSType!("file"),
+	eurlGopher = getOSType!("gphr"),
+	eurlTelnet = getOSType!("tlnt"),
+	eurlNews = getOSType!("news"),
+	eurlSNews = getOSType!("snws"),
+	eurlNNTP = getOSType!("nntp"),
+	eurlMessage = getOSType!("mess"),
+	eurlMailbox = getOSType!("mbox"),
+	eurlMulti = getOSType!("mult"),
+	eurlLaunch = getOSType!("laun"),
+	eurlAFP = getOSType!("afp "),
+	eurlAT = getOSType!("at  "),
+	eurlEPPC = getOSType!("eppc"),
+	eurlRTSP = getOSType!("rtsp"),
+	eurlIMAP = getOSType!("imap"),
+	eurlNFS = getOSType!("unfs"),
+	eurlPOP = getOSType!("upop"),
+	eurlLDAP = getOSType!("uldp"),
+	eurlUnknown = getOSType!("url?")
+}
+
+enum
+{
+	kConnSuite = getOSType!("macc"),
+	cDevSpec = getOSType!("cdev"),
+	cAddressSpec = getOSType!("cadr"),
+	cADBAddress = getOSType!("cadb"),
+	cAppleTalkAddress = getOSType!("cat "),
+	cBusAddress = getOSType!("cbus"),
+	cEthernetAddress = getOSType!("cen "),
+	cFireWireAddress = getOSType!("cfw "),
+	cIPAddress = getOSType!("cip "),
+	cLocalTalkAddress = getOSType!("clt "),
+	cSCSIAddress = getOSType!("cscs"),
+	cTokenRingAddress = getOSType!("ctok"),
+	cUSBAddress = getOSType!("cusb"),
+	pDeviceType = getOSType!("pdvt"),
+	pDeviceAddress = getOSType!("pdva"),
+	pConduit = getOSType!("pcon"),
+	pProtocol = getOSType!("pprt"),
+	pATMachine = getOSType!("patm"),
+	pATZone = getOSType!("patz"),
+	pATType = getOSType!("patt"),
+	pDottedDecimal = getOSType!("pipd"),
+	pDNS = getOSType!("pdns"),
+	pPort = getOSType!("ppor"),
+	pNetwork = getOSType!("pnet"),
+	pNode = getOSType!("pnod"),
+	pSocket = getOSType!("psoc"),
+	pSCSIBus = getOSType!("pscb"),
+	pSCSILUN = getOSType!("pslu"),
+	eDeviceType = getOSType!("edvt"),
+	eAddressSpec = getOSType!("eads"),
+	eConduit = getOSType!("econ"),
+	eProtocol = getOSType!("epro"),
+	eADB = getOSType!("eadb"),
+	eAnalogAudio = getOSType!("epau"),
+	eAppleTalk = getOSType!("epat"),
+	eAudioLineIn = getOSType!("ecai"),
+	eAudioLineOut = getOSType!("ecal"),
+	eAudioOut = getOSType!("ecao"),
+	eBus = getOSType!("ebus"),
+	eCDROM = getOSType!("ecd "),
+	eCommSlot = getOSType!("eccm"),
+	eDigitalAudio = getOSType!("epda"),
+	eDisplay = getOSType!("edds"),
+	eDVD = getOSType!("edvd"),
+	eEthernet = getOSType!("ecen"),
+	eFireWire = getOSType!("ecfw"),
+	eFloppy = getOSType!("efd "),
+	eHD = getOSType!("ehd "),
+	eInfrared = getOSType!("ecir"),
+	eIP = getOSType!("epip"),
+	eIrDA = getOSType!("epir"),
+	eIRTalk = getOSType!("epit"),
+	eKeyboard = getOSType!("ekbd"),
+	eLCD = getOSType!("edlc"),
+	eLocalTalk = getOSType!("eclt"),
+	eMacIP = getOSType!("epmi"),
+	eMacVideo = getOSType!("epmv"),
+	eMicrophone = getOSType!("ecmi"),
+	eModemPort = getOSType!("ecmp"),
+	eModemPrinterPort = getOSType!("empp"),
+	eModem = getOSType!("edmm"),
+	eMonitorOut = getOSType!("ecmn"),
+	eMouse = getOSType!("emou"),
+	eNuBusCard = getOSType!("ednb"),
+	eNuBus = getOSType!("enub"),
+	ePCcard = getOSType!("ecpc"),
+	ePCIbus = getOSType!("ecpi"),
+	ePCIcard = getOSType!("edpi"),
+	ePDSslot = getOSType!("ecpd"),
+	ePDScard = getOSType!("epds"),
+	ePointingDevice = getOSType!("edpd"),
+	ePostScript = getOSType!("epps"),
+	ePPP = getOSType!("eppp"),
+	ePrinterPort = getOSType!("ecpp"),
+	ePrinter = getOSType!("edpr"),
+	eSvideo = getOSType!("epsv"),
+	eSCSI = getOSType!("ecsc"),
+	eSerial = getOSType!("epsr"),
+	eSpeakers = getOSType!("edsp"),
+	eStorageDevice = getOSType!("edst"),
+	eSVGA = getOSType!("epsg"),
+	eTokenRing = getOSType!("etok"),
+	eTrackball = getOSType!("etrk"),
+	eTrackpad = getOSType!("edtp"),
+	eUSB = getOSType!("ecus"),
+	eVideoIn = getOSType!("ecvi"),
+	eVideoMonitor = getOSType!("edvm"),
+	eVideoOut = getOSType!("ecvo")
+}
+
+enum
+{
+	cKeystroke = getOSType!("kprs"),
+	pKeystrokeKey = getOSType!("kMsg"),
+	pModifiers = getOSType!("kMod"),
+	pKeyKind = getOSType!("kknd"),
+	eModifiers = getOSType!("eMds"),
+	eOptionDown = getOSType!("Kopt"),
+	eCommandDown = getOSType!("Kcmd"),
+	eControlDown = getOSType!("Kctl"),
+	eShiftDown = getOSType!("Ksft"),
+	eCapsLockDown = getOSType!("Kclk"),
+	eKeyKind = getOSType!("ekst"),
+	eEscapeKey = getOSType!("x6B73350"),
+	eDeleteKey = getOSType!("x6B73330"),
+	eTabKey = getOSType!("x6B73300"),
+	eReturnKey = getOSType!("x6B73240"),
+	eClearKey = getOSType!("x6B73470"),
+	eEnterKey = getOSType!("x6B734C0"),
+	eUpArrowKey = getOSType!("x6B737E0"),
+	eDownArrowKey = getOSType!("x6B737D0"),
+	eLeftArrowKey = getOSType!("x6B737B0"),
+	eRightArrowKey = getOSType!("x6B737C0"),
+	eHelpKey = getOSType!("x6B73720"),
+	eHomeKey = getOSType!("x6B73730"),
+	ePageUpKey = getOSType!("x6B73740"),
+	ePageDownKey = getOSType!("x6B73790"),
+	eForwardDelKey = getOSType!("x6B73750"),
+	eEndKey = getOSType!("x6B73770"),
+	eF1Key = getOSType!("x6B737A0"),
+	eF2Key = getOSType!("x6B73780"),
+	eF3Key = getOSType!("x6B73630"),
+	eF4Key = getOSType!("x6B73760"),
+	eF5Key = getOSType!("x6B73600"),
+	eF6Key = getOSType!("x6B73610"),
+	eF7Key = getOSType!("x6B73620"),
+	eF8Key = getOSType!("x6B73640"),
+	eF9Key = getOSType!("x6B73650"),
+	eF10Key = getOSType!("x6B736D0"),
+	eF11Key = getOSType!("x6B73670"),
+	eF12Key = getOSType!("x6B736F0"),
+	eF13Key = getOSType!("x6B73690"),
+	eF14Key = getOSType!("x6B736B0"),
+	eF15Key = getOSType!("x6B73710")
+}
+
+enum
+{
+	keyAELaunchedAsLogInItem = getOSType!("lgit"),
+	keyAELaunchedAsServiceItem = getOSType!("svit")
+}
+
+struct TextRange
+{
+	int fStart;
+	int fEnd;
+	short fHiliteStyle;
+}
+
+
+struct TextRangeArray
+{
+	short fNumOfRanges;
+	TextRange* fRange;
+}
+
+
+struct OffsetArray
+{
+	short fNumOfOffsets;
+	SInt32* fOffset;
+}
+
+
+struct WritingCode
+{
+	short theScriptCode;
+	short theLangCode;
+}
+
+
+struct IntlText
+{
+	short theScriptCode;
+	short theLangCode;
+	char* theText;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AEUserTermTypes.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,88 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AEUserTermTypes;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.objc.bridge.TypeEncoding;
+
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEUserTerminology = getOSType!("aeut");
+		const __kAETerminologyExtension = getOSType!("aete");
+		const __kAEScriptingSizeResource = getOSType!("scsz");
+		const __kAEOSAXSizeResource = getOSType!("osiz");
+
+	}
+}
+
+enum
+{
+	kAEUserTerminology = getOSType!("aeut"),
+	kAETerminologyExtension = getOSType!("aete"),
+	kAEScriptingSizeResource = getOSType!("scsz"),
+	kAEOSAXSizeResource = getOSType!("osiz")
+}
+
+enum
+{
+	kAEUTHasReturningParam = 31,
+	kAEUTOptional = 15,
+	kAEUTlistOfItems = 14,
+	kAEUTEnumerated = 13,
+	kAEUTReadWrite = 12,
+	kAEUTChangesState = 12,
+	kAEUTTightBindingFunction = 12,
+	kAEUTEnumsAreTypes = 11,
+	kAEUTEnumListIsExclusive = 10,
+	kAEUTReplyIsReference = 9,
+	kAEUTDirectParamIsReference = 9,
+	kAEUTParamIsReference = 9,
+	kAEUTPropertyIsReference = 9,
+	kAEUTNotDirectParamIsTarget = 8,
+	kAEUTParamIsTarget = 8,
+	kAEUTApostrophe = 3,
+	kAEUTFeminine = 2,
+	kAEUTMasculine = 1,
+	kAEUTPlural = 0
+}
+
+enum
+{
+	kLaunchToGetTerminology = (1 << 15),
+	kDontFindAppBySignature = (1 << 14),
+	kAlwaysSendSubject = (1 << 13)
+}
+
+enum
+{
+	kReadExtensionTermsMask = (1 << 15)
+}
+
+enum
+{
+	kOSIZDontOpenResourceFile = 15,
+	kOSIZdontAcceptRemoteEvents = 14,
+	kOSIZOpenWithReadPermission = 13,
+	kOSIZCodeInSharedLibraries = 11
+}
+
+struct TScriptingSizeResource
+{
+	short scriptingSizeFlags;
+	uint minStackSize;
+	uint preferredStackSize;
+	uint maxStackSize;
+	uint minHeapSize;
+	uint preferredHeapSize;
+	uint maxHeapSize;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/ae/AppleEvents.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,163 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.ae.AppleEvents;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.ae.AEDataModel;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.corefoundation.CoreFoundation;
+import dstep.objc.bridge.TypeEncoding;
+
+struct AERemoteProcessResolver;
+
+alias byte AEEventSource;
+alias AERemoteProcessResolver* AERemoteProcessResolverRef;
+
+extern (C)
+{
+	alias void function (AERemoteProcessResolverRef, void*) AERemoteProcessResolverCallback;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kAERemoteProcessURLKey;
+		const CFStringRef kAERemoteProcessNameKey;
+		const CFStringRef kAERemoteProcessUserIDKey;
+		const CFStringRef kAERemoteProcessProcessIDKey;
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __keyDirectObject = getOSType!("----");
+		const __keyErrorNumber = getOSType!("errn");
+		const __keyErrorString = getOSType!("errs");
+		const __keyProcessSerialNumber = getOSType!("psn ");
+		const __keyPreDispatch = getOSType!("phac");
+		const __keySelectProc = getOSType!("selh");
+		const __keyAERecorderCount = getOSType!("recr");
+		const __keyAEVersion = getOSType!("vers");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kCoreEventClass = getOSType!("aevt");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEOpenApplication = getOSType!("oapp");
+		const __kAEOpenDocuments = getOSType!("odoc");
+		const __kAEPrintDocuments = getOSType!("pdoc");
+		const __kAEOpenContents = getOSType!("ocon");
+		const __kAEQuitApplication = getOSType!("quit");
+		const __kAEAnswer = getOSType!("ansr");
+		const __kAEApplicationDied = getOSType!("obit");
+		const __kAEShowPreferences = getOSType!("pref");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAEStartRecording = getOSType!("reca");
+		const __kAEStopRecording = getOSType!("recc");
+		const __kAENotifyStartRecording = getOSType!("rec1");
+		const __kAENotifyStopRecording = getOSType!("rec0");
+		const __kAENotifyRecording = getOSType!("recr");
+
+	}
+}
+
+enum
+{
+	keyDirectObject = getOSType!("----"),
+	keyErrorNumber = getOSType!("errn"),
+	keyErrorString = getOSType!("errs"),
+	keyProcessSerialNumber = getOSType!("psn "),
+	keyPreDispatch = getOSType!("phac"),
+	keySelectProc = getOSType!("selh"),
+	keyAERecorderCount = getOSType!("recr"),
+	keyAEVersion = getOSType!("vers")
+}
+
+enum
+{
+	kCoreEventClass = getOSType!("aevt")
+}
+
+enum
+{
+	kAEOpenApplication = getOSType!("oapp"),
+	kAEOpenDocuments = getOSType!("odoc"),
+	kAEPrintDocuments = getOSType!("pdoc"),
+	kAEOpenContents = getOSType!("ocon"),
+	kAEQuitApplication = getOSType!("quit"),
+	kAEAnswer = getOSType!("ansr"),
+	kAEApplicationDied = getOSType!("obit"),
+	kAEShowPreferences = getOSType!("pref")
+}
+
+enum
+{
+	kAEStartRecording = getOSType!("reca"),
+	kAEStopRecording = getOSType!("recc"),
+	kAENotifyStartRecording = getOSType!("rec1"),
+	kAENotifyStopRecording = getOSType!("rec0"),
+	kAENotifyRecording = getOSType!("recr")
+}
+
+enum
+{
+	kAEUnknownSource = 0,
+	kAEDirectCall = 1,
+	kAESameProcess = 2,
+	kAELocalProcess = 3,
+	kAERemoteProcess = 4
+}
+
+struct AERemoteProcessResolverContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+}
+
+extern (C)
+{
+	short AEInstallEventHandler (uint theAEEventClass, uint theAEEventID, AEEventHandlerUPP handler, int handlerRefcon, ubyte isSysHandler);
+	short AERemoveEventHandler (uint theAEEventClass, uint theAEEventID, AEEventHandlerUPP handler, ubyte isSysHandler);
+	short AEGetEventHandler (uint theAEEventClass, uint theAEEventID, AEEventHandlerUPP* handler, SRefCon* handlerRefcon, ubyte isSysHandler);
+	short AEInstallSpecialHandler (uint functionClass, AEEventHandlerUPP handler, ubyte isSysHandler);
+	short AERemoveSpecialHandler (uint functionClass, AEEventHandlerUPP handler, ubyte isSysHandler);
+	short AEGetSpecialHandler (uint functionClass, AEEventHandlerUPP* handler, ubyte isSysHandler);
+	short AEManagerInfo (uint keyWord, long* result);
+	AERemoteProcessResolverRef AECreateRemoteProcessResolver (CFAllocatorRef allocator, CFURLRef url);
+	void AEDisposeRemoteProcessResolver (AERemoteProcessResolverRef ref_);
+	CFArrayRef AERemoteProcessResolverGetProcesses (AERemoteProcessResolverRef ref_, CFStreamError* outError);
+	void AERemoteProcessResolverScheduleWithRunLoop (AERemoteProcessResolverRef ref_, CFRunLoopRef runLoop, CFStringRef runLoopMode, AERemoteProcessResolverCallback callback, AERemoteProcessResolverContext* ctx);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/AIFF.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,253 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.AIFF;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.objc.bridge.TypeEncoding;
+
+alias uint ID;
+alias short MarkerIdType;
+alias FormatVersionChunk* FormatVersionChunkPtr;
+alias CommonChunk* CommonChunkPtr;
+alias ExtCommonChunk* ExtCommonChunkPtr;
+alias SoundDataChunk* SoundDataChunkPtr;
+alias MarkerChunk* MarkerChunkPtr;
+alias InstrumentChunk* InstrumentChunkPtr;
+alias MIDIDataChunk* MIDIDataChunkPtr;
+alias AudioRecordingChunk* AudioRecordingChunkPtr;
+alias ApplicationSpecificChunk* ApplicationSpecificChunkPtr;
+alias CommentsChunk*CommentsChunkPtr;
+alias TextChunk* TextChunkPtr;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __AIFFID = getOSType!("AIFF");
+		const __AIFCID = getOSType!("AIFC");
+		const __FormatVersionID = getOSType!("FVER");
+		const __CommonID = getOSType!("COMM");
+		const __FORMID = getOSType!("FORM");
+		const __SoundDataID = getOSType!("SSND");
+		const __MarkerID = getOSType!("MARK");
+		const __InstrumentID = getOSType!("INST");
+		const __MIDIDataID = getOSType!("MIDI");
+		const __AudioRecordingID = getOSType!("AESD");
+		const __ApplicationSpecificID = getOSType!("APPL");
+		const __CommentID = getOSType!("COMT");
+		const __NameID = getOSType!("NAME");
+		const __AuthorID = getOSType!("AUTH");
+		const __CopyrightID = getOSType!("(c) ");
+		const __AnnotationID = getOSType!("ANNO");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __NoneType = getOSType!("NONE");
+		const __ACE2Type = getOSType!("ACE2");
+		const __ACE8Type = getOSType!("ACE8");
+		const __MACE3Type = getOSType!("MAC3");
+		const __MACE6Type = getOSType!("MAC6");
+
+	}
+}
+
+enum
+{
+	AIFFID = getOSType!("AIFF"),
+	AIFCID = getOSType!("AIFC"),
+	FormatVersionID = getOSType!("FVER"),
+	CommonID = getOSType!("COMM"),
+	FORMID = getOSType!("FORM"),
+	SoundDataID = getOSType!("SSND"),
+	MarkerID = getOSType!("MARK"),
+	InstrumentID = getOSType!("INST"),
+	MIDIDataID = getOSType!("MIDI"),
+	AudioRecordingID = getOSType!("AESD"),
+	ApplicationSpecificID = getOSType!("APPL"),
+	CommentID = getOSType!("COMT"),
+	NameID = getOSType!("NAME"),
+	AuthorID = getOSType!("AUTH"),
+	CopyrightID = getOSType!("(c) "),
+	AnnotationID = getOSType!("ANNO")
+}
+
+enum
+{
+	NoLooping = 0,
+	ForwardLooping = 1,
+	ForwardBackwardLooping = 2
+}
+
+enum
+{
+	AIFCVersion1 = cast(uint)0xA2805140
+}
+
+enum
+{
+	NoneType = getOSType!("NONE"),
+	ACE2Type = getOSType!("ACE2"),
+	ACE8Type = getOSType!("ACE8"),
+	MACE3Type = getOSType!("MAC3"),
+	MACE6Type = getOSType!("MAC6")
+}
+
+struct ChunkHeader
+{
+	uint ckID;
+	int ckSize;
+}
+
+
+struct ContainerChunk
+{
+	uint ckID;
+	int ckSize;
+	uint formType;
+}
+
+
+struct FormatVersionChunk
+{
+	uint ckID;
+	int ckSize;
+	uint timestamp;
+}
+
+
+struct CommonChunk
+{
+	uint ckID;
+	int ckSize;
+	short numChannels;
+	uint numSampleFrames;
+	short sampleSize;
+	extended80 sampleRate;
+}
+
+
+struct ExtCommonChunk
+{
+	uint ckID;
+	int ckSize;
+	short numChannels;
+	uint numSampleFrames;
+	short sampleSize;
+	extended80 sampleRate;
+	uint compressionType;
+	char* compressionName;
+}
+
+
+struct SoundDataChunk
+{
+	uint ckID;
+	int ckSize;
+	uint offset;
+	uint blockSize;
+}
+
+
+struct Marker
+{
+	short id;
+	uint position;
+	ubyte[256] markerName;
+}
+
+
+struct MarkerChunk
+{
+	uint ckID;
+	int ckSize;
+	ushort numMarkers;
+	Marker* Markers;
+}
+
+
+struct AIFFLoop
+{
+	short playMode;
+	short beginLoop;
+	short endLoop;
+}
+
+
+struct InstrumentChunk
+{
+	uint ckID;
+	int ckSize;
+	ubyte baseFrequency;
+	ubyte detune;
+	ubyte lowFrequency;
+	ubyte highFrequency;
+	ubyte lowVelocity;
+	ubyte highVelocity;
+	short gain;
+	AIFFLoop sustainLoop;
+	AIFFLoop releaseLoop;
+}
+
+
+struct MIDIDataChunk
+{
+	uint ckID;
+	int ckSize;
+	char* MIDIdata;
+}
+
+
+struct AudioRecordingChunk
+{
+	uint ckID;
+	int ckSize;
+	char* AESChannelStatus;
+}
+
+
+struct ApplicationSpecificChunk
+{
+	uint ckID;
+	int ckSize;
+	uint applicationSignature;
+	char* data;
+}
+
+
+struct Comment
+{
+	uint timeStamp;
+	short marker;
+	ushort count;
+	char* text;
+}
+
+
+struct CommentsChunk
+{
+	uint ckID;
+	int ckSize;
+	ushort numComments;
+	Comment* comments;
+}
+
+
+struct TextChunk
+{
+	uint ckID;
+	int ckSize;
+	char* text;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/AVLTree.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,82 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.AVLTree;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Types;
+
+alias ushort AVLVisitStage;
+alias ushort AVLOrder;
+alias ushort AVLNodeType;
+alias AVLTreeStruct*[][] AVLTreePtr;
+alias AVLCompareItemsProcPtr AVLCompareItemsUPP;
+alias AVLItemSizeProcPtr AVLItemSizeUPP;
+alias AVLDisposeItemProcPtr AVLDisposeItemUPP;
+alias AVLWalkProcPtr AVLWalkUPP;
+
+extern (C)
+{
+	alias short function (AVLTreePtr, void*, ushort, ushort, uint, int, void*) AVLWalkProcPtr;
+	alias uint function (AVLTreePtr, void*) AVLItemSizeProcPtr;
+	alias int function (AVLTreePtr, void*, void*, ushort) AVLCompareItemsProcPtr;
+	alias void function (AVLTreePtr, void*) AVLDisposeItemProcPtr;
+}
+
+enum
+{
+	kAVLPreOrder = 0,
+	kAVLInOrder = 1,
+	kAVLPostOrder = 2
+}
+
+enum
+{
+	kLeftToRight = 0,
+	kRightToLeft = 1
+}
+
+enum
+{
+	kAVLIsTree = 0,
+	kAVLIsLeftBranch = 1,
+	kAVLIsRightBranch = 2,
+	kAVLIsLeaf = 3,
+	kAVLNullNode = 4
+}
+
+enum
+{
+	errItemAlreadyInTree = -960,
+	errNotValidTree = -961,
+	errItemNotFoundInTree = -962,
+	errCanNotInsertWhileWalkProcInProgress = -963,
+	errTreeIsLocked = -964
+}
+
+struct AVLTreeStruct
+{
+	uint signature;
+	c_ulong[8] privateStuff;
+}
+
+extern (C)
+{
+	AVLCompareItemsUPP NewAVLCompareItemsUPP (AVLCompareItemsProcPtr userRoutine);
+	AVLItemSizeUPP NewAVLItemSizeUPP (AVLItemSizeProcPtr userRoutine);
+	AVLDisposeItemUPP NewAVLDisposeItemUPP (AVLDisposeItemProcPtr userRoutine);
+	AVLWalkUPP NewAVLWalkUPP (AVLWalkProcPtr userRoutine);
+	void DisposeAVLCompareItemsUPP (AVLCompareItemsUPP userUPP);
+	void DisposeAVLItemSizeUPP (AVLItemSizeUPP userUPP);
+	void DisposeAVLDisposeItemUPP (AVLDisposeItemUPP userUPP);
+	void DisposeAVLWalkUPP (AVLWalkUPP userUPP);
+	int InvokeAVLCompareItemsUPP (AVLTreePtr tree, void* i1, void* i2, ushort nd_typ, AVLCompareItemsUPP userUPP);
+	uint InvokeAVLItemSizeUPP (AVLTreePtr tree, void* itemPtr, AVLItemSizeUPP userUPP);
+	void InvokeAVLDisposeItemUPP (AVLTreePtr tree, void* dataP, AVLDisposeItemUPP userUPP);
+	short InvokeAVLWalkUPP (AVLTreePtr tree, void* dataPtr, ushort visitStage, ushort node, uint level, int balance, void* refCon, AVLWalkUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Aliases.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,125 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Aliases;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.UTCUtils;
+import dstep.objc.bridge.TypeEncoding;
+
+alias uint FSAliasInfoBitmap;
+alias AliasRecord* AliasPtr;
+alias AliasPtr* AliasHandle;
+alias FSAliasInfo* FSAliasInfoPtr;
+alias short AliasInfoType;
+
+extern (C)
+{
+	alias ubyte function (FSRef*, char*, char*) FSAliasFilterProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __rAliasType = getOSType!("alis");
+
+	}
+}
+
+enum
+{
+	kFSAliasInfoNone = 0x00000000,
+	kFSAliasInfoVolumeCreateDate = 0x00000001,
+	kFSAliasInfoTargetCreateDate = 0x00000002,
+	kFSAliasInfoFinderInfo = 0x00000004,
+	kFSAliasInfoIsDirectory = 0x00000008,
+	kFSAliasInfoIDs = 0x00000010,
+	kFSAliasInfoFSInfo = 0x00000020,
+	kFSAliasInfoVolumeFlags = 0x00000040
+}
+
+enum
+{
+	rAliasType = getOSType!("alis")
+}
+
+enum
+{
+	kARMMountVol = 0x00000001,
+	kARMNoUI = 0x00000002,
+	kARMMultVols = 0x00000008,
+	kARMSearch = 0x00000100,
+	kARMSearchMore = 0x00000200,
+	kARMSearchRelFirst = 0x00000400,
+	kARMTryFileIDFirst = 0x00000800
+}
+
+enum
+{
+	asiZoneName = -3,
+	asiServerName = -2,
+	asiVolumeName = -1,
+	asiAliasName = 0,
+	asiParentName = 1
+}
+
+enum
+{
+	kResolveAliasFileNoUI = 0x00000001,
+	kResolveAliasTryFileIDFirst = 0x00000002
+}
+
+struct AliasRecord
+{
+	char* hidden;
+}
+
+
+struct FSAliasInfo
+{
+	UTCDateTime volumeCreateDate;
+	UTCDateTime targetCreateDate;
+	uint fileType;
+	uint fileCreator;
+	uint parentDirID;
+	uint nodeID;
+	ushort filesystemID;
+	ushort signature;
+	ubyte volumeIsBootVolume;
+	ubyte volumeIsAutomounted;
+	ubyte volumeIsEjectable;
+	ubyte volumeHasPersistentFileIDs;
+	ubyte isDirectory;
+}
+
+extern (C)
+{
+	short FSNewAlias (FSRef* fromFile, FSRef* target, AliasHandle* inAlias);
+	short FSNewAliasMinimal (FSRef* target, AliasHandle* inAlias);
+	short FSIsAliasFile (FSRef* fileRef, char* aliasFileFlag, char* folderFlag);
+	short FSResolveAliasWithMountFlags (FSRef* fromFile, AliasHandle inAlias, FSRef* target, char* wasChanged, uint mountFlags);
+	short FSResolveAlias (FSRef* fromFile, AliasHandle alias_, FSRef* target, char* wasChanged);
+	short FSResolveAliasFileWithMountFlags (FSRef* theRef, ubyte resolveAliasChains, char* targetIsFolder, char* wasAliased, uint mountFlags);
+	short FSResolveAliasFile (FSRef* theRef, ubyte resolveAliasChains, char* targetIsFolder, char* wasAliased);
+	short FSFollowFinderAlias (FSRef* fromFile, AliasHandle alias_, ubyte logon, FSRef* target, char* wasChanged);
+	short FSUpdateAlias (FSRef* fromFile, FSRef* target, AliasHandle alias_, char* wasChanged);
+	short FSNewAliasUnicode (FSRef* fromFile, FSRef* targetParentRef, uint targetNameLength, wchar* targetName, AliasHandle* inAlias, char* isDirectory);
+	short FSNewAliasMinimalUnicode (FSRef* targetParentRef, uint targetNameLength, wchar* targetName, AliasHandle* inAlias, char* isDirectory);
+	int FSNewAliasFromPath (char* fromFilePath, char* targetPath, uint flags, AliasHandle* inAlias, char* isDirectory);
+	int FSMatchAliasBulk (FSRef* fromFile, uint rulesMask, AliasHandle inAlias, short* aliasCount, FSRef* aliasList, char* needsUpdate, FSAliasFilterProcPtr aliasFilter, void* yourDataPtr);
+	int FSCopyAliasInfo (AliasHandle inAlias, HFSUniStr255* targetName, HFSUniStr255* volumeName, CFStringRef* pathString, FSAliasInfoBitmap* whichInfo, FSAliasInfo* info);
+	int GetAliasSize (AliasHandle alias_);
+	uint GetAliasUserType (AliasHandle alias_);
+	void SetAliasUserType (AliasHandle alias_, uint userType);
+	int GetAliasSizeFromPtr (AliasRecord* alias_);
+	uint GetAliasUserTypeFromPtr (AliasRecord* alias_);
+	void SetAliasUserTypeWithPtr (AliasPtr alias_, uint userType);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/BackupCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,16 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.BackupCore;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFURL;
+
+extern (C)
+{
+	int CSBackupSetItemExcluded (CFURLRef item, ubyte exclude, ubyte excludeByPath);
+	ubyte CSBackupIsItemExcluded (CFURLRef item, char* excludeByPath);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/CarbonCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,62 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.CarbonCore;
+
+public:
+
+import dstep.coreservices.carboncore.AIFF;
+import dstep.coreservices.carboncore.AVLTree;
+import dstep.coreservices.carboncore.Aliases;
+import dstep.coreservices.carboncore.BackupCore;
+import dstep.coreservices.carboncore.CodeFragments;
+import dstep.coreservices.carboncore.Collections;
+import dstep.coreservices.carboncore.Components;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.DateTimeUtils;
+import dstep.coreservices.carboncore.Debugging;
+import dstep.coreservices.carboncore.DriverServices;
+import dstep.coreservices.carboncore.DriverSynchronization;
+import dstep.coreservices.carboncore.Endian;
+import dstep.coreservices.carboncore.FSEvents;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.Finder;
+import dstep.coreservices.carboncore.FixMath;
+import dstep.coreservices.carboncore.Folders;
+import dstep.coreservices.carboncore.Gestalt;
+import dstep.coreservices.carboncore.HFSVolumes;
+import dstep.coreservices.carboncore.IntlResources;
+import dstep.coreservices.carboncore.LowMem;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacLocales;
+import dstep.coreservices.carboncore.MacMemory;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MachineExceptions;
+import dstep.coreservices.carboncore.Math64;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.Multiprocessing;
+import dstep.coreservices.carboncore.MultiprocessingInfo;
+import dstep.coreservices.carboncore.NumberFormatting;
+import dstep.coreservices.carboncore.OSUtils;
+import dstep.coreservices.carboncore.PEFBinaryFormat;
+import dstep.coreservices.carboncore.PLStringFuncs;
+import dstep.coreservices.carboncore.Resources;
+import dstep.coreservices.carboncore.Script;
+import dstep.coreservices.carboncore.StringCompare;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.coreservices.carboncore.TextEncodingConverter;
+import dstep.coreservices.carboncore.TextEncodingPlugin;
+import dstep.coreservices.carboncore.TextUtils;
+import dstep.coreservices.carboncore.Threads;
+import dstep.coreservices.carboncore.Timer;
+import dstep.coreservices.carboncore.ToolUtils;
+import dstep.coreservices.carboncore.UTCUtils;
+import dstep.coreservices.carboncore.UnicodeConverter;
+import dstep.coreservices.carboncore.UnicodeUtilities;
+import dstep.coreservices.carboncore.fp;
+import dstep.corefoundation.CoreFoundation;
+//import dstep.fenv;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/CodeFragments.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,365 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.CodeFragments;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.Multiprocessing;
+import dstep.corefoundation.CFBundle;
+import dstep.internal.Version;
+import dstep.objc.bridge.Bridge;
+import dstep.objc.bridge.TypeEncoding;
+import dstep.objc.objc : id;
+
+static if (!D_LP64):
+align (2):
+	
+version (GNU)
+{
+	private
+	{
+		const __kPowerPCCFragArch = getOSType!("pwpc");
+		const __kMotorola68KCFragArch = getOSType!("m68k");
+		const __kCFragResourceType = getOSType!("cfrg");
+		const __kCFragLibraryFileType = getOSType!("shlb");
+		const __kCompiledCFragArch = getOSType!("none");
+	}
+}
+
+template CFragHasFileLocation (alias a)
+{
+	const CFragHasFileLocation = a == kDataForkCFragLocator || a == kResourceCFragLocator;
+}
+	
+struct CFragCFBundleLocator
+{
+	CFBundleRef fragmentBundle;
+	uint offset;
+	uint length;
+}
+
+struct OpaqueCFragClosureID;
+alias OpaqueCFragClosureID* CFragClosureID;
+
+struct OpaqueCFragConnectionID;
+alias OpaqueCFragConnectionID* CFragConnectionID;
+
+struct OpaqueCFragContainerID;
+alias OpaqueCFragContainerID* CFragContainerID;
+
+alias MPProcessID CFragContextID;
+alias CFragSystem7DiskFlatLocator CFragHFSDiskFlatLocator;
+alias CFragSystem7Locator CFragHFSLocator;
+alias CFragSystem7LocatorPtr CFragHFSLocatorPtr;
+alias CFragSystem7MemoryLocator CFragHFSMemoryLocator;
+alias CFragSystem7SegmentedLocator CFragHFSSegmentedLocator;
+alias CFragSystem7InitBlock CFragInitBlock;
+alias CFragSystem7InitBlockPtr CFragInitBlockPtr;
+
+struct CFragResource
+{
+	uint reservedA;
+	uint reservedB;
+	ushort reservedC;
+	ushort version_;
+	uint reservedD;
+	uint reservedE;
+	uint reservedF;
+	uint reservedG;
+	ushort reservedH;
+	ushort memberCount;
+	CFragResourceMember firstMember;
+}
+
+alias CFragResource* CFragResourcePtr;
+alias CFragResourcePtr* CFragResourceHandle;
+
+struct CFragResourceExtensionHeader
+{
+	ushort extensionKind;
+	ushort extensionSize;
+}
+
+alias CFragResourceExtensionHeader* CFragResourceExtensionHeaderPtr;
+
+struct CFragResourceMember
+{
+	CFragArchitecture architecture;
+	ushort reservedA;
+	ubyte reservedB;
+	ubyte updateLevel;
+	CFragVersionNumber currentVersion;
+	CFragVersionNumber oldDefVersion;
+	CFragUsage1Union uUsage1;
+	CFragUsage2Union uUsage2;
+	CFragUsage usage;
+	CFragLocatorKind where;
+	uint offset;
+	uint length;
+	CFragWhere1Union uWhere1;
+	CFragWhere2Union uWhere2;
+	ushort extensionCount;
+	ushort memberSize;
+	ubyte[16] name;
+}
+
+alias CFragResourceMember* CFragResourceMemberPtr;
+
+struct CFragResourceSearchExtension
+{
+	CFragResourceExtensionHeader header;
+	OSType libKind;
+	ubyte[1] qualifiers;
+}
+
+alias CFragResourceSearchExtension* CFragResourceSearchExtensionPtr;
+
+struct CFragSystem7DiskFlatLocator
+{
+	FSSpec* fileSpec;
+	uint offset;
+	uint length;
+}
+
+struct CFragSystem7InitBlock
+{
+	CFragContextID contextID;
+	CFragContextID closureID;
+	CFragConnectionID connectionID;
+	CFragSystem7Locator fragLocator;
+	StringPtr libName;
+	uint reservedA;
+}
+
+alias CFragSystem7InitBlock* CFragSystem7InitBlockPtr;
+
+struct CFragSystem7Locator
+{
+	int where;
+	
+	union
+	{
+		CFragSystem7DiskFlatLocator onDisk;
+		CFragSystem7MemoryLocator inMem;
+		CFragSystem7SegmentedLocator inSegs;
+		CFragCFBundleLocator inBundle;
+	}
+}
+
+alias CFragSystem7Locator* CFragSystem7LocatorPtr;
+
+struct CFragSystem7MemoryLocator
+{
+	LogicalAddress address;
+	uint length;
+	bool inPlace;
+	ubyte reservedA;
+	ushort reservedB;
+}
+
+struct CFragSystem7SegmentedLocator
+{
+	FSSpec* fileSpec;
+	OSType rsrcType;
+	short rsrcID;
+	ushort reservedA;
+}
+
+union CFragUsage1Union
+{
+	uint appStackSize;
+}
+
+union CFragUsage2Union
+{
+	short appSubdirID;
+	ushort libFlags;
+}
+
+union CFragWhere1Union
+{
+	uint spaceID;
+}
+
+union CFragWhere2Union
+{
+	ushort reserved;
+}
+
+alias CFragConnectionID ConnectionID;
+alias CFragSystem7DiskFlatLocator DiskFragment;
+alias CFragSystem7Locator FragmentLocator;
+alias CFragSystem7LocatorPtr FragmentLocatorPtr;
+alias CFragInitBlock InitBlock;
+alias CFragInitBlockPtr InitBlockPtr;
+alias CFragLoadOptions LoadFlags;
+alias CFragSystem7MemoryLocator MemFragment;
+alias CFragSystem7SegmentedLocator SegmentedFragment;
+alias CFragSymbolClass SymClass;
+
+alias OSType CFragArchitecture;
+enum : OSType
+{
+	kPowerPCCFragArch = getOSType!("pwpc"),
+	kMotorola68KCFragArch = getOSType!("m68k"),
+	kAnyCFragArch = 0x3F3F3F3F
+}
+
+enum
+{
+	kIsCompleteCFrag = 0,
+	kFirstCFragUpdate = 1
+}
+
+enum
+{
+	kCurrCFragResourceVersion = 1
+}
+
+enum
+{
+	kDefaultCFragNameLen = 16
+}
+
+alias CFragHasFileLocation IsFileLocation;
+
+enum
+{
+	kCFragGoesToEOF = 0
+}
+
+enum
+{
+	kCFragLibUsageMapPrivatelyMask = 0x0001
+}
+
+enum
+{
+	kCFragResourceSearchExtensionKind = 0x30EE
+}
+
+enum
+{
+	kCFragResourceType = getOSType!("cfrg"),
+	kCFragResourceID = 0,
+	kCFragLibraryFileType = getOSType!("shlb"),
+	kCFragAllFileTypes = 0xFFFFFFFF
+}
+
+static if (PPC)
+{
+	enum
+	{
+		kCompiledCFragArch = kPowerPCCFragArch
+	}
+}
+
+else static if (X86)
+{
+	enum
+	{
+		kCompiledCFragArch = getOSType!("none")
+	}
+}
+
+enum : OptionBits
+{
+	kReferenceCFrag = 0x0001,
+	kFindCFrag = 0x0002,
+	kPrivateCFragCopy = 0x0005
+}
+
+enum
+{
+	kLoadCFrag = kReferenceCFrag
+}
+
+enum
+{
+	kPowerPC = kPowerPCCFragArch,
+	kMotorola68K = kMotorola68KCFragArch
+}
+
+enum : ubyte
+{
+	kCodeCFragSymbol = 0,
+	kDataCFragSymbol = 1,
+	kTVectorCFragSymbol = 2,
+	kTOCCFragSymbol = 3,
+	kGlueCFragSymbol = 4
+}
+
+enum : ubyte
+{
+	kMemoryCFragLocator = 0,
+	kDataForkCFragLocator = 1,
+	kResourceCFragLocator = 2,
+	kNamedFragmentCFragLocator = 4,
+	kCFBundleCFragLocator = 5,
+	kCFBundlePreCFragLocator = 6
+}
+
+
+enum : ubyte
+{
+	kImportLibraryCFrag = 0,
+	kApplicationCFrag = 1,
+	kDropInAdditionCFrag = 2,
+	kStubLibraryCFrag = 3,
+	kWeakStubLibraryCFrag = 4
+}
+
+enum
+{
+	kUnresolvedCFragSymbolAddress = 0
+}
+
+
+enum
+{
+	kPowerPCArch = kPowerPCCFragArch,
+	kMotorola68KArch = kMotorola68KCFragArch,
+	kAnyArchType = kAnyCFragArch,
+	kNoLibName = 0,
+	kNoConnectionID = 0,
+	kLoadLib = kLoadCFrag,
+	kFindLib = kFindCFrag,
+	kNewCFragCopy = kPrivateCFragCopy,
+	kLoadNewCopy = kPrivateCFragCopy,
+	kUseInPlace = 0x80,
+	kCodeSym = kCodeCFragSymbol,
+	kDataSym = kDataCFragSymbol,
+	kTVectSym = kTVectorCFragSymbol,
+	kTOCSym = kTOCCFragSymbol,
+	kGlueSym = kGlueCFragSymbol,
+	kInMem = kMemoryCFragLocator,
+	kOnDiskFlat = kDataForkCFragLocator,
+	kOnDiskSegmented = kResourceCFragLocator,
+	kIsLib = kImportLibraryCFrag,
+	kIsApp = kApplicationCFrag,
+	kIsDropIn = kDropInAdditionCFrag,
+	kFullLib = kIsCompleteCFrag,
+	kUpdateLib = kFirstCFragUpdate,
+	kWholeFork = kCFragGoesToEOF,
+	kCFMRsrcType = kCFragResourceType,
+	kCFMRsrcID = kCFragResourceID,
+	kSHLBFileType = kCFragLibraryFileType,
+	kUnresolvedSymbolAddress = kUnresolvedCFragSymbolAddress
+}
+
+alias OptionBits CFragLoadOptions;
+alias ubyte CFragLocatorKind;
+alias ubyte CFragSymbolClass;
+alias ubyte CFragUsage;
+alias uint CFragVersionNumber;
+
+enum : uint
+{
+	kNullCFragVersion = 0,
+	kWildcardCFragVersion = 0xFFFFFFFF
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Collections.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,209 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Collections;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Types;
+import dstep.internal.Version;
+
+struct OpaqueCollection;
+alias OpaqueCollection* Collection;
+alias uint CollectionTag;
+alias CollectionFlattenProcPtr CollectionFlattenUPP;
+alias CollectionExceptionProcPtr CollectionExceptionUPP;
+
+extern (C)
+{
+	alias short function (Collection, short) CollectionExceptionProcPtr;
+	alias short function (int, void*, void*) CollectionFlattenProcPtr;
+}
+
+enum
+{
+	kCollectionDontWantTag = 0L,
+	kCollectionDontWantId = 0L,
+	kCollectionDontWantSize = 0L,
+	kCollectionDontWantAttributes = 0L,
+	kCollectionDontWantIndex = 0L,
+	kCollectionDontWantData = 0L
+}
+
+enum
+{
+	kCollectionNoAttributes = 0x00000000,
+	kCollectionAllAttributes = cast(c_long)0xFFFFFFFF,
+	kCollectionUserAttributes = 0x0000FFFF,
+	kCollectionDefaultAttributes = 0x40000000
+}
+
+enum
+{
+	kCollectionUser0Bit = 0,
+	kCollectionUser1Bit = 1,
+	kCollectionUser2Bit = 2,
+	kCollectionUser3Bit = 3,
+	kCollectionUser4Bit = 4,
+	kCollectionUser5Bit = 5,
+	kCollectionUser6Bit = 6,
+	kCollectionUser7Bit = 7,
+	kCollectionUser8Bit = 8,
+	kCollectionUser9Bit = 9,
+	kCollectionUser10Bit = 10,
+	kCollectionUser11Bit = 11,
+	kCollectionUser12Bit = 12,
+	kCollectionUser13Bit = 13,
+	kCollectionUser14Bit = 14,
+	kCollectionUser15Bit = 15,
+	kCollectionReserved0Bit = 16,
+	kCollectionReserved1Bit = 17,
+	kCollectionReserved2Bit = 18,
+	kCollectionReserved3Bit = 19,
+	kCollectionReserved4Bit = 20,
+	kCollectionReserved5Bit = 21,
+	kCollectionReserved6Bit = 22,
+	kCollectionReserved7Bit = 23,
+	kCollectionReserved8Bit = 24,
+	kCollectionReserved9Bit = 25,
+	kCollectionReserved10Bit = 26,
+	kCollectionReserved11Bit = 27,
+	kCollectionReserved12Bit = 28,
+	kCollectionReserved13Bit = 29,
+	kCollectionPersistenceBit = 30,
+	kCollectionLockBit = 31
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		kCollectionUser0Mask = 1L << kCollectionUser0Bit,
+		kCollectionUser1Mask = 1L << kCollectionUser1Bit,
+		kCollectionUser2Mask = 1L << kCollectionUser2Bit,
+		kCollectionUser3Mask = 1L << kCollectionUser3Bit,
+		kCollectionUser4Mask = 1L << kCollectionUser4Bit,
+		kCollectionUser5Mask = 1L << kCollectionUser5Bit,
+		kCollectionUser6Mask = 1L << kCollectionUser6Bit,
+		kCollectionUser7Mask = 1L << kCollectionUser7Bit,
+		kCollectionUser8Mask = 1L << kCollectionUser8Bit,
+		kCollectionUser9Mask = 1L << kCollectionUser9Bit,
+		kCollectionUser10Mask = 1L << kCollectionUser10Bit,
+		kCollectionUser11Mask = 1L << kCollectionUser11Bit,
+		kCollectionUser12Mask = 1L << kCollectionUser12Bit,
+		kCollectionUser13Mask = 1L << kCollectionUser13Bit,
+		kCollectionUser14Mask = 1L << kCollectionUser14Bit,
+		kCollectionUser15Mask = 1L << kCollectionUser15Bit,
+		kCollectionReserved0Mask = 1L << kCollectionReserved0Bit,
+		kCollectionReserved1Mask = 1L << kCollectionReserved1Bit,
+		kCollectionReserved2Mask = 1L << kCollectionReserved2Bit,
+		kCollectionReserved3Mask = 1L << kCollectionReserved3Bit,
+		kCollectionReserved4Mask = 1L << kCollectionReserved4Bit,
+		kCollectionReserved5Mask = 1L << kCollectionReserved5Bit,
+		kCollectionReserved6Mask = 1L << kCollectionReserved6Bit,
+		kCollectionReserved7Mask = 1L << kCollectionReserved7Bit,
+		kCollectionReserved8Mask = 1L << kCollectionReserved8Bit,
+		kCollectionReserved9Mask = 1L << kCollectionReserved9Bit,
+		kCollectionReserved10Mask = 1L << kCollectionReserved10Bit,
+		kCollectionReserved11Mask = 1L << kCollectionReserved11Bit,
+		kCollectionReserved12Mask = 1L << kCollectionReserved12Bit,
+		kCollectionReserved13Mask = 1L << kCollectionReserved13Bit,
+		kCollectionPersistenceMask = 1L << kCollectionPersistenceBit,
+		kCollectionLockMask = 1L << kCollectionLockBit
+	}
+}
+
+else
+{
+	enum
+	{
+		kCollectionUser0Mask = 1 << kCollectionUser0Bit,
+		kCollectionUser1Mask = 1 << kCollectionUser1Bit,
+		kCollectionUser2Mask = 1 << kCollectionUser2Bit,
+		kCollectionUser3Mask = 1 << kCollectionUser3Bit,
+		kCollectionUser4Mask = 1 << kCollectionUser4Bit,
+		kCollectionUser5Mask = 1 << kCollectionUser5Bit,
+		kCollectionUser6Mask = 1 << kCollectionUser6Bit,
+		kCollectionUser7Mask = 1 << kCollectionUser7Bit,
+		kCollectionUser8Mask = 1 << kCollectionUser8Bit,
+		kCollectionUser9Mask = 1 << kCollectionUser9Bit,
+		kCollectionUser10Mask = 1 << kCollectionUser10Bit,
+		kCollectionUser11Mask = 1 << kCollectionUser11Bit,
+		kCollectionUser12Mask = 1 << kCollectionUser12Bit,
+		kCollectionUser13Mask = 1 << kCollectionUser13Bit,
+		kCollectionUser14Mask = 1 << kCollectionUser14Bit,
+		kCollectionUser15Mask = 1 << kCollectionUser15Bit,
+		kCollectionReserved0Mask = 1 << kCollectionReserved0Bit,
+		kCollectionReserved1Mask = 1 << kCollectionReserved1Bit,
+		kCollectionReserved2Mask = 1 << kCollectionReserved2Bit,
+		kCollectionReserved3Mask = 1 << kCollectionReserved3Bit,
+		kCollectionReserved4Mask = 1 << kCollectionReserved4Bit,
+		kCollectionReserved5Mask = 1 << kCollectionReserved5Bit,
+		kCollectionReserved6Mask = 1 << kCollectionReserved6Bit,
+		kCollectionReserved7Mask = 1 << kCollectionReserved7Bit,
+		kCollectionReserved8Mask = 1 << kCollectionReserved8Bit,
+		kCollectionReserved9Mask = 1 << kCollectionReserved9Bit,
+		kCollectionReserved10Mask = 1 << kCollectionReserved10Bit,
+		kCollectionReserved11Mask = 1 << kCollectionReserved11Bit,
+		kCollectionReserved12Mask = 1 << kCollectionReserved12Bit,
+		kCollectionReserved13Mask = 1 << kCollectionReserved13Bit,
+		kCollectionPersistenceMask = 1 << kCollectionPersistenceBit,
+		kCollectionLockMask = 1 << kCollectionLockBit
+	}
+}
+
+extern (C)
+{
+	CollectionFlattenUPP NewCollectionFlattenUPP (CollectionFlattenProcPtr userRoutine);
+	CollectionExceptionUPP NewCollectionExceptionUPP (CollectionExceptionProcPtr userRoutine);
+	void DisposeCollectionFlattenUPP (CollectionFlattenUPP userUPP);
+	void DisposeCollectionExceptionUPP (CollectionExceptionUPP userUPP);
+	short InvokeCollectionFlattenUPP (int size, void* data, void* refCon, CollectionFlattenUPP userUPP);
+	short InvokeCollectionExceptionUPP (Collection c, short status, CollectionExceptionUPP userUPP);
+	Collection NewCollection ();
+	void DisposeCollection (Collection c);
+	Collection CloneCollection (Collection c);
+	int CountCollectionOwners (Collection c);
+	int RetainCollection (Collection c);
+	int ReleaseCollection (Collection c);
+	uint GetCollectionRetainCount (Collection c);
+	Collection CopyCollection (Collection srcCollection, Collection dstCollection);
+	int GetCollectionDefaultAttributes (Collection c);
+	void SetCollectionDefaultAttributes (Collection c, int whichAttributes, int newAttributes);
+	int CountCollectionItems (Collection c);
+	short AddCollectionItem (Collection c, uint tag, int id, int itemSize, void* itemData);
+	short GetCollectionItem (Collection c, uint tag, int id, SInt32* itemSize, void* itemData);
+	short RemoveCollectionItem (Collection c, uint tag, int id);
+	short SetCollectionItemInfo (Collection c, uint tag, int id, int whichAttributes, int newAttributes);
+	short GetCollectionItemInfo (Collection c, uint tag, int id, SInt32* itemIndex, SInt32* itemSize, SInt32* attributes);
+	short ReplaceIndexedCollectionItem (Collection c, int itemIndex, int itemSize, void* itemData);
+	short GetIndexedCollectionItem (Collection c, int itemIndex, SInt32* itemSize, void* itemData);
+	short RemoveIndexedCollectionItem (Collection c, int itemIndex);
+	short SetIndexedCollectionItemInfo (Collection c, int itemIndex, int whichAttributes, int newAttributes);
+	short GetIndexedCollectionItemInfo (Collection c, int itemIndex, CollectionTag* tag, SInt32* id, SInt32* itemSize, SInt32* attributes);
+	ubyte CollectionTagExists (Collection c, uint tag);
+	int CountCollectionTags (Collection c);
+	short GetIndexedCollectionTag (Collection c, int tagIndex, CollectionTag* tag);
+	int CountTaggedCollectionItems (Collection c, uint tag);
+	short GetTaggedCollectionItem (Collection c, uint tag, int whichItem, SInt32* itemSize, void* itemData);
+	short GetTaggedCollectionItemInfo (Collection c, uint tag, int whichItem, SInt32* id, SInt32* itemIndex, SInt32* itemSize, SInt32* attributes);
+	void PurgeCollection (Collection c, int whichAttributes, int matchingAttributes);
+	void PurgeCollectionTag (Collection c, uint tag);
+	void EmptyCollection (Collection c);
+	short FlattenCollection (Collection c, CollectionFlattenUPP flattenProc, void* refCon);
+	short FlattenPartialCollection (Collection c, CollectionFlattenUPP flattenProc, void* refCon, int whichAttributes, int matchingAttributes);
+	short UnflattenCollection (Collection c, CollectionFlattenUPP flattenProc, void* refCon);
+	CollectionExceptionUPP GetCollectionExceptionProc (Collection c);
+	void SetCollectionExceptionProc (Collection c, CollectionExceptionUPP exceptionProc);
+	Collection GetNewCollection (short collectionID);
+	short AddCollectionItemHdl (Collection aCollection, uint tag, int id, Handle itemData);
+	short GetCollectionItemHdl (Collection aCollection, uint tag, int id, Handle itemData);
+	short ReplaceIndexedCollectionItemHdl (Collection aCollection, int itemIndex, Handle itemData);
+	short GetIndexedCollectionItemHdl (Collection aCollection, int itemIndex, Handle itemData);
+	short FlattenCollectionToHdl (Collection aCollection, Handle flattened);
+	short UnflattenCollectionFromHdl (Collection aCollection, Handle flattened);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Components.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,374 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Components;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.Resources;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+
+alias ComponentResource* ComponentResourcePtr;
+alias ComponentResourcePtr* ComponentResourceHandle;
+alias ExtComponentResource* ExtComponentResourcePtr;
+alias ExtComponentResourcePtr* ExtComponentResourceHandle;
+alias ComponentRecord* Component;
+alias ComponentInstanceRecord* ComponentInstance;
+alias RegisteredComponentRecord* RegisteredComponentRecordPtr;
+alias RegisteredComponentInstanceRecord* RegisteredComponentInstanceRecordPtr;
+alias int ComponentResult;
+alias uint CSComponentsThreadMode;
+alias ComponentMPWorkFunctionHeaderRecord* ComponentMPWorkFunctionHeaderRecordPtr;
+alias ComponentMPWorkFunctionProcPtr ComponentMPWorkFunctionUPP;
+alias ComponentRoutineProcPtr ComponentRoutineUPP;
+alias GetMissingComponentResourceProcPtr GetMissingComponentResourceUPP;
+alias UniversalProcPtr ComponentFunctionUPP;
+
+extern (C)
+{
+	alias short function (Component, uint, short, void*, Handle*) GetMissingComponentResourceProcPtr;
+	alias int function (void*, ComponentMPWorkFunctionHeaderRecordPtr) ComponentMPWorkFunctionProcPtr;
+	alias int function (ComponentParameters*, Handle) ComponentRoutineProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kAppleManufacturer = getOSType!("appl");
+		const __kComponentResourceType = getOSType!("thng");
+		const __kComponentAliasResourceType = getOSType!("thga");
+
+	}
+}
+
+enum
+{
+	kAppleManufacturer = getOSType!("appl"),
+	kComponentResourceType = getOSType!("thng"),
+	kComponentAliasResourceType = getOSType!("thga")
+}
+
+enum
+{
+	kAnyComponentType = 0,
+	kAnyComponentSubType = 0,
+	kAnyComponentManufacturer = 0,
+	kAnyComponentFlagsMask = 0
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		cmpThreadSafe = 1L << 28,
+		cmpIsMissing = 1L << 29,
+		cmpWantsRegisterMessage = 1L << 31
+	}
+}
+
+else
+{
+	enum
+	{
+		cmpThreadSafe = 1 << 28,
+		cmpIsMissing = 1 << 29,
+		cmpWantsRegisterMessage = 1 << 31
+	}
+}
+
+enum
+{
+	kComponentOpenSelect = -1,
+	kComponentCloseSelect = -2,
+	kComponentCanDoSelect = -3,
+	kComponentVersionSelect = -4,
+	kComponentRegisterSelect = -5,
+	kComponentTargetSelect = -6,
+	kComponentUnregisterSelect = -7,
+	kComponentGetMPWorkFunctionSelect = -8,
+	kComponentExecuteWiredActionSelect = -9,
+	kComponentGetPublicResourceSelect = -10
+}
+
+enum
+{
+	componentDoAutoVersion = (1 << 0),
+	componentWantsUnregister = (1 << 1),
+	componentAutoVersionIncludeFlags = (1 << 2),
+	componentHasMultiplePlatforms = (1 << 3),
+	componentLoadResident = (1 << 4)
+}
+
+enum
+{
+	defaultComponentIdentical = 0,
+	defaultComponentAnyFlags = 1,
+	defaultComponentAnyManufacturer = 2,
+	defaultComponentAnySubType = 4,
+	defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
+	defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
+}
+
+enum
+{
+	registerComponentGlobal = 1,
+	registerComponentNoDuplicates = 2,
+	registerComponentAfterExisting = 4,
+	registerComponentAliasesOnly = 8
+}
+
+enum
+{
+	platform68k = 1,
+	platformPowerPC = 2,
+	platformInterpreted = 3,
+	platformWin32 = 4,
+	platformPowerPCNativeEntryPoint = 5,
+	platformIA32NativeEntryPoint = 6,
+	platformPowerPC64NativeEntryPoint = 7,
+	platformX86_64NativeEntryPoint = 8
+}
+
+enum
+{
+	platformIRIXmips = 1000,
+	platformSunOSsparc = 1100,
+	platformSunOSintel = 1101,
+	platformLinuxppc = 1200,
+	platformLinuxintel = 1201,
+	platformAIXppc = 1300,
+	platformNeXTIntel = 1400,
+	platformNeXTppc = 1401,
+	platformNeXTsparc = 1402,
+	platformNeXT68k = 1403,
+	platformMacOSx86 = 1500
+}
+
+enum
+{
+	mpWorkFlagDoWork = (1 << 0),
+	mpWorkFlagDoCompletion = (1 << 1),
+	mpWorkFlagCopyWorkBlock = (1 << 2),
+	mpWorkFlagDontBlock = (1 << 3),
+	mpWorkFlagGetProcessorCount = (1 << 4),
+	mpWorkFlagGetIsRunning = (1 << 6)
+}
+
+enum
+{
+	cmpAliasNoFlags = 0,
+	cmpAliasOnlyThisFile = 1
+}
+
+enum
+{
+	kCSAcceptAllComponentsMode = 0,
+	kCSAcceptThreadSafeComponentsOnlyMode = 1
+}
+
+enum
+{
+	uppComponentFunctionImplementedProcInfo = 0x000002F0,
+	uppGetComponentVersionProcInfo = 0x000000F0,
+	uppComponentSetTargetProcInfo = 0x000003F0,
+	uppCallComponentOpenProcInfo = 0x000003F0,
+	uppCallComponentCloseProcInfo = 0x000003F0,
+	uppCallComponentCanDoProcInfo = 0x000002F0,
+	uppCallComponentVersionProcInfo = 0x000000F0,
+	uppCallComponentRegisterProcInfo = 0x000000F0,
+	uppCallComponentTargetProcInfo = 0x000003F0,
+	uppCallComponentUnregisterProcInfo = 0x000000F0,
+	uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0,
+	uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
+}
+
+struct ComponentDescription
+{
+	uint componentType;
+	uint componentSubType;
+	uint componentManufacturer;
+	uint componentFlags;
+	uint componentFlagsMask;
+}
+
+
+struct ResourceSpec
+{
+	uint resType;
+	short resID;
+}
+
+
+struct ComponentResource
+{
+	ComponentDescription cd;
+	ResourceSpec component;
+	ResourceSpec componentName;
+	ResourceSpec componentInfo;
+	ResourceSpec componentIcon;
+}
+
+
+struct ComponentPlatformInfo
+{
+	int componentFlags;
+	ResourceSpec component;
+	short platformType;
+}
+
+
+struct ComponentResourceExtension
+{
+	int componentVersion;
+	int componentRegisterFlags;
+	short componentIconFamily;
+}
+
+
+struct ComponentPlatformInfoArray
+{
+	int count;
+	ComponentPlatformInfo* platformArray;
+}
+
+
+struct ExtComponentResource
+{
+	ComponentDescription cd;
+	ResourceSpec component;
+	ResourceSpec componentName;
+	ResourceSpec componentInfo;
+	ResourceSpec componentIcon;
+	int componentVersion;
+	int componentRegisterFlags;
+	short componentIconFamily;
+	int count;
+	ComponentPlatformInfo* platformArray;
+}
+
+
+struct ComponentAliasResource
+{
+	ComponentResource cr;
+	ComponentDescription aliasCD;
+}
+
+
+struct ComponentParameters
+{
+	ubyte flags;
+	ubyte paramSize;
+	short what;
+	uint padding;
+	long* params;
+}
+
+
+struct ComponentRecord
+{
+	long* data;
+}
+
+
+struct ComponentInstanceRecord
+{
+	long* data;
+}
+
+
+struct RegisteredComponentRecord
+{
+	long* data;
+}
+
+
+struct RegisteredComponentInstanceRecord
+{
+	long* data;
+}
+
+
+struct ComponentMPWorkFunctionHeaderRecord
+{
+	uint headerSize;
+	uint recordSize;
+	uint workFlags;
+	ushort processorCount;
+	ubyte unused;
+	ubyte isRunning;
+}
+
+extern (C)
+{
+	void CSSetComponentsThreadMode (uint mode);
+	uint CSGetComponentsThreadMode ();
+	ComponentFunctionUPP NewComponentFunctionUPP (ProcPtr userRoutine, uint procInfo);
+	void DisposeComponentFunctionUPP (ComponentFunctionUPP userUPP);
+	Component RegisterComponent (ComponentDescription* cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon);
+	Component RegisterComponentResource (ComponentResourceHandle cr, short global);
+	short UnregisterComponent (Component aComponent);
+	Component FindNextComponent (Component aComponent, ComponentDescription* looking);
+	int CountComponents (ComponentDescription* looking);
+	short GetComponentInfo (Component aComponent, ComponentDescription* cd, Handle componentName, Handle componentInfo, Handle componentIcon);
+	int GetComponentListModSeed ();
+	int GetComponentTypeModSeed (uint componentType);
+	short OpenAComponent (Component aComponent, ComponentInstance* ci);
+	ComponentInstance OpenComponent (Component aComponent);
+	short CloseComponent (ComponentInstance aComponentInstance);
+	short GetComponentInstanceError (ComponentInstance aComponentInstance);
+	Component ResolveComponentAlias (Component aComponent);
+	short GetComponentPublicResource (Component aComponent, uint resourceType, short resourceID, Handle* theResource);
+	short GetComponentPublicResourceList (uint resourceType, short resourceID, int flags, ComponentDescription* cd, GetMissingComponentResourceUPP missingProc, void* refCon, void* atomContainerPtr);
+	short GetComponentPublicIndString (Component aComponent, ubyte[256] theString, short strListID, short index);
+	void SetComponentInstanceError (ComponentInstance aComponentInstance, short theError);
+	int GetComponentRefcon (Component aComponent);
+	void SetComponentRefcon (Component aComponent, int theRefcon);
+	short OpenComponentResFile (Component aComponent);
+	short OpenAComponentResFile (Component aComponent, ResFileRefNum* resRef);
+	short CloseComponentResFile (short refnum);
+	short GetComponentResource (Component aComponent, uint resType, short resID, Handle* theResource);
+	short GetComponentIndString (Component aComponent, ubyte[256] theString, short strListID, short index);
+	Handle GetComponentInstanceStorage (ComponentInstance aComponentInstance);
+	void SetComponentInstanceStorage (ComponentInstance aComponentInstance, Handle theStorage);
+	int CountComponentInstances (Component aComponent);
+	int CallComponentFunction (ComponentParameters* params, ComponentFunctionUPP func);
+	int CallComponentFunctionWithStorage (Handle storage, ComponentParameters* params, ComponentFunctionUPP func);
+	int CallComponentFunctionWithStorageProcInfo (Handle storage, ComponentParameters* params, ProcPtr func, uint funcProcInfo);
+	int DelegateComponentCall (ComponentParameters* originalParams, ComponentInstance ci);
+	short SetDefaultComponent (Component aComponent, short flags);
+	ComponentInstance OpenDefaultComponent (uint componentType, uint componentSubType);
+	short OpenADefaultComponent (uint componentType, uint componentSubType, ComponentInstance* ci);
+	Component CaptureComponent (Component capturedComponent, Component capturingComponent);
+	short UncaptureComponent (Component aComponent);
+	int RegisterComponentResourceFile (short resRefNum, short global);
+	short RegisterComponentFileRef (FSRef* ref_, short global);
+	short RegisterComponentFileRefEntries (FSRef* ref_, short global, ComponentDescription* toRegister, uint registerCount);
+	int CallComponentOpen (ComponentInstance ci, ComponentInstance self);
+	int CallComponentClose (ComponentInstance ci, ComponentInstance self);
+	int CallComponentCanDo (ComponentInstance ci, short ftnNumber);
+	int CallComponentVersion (ComponentInstance ci);
+	int CallComponentRegister (ComponentInstance ci);
+	int CallComponentTarget (ComponentInstance ci, ComponentInstance target);
+	int CallComponentUnregister (ComponentInstance ci);
+	int CallComponentGetMPWorkFunction (ComponentInstance ci, ComponentMPWorkFunctionUPP* workFunction, void** refCon);
+	int CallComponentGetPublicResource (ComponentInstance ci, uint resourceType, short resourceID, Handle* resource);
+	int CallComponentDispatch (ComponentParameters* cp);
+	ComponentMPWorkFunctionUPP NewComponentMPWorkFunctionUPP (ComponentMPWorkFunctionProcPtr userRoutine);
+	ComponentRoutineUPP NewComponentRoutineUPP (ComponentRoutineProcPtr userRoutine);
+	GetMissingComponentResourceUPP NewGetMissingComponentResourceUPP (GetMissingComponentResourceProcPtr userRoutine);
+	void DisposeComponentMPWorkFunctionUPP (ComponentMPWorkFunctionUPP userUPP);
+	void DisposeComponentRoutineUPP (ComponentRoutineUPP userUPP);
+	void DisposeGetMissingComponentResourceUPP (GetMissingComponentResourceUPP userUPP);
+	int InvokeComponentMPWorkFunctionUPP (void* globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header, ComponentMPWorkFunctionUPP userUPP);
+	int InvokeComponentRoutineUPP (ComponentParameters* cp, Handle componentStorage, ComponentRoutineUPP userUPP);
+	short InvokeGetMissingComponentResourceUPP (Component c, uint resType, short resID, void* refCon, Handle* resource, GetMissingComponentResourceUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/ConditionalMacros.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,11 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.ConditionalMacros;
+
+//import dstep.AvailabilityMacros;
+//import dstep.TargetConditionals;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/DateTimeUtils.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,141 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.DateTimeUtils;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.UTCUtils;
+import dstep.corefoundation.CFDate;
+
+alias short ToggleResults;
+alias byte LongDateField;
+alias byte DateForm;
+alias short StringToDateStatus;
+alias short String2DateStatus;
+alias DateCacheRecord* DateCachePtr;
+alias long LongDateTime;
+alias byte DateDelta;
+
+enum
+{
+	toggleUndefined = 0,
+	toggleOK = 1,
+	toggleBadField = 2,
+	toggleBadDelta = 3,
+	toggleBadChar = 4,
+	toggleUnknown = 5,
+	toggleBadNum = 6,
+	toggleOutOfRange = 7,
+	toggleErr3 = 7,
+	toggleErr4 = 8,
+	toggleErr5 = 9
+}
+
+enum
+{
+	smallDateBit = 31,
+	togChar12HourBit = 30,
+	togCharZCycleBit = 29,
+	togDelta12HourBit = 28,
+	genCdevRangeBit = 27,
+	validDateFields = -1,
+	maxDateField = 10
+}
+
+enum
+{
+	eraMask = 0x0001,
+	yearMask = 0x0002,
+	monthMask = 0x0004,
+	dayMask = 0x0008,
+	hourMask = 0x0010,
+	minuteMask = 0x0020,
+	secondMask = 0x0040,
+	dayOfWeekMask = 0x0080,
+	dayOfYearMask = 0x0100,
+	weekOfYearMask = 0x0200,
+	pmMask = 0x0400,
+	dateStdMask = 0x007F
+}
+
+enum
+{
+	eraField = 0,
+	yearField = 1,
+	monthField = 2,
+	dayField = 3,
+	hourField = 4,
+	minuteField = 5,
+	secondField = 6,
+	dayOfWeekField = 7,
+	dayOfYearField = 8,
+	weekOfYearField = 9,
+	pmField = 10,
+	res1Field = 11,
+	res2Field = 12,
+	res3Field = 13
+}
+
+enum
+{
+	shortDate = 0,
+	longDate = 1,
+	abbrevDate = 2
+}
+
+enum
+{
+	fatalDateTime = 0x8000,
+	longDateFound = 1,
+	leftOverChars = 2,
+	sepNotIntlSep = 4,
+	fieldOrderNotIntl = 8,
+	extraneousStrings = 16,
+	tooManySeps = 32,
+	sepNotConsistent = 64,
+	tokenErr = 0x8100,
+	cantReadUtilities = 0x8200,
+	dateTimeNotFound = 0x8400,
+	dateTimeInvalid = 0x8800
+}
+
+struct DateCacheRecord
+{
+	short* hidden;
+}
+
+
+struct DateTimeRec
+{
+	short year;
+	short month;
+	short day;
+	short hour;
+	short minute;
+	short second;
+	short dayOfWeek;
+}
+
+
+struct TogglePB
+{
+	int togFlags;
+	uint amChars;
+	uint pmChars;
+	long* reserved;
+}
+
+extern (C)
+{
+	int UCConvertUTCDateTimeToCFAbsoluteTime (UTCDateTime* iUTCDate, CFAbsoluteTime* oCFTime);
+	int UCConvertSecondsToCFAbsoluteTime (uint iSeconds, CFAbsoluteTime* oCFTime);
+	int UCConvertLongDateTimeToCFAbsoluteTime (long iLongTime, CFAbsoluteTime* oCFTime);
+	int UCConvertCFAbsoluteTimeToUTCDateTime (double iCFTime, UTCDateTime* oUTCDate);
+	int UCConvertCFAbsoluteTimeToSeconds (double iCFTime, UInt32* oSeconds);
+	int UCConvertCFAbsoluteTimeToLongDateTime (double iCFTime, LongDateTime* oLongDate);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Debugging.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,68 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Debugging;
+
+//import dstep.AssertMacros;
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+
+alias DebugComponentCallbackProcPtr DebugComponentCallbackUPP;
+alias DebugAssertOutputHandlerProcPtr DebugAssertOutputHandlerUPP;
+
+extern (C)
+{
+	alias void function (uint, uint, char*, char*, char*, char*, int, void*, char*) DebugAssertOutputHandlerProcPtr;
+	alias void function (int, uint, char*) DebugComponentCallbackProcPtr;
+}
+
+enum
+{
+	kBlessedBusErrorBait = 0x68F168F1
+}
+
+enum
+{
+	k68kInterruptLevelMask = 0x00000007,
+	kInVBLTaskMask = 0x00000010,
+	kInDeferredTaskMask = 0x00000020,
+	kInSecondaryIntHandlerMask = 0x00000040,
+	kInNestedInterruptMask = 0x00000080
+}
+
+enum
+{
+	kComponentDebugOption = 0
+}
+
+enum
+{
+	kGetDebugOption = 1,
+	kSetDebugOption = 2
+}
+
+extern (C)
+{
+	void DebugAssert (uint componentSignature, uint options, char* assertionString, char* exceptionLabelString, char* errorString, char* fileName, int lineNumber, void* value);
+	uint TaskLevel ();
+	int NewDebugComponent (uint componentSignature, char* componentName, DebugComponentCallbackUPP componentCallback);
+	int NewDebugOption (uint componentSignature, int optionSelectorNum, char* optionName);
+	int DisposeDebugComponent (uint componentSignature);
+	int GetDebugComponentInfo (uint itemIndex, OSType* componentSignature, ubyte[256] componentName);
+	int GetDebugOptionInfo (uint itemIndex, uint componentSignature, SInt32* optionSelectorNum, ubyte[256] optionName, char* optionSetting);
+	int SetDebugOptionValue (uint componentSignature, int optionSelectorNum, ubyte newOptionSetting);
+	void InstallDebugAssertOutputHandler (DebugAssertOutputHandlerUPP handler);
+	char* GetMacOSStatusErrorString (int err);
+	char* GetMacOSStatusCommentString (int err);
+	DebugComponentCallbackUPP NewDebugComponentCallbackUPP (DebugComponentCallbackProcPtr userRoutine);
+	DebugAssertOutputHandlerUPP NewDebugAssertOutputHandlerUPP (DebugAssertOutputHandlerProcPtr userRoutine);
+	void DisposeDebugComponentCallbackUPP (DebugComponentCallbackUPP userUPP);
+	void DisposeDebugAssertOutputHandlerUPP (DebugAssertOutputHandlerUPP userUPP);
+	void InvokeDebugComponentCallbackUPP (int optionSelectorNum, uint command, char* optionSetting, DebugComponentCallbackUPP userUPP);
+	void InvokeDebugAssertOutputHandlerUPP (uint componentSignature, uint options, char* assertionString, char* exceptionLabelString, char* errorString, char* fileName, int lineNumber, void* value, char* outputMsg, DebugAssertOutputHandlerUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/DriverServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,47 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.DriverServices;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.DriverSynchronization;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MachineExceptions;
+
+alias UnsignedWide Nanoseconds;
+
+enum
+{
+	durationMicrosecond = -1L,
+	durationMillisecond = 1L,
+	durationSecond = 1000L,
+	durationMinute = 60000L,
+	durationHour = 3600000L,
+	durationDay = 86400000L,
+	durationNoWait = 0L,
+	durationForever = 0x7FFFFFFF
+}
+
+extern (C)
+{
+	AbsoluteTime UpTime ();
+	Nanoseconds AbsoluteToNanoseconds (AbsoluteTime absoluteTime);
+	int AbsoluteToDuration (AbsoluteTime absoluteTime);
+	AbsoluteTime NanosecondsToAbsolute (Nanoseconds nanoseconds);
+	AbsoluteTime DurationToAbsolute (int duration);
+	AbsoluteTime AddAbsoluteToAbsolute (AbsoluteTime absoluteTime1, AbsoluteTime absoluteTime2);
+	AbsoluteTime SubAbsoluteFromAbsolute (AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
+	AbsoluteTime AddNanosecondsToAbsolute (Nanoseconds nanoseconds, AbsoluteTime absoluteTime);
+	AbsoluteTime AddDurationToAbsolute (int duration, AbsoluteTime absoluteTime);
+	AbsoluteTime SubNanosecondsFromAbsolute (Nanoseconds nanoseconds, AbsoluteTime absoluteTime);
+	AbsoluteTime SubDurationFromAbsolute (int duration, AbsoluteTime absoluteTime);
+	Nanoseconds AbsoluteDeltaToNanoseconds (AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
+	int AbsoluteDeltaToDuration (AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
+	Nanoseconds DurationToNanoseconds (int theDuration);
+	int NanosecondsToDuration (Nanoseconds theNanoseconds);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/DriverSynchronization.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,36 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.DriverSynchronization;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+extern (C)
+{
+	ubyte CompareAndSwap (uint oldValue, uint newValue, UInt32* address);
+	ubyte TestAndClear (uint bit, char* address);
+	ubyte TestAndSet (uint bit, char* address);
+	byte IncrementAtomic8 (char* address);
+	byte DecrementAtomic8 (char* address);
+	byte AddAtomic8 (int amount, char* address);
+	ubyte BitAndAtomic8 (uint mask, char* address);
+	ubyte BitOrAtomic8 (uint mask, char* address);
+	ubyte BitXorAtomic8 (uint mask, char* address);
+	short IncrementAtomic16 (SInt16* address);
+	short DecrementAtomic16 (SInt16* address);
+	short AddAtomic16 (int amount, SInt16* address);
+	ushort BitAndAtomic16 (uint mask, UInt16* address);
+	ushort BitOrAtomic16 (uint mask, UInt16* address);
+	ushort BitXorAtomic16 (uint mask, UInt16* address);
+	int IncrementAtomic (SInt32* address);
+	int DecrementAtomic (SInt32* address);
+	int AddAtomic (int amount, SInt32* address);
+	uint BitAndAtomic (uint mask, UInt32* address);
+	uint BitOrAtomic (uint mask, UInt32* address);
+	uint BitXorAtomic (uint mask, UInt32* address);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Endian.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,84 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Endian;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+//import dstep.libkern.OSByteOrder;
+import dstep.objc.bridge.TypeEncoding;
+
+
+extern (C)
+{
+	alias int function (uint, uint, short, void*, uint, ubyte, void*) CoreEndianFlipProc;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kCoreEndianResourceManagerDomain = getOSType!("rsrc");
+		const __kCoreEndianAppleEventManagerDomain = getOSType!("aevt");
+
+	}
+}
+
+enum
+{
+	kCoreEndianResourceManagerDomain = getOSType!("rsrc"),
+	kCoreEndianAppleEventManagerDomain = getOSType!("aevt")
+}
+
+struct BigEndianLong
+{
+	int bigEndianValue;
+}
+
+
+struct BigEndianUnsignedLong
+{
+	uint bigEndianValue;
+}
+
+
+struct BigEndianShort
+{
+	short bigEndianValue;
+}
+
+
+struct BigEndianUnsignedShort
+{
+	ushort bigEndianValue;
+}
+
+
+struct BigEndianFixed
+{
+	int bigEndianValue;
+}
+
+
+struct BigEndianUnsignedFixed
+{
+	uint bigEndianValue;
+}
+
+
+struct BigEndianOSType
+{
+	uint bigEndianValue;
+}
+
+extern (C)
+{
+	int CoreEndianInstallFlipper (uint dataDomain, uint dataType, CoreEndianFlipProc proc, void* refcon);
+	int CoreEndianGetFlipper (uint dataDomain, uint dataType, CoreEndianFlipProc* proc, void** refcon);
+	int CoreEndianFlipData (uint dataDomain, uint dataType, short id, void* data, uint dataLen, ubyte currentlyNative);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/FSEvents.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,86 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.FSEvents;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFUUID;
+//import dstep.sys.types;
+
+struct __FSEventStream;
+
+alias uint FSEventStreamCreateFlags;
+alias uint FSEventStreamEventFlags;
+alias ulong FSEventStreamEventId;
+alias __FSEventStream* FSEventStreamRef;
+alias __FSEventStream* ConstFSEventStreamRef;
+
+extern (C)
+{
+	alias void function (ConstFSEventStreamRef, void*, uint, void*, FSEventStreamEventFlags*, FSEventStreamEventId*) FSEventStreamCallback;
+}
+
+enum
+{
+	kFSEventStreamCreateFlagNone = 0x00000000,
+	kFSEventStreamCreateFlagUseCFTypes = 0x00000001,
+	kFSEventStreamCreateFlagNoDefer = 0x00000002,
+	kFSEventStreamCreateFlagWatchRoot = 0x00000004
+}
+
+enum
+{
+	kFSEventStreamEventFlagNone = 0x00000000,
+	kFSEventStreamEventFlagMustScanSubDirs = 0x00000001,
+	kFSEventStreamEventFlagUserDropped = 0x00000002,
+	kFSEventStreamEventFlagKernelDropped = 0x00000004,
+	kFSEventStreamEventFlagEventIdsWrapped = 0x00000008,
+	kFSEventStreamEventFlagHistoryDone = 0x00000010,
+	kFSEventStreamEventFlagRootChanged = 0x00000020,
+	kFSEventStreamEventFlagMount = 0x00000040,
+	kFSEventStreamEventFlagUnmount = 0x00000080
+}
+
+enum : ulong
+{
+	kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFUL
+}
+
+struct FSEventStreamContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+}
+
+extern (C)
+{
+	FSEventStreamRef FSEventStreamCreate (CFAllocatorRef allocator, FSEventStreamCallback callback, FSEventStreamContext* context, CFArrayRef pathsToWatch, ulong sinceWhen, double latency, uint flags);
+	FSEventStreamRef FSEventStreamCreateRelativeToDevice (CFAllocatorRef allocator, FSEventStreamCallback callback, FSEventStreamContext* context, int deviceToWatch, CFArrayRef pathsToWatchRelativeToDevice, ulong sinceWhen, double latency, uint flags);
+	ulong FSEventStreamGetLatestEventId (ConstFSEventStreamRef streamRef);
+	int FSEventStreamGetDeviceBeingWatched (ConstFSEventStreamRef streamRef);
+	CFArrayRef FSEventStreamCopyPathsBeingWatched (ConstFSEventStreamRef streamRef);
+	ulong FSEventsGetCurrentEventId ();
+	CFUUIDRef FSEventsCopyUUIDForDevice (int dev);
+	ulong FSEventsGetLastEventIdForDeviceBeforeTime (int dev, double time);
+	ubyte FSEventsPurgeEventsForDeviceUpToEventId (int dev, ulong eventId);
+	void FSEventStreamRetain (FSEventStreamRef streamRef);
+	void FSEventStreamRelease (FSEventStreamRef streamRef);
+	void FSEventStreamScheduleWithRunLoop (FSEventStreamRef streamRef, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void FSEventStreamUnscheduleFromRunLoop (FSEventStreamRef streamRef, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void FSEventStreamInvalidate (FSEventStreamRef streamRef);
+	ubyte FSEventStreamStart (FSEventStreamRef streamRef);
+	ulong FSEventStreamFlushAsync (FSEventStreamRef streamRef);
+	void FSEventStreamFlushSync (FSEventStreamRef streamRef);
+	void FSEventStreamStop (FSEventStreamRef streamRef);
+	void FSEventStreamShow (ConstFSEventStreamRef streamRef);
+	CFStringRef FSEventStreamCopyDescription (ConstFSEventStreamRef streamRef);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Files.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,1279 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Files;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Finder;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.OSUtils;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.coreservices.carboncore.UTCUtils;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFURL;
+import dstep.corefoundation.CFUUID;
+import dstep.diskarbitration.DADisk;
+import dstep.objc.bridge.TypeEncoding;
+import dstep.internal.Types;
+/*import dstep.sys.acl;
+import dstep.sys.fcntl;
+import dstep.sys.types;*/
+
+
+struct __FSFileOperation;
+struct __FSFileSecurity;
+struct OpaqueFSIterator;
+struct OpaqueFNSubscriptionRef;
+struct OpaqueFSVolumeOperation;
+struct _acl;
+
+alias _acl* acl_t;
+alias int pid_t;
+alias HFSUniStr255* ConstHFSUniStr255Param;
+alias short FSVolumeRefNum;
+alias int FSIORefNum;
+alias FSRef* FSRefPtr;
+alias __FSFileSecurity* FSFileSecurityRef;
+alias FSSpec* FSSpecPtr;
+alias FSSpecPtr* FSSpecHandle;
+alias FSSpecPtr FSSpecArrayPtr;
+alias FSSpec* ConstFSSpecPtr;
+alias void* ParmBlkPtr;
+alias IOCompletionProcPtr IOCompletionUPP;
+alias uint FSCatalogInfoBitmap;
+alias FSCatalogInfo* FSCatalogInfoPtr;
+alias FSRefParam* FSRefParamPtr;
+alias FSRefForkIOParam* FSRefForkIOParamPtr;
+alias OpaqueFSIterator* FSIterator;
+alias uint FSIteratorFlags;
+alias FSSearchParams* FSSearchParamsPtr;
+alias FSCatalogBulkParam* FSCatalogBulkParamPtr;
+alias ushort FSAllocationFlags;
+alias FSForkIOParam* FSForkIOParamPtr;
+alias FSForkInfo* FSForkInfoPtr;
+alias FSForkCBInfoParam* FSForkCBInfoParamPtr;
+alias FSRangeLockParam* FSRangeLockParamPtr;
+alias uint FSVolumeInfoBitmap;
+alias FSVolumeInfo* FSVolumeInfoPtr;
+alias FSVolumeInfoParam* FSVolumeInfoParamPtr;
+alias uint VolumeType;
+alias VolMountInfoHeader* VolMountInfoPtr;
+alias VolumeMountInfoHeader* VolumeMountInfoHeaderPtr;
+alias AFPVolMountInfo* AFPVolMountInfoPtr;
+alias AFPXVolMountInfo* AFPXVolMountInfoPtr;
+alias uint FNMessage;
+alias OpaqueFNSubscriptionRef* FNSubscriptionRef;
+alias FNSubscriptionProcPtr FNSubscriptionUPP;
+alias uint FSMountStatus;
+alias uint FSEjectStatus;
+alias uint FSUnmountStatus;
+alias OpaqueFSVolumeOperation* FSVolumeOperation;
+alias FSVolumeMountProcPtr FSVolumeMountUPP;
+alias FSVolumeUnmountProcPtr FSVolumeUnmountUPP;
+alias FSVolumeEjectProcPtr FSVolumeEjectUPP;
+alias __FSFileOperation* FSFileOperationRef;
+alias uint FSFileOperationStage;
+
+extern (C)
+{
+	alias void function (ParmBlkPtr) IOCompletionProcPtr;
+	alias void function (FSFileOperationRef, FSRef*, uint, int, CFDictionaryRef, void*) FSFileOperationStatusProcPtr;
+	alias void function (uint, uint, void*, FNSubscriptionRef) FNSubscriptionProcPtr;
+	alias void function (FSFileOperationRef, char*, uint, int, CFDictionaryRef, void*) FSPathFileOperationStatusProcPtr;
+	alias void function (FSVolumeOperation, void*, int, short, int) FSVolumeUnmountProcPtr;
+	alias void function (FSVolumeOperation, void*, int, short, int) FSVolumeEjectProcPtr;
+	alias void function (FSVolumeOperation, void*, int, short) FSVolumeMountProcPtr;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kFSOperationTotalBytesKey;
+		const CFStringRef kFSOperationBytesCompleteKey;
+		const CFStringRef kFSOperationBytesRemainingKey;
+		const CFStringRef kFSOperationTotalObjectsKey;
+		const CFStringRef kFSOperationObjectsCompleteKey;
+		const CFStringRef kFSOperationObjectsRemainingKey;
+		const CFStringRef kFSOperationTotalUserVisibleObjectsKey;
+		const CFStringRef kFSOperationUserVisibleObjectsCompleteKey;
+		const CFStringRef kFSOperationUserVisibleObjectsRemainingKey;
+		const CFStringRef kFSOperationThroughputKey;
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __AppleShareMediaType = getOSType!("afpm");
+
+	}
+}
+
+enum
+{
+	fsCurPerm = 0x00,
+	fsRdPerm = 0x01,
+	fsWrPerm = 0x02,
+	fsRdWrPerm = 0x03,
+	fsRdWrShPerm = 0x04
+}
+
+enum
+{
+	fsRdAccessPerm = 0x01,
+	fsWrAccessPerm = 0x02,
+	fsRdDenyPerm = 0x10,
+	fsWrDenyPerm = 0x20
+}
+
+enum
+{
+	fsRtParID = 1,
+	fsRtDirID = 2
+}
+
+enum
+{
+	fsAtMark = 0,
+	fsFromStart = 1,
+	fsFromLEOF = 2,
+	fsFromMark = 3
+}
+
+enum
+{
+	kFSAllowConcurrentAsyncIOBit = 3,
+	kFSAllowConcurrentAsyncIOMask = 0x0008,
+	kFSPleaseCacheBit = 4,
+	kFSPleaseCacheMask = 0x0010,
+	kFSNoCacheBit = 5,
+	kFSNoCacheMask = 0x0020,
+	kFSRdVerifyBit = 6,
+	kFSRdVerifyMask = 0x0040,
+	kFSForceReadBit = 6,
+	kFSForceReadMask = 0x0040,
+	kFSNewLineBit = 7,
+	kFSNewLineMask = 0x0080,
+	kFSNewLineCharMask = 0xFF00
+}
+
+enum
+{
+	fsSBPartialName = 0x01,
+	fsSBFullName = 0x02,
+	fsSBFlAttrib = 0x04,
+	fsSBFlFndrInfo = 0x08,
+	fsSBFlLgLen = 0x20,
+	fsSBFlPyLen = 0x40,
+	fsSBFlRLgLen = 0x80,
+	fsSBFlRPyLen = 0x0100,
+	fsSBFlCrDat = 0x0200,
+	fsSBFlMdDat = 0x0400,
+	fsSBFlBkDat = 0x0800,
+	fsSBFlXFndrInfo = 0x1000,
+	fsSBFlParID = 0x2000,
+	fsSBNegate = 0x4000,
+	fsSBDrUsrWds = 0x08,
+	fsSBDrNmFls = 0x10,
+	fsSBDrCrDat = 0x0200,
+	fsSBDrMdDat = 0x0400,
+	fsSBDrBkDat = 0x0800,
+	fsSBDrFndrInfo = 0x1000,
+	fsSBDrParID = 0x2000,
+	fsSBNodeID = 0x8000,
+	fsSBAttributeModDate = 0x00010000,
+	fsSBAccessDate = 0x00020000,
+	fsSBPermissions = 0x00040000,
+	fsSBSkipPackageContents = 0x00080000,
+	fsSBSkipHiddenItems = 0x00100000,
+	fsSBUserID = 0x00200000,
+	fsSBGroupID = 0x00400000
+}
+
+enum
+{
+	fsSBPartialNameBit = 0,
+	fsSBFullNameBit = 1,
+	fsSBFlAttribBit = 2,
+	fsSBFlFndrInfoBit = 3,
+	fsSBFlLgLenBit = 5,
+	fsSBFlPyLenBit = 6,
+	fsSBFlRLgLenBit = 7,
+	fsSBFlRPyLenBit = 8,
+	fsSBFlCrDatBit = 9,
+	fsSBFlMdDatBit = 10,
+	fsSBFlBkDatBit = 11,
+	fsSBFlXFndrInfoBit = 12,
+	fsSBFlParIDBit = 13,
+	fsSBNegateBit = 14,
+	fsSBDrUsrWdsBit = 3,
+	fsSBDrNmFlsBit = 4,
+	fsSBDrCrDatBit = 9,
+	fsSBDrMdDatBit = 10,
+	fsSBDrBkDatBit = 11,
+	fsSBDrFndrInfoBit = 12,
+	fsSBDrParIDBit = 13,
+	fsSBNodeIDBit = 15,
+	fsSBAttributeModDateBit = 16,
+	fsSBAccessDateBit = 17,
+	fsSBPermissionsBit = 18,
+	fsSBSkipPackageContentsBit = 19,
+	fsSBSkipHiddenItemsBit = 20,
+	fsSBUserIDBit = 21,
+	fsSBGroupIDBit = 22
+}
+
+enum
+{
+	bLimitFCBs = 31,
+	bLocalWList = 30,
+	bNoMiniFndr = 29,
+	bNoVNEdit = 28,
+	bNoLclSync = 27,
+	bTrshOffLine = 26,
+	bNoSwitchTo = 25,
+	bNoDeskItems = 20,
+	bNoBootBlks = 19,
+	bAccessCntl = 18,
+	bNoSysDir = 17,
+	bHasExtFSVol = 16,
+	bHasOpenDeny = 15,
+	bHasCopyFile = 14,
+	bHasMoveRename = 13,
+	bHasDesktopMgr = 12,
+	bHasShortName = 11,
+	bHasFolderLock = 10,
+	bHasPersonalAccessPrivileges = 9,
+	bHasUserGroupList = 8,
+	bHasCatSearch = 7,
+	bHasFileIDs = 6,
+	bHasBTreeMgr = 5,
+	bHasBlankAccessPrivileges = 4,
+	bSupportsAsyncRequests = 3,
+	bSupportsTrashVolumeCache = 2
+}
+
+enum
+{
+	bHasDirectIO = 1
+}
+
+enum
+{
+	bIsEjectable = 0,
+	bSupportsHFSPlusAPIs = 1,
+	bSupportsFSCatalogSearch = 2,
+	bSupportsFSExchangeObjects = 3,
+	bSupports2TBFiles = 4,
+	bSupportsLongNames = 5,
+	bSupportsMultiScriptNames = 6,
+	bSupportsNamedForks = 7,
+	bSupportsSubtreeIterators = 8,
+	bL2PCanMapFileBlocks = 9,
+	bParentModDateChanges = 10,
+	bAncestorModDateChanges = 11,
+	bSupportsSymbolicLinks = 13,
+	bIsAutoMounted = 14,
+	bAllowCDiDataHandler = 17,
+	bSupportsExclusiveLocks = 18,
+	bSupportsJournaling = 19,
+	bNoVolumeSizes = 20,
+	bIsOnInternalBus = 21,
+	bIsCaseSensitive = 22,
+	bIsCasePreserving = 23,
+	bDoNotDisplay = 24,
+	bIsRemovable = 25,
+	bNoRootTimes = 26,
+	bIsOnExternalBus = 27,
+	bSupportsExtendedFileSecurity = 28
+}
+
+enum
+{
+	kWidePosOffsetBit = 8,
+	kUseWidePositioning = (1 << kWidePosOffsetBit),
+	kMaximumBlocksIn4GB = 0x007FFFFF
+}
+
+enum
+{
+	fsUnixPriv = 1
+}
+
+enum
+{
+	kNoUserAuthentication = 1,
+	kPassword = 2,
+	kEncryptPassword = 3,
+	kTwoWayEncryptPassword = 6
+}
+
+enum
+{
+	knoUser = 0,
+	kadministratorUser = 1
+}
+
+enum
+{
+	knoGroup = 0
+}
+
+enum
+{
+	kFSInvalidVolumeRefNum = 0
+}
+
+enum
+{
+	kFSCatInfoNone = 0x00000000,
+	kFSCatInfoTextEncoding = 0x00000001,
+	kFSCatInfoNodeFlags = 0x00000002,
+	kFSCatInfoVolume = 0x00000004,
+	kFSCatInfoParentDirID = 0x00000008,
+	kFSCatInfoNodeID = 0x00000010,
+	kFSCatInfoCreateDate = 0x00000020,
+	kFSCatInfoContentMod = 0x00000040,
+	kFSCatInfoAttrMod = 0x00000080,
+	kFSCatInfoAccessDate = 0x00000100,
+	kFSCatInfoBackupDate = 0x00000200,
+	kFSCatInfoPermissions = 0x00000400,
+	kFSCatInfoFinderInfo = 0x00000800,
+	kFSCatInfoFinderXInfo = 0x00001000,
+	kFSCatInfoValence = 0x00002000,
+	kFSCatInfoDataSizes = 0x00004000,
+	kFSCatInfoRsrcSizes = 0x00008000,
+	kFSCatInfoSharingFlags = 0x00010000,
+	kFSCatInfoUserPrivs = 0x00020000,
+	kFSCatInfoUserAccess = 0x00080000,
+	kFSCatInfoSetOwnership = 0x00100000,
+	kFSCatInfoFSFileSecurityRef = 0x00400000,
+	kFSCatInfoAllDates = 0x000003E0,
+	kFSCatInfoGettableInfo = 0x0003FFFF,
+	kFSCatInfoSettableInfo = 0x00001FE3,
+	kFSCatInfoReserved = cast(c_long)0xFFFC0000
+}
+
+enum
+{
+	kFSNodeLockedBit = 0,
+	kFSNodeLockedMask = 0x0001,
+	kFSNodeResOpenBit = 2,
+	kFSNodeResOpenMask = 0x0004,
+	kFSNodeDataOpenBit = 3,
+	kFSNodeDataOpenMask = 0x0008,
+	kFSNodeIsDirectoryBit = 4,
+	kFSNodeIsDirectoryMask = 0x0010,
+	kFSNodeCopyProtectBit = 6,
+	kFSNodeCopyProtectMask = 0x0040,
+	kFSNodeForkOpenBit = 7,
+	kFSNodeForkOpenMask = 0x0080,
+	kFSNodeHardLinkBit = 8,
+	kFSNodeHardLinkMask = 0x00000100
+}
+
+enum
+{
+	kFSNodeInSharedBit = 2,
+	kFSNodeInSharedMask = 0x0004,
+	kFSNodeIsMountedBit = 3,
+	kFSNodeIsMountedMask = 0x0008,
+	kFSNodeIsSharePointBit = 5,
+	kFSNodeIsSharePointMask = 0x0020
+}
+
+enum
+{
+	kFSIterateFlat = 0,
+	kFSIterateSubtree = 1,
+	kFSIterateDelete = 2,
+	kFSIterateReserved = cast(c_long)0xFFFFFFFC
+}
+
+enum
+{
+	kFSAllocDefaultFlags = 0x0000,
+	kFSAllocAllOrNothingMask = 0x0001,
+	kFSAllocContiguousMask = 0x0002,
+	kFSAllocNoRoundUpMask = 0x0004,
+	kFSAllocReservedMask = 0xFFF8
+}
+
+enum
+{
+	kFSVolInfoNone = 0x0000,
+	kFSVolInfoCreateDate = 0x0001,
+	kFSVolInfoModDate = 0x0002,
+	kFSVolInfoBackupDate = 0x0004,
+	kFSVolInfoCheckedDate = 0x0008,
+	kFSVolInfoFileCount = 0x0010,
+	kFSVolInfoDirCount = 0x0020,
+	kFSVolInfoSizes = 0x0040,
+	kFSVolInfoBlocks = 0x0080,
+	kFSVolInfoNextAlloc = 0x0100,
+	kFSVolInfoRsrcClump = 0x0200,
+	kFSVolInfoDataClump = 0x0400,
+	kFSVolInfoNextID = 0x0800,
+	kFSVolInfoFinderInfo = 0x1000,
+	kFSVolInfoFlags = 0x2000,
+	kFSVolInfoFSInfo = 0x4000,
+	kFSVolInfoDriveInfo = 0x8000,
+	kFSVolInfoGettableInfo = 0xFFFF,
+	kFSVolInfoSettableInfo = 0x3004
+}
+
+enum
+{
+	kFSVolFlagDefaultVolumeBit = 5,
+	kFSVolFlagDefaultVolumeMask = 0x0020,
+	kFSVolFlagFilesOpenBit = 6,
+	kFSVolFlagFilesOpenMask = 0x0040,
+	kFSVolFlagHardwareLockedBit = 7,
+	kFSVolFlagHardwareLockedMask = 0x0080,
+	kFSVolFlagJournalingActiveBit = 14,
+	kFSVolFlagJournalingActiveMask = 0x4000,
+	kFSVolFlagSoftwareLockedBit = 15,
+	kFSVolFlagSoftwareLockedMask = 0x8000
+}
+
+enum
+{
+	AppleShareMediaType = getOSType!("afpm")
+}
+
+enum
+{
+	volMountNoLoginMsgFlagBit = 0,
+	volMountNoLoginMsgFlagMask = 0x0001,
+	volMountExtendedFlagsBit = 7,
+	volMountExtendedFlagsMask = 0x0080,
+	volMountInteractBit = 15,
+	volMountInteractMask = 0x8000,
+	volMountChangedBit = 14,
+	volMountChangedMask = 0x4000,
+	volMountFSReservedMask = 0x00FF,
+	volMountSysReservedMask = 0xFF00
+}
+
+enum
+{
+	kAFPExtendedFlagsAlternateAddressMask = 1
+}
+
+enum
+{
+	kAFPTagTypeIP = 0x01,
+	kAFPTagTypeIPPort = 0x02,
+	kAFPTagTypeDDP = 0x03,
+	kAFPTagTypeDNS = 0x04
+}
+
+enum
+{
+	kAFPTagLengthIP = 0x06,
+	kAFPTagLengthIPPort = 0x08,
+	kAFPTagLengthDDP = 0x06
+}
+
+enum
+{
+	kLargeIconSize = 256,
+	kLarge4BitIconSize = 512,
+	kLarge8BitIconSize = 1024,
+	kSmallIconSize = 64,
+	kSmall4BitIconSize = 128,
+	kSmall8BitIconSize = 256
+}
+
+enum
+{
+	kFSReplaceObjectDefaultOptions = 0,
+	kFSReplaceObjectReplaceMetadata = 0x01,
+	kFSReplaceObjectSaveOriginalAsABackup = 0x02,
+	kFSReplaceObjectReplacePermissionInfo = 0x04,
+	kFSReplaceObjectPreservePermissionInfo = 0x08,
+	kFSReplaceObjectDoNotCheckObjectWriteAccess = 0x10
+}
+
+enum
+{
+	kFSPathMakeRefDefaultOptions = 0,
+	kFSPathMakeRefDoNotFollowLeafSymlink = 0x01
+}
+
+enum
+{
+	kFNDirectoryModifiedMessage = 1
+}
+
+enum
+{
+	kFNNoImplicitAllSubscription = (1 << 0),
+	kFNNotifyInBackground = (1 << 1)
+}
+
+enum
+{
+	kAsyncMountInProgress = 1,
+	kAsyncMountComplete = 2,
+	kAsyncUnmountInProgress = 3,
+	kAsyncUnmountComplete = 4,
+	kAsyncEjectInProgress = 5,
+	kAsyncEjectComplete = 6
+}
+
+enum
+{
+	kFSMountServerMarkDoNotDisplay = (1 << 0),
+	kFSMountServerMountOnMountDir = (1 << 2)
+}
+
+enum
+{
+	kFSMountServerMountWithoutNotification = (1 << 1)
+}
+
+enum
+{
+	kFSEjectVolumeForceEject = (1 << 0)
+}
+
+enum
+{
+	kFSUnmountVolumeForceUnmount = (1 << 0)
+}
+
+enum
+{
+	kFSFileOperationDefaultOptions = 0,
+	kFSFileOperationOverwrite = 0x01,
+	kFSFileOperationSkipSourcePermissionErrors = 0x02,
+	kFSFileOperationDoNotMoveAcrossVolumes = 0x04,
+	kFSFileOperationSkipPreflight = 0x08
+}
+
+enum
+{
+	kFSOperationStageUndefined = 0,
+	kFSOperationStagePreflighting = 1,
+	kFSOperationStageRunning = 2,
+	kFSOperationStageComplete = 3
+}
+
+enum
+{
+	pleaseCacheBit = 4,
+	pleaseCacheMask = 0x0010,
+	noCacheBit = 5,
+	noCacheMask = 0x0020,
+	rdVerifyBit = 6,
+	rdVerifyMask = 0x0040,
+	rdVerify = 64,
+	forceReadBit = 6,
+	forceReadMask = 0x0040,
+	newLineBit = 7,
+	newLineMask = 0x0080,
+	newLineCharMask = 0xFF00
+}
+
+enum
+{
+	kOwnerID2Name = 1,
+	kGroupID2Name = 2,
+	kOwnerName2ID = 3,
+	kGroupName2ID = 4,
+	kReturnNextUser = 1,
+	kReturnNextGroup = 2,
+	kReturnNextUG = 3
+}
+
+enum
+{
+	kVCBFlagsIdleFlushBit = 3,
+	kVCBFlagsIdleFlushMask = 0x0008,
+	kVCBFlagsHFSPlusAPIsBit = 4,
+	kVCBFlagsHFSPlusAPIsMask = 0x0010,
+	kVCBFlagsHardwareGoneBit = 5,
+	kVCBFlagsHardwareGoneMask = 0x0020,
+	kVCBFlagsVolumeDirtyBit = 15,
+	kVCBFlagsVolumeDirtyMask = 0x8000
+}
+
+enum
+{
+	kioVAtrbDefaultVolumeBit = 5,
+	kioVAtrbDefaultVolumeMask = 0x0020,
+	kioVAtrbFilesOpenBit = 6,
+	kioVAtrbFilesOpenMask = 0x0040,
+	kioVAtrbHardwareLockedBit = 7,
+	kioVAtrbHardwareLockedMask = 0x0080,
+	kioVAtrbSoftwareLockedBit = 15,
+	kioVAtrbSoftwareLockedMask = 0x8000
+}
+
+enum
+{
+	kioFlAttribLockedBit = 0,
+	kioFlAttribLockedMask = 0x01,
+	kioFlAttribResOpenBit = 2,
+	kioFlAttribResOpenMask = 0x04,
+	kioFlAttribDataOpenBit = 3,
+	kioFlAttribDataOpenMask = 0x08,
+	kioFlAttribDirBit = 4,
+	kioFlAttribDirMask = 0x10,
+	ioDirFlg = 4,
+	ioDirMask = 0x10,
+	kioFlAttribCopyProtBit = 6,
+	kioFlAttribCopyProtMask = 0x40,
+	kioFlAttribFileOpenBit = 7,
+	kioFlAttribFileOpenMask = 0x80,
+	kioFlAttribInSharedBit = 2,
+	kioFlAttribInSharedMask = 0x04,
+	kioFlAttribMountedBit = 3,
+	kioFlAttribMountedMask = 0x08,
+	kioFlAttribSharePointBit = 5,
+	kioFlAttribSharePointMask = 0x20
+}
+
+enum
+{
+	kioFCBWriteBit = 8,
+	kioFCBWriteMask = 0x0100,
+	kioFCBResourceBit = 9,
+	kioFCBResourceMask = 0x0200,
+	kioFCBWriteLockedBit = 10,
+	kioFCBWriteLockedMask = 0x0400,
+	kioFCBLargeFileBit = 11,
+	kioFCBLargeFileMask = 0x0800,
+	kioFCBSharedWriteBit = 12,
+	kioFCBSharedWriteMask = 0x1000,
+	kioFCBFileLockedBit = 13,
+	kioFCBFileLockedMask = 0x2000,
+	kioFCBOwnClumpBit = 14,
+	kioFCBOwnClumpMask = 0x4000,
+	kioFCBModifiedBit = 15,
+	kioFCBModifiedMask = 0x8000
+}
+
+enum
+{
+	kioACUserNoSeeFolderBit = 0,
+	kioACUserNoSeeFolderMask = 0x01,
+	kioACUserNoSeeFilesBit = 1,
+	kioACUserNoSeeFilesMask = 0x02,
+	kioACUserNoMakeChangesBit = 2,
+	kioACUserNoMakeChangesMask = 0x04,
+	kioACUserNotOwnerBit = 7,
+	kioACUserNotOwnerMask = 0x80
+}
+
+enum
+{
+	kioACAccessOwnerBit = 31,
+	kioACAccessOwnerMask = cast(c_long)0x80000000,
+	kioACAccessBlankAccessBit = 28,
+	kioACAccessBlankAccessMask = 0x10000000,
+	kioACAccessUserWriteBit = 26,
+	kioACAccessUserWriteMask = 0x04000000,
+	kioACAccessUserReadBit = 25,
+	kioACAccessUserReadMask = 0x02000000,
+	kioACAccessUserSearchBit = 24,
+	kioACAccessUserSearchMask = 0x01000000,
+	kioACAccessEveryoneWriteBit = 18,
+	kioACAccessEveryoneWriteMask = 0x00040000,
+	kioACAccessEveryoneReadBit = 17,
+	kioACAccessEveryoneReadMask = 0x00020000,
+	kioACAccessEveryoneSearchBit = 16,
+	kioACAccessEveryoneSearchMask = 0x00010000,
+	kioACAccessGroupWriteBit = 10,
+	kioACAccessGroupWriteMask = 0x00000400,
+	kioACAccessGroupReadBit = 9,
+	kioACAccessGroupReadMask = 0x00000200,
+	kioACAccessGroupSearchBit = 8,
+	kioACAccessGroupSearchMask = 0x00000100,
+	kioACAccessOwnerWriteBit = 2,
+	kioACAccessOwnerWriteMask = 0x00000004,
+	kioACAccessOwnerReadBit = 1,
+	kioACAccessOwnerReadMask = 0x00000002,
+	kioACAccessOwnerSearchBit = 0,
+	kioACAccessOwnerSearchMask = 0x00000001,
+	kfullPrivileges = 0x00070007,
+	kownerPrivileges = 0x00000007
+}
+
+struct HFSUniStr255
+{
+	ushort length;
+	wchar* unicode;
+}
+
+
+struct FSRef
+{
+	ubyte[80] hidden;
+}
+
+
+struct CatPositionRec
+{
+	int initialize;
+	short[6] priv;
+}
+
+
+struct FSSpec
+{
+	ubyte[70] hidden;
+}
+
+
+struct FSPermissionInfo
+{
+	uint userID;
+	uint groupID;
+	ubyte reserved1;
+	ubyte userAccess;
+	ushort mode;
+	FSFileSecurityRef fileSec;
+}
+
+
+struct FSCatalogInfo
+{
+	ushort nodeFlags;
+	short volume;
+	uint parentDirID;
+	uint nodeID;
+	ubyte sharingFlags;
+	ubyte userPrivileges;
+	ubyte reserved1;
+	ubyte reserved2;
+	UTCDateTime createDate;
+	UTCDateTime contentModDate;
+	UTCDateTime attributeModDate;
+	UTCDateTime accessDate;
+	UTCDateTime backupDate;
+	FSPermissionInfo permissions;
+	char* finderInfo;
+	char* extFinderInfo;
+	ulong dataLogicalSize;
+	ulong dataPhysicalSize;
+	ulong rsrcLogicalSize;
+	ulong rsrcPhysicalSize;
+	uint valence;
+	uint textEncodingHint;
+}
+
+
+struct FSRefParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	char* ioNamePtr;
+	short ioVRefNum;
+	short reserved1;
+	ubyte reserved2;
+	ubyte reserved3;
+	FSRef* ref_;
+	uint whichInfo;
+	FSCatalogInfo* catInfo;
+	uint nameLength;
+	wchar* name;
+	uint ioDirID;
+	FSSpecPtr spec;
+	FSRef* parentRef;
+	FSRef* newRef;
+	uint textEncodingHint;
+	HFSUniStr255* outName;
+}
+
+
+struct FSRefForkIOParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	FSRef* parentRef;
+	uint nameLength;
+	wchar* name;
+	uint whichInfo;
+	FSCatalogInfo* catInfo;
+	uint forkNameLength;
+	wchar* forkName;
+	byte permissions;
+	ubyte reserved1;
+	short forkRefNum;
+	FSRef* newRef;
+}
+
+
+struct FSSearchParams
+{
+	int searchTime;
+	uint searchBits;
+	uint searchNameLength;
+	wchar* searchName;
+	FSCatalogInfo* searchInfo1;
+	FSCatalogInfo* searchInfo2;
+}
+
+
+struct FSCatalogBulkParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	ubyte containerChanged;
+	ubyte reserved;
+	uint iteratorFlags;
+	FSIterator iterator;
+	FSRef* container;
+	uint maximumItems;
+	uint actualItems;
+	uint whichInfo;
+	FSCatalogInfo* catalogInfo;
+	FSRef* refs;
+	FSSpecPtr specs;
+	HFSUniStr255* names;
+	FSSearchParams* searchParams;
+}
+
+
+struct FSForkIOParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	void* reserved1;
+	short reserved2;
+	short forkRefNum;
+	ubyte reserved3;
+	byte permissions;
+	FSRef* ref_;
+	char* buffer;
+	uint requestCount;
+	uint actualCount;
+	ushort positionMode;
+	long positionOffset;
+	ushort allocationFlags;
+	ulong allocationAmount;
+	uint forkNameLength;
+	wchar* forkName;
+	CatPositionRec forkIterator;
+	HFSUniStr255* outForkName;
+}
+
+
+struct FSForkInfo
+{
+	byte flags;
+	byte permissions;
+	short volume;
+	uint reserved2;
+	uint nodeID;
+	uint forkID;
+	ulong currentPosition;
+	ulong logicalEOF;
+	ulong physicalEOF;
+	ulong process;
+}
+
+
+struct FSForkCBInfoParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	short desiredRefNum;
+	short volumeRefNum;
+	short iterator;
+	short actualRefNum;
+	FSRef* ref_;
+	FSForkInfo* forkInfo;
+	HFSUniStr255* forkName;
+}
+
+
+struct FSRangeLockParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	short forkRefNum;
+	ulong requestCount;
+	ushort positionMode;
+	long positionOffset;
+	ulong rangeStart;
+}
+
+
+struct FSVolumeInfo
+{
+	UTCDateTime createDate;
+	UTCDateTime modifyDate;
+	UTCDateTime backupDate;
+	UTCDateTime checkedDate;
+	uint fileCount;
+	uint folderCount;
+	ulong totalBytes;
+	ulong freeBytes;
+	uint blockSize;
+	uint totalBlocks;
+	uint freeBlocks;
+	uint nextAllocation;
+	uint rsrcClumpSize;
+	uint dataClumpSize;
+	uint nextCatalogID;
+	char* finderInfo;
+	ushort flags;
+	ushort filesystemID;
+	ushort signature;
+	ushort driveNumber;
+	short driverRefNum;
+}
+
+
+struct FSVolumeInfoParam
+{
+	QElemPtr qLink;
+	short qType;
+	short ioTrap;
+	char* ioCmdAddr;
+	IOCompletionUPP ioCompletion;
+	short ioResult;
+	char* ioNamePtr;
+	short ioVRefNum;
+	uint volumeIndex;
+	uint whichInfo;
+	FSVolumeInfo* volumeInfo;
+	HFSUniStr255* volumeName;
+	FSRef* ref_;
+}
+
+
+struct GetVolParmsInfoBuffer
+{
+	short vMVersion;
+	int vMAttrib;
+	Handle vMLocalHand;
+	int vMServerAdr;
+	int vMVolumeGrade;
+	short vMForeignPrivID;
+	int vMExtendedAttributes;
+	void* vMDeviceID;
+	uint vMMaxNameLength;
+}
+
+
+struct VolMountInfoHeader
+{
+	short length;
+	uint media;
+}
+
+
+struct VolumeMountInfoHeader
+{
+	short length;
+	uint media;
+	short flags;
+}
+
+
+struct AFPVolMountInfo
+{
+	short length;
+	uint media;
+	short flags;
+	byte nbpInterval;
+	byte nbpCount;
+	short uamType;
+	short zoneNameOffset;
+	short serverNameOffset;
+	short volNameOffset;
+	short userNameOffset;
+	short userPasswordOffset;
+	short volPasswordOffset;
+	char* AFPData;
+}
+
+
+struct AFPXVolMountInfo
+{
+	short length;
+	uint media;
+	short flags;
+	byte nbpInterval;
+	byte nbpCount;
+	short uamType;
+	short zoneNameOffset;
+	short serverNameOffset;
+	short volNameOffset;
+	short userNameOffset;
+	short userPasswordOffset;
+	short volPasswordOffset;
+	short extendedFlags;
+	short uamNameOffset;
+	short alternateAddressOffset;
+	char* AFPData;
+}
+
+
+struct AFPTagData
+{
+	ubyte fLength;
+	ubyte fType;
+	char* fData;
+}
+
+
+struct AFPAlternateAddress
+{
+	ubyte fVersion;
+	ubyte fAddressCount;
+	char* fAddressList;
+}
+
+
+struct FSFileOperationClientContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+}
+
+extern (C)
+{
+	IOCompletionUPP NewIOCompletionUPP (IOCompletionProcPtr userRoutine);
+	void DisposeIOCompletionUPP (IOCompletionUPP userUPP);
+	void InvokeIOCompletionUPP (ParmBlkPtr paramBlock, IOCompletionUPP userUPP);
+	short FSMakeFSRefUnicode (FSRef* parentRef, uint nameLength, wchar* name, uint textEncodingHint, FSRef* newRef);
+	short PBMakeFSRefUnicodeSync (FSRefParam* paramBlock);
+	void PBMakeFSRefUnicodeAsync (FSRefParam* paramBlock);
+	short FSCompareFSRefs (FSRef* ref1, FSRef* ref2);
+	short PBCompareFSRefsSync (FSRefParam* paramBlock);
+	void PBCompareFSRefsAsync (FSRefParam* paramBlock);
+	short FSCreateFileUnicode (FSRef* parentRef, uint nameLength, wchar* name, uint whichInfo, FSCatalogInfo* catalogInfo, FSRef* newRef, FSSpecPtr newSpec);
+	short PBCreateFileUnicodeSync (FSRefParam* paramBlock);
+	void PBCreateFileUnicodeAsync (FSRefParam* paramBlock);
+	short FSCreateDirectoryUnicode (FSRef* parentRef, uint nameLength, wchar* name, uint whichInfo, FSCatalogInfo* catalogInfo, FSRef* newRef, FSSpecPtr newSpec, UInt32* newDirID);
+	short PBCreateDirectoryUnicodeSync (FSRefParam* paramBlock);
+	void PBCreateDirectoryUnicodeAsync (FSRefParam* paramBlock);
+	short FSDeleteObject (FSRef* ref_);
+	short PBDeleteObjectSync (FSRefParam* paramBlock);
+	void PBDeleteObjectAsync (FSRefParam* paramBlock);
+	short FSUnlinkObject (FSRef* ref_);
+	short PBUnlinkObjectSync (FSRefParam* paramBlock);
+	void PBUnlinkObjectAsync (FSRefParam* paramBlock);
+	short FSMoveObject (FSRef* ref_, FSRef* destDirectory, FSRef* newRef);
+	short PBMoveObjectSync (FSRefParam* paramBlock);
+	void PBMoveObjectAsync (FSRefParam* paramBlock);
+	short FSExchangeObjects (FSRef* ref_, FSRef* destRef);
+	short PBExchangeObjectsSync (FSRefParam* paramBlock);
+	void PBExchangeObjectsAsync (FSRefParam* paramBlock);
+	int FSReplaceObject (FSRef* originalObject, FSRef* replacementObject, CFStringRef newName, CFStringRef temporaryName, FSRef* temporaryDirectory, uint flags, FSRef* resultObject);
+	int FSPathReplaceObject (char* originalObjectPath, char* replacementObjectPath, CFStringRef newName, CFStringRef temporaryName, char* temporaryDirectoryPath, uint flags);
+	int FSGetTemporaryDirectoryForReplaceObject (FSRef* originalObject, FSRef* temporaryDirectory, uint flags);
+	int FSPathGetTemporaryDirectoryForReplaceObject (char* originalObjectPath, char* temporaryDirectoryPath, uint maxPathSize, uint flags);
+	short FSRenameUnicode (FSRef* ref_, uint nameLength, wchar* name, uint textEncodingHint, FSRef* newRef);
+	short PBRenameUnicodeSync (FSRefParam* paramBlock);
+	void PBRenameUnicodeAsync (FSRefParam* paramBlock);
+	short FSGetCatalogInfo (FSRef* ref_, uint whichInfo, FSCatalogInfo* catalogInfo, HFSUniStr255* outName, FSSpecPtr fsSpec, FSRef* parentRef);
+	short PBGetCatalogInfoSync (FSRefParam* paramBlock);
+	void PBGetCatalogInfoAsync (FSRefParam* paramBlock);
+	short FSSetCatalogInfo (FSRef* ref_, uint whichInfo, FSCatalogInfo* catalogInfo);
+	short PBSetCatalogInfoSync (FSRefParam* paramBlock);
+	void PBSetCatalogInfoAsync (FSRefParam* paramBlock);
+	short FSOpenIterator (FSRef* container, uint iteratorFlags, FSIterator* iterator);
+	short PBOpenIteratorSync (FSCatalogBulkParam* paramBlock);
+	void PBOpenIteratorAsync (FSCatalogBulkParam* paramBlock);
+	short FSCloseIterator (FSIterator iterator);
+	short PBCloseIteratorSync (FSCatalogBulkParam* paramBlock);
+	void PBCloseIteratorAsync (FSCatalogBulkParam* paramBlock);
+	short FSGetCatalogInfoBulk (FSIterator iterator, uint maximumObjects, ItemCount* actualObjects, char* containerChanged, uint whichInfo, FSCatalogInfo* catalogInfos, FSRef* refs, FSSpecPtr specs, HFSUniStr255* names);
+	short PBGetCatalogInfoBulkSync (FSCatalogBulkParam* paramBlock);
+	void PBGetCatalogInfoBulkAsync (FSCatalogBulkParam* paramBlock);
+	short FSCatalogSearch (FSIterator iterator, FSSearchParams* searchCriteria, uint maximumObjects, ItemCount* actualObjects, char* containerChanged, uint whichInfo, FSCatalogInfo* catalogInfos, FSRef* refs, FSSpecPtr specs, HFSUniStr255* names);
+	short PBCatalogSearchSync (FSCatalogBulkParam* paramBlock);
+	void PBCatalogSearchAsync (FSCatalogBulkParam* paramBlock);
+	int FSCreateFileAndOpenForkUnicode (FSRef* parentRef, uint nameLength, wchar* name, uint whichInfo, FSCatalogInfo* catalogInfo, uint forkNameLength, wchar* forkName, byte permissions, FSIORefNum* forkRefNum, FSRef* newRef);
+	int PBCreateFileAndOpenForkUnicodeSync (FSRefForkIOParamPtr paramBlock);
+	void PBCreateFileAndOpenForkUnicodeAsync (FSRefForkIOParamPtr paramBlock);
+	short FSCreateFork (FSRef* ref_, uint forkNameLength, wchar* forkName);
+	short PBCreateForkSync (FSForkIOParam* paramBlock);
+	void PBCreateForkAsync (FSForkIOParam* paramBlock);
+	short FSDeleteFork (FSRef* ref_, uint forkNameLength, wchar* forkName);
+	short PBDeleteForkSync (FSForkIOParam* paramBlock);
+	void PBDeleteForkAsync (FSForkIOParam* paramBlock);
+	short FSIterateForks (FSRef* ref_, CatPositionRec* forkIterator, HFSUniStr255* forkName, SInt64* forkSize, UInt64* forkPhysicalSize);
+	short PBIterateForksSync (FSForkIOParam* paramBlock);
+	void PBIterateForksAsync (FSForkIOParam* paramBlock);
+	short FSOpenFork (FSRef* ref_, uint forkNameLength, wchar* forkName, byte permissions, FSIORefNum* forkRefNum);
+	short PBOpenForkSync (FSForkIOParam* paramBlock);
+	void PBOpenForkAsync (FSForkIOParam* paramBlock);
+	short FSReadFork (short forkRefNum, ushort positionMode, long positionOffset, uint requestCount, void* buffer, ByteCount* actualCount);
+	short PBReadForkSync (FSForkIOParam* paramBlock);
+	void PBReadForkAsync (FSForkIOParam* paramBlock);
+	short FSWriteFork (short forkRefNum, ushort positionMode, long positionOffset, uint requestCount, void* buffer, ByteCount* actualCount);
+	short PBWriteForkSync (FSForkIOParam* paramBlock);
+	void PBWriteForkAsync (FSForkIOParam* paramBlock);
+	short FSGetForkPosition (short forkRefNum, SInt64* position);
+	short PBGetForkPositionSync (FSForkIOParam* paramBlock);
+	void PBGetForkPositionAsync (FSForkIOParam* paramBlock);
+	short FSSetForkPosition (short forkRefNum, ushort positionMode, long positionOffset);
+	short PBSetForkPositionSync (FSForkIOParam* paramBlock);
+	void PBSetForkPositionAsync (FSForkIOParam* paramBlock);
+	short FSGetForkSize (short forkRefNum, SInt64* forkSize);
+	short PBGetForkSizeSync (FSForkIOParam* paramBlock);
+	void PBGetForkSizeAsync (FSForkIOParam* paramBlock);
+	short FSSetForkSize (short forkRefNum, ushort positionMode, long positionOffset);
+	short PBSetForkSizeSync (FSForkIOParam* paramBlock);
+	void PBSetForkSizeAsync (FSForkIOParam* paramBlock);
+	short FSAllocateFork (short forkRefNum, ushort flags, ushort positionMode, long positionOffset, ulong requestCount, UInt64* actualCount);
+	short PBAllocateForkSync (FSForkIOParam* paramBlock);
+	void PBAllocateForkAsync (FSForkIOParam* paramBlock);
+	short FSFlushFork (short forkRefNum);
+	short PBFlushForkSync (FSForkIOParam* paramBlock);
+	void PBFlushForkAsync (FSForkIOParam* paramBlock);
+	short FSCloseFork (short forkRefNum);
+	short PBCloseForkSync (FSForkIOParam* paramBlock);
+	void PBCloseForkAsync (FSForkIOParam* paramBlock);
+	short FSGetForkCBInfo (short desiredRefNum, short volume, short* iterator, FSIORefNum* actualRefNum, FSForkInfo* forkInfo, FSRef* ref_, HFSUniStr255* outForkName);
+	short PBGetForkCBInfoSync (FSForkCBInfoParam* paramBlock);
+	void PBGetForkCBInfoAsync (FSForkCBInfoParam* paramBlock);
+	int FSLockRange (short forkRefNum, ushort positionMode, long positionOffset, ulong requestCount, UInt64* rangeStart);
+	int PBXLockRangeSync (FSRangeLockParamPtr paramBlock);
+	int PBXLockRangeAsync (FSRangeLockParamPtr paramBlock);
+	int FSUnlockRange (short forkRefNum, ushort positionMode, long positionOffset, ulong requestCount, UInt64* rangeStart);
+	int PBXUnlockRangeSync (FSRangeLockParamPtr paramBlock);
+	int PBXUnlockRangeAsync (FSRangeLockParamPtr paramBlock);
+	short FSGetVolumeInfo (short volume, uint volumeIndex, FSVolumeRefNum* actualVolume, uint whichInfo, FSVolumeInfo* info, HFSUniStr255* volumeName, FSRef* rootDirectory);
+	short PBGetVolumeInfoSync (FSVolumeInfoParam* paramBlock);
+	void PBGetVolumeInfoAsync (FSVolumeInfoParam* paramBlock);
+	short FSSetVolumeInfo (short volume, uint whichInfo, FSVolumeInfo* info);
+	short PBSetVolumeInfoSync (FSVolumeInfoParam* paramBlock);
+	void PBSetVolumeInfoAsync (FSVolumeInfoParam* paramBlock);
+	short FSGetDataForkName (HFSUniStr255* dataForkName);
+	short FSGetResourceForkName (HFSUniStr255* resourceForkName);
+	int FSRefMakePath (FSRef* ref_, char* path, uint pathBufferSize);
+	int FSPathMakeRef (char* path, FSRef* ref_, char* isDirectory);
+	int FSPathMakeRefWithOptions (char* path, uint options, FSRef* ref_, char* isDirectory);
+	ubyte FSIsFSRefValid (FSRef* ref_);
+	int FNNotify (FSRef* ref_, uint message, uint flags);
+	int FNNotifyByPath (char* path, uint message, uint flags);
+	int FNNotifyAll (uint message, uint flags);
+	FNSubscriptionUPP NewFNSubscriptionUPP (FNSubscriptionProcPtr userRoutine);
+	void DisposeFNSubscriptionUPP (FNSubscriptionUPP userUPP);
+	void InvokeFNSubscriptionUPP (uint message, uint flags, void* refcon, FNSubscriptionRef subscription, FNSubscriptionUPP userUPP);
+	int FNSubscribe (FSRef* directoryRef, FNSubscriptionUPP callback, void* refcon, uint flags, FNSubscriptionRef* subscription);
+	int FNSubscribeByPath (char* directoryPath, FNSubscriptionUPP callback, void* refcon, uint flags, FNSubscriptionRef* subscription);
+	int FNUnsubscribe (FNSubscriptionRef subscription);
+	int FNGetDirectoryForSubscription (FNSubscriptionRef subscription, FSRef* ref_);
+	FSVolumeMountUPP NewFSVolumeMountUPP (FSVolumeMountProcPtr userRoutine);
+	FSVolumeUnmountUPP NewFSVolumeUnmountUPP (FSVolumeUnmountProcPtr userRoutine);
+	FSVolumeEjectUPP NewFSVolumeEjectUPP (FSVolumeEjectProcPtr userRoutine);
+	void DisposeFSVolumeMountUPP (FSVolumeMountUPP userUPP);
+	void DisposeFSVolumeUnmountUPP (FSVolumeUnmountUPP userUPP);
+	void DisposeFSVolumeEjectUPP (FSVolumeEjectUPP userUPP);
+	void InvokeFSVolumeMountUPP (FSVolumeOperation volumeOp, void* clientData, int err, short mountedVolumeRefNum, FSVolumeMountUPP userUPP);
+	void InvokeFSVolumeUnmountUPP (FSVolumeOperation volumeOp, void* clientData, int err, short volumeRefNum, int dissenter, FSVolumeUnmountUPP userUPP);
+	void InvokeFSVolumeEjectUPP (FSVolumeOperation volumeOp, void* clientData, int err, short volumeRefNum, int dissenter, FSVolumeEjectUPP userUPP);
+	int FSCreateVolumeOperation (FSVolumeOperation* volumeOp);
+	int FSDisposeVolumeOperation (FSVolumeOperation volumeOp);
+	int FSMountLocalVolumeSync (CFStringRef diskID, CFURLRef mountDir, FSVolumeRefNum* mountedVolumeRefNum, uint flags);
+	int FSMountLocalVolumeAsync (CFStringRef diskID, CFURLRef mountDir, FSVolumeOperation volumeOp, void* clientData, uint flags, FSVolumeMountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode);
+	int FSMountServerVolumeSync (CFURLRef url, CFURLRef mountDir, CFStringRef user, CFStringRef password, FSVolumeRefNum* mountedVolumeRefNum, uint flags);
+	int FSMountServerVolumeAsync (CFURLRef url, CFURLRef mountDir, CFStringRef user, CFStringRef password, FSVolumeOperation volumeOp, void* clientData, uint flags, FSVolumeMountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode);
+	int FSGetAsyncMountStatus (FSVolumeOperation volumeOp, FSMountStatus* status, OSStatus* volumeOpStatus, FSVolumeRefNum* mountedVolumeRefNum, void** clientData);
+	int FSUnmountVolumeSync (short vRefNum, uint flags, pid_t* dissenter);
+	int FSUnmountVolumeAsync (short vRefNum, uint flags, FSVolumeOperation volumeOp, void* clientData, FSVolumeUnmountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode);
+	int FSGetAsyncUnmountStatus (FSVolumeOperation volumeOp, FSUnmountStatus* status, OSStatus* volumeOpStatus, FSVolumeRefNum* volumeRefNum, pid_t* dissenter, void** clientData);
+	int FSCancelVolumeOperation (FSVolumeOperation volumeOp);
+	int FSEjectVolumeSync (short vRefNum, uint flags, pid_t* dissenter);
+	int FSEjectVolumeAsync (short vRefNum, uint flags, FSVolumeOperation volumeOp, void* clientData, FSVolumeEjectUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode);
+	int FSGetAsyncEjectStatus (FSVolumeOperation volumeOp, FSEjectStatus* status, OSStatus* volumeOpStatus, FSVolumeRefNum* volumeRefNum, pid_t* dissenter, void** clientData);
+	int FSCopyDiskIDForVolume (short vRefNum, CFStringRef* diskID);
+	int FSCopyURLForVolume (short vRefNum, CFURLRef* url);
+	int FSGetVolumeForDiskID (CFStringRef diskID, FSVolumeRefNum* vRefNum);
+	int FSCopyDADiskForVolume (short vRefNum, DADiskRef* disk);
+	int FSGetVolumeForDADisk (DADiskRef disk, FSVolumeRefNum* vRefNum);
+	int FSCopyObjectSync (FSRef* source, FSRef* destDir, CFStringRef destName, FSRef* target, uint options);
+	int FSMoveObjectSync (FSRef* source, FSRef* destDir, CFStringRef destName, FSRef* target, uint options);
+	int FSMoveObjectToTrashSync (FSRef* source, FSRef* target, uint options);
+	int FSPathCopyObjectSync (char* sourcePath, char* destDirPath, CFStringRef destName, char** targetPath, uint options);
+	int FSPathMoveObjectSync (char* sourcePath, char* destDirPath, CFStringRef destName, char** targetPath, uint options);
+	int FSPathMoveObjectToTrashSync (char* sourcePath, char** targetPath, uint options);
+	uint FSFileOperationGetTypeID ();
+	FSFileOperationRef FSFileOperationCreate (CFAllocatorRef alloc);
+	int FSFileOperationScheduleWithRunLoop (FSFileOperationRef fileOp, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	int FSFileOperationUnscheduleFromRunLoop (FSFileOperationRef fileOp, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	int FSCopyObjectAsync (FSFileOperationRef fileOp, FSRef* source, FSRef* destDir, CFStringRef destName, uint flags, FSFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSMoveObjectAsync (FSFileOperationRef fileOp, FSRef* source, FSRef* destDir, CFStringRef destName, uint flags, FSFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSMoveObjectToTrashAsync (FSFileOperationRef fileOp, FSRef* source, uint flags, FSFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSPathCopyObjectAsync (FSFileOperationRef fileOp, char* sourcePath, char* destDirPath, CFStringRef destName, uint flags, FSPathFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSPathMoveObjectAsync (FSFileOperationRef fileOp, char* sourcePath, char* destDirPath, CFStringRef destName, uint flags, FSPathFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSPathMoveObjectToTrashAsync (FSFileOperationRef fileOp, char* sourcePath, uint flags, FSPathFileOperationStatusProcPtr callback, double statusChangeInterval, FSFileOperationClientContext* clientContext);
+	int FSFileOperationCancel (FSFileOperationRef fileOp);
+	int FSFileOperationCopyStatus (FSFileOperationRef fileOp, FSRef* currentItem, FSFileOperationStage* stage, OSStatus* error, CFDictionaryRef* statusDictionary, void** info);
+	int FSPathFileOperationCopyStatus (FSFileOperationRef fileOp, char** currentItem, FSFileOperationStage* stage, OSStatus* error, CFDictionaryRef* statusDictionary, void** info);
+	CFStringRef FSCreateStringFromHFSUniStr (CFAllocatorRef alloc, HFSUniStr255* uniStr);
+	int FSGetHFSUniStrFromString (CFStringRef theString, HFSUniStr255* uniStr);
+	uint FSFileSecurityGetTypeID ();
+	FSFileSecurityRef FSFileSecurityCreate (CFAllocatorRef alloc);
+	FSFileSecurityRef FSFileSecurityCreateWithFSPermissionInfo (CFAllocatorRef alloc, FSPermissionInfo* permissions);
+	FSFileSecurityRef FSFileSecurityRefCreateCopy (CFAllocatorRef alloc, FSFileSecurityRef fileSec);
+	int FSFileSecurityGetOwnerUUID (FSFileSecurityRef fileSec, CFUUIDBytes* owner);
+	int FSFileSecuritySetOwnerUUID (FSFileSecurityRef fileSec, CFUUIDBytes* owner);
+	int FSFileSecurityGetGroupUUID (FSFileSecurityRef fileSec, CFUUIDBytes* group);
+	int FSFileSecuritySetGroupUUID (FSFileSecurityRef fileSec, CFUUIDBytes* group);
+	int FSFileSecurityCopyAccessControlList (FSFileSecurityRef fileSec, acl_t* accessControlList);
+	int FSFileSecuritySetAccessControlList (FSFileSecurityRef fileSec, acl_t accessControlList);
+	int FSFileSecurityGetOwner (FSFileSecurityRef fileSec, UInt32* owner);
+	int FSFileSecuritySetOwner (FSFileSecurityRef fileSec, uint owner);
+	int FSFileSecurityGetGroup (FSFileSecurityRef fileSec, UInt32* group);
+	int FSFileSecuritySetGroup (FSFileSecurityRef fileSec, uint group);
+	int FSFileSecurityGetMode (FSFileSecurityRef fileSec, UInt16* mode);
+	int FSFileSecuritySetMode (FSFileSecurityRef fileSec, ushort mode);
+	int FSGetVolumeParms (short volume, GetVolParmsInfoBuffer* buffer, uint bufferSize);
+	int FSGetVolumeMountInfoSize (short volume, ByteCount* size);
+	int FSGetVolumeMountInfo (short volume, char* buffer, uint bufferSize, ByteCount* actualSize);
+	int FSVolumeMount (char* buffer, FSVolumeRefNum* mountedVolume);
+	int FSFlushVolume (short vRefNum);
+	int PBFlushVolumeSync (FSRefParamPtr paramBlock);
+	int PBFlushVolumeAsync (FSRefParamPtr paramBlock);
+	int PBFSCopyFileSync (FSRefParamPtr paramBlock);
+	int PBFSCopyFileAsync (FSRefParamPtr paramBlock);
+	int FSResolveNodeID (short volume, uint nodeID, FSRefPtr newRef);
+	int PBFSResolveNodeIDSync (FSRefParamPtr paramBlock);
+	int PBFSResolveNodeIDAsync (FSRefParamPtr paramBlock);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Finder.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,361 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Finder;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.objc.bridge.TypeEncoding;
+
+alias CustomBadgeResource* CustomBadgeResourcePtr;
+alias CustomBadgeResourcePtr* CustomBadgeResourceHandle;
+alias RoutingResourceEntry* RoutingResourcePtr;
+alias RoutingResourcePtr* RoutingResourceHandle;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kClippingCreator = getOSType!("drag");
+		const __kClippingPictureType = getOSType!("clpp");
+		const __kClippingTextType = getOSType!("clpt");
+		const __kClippingSoundType = getOSType!("clps");
+		const __kClippingUnknownType = getOSType!("clpu");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kInternetLocationCreator = getOSType!("drag");
+		const __kInternetLocationHTTP = getOSType!("ilht");
+		const __kInternetLocationFTP = getOSType!("ilft");
+		const __kInternetLocationFile = getOSType!("ilfi");
+		const __kInternetLocationMail = getOSType!("ilma");
+		const __kInternetLocationNNTP = getOSType!("ilnw");
+		const __kInternetLocationAFP = getOSType!("ilaf");
+		const __kInternetLocationAppleTalk = getOSType!("ilat");
+		const __kInternetLocationNSL = getOSType!("ilns");
+		const __kInternetLocationGeneric = getOSType!("ilge");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kCustomBadgeResourceType = getOSType!("badg");
+		const __kCustomBadgeResourceID = getOSType!("CustomIconResourc");
+		const __kCustomBadgeResourceVersion = getOSType!("");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kRoutingResourceType = getOSType!("rout");
+		const __kRoutingResourceID = getOSType!("");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kContainerFolderAliasType = getOSType!("fdrp");
+		const __kContainerTrashAliasType = getOSType!("trsh");
+		const __kContainerHardDiskAliasType = getOSType!("hdsk");
+		const __kContainerFloppyAliasType = getOSType!("flpy");
+		const __kContainerServerAliasType = getOSType!("srvr");
+		const __kApplicationAliasType = getOSType!("adrp");
+		const __kContainerAliasType = getOSType!("drop");
+		const __kDesktopPrinterAliasType = getOSType!("dtpa");
+		const __kContainerCDROMAliasType = getOSType!("cddr");
+		const __kApplicationCPAliasType = getOSType!("acdp");
+		const __kApplicationDAAliasType = getOSType!("addp");
+		const __kPackageAliasType = getOSType!("fpka");
+		const __kAppPackageAliasType = getOSType!("fapa");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSystemFolderAliasType = getOSType!("fasy");
+		const __kAppleMenuFolderAliasType = getOSType!("faam");
+		const __kStartupFolderAliasType = getOSType!("fast");
+		const __kPrintMonitorDocsFolderAliasType = getOSType!("fapn");
+		const __kPreferencesFolderAliasType = getOSType!("fapf");
+		const __kControlPanelFolderAliasType = getOSType!("fact");
+		const __kExtensionFolderAliasType = getOSType!("faex");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kExportedFolderAliasType = getOSType!("faet");
+		const __kDropFolderAliasType = getOSType!("fadr");
+		const __kSharedFolderAliasType = getOSType!("fash");
+		const __kMountedFolderAliasType = getOSType!("famn");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kFirstMagicBusyFiletype = getOSType!("bzy ");
+		const __kLastMagicBusyFiletype = getOSType!("bzy?");
+
+	}
+}
+
+enum
+{
+	kClippingCreator = getOSType!("drag"),
+	kClippingPictureType = getOSType!("clpp"),
+	kClippingTextType = getOSType!("clpt"),
+	kClippingSoundType = getOSType!("clps"),
+	kClippingUnknownType = getOSType!("clpu")
+}
+
+enum
+{
+	kInternetLocationCreator = getOSType!("drag"),
+	kInternetLocationHTTP = getOSType!("ilht"),
+	kInternetLocationFTP = getOSType!("ilft"),
+	kInternetLocationFile = getOSType!("ilfi"),
+	kInternetLocationMail = getOSType!("ilma"),
+	kInternetLocationNNTP = getOSType!("ilnw"),
+	kInternetLocationAFP = getOSType!("ilaf"),
+	kInternetLocationAppleTalk = getOSType!("ilat"),
+	kInternetLocationNSL = getOSType!("ilns"),
+	kInternetLocationGeneric = getOSType!("ilge")
+}
+
+enum
+{
+	kCustomIconResource = -16455
+}
+
+enum
+{
+	kCustomBadgeResourceType = getOSType!("badg"),
+	kCustomBadgeResourceID = kCustomIconResource,
+	kCustomBadgeResourceVersion = 0
+}
+
+enum
+{
+	kRoutingResourceType = getOSType!("rout"),
+	kRoutingResourceID = 0
+}
+
+enum
+{
+	kContainerFolderAliasType = getOSType!("fdrp"),
+	kContainerTrashAliasType = getOSType!("trsh"),
+	kContainerHardDiskAliasType = getOSType!("hdsk"),
+	kContainerFloppyAliasType = getOSType!("flpy"),
+	kContainerServerAliasType = getOSType!("srvr"),
+	kApplicationAliasType = getOSType!("adrp"),
+	kContainerAliasType = getOSType!("drop"),
+	kDesktopPrinterAliasType = getOSType!("dtpa"),
+	kContainerCDROMAliasType = getOSType!("cddr"),
+	kApplicationCPAliasType = getOSType!("acdp"),
+	kApplicationDAAliasType = getOSType!("addp"),
+	kPackageAliasType = getOSType!("fpka"),
+	kAppPackageAliasType = getOSType!("fapa")
+}
+
+enum
+{
+	kSystemFolderAliasType = getOSType!("fasy"),
+	kAppleMenuFolderAliasType = getOSType!("faam"),
+	kStartupFolderAliasType = getOSType!("fast"),
+	kPrintMonitorDocsFolderAliasType = getOSType!("fapn"),
+	kPreferencesFolderAliasType = getOSType!("fapf"),
+	kControlPanelFolderAliasType = getOSType!("fact"),
+	kExtensionFolderAliasType = getOSType!("faex")
+}
+
+enum
+{
+	kExportedFolderAliasType = getOSType!("faet"),
+	kDropFolderAliasType = getOSType!("fadr"),
+	kSharedFolderAliasType = getOSType!("fash"),
+	kMountedFolderAliasType = getOSType!("famn")
+}
+
+enum
+{
+	kIsOnDesk = 0x0001,
+	kColor = 0x000E,
+	kIsShared = 0x0040,
+	kHasNoINITs = 0x0080,
+	kHasBeenInited = 0x0100,
+	kHasCustomIcon = 0x0400,
+	kIsStationery = 0x0800,
+	kNameLocked = 0x1000,
+	kHasBundle = 0x2000,
+	kIsInvisible = 0x4000,
+	kIsAlias = 0x8000
+}
+
+enum
+{
+	fOnDesk = kIsOnDesk,
+	fHasBundle = kHasBundle,
+	fInvisible = kIsInvisible
+}
+
+enum
+{
+	fTrash = -3,
+	fDesktop = -2,
+	fDisk = 0
+}
+
+enum
+{
+	kExtendedFlagsAreInvalid = 0x8000,
+	kExtendedFlagHasCustomBadge = 0x0100,
+	kExtendedFlagObjectIsBusy = 0x0080,
+	kExtendedFlagHasRoutingInfo = 0x0004
+}
+
+enum
+{
+	kFirstMagicBusyFiletype = getOSType!("bzy "),
+	kLastMagicBusyFiletype = getOSType!("bzy?")
+}
+
+enum
+{
+	kMagicBusyCreationDate = 0x4F3AFDB0
+}
+
+struct CustomBadgeResource
+{
+	short version_;
+	short customBadgeResourceID;
+	uint customBadgeType;
+	uint customBadgeCreator;
+	uint windowBadgeType;
+	uint windowBadgeCreator;
+	uint overrideType;
+	uint overrideCreator;
+}
+
+
+struct RoutingResourceEntry
+{
+	uint creator;
+	uint fileType;
+	uint targetFolder;
+	uint destinationFolder;
+	uint reservedField;
+}
+
+
+struct FileInfo
+{
+	uint fileType;
+	uint fileCreator;
+	ushort finderFlags;
+	Point location;
+	ushort reservedField;
+}
+
+
+struct FolderInfo
+{
+	Rect windowBounds;
+	ushort finderFlags;
+	Point location;
+	ushort reservedField;
+}
+
+
+struct ExtendedFileInfo
+{
+	SInt16* reserved1;
+	ushort extendedFinderFlags;
+	short reserved2;
+	int putAwayFolderID;
+}
+
+
+struct ExtendedFolderInfo
+{
+	Point scrollPosition;
+	int reserved1;
+	ushort extendedFinderFlags;
+	short reserved2;
+	int putAwayFolderID;
+}
+
+
+struct FInfo
+{
+	uint fdType;
+	uint fdCreator;
+	ushort fdFlags;
+	Point fdLocation;
+	short fdFldr;
+}
+
+
+struct FXInfo
+{
+	short fdIconID;
+	SInt16* fdReserved;
+	byte fdScript;
+	byte fdXFlags;
+	short fdComment;
+	int fdPutAway;
+}
+
+
+struct DInfo
+{
+	Rect frRect;
+	ushort frFlags;
+	Point frLocation;
+	short frView;
+}
+
+
+struct DXInfo
+{
+	Point frScroll;
+	int frOpenChain;
+	byte frScript;
+	byte frXFlags;
+	short frComment;
+	int frPutAway;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/FixMath.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,43 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.FixMath;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+extern (C)
+{
+	int FixRatio (short numer, short denom);
+	int FixMul (int a, int b);
+	short FixRound (int x);
+	int Fix2Frac (int x);
+	int Fix2Long (int x);
+	int Long2Fix (int x);
+	int Frac2Fix (int x);
+	int FracMul (int x, int y);
+	int FixDiv (int x, int y);
+	int FracDiv (int x, int y);
+	int FracSqrt (int x);
+	int FracSin (int x);
+	int FracCos (int x);
+	int FixATan2 (int x, int y);
+	double Frac2X (int x);
+	double Fix2X (int x);
+	int X2Fix (double x);
+	int X2Frac (double x);
+	short WideCompare (wide* target, wide* source);
+	wide* WideAdd (wide* target, wide* source);
+	wide* WideSubtract (wide* target, wide* source);
+	wide* WideNegate (wide* target);
+	wide* WideShift (wide* target, int shift);
+	uint WideSquareRoot (wide* source);
+	wide* WideMultiply (int multiplicand, int multiplier, wide* target);
+	int WideDivide (wide* dividend, int divisor, SInt32* remainder);
+	wide* WideWideDivide (wide* dividend, int divisor, SInt32* remainder);
+	wide* WideBitShift (wide* target, int shift);
+	uint UnsignedFixedMulDiv (uint value, uint multiplier, uint divisor);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Folders.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,651 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Folders;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.objc.bridge.TypeEncoding;
+
+alias uint FolderDescFlags;
+alias uint FolderClass;
+alias uint FolderType;
+alias uint FolderLocation;
+alias FolderDesc* FolderDescPtr;
+alias uint RoutingFlags;
+alias FolderRouting* FolderRoutingPtr;
+alias FolderManagerNotificationProcPtr FolderManagerNotificationUPP;
+
+extern (C)
+{
+	alias int function (uint, void*, void*) FolderManagerNotificationProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kDesktopFolderType = getOSType!("desk");
+		const __kTrashFolderType = getOSType!("trsh");
+		const __kWhereToEmptyTrashFolderType = getOSType!("empt");
+		const __kFontsFolderType = getOSType!("font");
+		const __kPreferencesFolderType = getOSType!("pref");
+		const __kSystemPreferencesFolderType = getOSType!("sprf");
+		const __kTemporaryFolderType = getOSType!("temp");
+		const __kChewableItemsFolderType = getOSType!("flnt");
+		const __kTemporaryItemsInCacheDataFolderType = getOSType!("vtmp");
+		const __kApplicationsFolderType = getOSType!("apps");
+		const __kVolumeRootFolderType = getOSType!("root");
+		const __kDomainTopLevelFolderType = getOSType!("dtop");
+		const __kDomainLibraryFolderType = getOSType!("dlib");
+		const __kUsersFolderType = getOSType!("usrs");
+		const __kCurrentUserFolderType = getOSType!("cusr");
+		const __kSharedUserDataFolderType = getOSType!("sdat");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kDocumentsFolderType = getOSType!("docs");
+		const __kPictureDocumentsFolderType = getOSType!("pdoc");
+		const __kMovieDocumentsFolderType = getOSType!("mdoc");
+		const __kMusicDocumentsFolderType = getOSType!("xB5646F6");
+		const __kInternetSitesFolderType = getOSType!("site");
+		const __kPublicFolderType = getOSType!("pubb");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kVoicesFolderType = getOSType!("fvoc");
+		const __kUtilitiesFolderType = getOSType!("x757469C");
+		const __kThemesFolderType = getOSType!("thme");
+		const __kFavoritesFolderType = getOSType!("favs");
+		const __kInternetSearchSitesFolderType = getOSType!("issf");
+		const __kInstallerLogsFolderType = getOSType!("ilgf");
+		const __kScriptsFolderType = getOSType!("x736372C");
+		const __kFolderActionsFolderType = getOSType!("fasf");
+		const __kSpeakableItemsFolderType = getOSType!("spki");
+		const __kKeychainFolderType = getOSType!("kchn");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kColorSyncFolderType = getOSType!("sync");
+		const __kColorSyncCMMFolderType = getOSType!("ccmm");
+		const __kColorSyncScriptingFolderType = getOSType!("cscr");
+		const __kPrintersFolderType = getOSType!("impr");
+		const __kSpeechFolderType = getOSType!("spch");
+		const __kCarbonLibraryFolderType = getOSType!("carb");
+		const __kDocumentationFolderType = getOSType!("info");
+		const __kISSDownloadsFolderType = getOSType!("issd");
+		const __kUserSpecificTmpFolderType = getOSType!("utmp");
+		const __kCachedDataFolderType = getOSType!("cach");
+		const __kFrameworksFolderType = getOSType!("fram");
+		const __kPrivateFrameworksFolderType = getOSType!("pfrm");
+		const __kClassicDesktopFolderType = getOSType!("sdsk");
+		const __kSystemSoundsFolderType = getOSType!("ssnd");
+		const __kComponentsFolderType = getOSType!("cmpd");
+		const __kQuickTimeComponentsFolderType = getOSType!("wcmp");
+		const __kCoreServicesFolderType = getOSType!("csrv");
+		const __kAudioSupportFolderType = getOSType!("adio");
+		const __kAudioPresetsFolderType = getOSType!("apst");
+		const __kAudioSoundsFolderType = getOSType!("asnd");
+		const __kAudioSoundBanksFolderType = getOSType!("bank");
+		const __kAudioAlertSoundsFolderType = getOSType!("alrt");
+		const __kAudioPlugInsFolderType = getOSType!("aplg");
+		const __kAudioComponentsFolderType = getOSType!("acmp");
+		const __kKernelExtensionsFolderType = getOSType!("kext");
+		const __kDirectoryServicesFolderType = getOSType!("dsrv");
+		const __kDirectoryServicesPlugInsFolderType = getOSType!("dplg");
+		const __kInstallerReceiptsFolderType = getOSType!("rcpt");
+		const __kFileSystemSupportFolderType = getOSType!("fsys");
+		const __kAppleShareSupportFolderType = getOSType!("shar");
+		const __kAppleShareAuthenticationFolderType = getOSType!("auth");
+		const __kMIDIDriversFolderType = getOSType!("midi");
+		const __kKeyboardLayoutsFolderType = getOSType!("klay");
+		const __kIndexFilesFolderType = getOSType!("indx");
+		const __kFindByContentIndexesFolderType = getOSType!("fbcx");
+		const __kManagedItemsFolderType = getOSType!("mang");
+		const __kBootTimeStartupItemsFolderType = getOSType!("empz");
+		const __kAutomatorWorkflowsFolderType = getOSType!("flow");
+		const __kAutosaveInformationFolderType = getOSType!("asav");
+		const __kSpotlightSavedSearchesFolderType = getOSType!("spot");
+		const __kSpotlightImportersFolderType = getOSType!("simp");
+		const __kSpotlightMetadataCacheFolderType = getOSType!("scch");
+		const __kInputManagersFolderType = getOSType!("inpt");
+		const __kInputMethodsFolderType = getOSType!("inpf");
+		const __kLibraryAssistantsFolderType = getOSType!("astl");
+		const __kAudioDigidesignFolderType = getOSType!("adig");
+		const __kAudioVSTFolderType = getOSType!("avst");
+		const __kColorPickersFolderType = getOSType!("cpkr");
+		const __kCompositionsFolderType = getOSType!("cmps");
+		const __kFontCollectionsFolderType = getOSType!("fncl");
+		const __kiMovieFolderType = getOSType!("imov");
+		const __kiMoviePlugInsFolderType = getOSType!("impi");
+		const __kiMovieSoundEffectsFolderType = getOSType!("imse");
+		const __kDownloadsFolderType = getOSType!("down");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kColorSyncProfilesFolderType = getOSType!("prof");
+		const __kApplicationSupportFolderType = getOSType!("asup");
+		const __kTextEncodingsFolderType = getOSType!("xC474657");
+		const __kPrinterDescriptionFolderType = getOSType!("ppdf");
+		const __kPrinterDriverFolderType = getOSType!("xC470726");
+		const __kScriptingAdditionsFolderType = getOSType!("xC473637");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kClassicPreferencesFolderType = getOSType!("cprf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSystemFolderType = getOSType!("macs");
+		const __kSystemDesktopFolderType = getOSType!("sdsk");
+		const __kSystemTrashFolderType = getOSType!("strs");
+		const __kPrintMonitorDocsFolderType = getOSType!("prnt");
+		const __kALMModulesFolderType = getOSType!("walk");
+		const __kALMPreferencesFolderType = getOSType!("trip");
+		const __kALMLocationsFolderType = getOSType!("fall");
+		const __kAppleExtrasFolderType = getOSType!("x616578C");
+		const __kContextualMenuItemsFolderType = getOSType!("cmnu");
+		const __kMacOSReadMesFolderType = getOSType!("x6D6F72C");
+		const __kStartupFolderType = getOSType!("strt");
+		const __kShutdownFolderType = getOSType!("shdf");
+		const __kAppleMenuFolderType = getOSType!("amnu");
+		const __kControlPanelFolderType = getOSType!("ctrl");
+		const __kSystemControlPanelFolderType = getOSType!("sctl");
+		const __kExtensionFolderType = getOSType!("extn");
+		const __kExtensionDisabledFolderType = getOSType!("extD");
+		const __kControlPanelDisabledFolderType = getOSType!("ctrD");
+		const __kSystemExtensionDisabledFolderType = getOSType!("macD");
+		const __kStartupItemsDisabledFolderType = getOSType!("strD");
+		const __kShutdownItemsDisabledFolderType = getOSType!("shdD");
+		const __kAssistantsFolderType = getOSType!("x617374C");
+		const __kStationeryFolderType = getOSType!("odst");
+		const __kOpenDocFolderType = getOSType!("odod");
+		const __kOpenDocShellPlugInsFolderType = getOSType!("odsp");
+		const __kEditorsFolderType = getOSType!("oded");
+		const __kOpenDocEditorsFolderType = getOSType!("xC46F646");
+		const __kOpenDocLibrariesFolderType = getOSType!("odlb");
+		const __kGenEditorsFolderType = getOSType!("xC465646");
+		const __kHelpFolderType = getOSType!("xC4686C7");
+		const __kInternetPlugInFolderType = getOSType!("xC46E657");
+		const __kModemScriptsFolderType = getOSType!("xC46D6F6");
+		const __kControlStripModulesFolderType = getOSType!("sdev");
+		const __kInternetFolderType = getOSType!("x696E74C");
+		const __kAppearanceFolderType = getOSType!("appr");
+		const __kSoundSetsFolderType = getOSType!("snds");
+		const __kDesktopPicturesFolderType = getOSType!("x647470C");
+		const __kFindSupportFolderType = getOSType!("fnds");
+		const __kRecentApplicationsFolderType = getOSType!("rapp");
+		const __kRecentDocumentsFolderType = getOSType!("rdoc");
+		const __kRecentServersFolderType = getOSType!("rsvr");
+		const __kLauncherItemsFolderType = getOSType!("laun");
+		const __kQuickTimeExtensionsFolderType = getOSType!("qtex");
+		const __kDisplayExtensionsFolderType = getOSType!("dspl");
+		const __kMultiprocessingFolderType = getOSType!("mpxf");
+		const __kPrintingPlugInsFolderType = getOSType!("pplg");
+		const __kAppleshareAutomountServerAliasesFolderType = getOSType!("x737276C");
+		const __kVolumeSettingsFolderType = getOSType!("vsfd");
+		const __kPreMacOS91ApplicationsFolderType = getOSType!("x8C70707");
+		const __kPreMacOS91InstallerLogsFolderType = getOSType!("x946C676");
+		const __kPreMacOS91AssistantsFolderType = getOSType!("x8C7374C");
+		const __kPreMacOS91UtilitiesFolderType = getOSType!("x9F7469C");
+		const __kPreMacOS91AppleExtrasFolderType = getOSType!("x8C6578C");
+		const __kPreMacOS91MacOSReadMesFolderType = getOSType!("xB56F72C");
+		const __kPreMacOS91InternetFolderType = getOSType!("x946E74C");
+		const __kPreMacOS91AutomountedServersFolderType = getOSType!("xA77276C");
+		const __kPreMacOS91StationeryFolderType = getOSType!("xBF64737");
+		const __kLocalesFolderType = getOSType!("xC46C6F6");
+		const __kFindByContentPluginsFolderType = getOSType!("fbcp");
+		const __kFindByContentFolderType = getOSType!("fbcf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kMagicTemporaryItemsFolderType = getOSType!("mtmp");
+		const __kTemporaryItemsInUserDomainFolderType = getOSType!("temq");
+		const __kCurrentUserRemoteFolderLocation = getOSType!("rusf");
+		const __kCurrentUserRemoteFolderType = getOSType!("rusr");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kDeveloperDocsFolderType = getOSType!("ddoc");
+		const __kDeveloperHelpFolderType = getOSType!("devh");
+		const __kDeveloperFolderType = getOSType!("devf");
+		const __kDeveloperApplicationsFolderType = getOSType!("dapp");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kRelativeFolder = getOSType!("relf");
+		const __kRedirectedRelativeFolder = getOSType!("rrel");
+		const __kSpecialFolder = getOSType!("spcf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kBlessedFolder = getOSType!("blsf");
+		const __kRootFolder = getOSType!("rotf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kCurrentUserFolderLocation = getOSType!("cusf");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kDictionariesFolderType = getOSType!("dict");
+		const __kLogsFolderType = getOSType!("logs");
+		const __kPreferencePanesFolderType = getOSType!("ppan");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kWidgetsFolderType = getOSType!("wdgt");
+		const __kScreenSaversFolderType = getOSType!("scrn");
+
+	}
+}
+
+enum
+{
+	kOnSystemDisk = -32768L,
+	kOnAppropriateDisk = -32767,
+	kSystemDomain = -32766,
+	kLocalDomain = -32765,
+	kNetworkDomain = -32764,
+	kUserDomain = -32763,
+	kClassicDomain = -32762,
+	kFolderManagerLastDomain = -32760
+}
+
+enum
+{
+	kLastDomainConstant = -32760
+}
+
+enum
+{
+	kCreateFolder = 1,
+	kDontCreateFolder = 0
+}
+
+enum
+{
+	kDesktopFolderType = getOSType!("desk"),
+	kTrashFolderType = getOSType!("trsh"),
+	kWhereToEmptyTrashFolderType = getOSType!("empt"),
+	kFontsFolderType = getOSType!("font"),
+	kPreferencesFolderType = getOSType!("pref"),
+	kSystemPreferencesFolderType = getOSType!("sprf"),
+	kTemporaryFolderType = getOSType!("temp"),
+	kChewableItemsFolderType = getOSType!("flnt"),
+	kTemporaryItemsInCacheDataFolderType = getOSType!("vtmp"),
+	kApplicationsFolderType = getOSType!("apps"),
+	kVolumeRootFolderType = getOSType!("root"),
+	kDomainTopLevelFolderType = getOSType!("dtop"),
+	kDomainLibraryFolderType = getOSType!("dlib"),
+	kUsersFolderType = getOSType!("usrs"),
+	kCurrentUserFolderType = getOSType!("cusr"),
+	kSharedUserDataFolderType = getOSType!("sdat")
+}
+
+enum
+{
+	kDocumentsFolderType = getOSType!("docs"),
+	kPictureDocumentsFolderType = getOSType!("pdoc"),
+	kMovieDocumentsFolderType = getOSType!("mdoc"),
+	kMusicDocumentsFolderType = getOSType!("xB5646F6"),
+	kInternetSitesFolderType = getOSType!("site"),
+	kPublicFolderType = getOSType!("pubb")
+}
+
+enum
+{
+	kSharedLibrariesFolderType = 0xC46C6962,
+	kVoicesFolderType = getOSType!("fvoc"),
+	kUtilitiesFolderType = getOSType!("x757469C"),
+	kThemesFolderType = getOSType!("thme"),
+	kFavoritesFolderType = getOSType!("favs"),
+	kInternetSearchSitesFolderType = getOSType!("issf"),
+	kInstallerLogsFolderType = getOSType!("ilgf"),
+	kScriptsFolderType = getOSType!("x736372C"),
+	kFolderActionsFolderType = getOSType!("fasf"),
+	kSpeakableItemsFolderType = getOSType!("spki"),
+	kKeychainFolderType = getOSType!("kchn")
+}
+
+enum
+{
+	kColorSyncFolderType = getOSType!("sync"),
+	kColorSyncCMMFolderType = getOSType!("ccmm"),
+	kColorSyncScriptingFolderType = getOSType!("cscr"),
+	kPrintersFolderType = getOSType!("impr"),
+	kSpeechFolderType = getOSType!("spch"),
+	kCarbonLibraryFolderType = getOSType!("carb"),
+	kDocumentationFolderType = getOSType!("info"),
+	kISSDownloadsFolderType = getOSType!("issd"),
+	kUserSpecificTmpFolderType = getOSType!("utmp"),
+	kCachedDataFolderType = getOSType!("cach"),
+	kFrameworksFolderType = getOSType!("fram"),
+	kPrivateFrameworksFolderType = getOSType!("pfrm"),
+	kClassicDesktopFolderType = getOSType!("sdsk"),
+	kSystemSoundsFolderType = getOSType!("ssnd"),
+	kComponentsFolderType = getOSType!("cmpd"),
+	kQuickTimeComponentsFolderType = getOSType!("wcmp"),
+	kCoreServicesFolderType = getOSType!("csrv"),
+	kAudioSupportFolderType = getOSType!("adio"),
+	kAudioPresetsFolderType = getOSType!("apst"),
+	kAudioSoundsFolderType = getOSType!("asnd"),
+	kAudioSoundBanksFolderType = getOSType!("bank"),
+	kAudioAlertSoundsFolderType = getOSType!("alrt"),
+	kAudioPlugInsFolderType = getOSType!("aplg"),
+	kAudioComponentsFolderType = getOSType!("acmp"),
+	kKernelExtensionsFolderType = getOSType!("kext"),
+	kDirectoryServicesFolderType = getOSType!("dsrv"),
+	kDirectoryServicesPlugInsFolderType = getOSType!("dplg"),
+	kInstallerReceiptsFolderType = getOSType!("rcpt"),
+	kFileSystemSupportFolderType = getOSType!("fsys"),
+	kAppleShareSupportFolderType = getOSType!("shar"),
+	kAppleShareAuthenticationFolderType = getOSType!("auth"),
+	kMIDIDriversFolderType = getOSType!("midi"),
+	kKeyboardLayoutsFolderType = getOSType!("klay"),
+	kIndexFilesFolderType = getOSType!("indx"),
+	kFindByContentIndexesFolderType = getOSType!("fbcx"),
+	kManagedItemsFolderType = getOSType!("mang"),
+	kBootTimeStartupItemsFolderType = getOSType!("empz"),
+	kAutomatorWorkflowsFolderType = getOSType!("flow"),
+	kAutosaveInformationFolderType = getOSType!("asav"),
+	kSpotlightSavedSearchesFolderType = getOSType!("spot"),
+	kSpotlightImportersFolderType = getOSType!("simp"),
+	kSpotlightMetadataCacheFolderType = getOSType!("scch"),
+	kInputManagersFolderType = getOSType!("inpt"),
+	kInputMethodsFolderType = getOSType!("inpf"),
+	kLibraryAssistantsFolderType = getOSType!("astl"),
+	kAudioDigidesignFolderType = getOSType!("adig"),
+	kAudioVSTFolderType = getOSType!("avst"),
+	kColorPickersFolderType = getOSType!("cpkr"),
+	kCompositionsFolderType = getOSType!("cmps"),
+	kFontCollectionsFolderType = getOSType!("fncl"),
+	kiMovieFolderType = getOSType!("imov"),
+	kiMoviePlugInsFolderType = getOSType!("impi"),
+	kiMovieSoundEffectsFolderType = getOSType!("imse"),
+	kDownloadsFolderType = getOSType!("down")
+}
+
+enum
+{
+	kColorSyncProfilesFolderType = getOSType!("prof"),
+	kApplicationSupportFolderType = getOSType!("asup"),
+	kTextEncodingsFolderType = getOSType!("xC474657"),
+	kPrinterDescriptionFolderType = getOSType!("ppdf"),
+	kPrinterDriverFolderType = getOSType!("xC470726"),
+	kScriptingAdditionsFolderType = getOSType!("xC473637")
+}
+
+enum
+{
+	kClassicPreferencesFolderType = getOSType!("cprf")
+}
+
+enum
+{
+	kSystemFolderType = getOSType!("macs"),
+	kSystemDesktopFolderType = getOSType!("sdsk"),
+	kSystemTrashFolderType = getOSType!("strs"),
+	kPrintMonitorDocsFolderType = getOSType!("prnt"),
+	kALMModulesFolderType = getOSType!("walk"),
+	kALMPreferencesFolderType = getOSType!("trip"),
+	kALMLocationsFolderType = getOSType!("fall"),
+	kAppleExtrasFolderType = getOSType!("x616578C"),
+	kContextualMenuItemsFolderType = getOSType!("cmnu"),
+	kMacOSReadMesFolderType = getOSType!("x6D6F72C"),
+	kStartupFolderType = getOSType!("strt"),
+	kShutdownFolderType = getOSType!("shdf"),
+	kAppleMenuFolderType = getOSType!("amnu"),
+	kControlPanelFolderType = getOSType!("ctrl"),
+	kSystemControlPanelFolderType = getOSType!("sctl"),
+	kExtensionFolderType = getOSType!("extn"),
+	kExtensionDisabledFolderType = getOSType!("extD"),
+	kControlPanelDisabledFolderType = getOSType!("ctrD"),
+	kSystemExtensionDisabledFolderType = getOSType!("macD"),
+	kStartupItemsDisabledFolderType = getOSType!("strD"),
+	kShutdownItemsDisabledFolderType = getOSType!("shdD"),
+	kAssistantsFolderType = getOSType!("x617374C"),
+	kStationeryFolderType = getOSType!("odst"),
+	kOpenDocFolderType = getOSType!("odod"),
+	kOpenDocShellPlugInsFolderType = getOSType!("odsp"),
+	kEditorsFolderType = getOSType!("oded"),
+	kOpenDocEditorsFolderType = getOSType!("xC46F646"),
+	kOpenDocLibrariesFolderType = getOSType!("odlb"),
+	kGenEditorsFolderType = getOSType!("xC465646"),
+	kHelpFolderType = getOSType!("xC4686C7"),
+	kInternetPlugInFolderType = getOSType!("xC46E657"),
+	kModemScriptsFolderType = getOSType!("xC46D6F6"),
+	kControlStripModulesFolderType = getOSType!("sdev"),
+	kInternetFolderType = getOSType!("x696E74C"),
+	kAppearanceFolderType = getOSType!("appr"),
+	kSoundSetsFolderType = getOSType!("snds"),
+	kDesktopPicturesFolderType = getOSType!("x647470C"),
+	kFindSupportFolderType = getOSType!("fnds"),
+	kRecentApplicationsFolderType = getOSType!("rapp"),
+	kRecentDocumentsFolderType = getOSType!("rdoc"),
+	kRecentServersFolderType = getOSType!("rsvr"),
+	kLauncherItemsFolderType = getOSType!("laun"),
+	kQuickTimeExtensionsFolderType = getOSType!("qtex"),
+	kDisplayExtensionsFolderType = getOSType!("dspl"),
+	kMultiprocessingFolderType = getOSType!("mpxf"),
+	kPrintingPlugInsFolderType = getOSType!("pplg"),
+	kAppleshareAutomountServerAliasesFolderType = getOSType!("x737276C"),
+	kVolumeSettingsFolderType = getOSType!("vsfd"),
+	kPreMacOS91ApplicationsFolderType = getOSType!("x8C70707"),
+	kPreMacOS91InstallerLogsFolderType = getOSType!("x946C676"),
+	kPreMacOS91AssistantsFolderType = getOSType!("x8C7374C"),
+	kPreMacOS91UtilitiesFolderType = getOSType!("x9F7469C"),
+	kPreMacOS91AppleExtrasFolderType = getOSType!("x8C6578C"),
+	kPreMacOS91MacOSReadMesFolderType = getOSType!("xB56F72C"),
+	kPreMacOS91InternetFolderType = getOSType!("x946E74C"),
+	kPreMacOS91AutomountedServersFolderType = getOSType!("xA77276C"),
+	kPreMacOS91StationeryFolderType = getOSType!("xBF64737"),
+	kLocalesFolderType = getOSType!("xC46C6F6"),
+	kFindByContentPluginsFolderType = getOSType!("fbcp"),
+	kFindByContentFolderType = getOSType!("fbcf")
+}
+
+enum
+{
+	kMagicTemporaryItemsFolderType = getOSType!("mtmp"),
+	kTemporaryItemsInUserDomainFolderType = getOSType!("temq"),
+	kCurrentUserRemoteFolderLocation = getOSType!("rusf"),
+	kCurrentUserRemoteFolderType = getOSType!("rusr")
+}
+
+enum
+{
+	kDeveloperDocsFolderType = getOSType!("ddoc"),
+	kDeveloperHelpFolderType = getOSType!("devh"),
+	kDeveloperFolderType = getOSType!("devf"),
+	kDeveloperApplicationsFolderType = getOSType!("dapp")
+}
+
+enum
+{
+	kCreateFolderAtBoot = 0x00000002,
+	kCreateFolderAtBootBit = 1,
+	kFolderCreatedInvisible = 0x00000004,
+	kFolderCreatedInvisibleBit = 2,
+	kFolderCreatedNameLocked = 0x00000008,
+	kFolderCreatedNameLockedBit = 3,
+	kFolderCreatedAdminPrivs = 0x00000010,
+	kFolderCreatedAdminPrivsBit = 4
+}
+
+enum
+{
+	kFolderInUserFolder = 0x00000020,
+	kFolderInUserFolderBit = 5,
+	kFolderTrackedByAlias = 0x00000040,
+	kFolderTrackedByAliasBit = 6,
+	kFolderInRemoteUserFolderIfAvailable = 0x00000080,
+	kFolderInRemoteUserFolderIfAvailableBit = 7,
+	kFolderNeverMatchedInIdentifyFolder = 0x00000100,
+	kFolderNeverMatchedInIdentifyFolderBit = 8,
+	kFolderMustStayOnSameVolume = 0x00000200,
+	kFolderMustStayOnSameVolumeBit = 9,
+	kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400,
+	kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10,
+	kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable,
+	kFolderManagerNotCreatedOnRemoteVolumesBit = 11,
+	kFolderManagerNotCreatedOnRemoteVolumesMask = (1 << kFolderManagerNotCreatedOnRemoteVolumesBit),
+	kFolderManagerNewlyCreatedFolderIsLocalizedBit = 12,
+	kFolderManagerNewlyCreatedFolderShouldHaveDotLocalizedCreatedWithinMask = (1 << kFolderManagerNewlyCreatedFolderIsLocalizedBit)
+}
+
+enum
+{
+	kRelativeFolder = getOSType!("relf"),
+	kRedirectedRelativeFolder = getOSType!("rrel"),
+	kSpecialFolder = getOSType!("spcf")
+}
+
+enum
+{
+	kBlessedFolder = getOSType!("blsf"),
+	kRootFolder = getOSType!("rotf")
+}
+
+enum
+{
+	kCurrentUserFolderLocation = getOSType!("cusf")
+}
+
+enum
+{
+	kDictionariesFolderType = getOSType!("dict"),
+	kLogsFolderType = getOSType!("logs"),
+	kPreferencePanesFolderType = getOSType!("ppan")
+}
+
+enum
+{
+	kWidgetsFolderType = getOSType!("wdgt"),
+	kScreenSaversFolderType = getOSType!("scrn")
+}
+
+struct FolderDesc
+{
+	int descSize;
+	uint foldType;
+	uint flags;
+	uint foldClass;
+	uint foldLocation;
+	uint badgeSignature;
+	uint badgeType;
+	uint reserved;
+	ubyte[64] name;
+}
+
+
+struct FolderRouting
+{
+	int descSize;
+	uint fileType;
+	uint routeFromFolder;
+	uint routeToFolder;
+	uint flags;
+}
+
+extern (C)
+{
+	short FindFolder (short vRefNum, uint folderType, ubyte createFolder, FSVolumeRefNum* foundVRefNum, SInt32* foundDirID);
+	short ReleaseFolder (short vRefNum, uint folderType);
+	short FSFindFolder (short vRefNum, uint folderType, ubyte createFolder, FSRef* foundRef);
+	short AddFolderDescriptor (uint foldType, uint flags, uint foldClass, uint foldLocation, uint badgeSignature, uint badgeType, char* name, ubyte replaceFlag);
+	short GetFolderTypes (uint requestedTypeCount, UInt32* totalTypeCount, FolderType* theTypes);
+	short RemoveFolderDescriptor (uint foldType);
+	int GetFolderNameUnicode (short vRefNum, uint foldType, FSVolumeRefNum* foundVRefNum, HFSUniStr255* name);
+	short InvalidateFolderDescriptorCache (short vRefNum, int dirID);
+	short IdentifyFolder (short vRefNum, int dirID, FolderType* foldType);
+	short FSDetermineIfRefIsEnclosedByFolder (short domainOrVRefNum, uint folderType, FSRef* inRef, char* outResult);
+	short DetermineIfPathIsEnclosedByFolder (short domainOrVRefNum, uint folderType, char* utf8Path, ubyte pathIsRealPath, char* outResult);
+	FolderManagerNotificationUPP NewFolderManagerNotificationUPP (FolderManagerNotificationProcPtr userRoutine);
+	void DisposeFolderManagerNotificationUPP (FolderManagerNotificationUPP userUPP);
+	int InvokeFolderManagerNotificationUPP (uint message, void* arg, void* userRefCon, FolderManagerNotificationUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Gestalt.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,2168 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Gestalt;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+
+alias SelectorFunctionProcPtr SelectorFunctionUPP;
+
+extern (C)
+{
+	alias short function (uint, SInt32*) SelectorFunctionProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __gestaltAddressingModeAttr = getOSType!("addr");
+		const __gestaltAFPClient = getOSType!("afps");
+		const __gestaltAliasMgrAttr = getOSType!("alis");
+		const __gestaltAppearanceAttr = getOSType!("appr");
+		const __gestaltAppearanceVersion = getOSType!("apvr");
+		const __gestaltArbitorAttr = getOSType!("arb ");
+		const __gestaltAppleScriptVersion = getOSType!("ascv");
+		const __gestaltAppleScriptAttr = getOSType!("ascr");
+		const __gestaltATAAttr = getOSType!("ata ");
+		const __gestaltATalkVersion = getOSType!("atkv");
+		const __gestaltAppleTalkVersion = getOSType!("atlk");
+		const __gestaltAUXVersion = getOSType!("a/ux");
+		const __gestaltMacOSCompatibilityBoxAttr = getOSType!("bbox");
+		const __gestaltBusClkSpeed = getOSType!("bclk");
+		const __gestaltBusClkSpeedMHz = getOSType!("bclm");
+		const __gestaltCloseViewAttr = getOSType!("BSDa");
+		const __gestaltCarbonVersion = getOSType!("cbon");
+		const __gestaltCFMAttr = getOSType!("cfrg");
+		const __gestaltProcessorCacheLineSize = getOSType!("csiz");
+		const __gestaltCollectionMgrVersion = getOSType!("cltn");
+		const __gestaltColorMatchingAttr = getOSType!("cmta");
+		const __gestaltColorMatchingVersion = getOSType!("cmtc");
+		const __gestaltControlMgrVersion = getOSType!("cmvr");
+		const __gestaltControlMgrAttr = getOSType!("cntl");
+		const __gestaltConnMgrAttr = getOSType!("conn");
+		const __gestaltColorPickerVersion = getOSType!("cpkr");
+		const __gestaltColorPicker = getOSType!("cpkr");
+		const __gestaltComponentMgr = getOSType!("cpnt");
+		const __gestaltComponentPlatform = getOSType!("copl");
+		const __gestaltNativeCPUtype = getOSType!("cput");
+		const __gestaltNativeCPUfamily = getOSType!("cpuf");
+		const __gestaltCPU486 = getOSType!("i486");
+		const __gestaltCPUPentium = getOSType!("i586");
+		const __gestaltCPUPentiumPro = getOSType!("i5pr");
+		const __gestaltCPUPentiumII = getOSType!("i5ii");
+		const __gestaltCPUX86 = getOSType!("ixxx");
+		const __gestaltCPUPentium4 = getOSType!("i5iv");
+		const __gestaltCRMAttr = getOSType!("crm ");
+		const __gestaltControlStripVersion = getOSType!("csvr");
+		const __gestaltCountOfCPUs = getOSType!("cpus");
+		const __gestaltCTBVersion = getOSType!("ctbv");
+		const __gestaltDBAccessMgrAttr = getOSType!("dbac");
+		const __gestaltDiskCacheSize = getOSType!("dcsz");
+		const __gestaltSDPFindVersion = getOSType!("dfnd");
+		const __gestaltDictionaryMgrAttr = getOSType!("dict");
+		const __gestaltDITLExtAttr = getOSType!("ditl");
+		const __gestaltDialogMgrAttr = getOSType!("dlog");
+		const __gestaltDesktopPicturesAttr = getOSType!("dkpx");
+		const __gestaltDisplayMgrVers = getOSType!("dplv");
+		const __gestaltDisplayMgrAttr = getOSType!("dply");
+		const __gestaltDragMgrAttr = getOSType!("drag");
+		const __gestaltDrawSprocketVersion = getOSType!("dspv");
+		const __gestaltDigitalSignatureVersion = getOSType!("dsig");
+		const __gestaltDTPFeatures = getOSType!("dtpf");
+		const __gestaltDTPInfo = getOSType!("dtpx");
+		const __gestaltEasyAccessAttr = getOSType!("easy");
+		const __gestaltEditionMgrAttr = getOSType!("edtn");
+		const __gestaltAppleEventsAttr = getOSType!("evnt");
+		const __gestaltExtensionTableVersion = getOSType!("etbl");
+		const __gestaltFBCIndexingState = getOSType!("fbci");
+		const __gestaltFBCVersion = getOSType!("fbcv");
+		const __gestaltFileMappingAttr = getOSType!("flmp");
+		const __gestaltFloppyAttr = getOSType!("flpy");
+		const __gestaltFinderAttr = getOSType!("fndr");
+		const __gestaltFindFolderAttr = getOSType!("fold");
+		const __gestaltFindFolderRedirectionAttr = getOSType!("fole");
+		const __gestaltFontMgrAttr = getOSType!("font");
+		const __gestaltFPUType = getOSType!("fpu ");
+		const __gestaltFSAttr = getOSType!("fs  ");
+		const __gestaltAdminFeaturesFlagsAttr = getOSType!("fred");
+		const __gestaltFSMVersion = getOSType!("fsm ");
+		const __gestaltFXfrMgrAttr = getOSType!("fxfr");
+		const __gestaltGraphicsAttr = getOSType!("gfxa");
+		const __gestaltGraphicsVersion = getOSType!("grfx");
+		const __gestaltHardwareAttr = getOSType!("hdwr");
+		const __gestaltHelpMgrAttr = getOSType!("help");
+		const __gestaltHardwareVendorCode = getOSType!("hrad");
+		const __gestaltHardwareVendorApple = getOSType!("Appl");
+		const __gestaltCompressionMgr = getOSType!("icmp");
+		const __gestaltIconUtilitiesAttr = getOSType!("icon");
+		const __gestaltInternalDisplay = getOSType!("idsp");
+		const __gestaltKeyboardType = getOSType!("kbd ");
+		const __gestaltUDFSupport = getOSType!("kudf");
+		const __gestaltLowMemorySize = getOSType!("lmem");
+		const __gestaltLogicalRAMSize = getOSType!("lram");
+		const __gestaltMachineType = getOSType!("mach");
+		const __gestaltSMPMailerVersion = getOSType!("malr");
+		const __gestaltMediaBay = getOSType!("mbeh");
+		const __gestaltMessageMgrVersion = getOSType!("mess");
+		const __gestaltMenuMgrAttr = getOSType!("menu");
+		const __gestaltMultipleUsersState = getOSType!("mfdr");
+		const __gestaltMachineIcon = getOSType!("micn");
+		const __gestaltMiscAttr = getOSType!("misc");
+		const __gestaltMixedModeVersion = getOSType!("mixd");
+		const __gestaltMixedModeAttr = getOSType!("mixd");
+		const __gestaltQuickTimeConferencing = getOSType!("mtlk");
+		const __gestaltMemoryMapAttr = getOSType!("mmap");
+		const __gestaltMMUType = getOSType!("mmu ");
+		const __gestaltUserVisibleMachineName = getOSType!("mnam");
+		const __gestaltMPCallableAPIsAttr = getOSType!("mpsc");
+		const __gestaltStdNBPAttr = getOSType!("nlup");
+		const __gestaltNotificationMgrAttr = getOSType!("nmgr");
+		const __gestaltNameRegistryVersion = getOSType!("nreg");
+		const __gestaltNuBusSlotCount = getOSType!("nubs");
+		const __gestaltOCEToolboxVersion = getOSType!("ocet");
+		const __gestaltOCEToolboxAttr = getOSType!("oceu");
+		const __gestaltOpenFirmwareInfo = getOSType!("opfw");
+		const __gestaltOSAttr = getOSType!("os  ");
+		const __gestaltOSTable = getOSType!("ostt");
+		const __gestaltOpenTptNetworkSetup = getOSType!("otcf");
+		const __gestaltOpenTptNetworkSetupVersion = getOSType!("otcv");
+		const __gestaltOpenTptRemoteAccess = getOSType!("otra");
+		const __gestaltOpenTptRemoteAccessVersion = getOSType!("otrv");
+		const __gestaltOpenTptVersions = getOSType!("otvr");
+		const __gestaltOpenTpt = getOSType!("otan");
+		const __gestaltPCCard = getOSType!("pccd");
+		const __gestaltProcClkSpeed = getOSType!("pclk");
+		const __gestaltProcClkSpeedMHz = getOSType!("mclk");
+		const __gestaltPCXAttr = getOSType!("pcxg");
+		const __gestaltLogicalPageSize = getOSType!("pgsz");
+		const __gestaltScreenCaptureMain = getOSType!("pic1");
+		const __gestaltScreenCaptureDir = getOSType!("pic2");
+		const __gestaltGXPrintingMgrVersion = getOSType!("pmgr");
+		const __gestaltPopupAttr = getOSType!("pop!");
+		const __gestaltPowerMgrAttr = getOSType!("powr");
+		const __gestaltPowerMgrVers = getOSType!("pwrv");
+		const __gestaltPPCToolboxAttr = getOSType!("ppc ");
+		const __gestaltPowerPCProcessorFeatures = getOSType!("ppcf");
+		const __gestaltProcessorType = getOSType!("proc");
+		const __gestaltSDPPromptVersion = getOSType!("prpv");
+		const __gestaltParityAttr = getOSType!("prty");
+		const __gestaltQD3DVersion = getOSType!("q3v ");
+		const __gestaltQD3DViewer = getOSType!("q3vc");
+		const __gestaltQuickdrawVersion = getOSType!("qd  ");
+		const __gestaltQD3D = getOSType!("qd3d");
+		const __gestaltGXVersion = getOSType!("qdgx");
+		const __gestaltQuickdrawFeatures = getOSType!("qdrw");
+		const __gestaltQDTextVersion = getOSType!("qdtx");
+		const __gestaltQDTextFeatures = getOSType!("qdtf");
+		const __gestaltQuickTimeConferencingInfo = getOSType!("qtci");
+		const __gestaltQuickTimeVersion = getOSType!("qtim");
+		const __gestaltQuickTime = getOSType!("qtim");
+		const __gestaltQuickTimeFeatures = getOSType!("qtrs");
+		const __gestaltQuickTimeStreamingFeatures = getOSType!("qtsf");
+		const __gestaltQuickTimeStreamingVersion = getOSType!("qtst");
+		const __gestaltQuickTimeThreadSafeFeaturesAttr = getOSType!("qtth");
+		const __gestaltQTVRMgrAttr = getOSType!("qtvr");
+		const __gestaltQTVRMgrVers = getOSType!("qtvv");
+		const __gestaltPhysicalRAMSize = getOSType!("ram ");
+		const __gestaltPhysicalRAMSizeInMegabytes = getOSType!("ramm");
+		const __gestaltRBVAddr = getOSType!("rbv ");
+		const __gestaltROMSize = getOSType!("rom ");
+		const __gestaltROMVersion = getOSType!("romv");
+		const __gestaltResourceMgrAttr = getOSType!("rsrc");
+		const __gestaltResourceMgrBugFixesAttrs = getOSType!("rmbg");
+		const __gestaltRealtimeMgrAttr = getOSType!("rtmr");
+		const __gestaltSafeOFAttr = getOSType!("safe");
+		const __gestaltSCCReadAddr = getOSType!("sccr");
+		const __gestaltSCCWriteAddr = getOSType!("sccw");
+		const __gestaltScrapMgrAttr = getOSType!("scra");
+		const __gestaltScriptMgrVersion = getOSType!("scri");
+		const __gestaltScriptCount = getOSType!("scr#");
+		const __gestaltSCSI = getOSType!("scsi");
+		const __gestaltControlStripAttr = getOSType!("sdev");
+		const __gestaltSDPStandardDirectoryVersion = getOSType!("sdvr");
+		const __gestaltSerialAttr = getOSType!("ser ");
+		const __gestaltShutdownAttributes = getOSType!("shut");
+		const __gestaltNuBusConnectors = getOSType!("sltc");
+		const __gestaltSlotAttr = getOSType!("slot");
+		const __gestaltFirstSlotNumber = getOSType!("slt1");
+		const __gestaltSoundAttr = getOSType!("snd ");
+		const __gestaltSplitOSAttr = getOSType!("spos");
+		const __gestaltSMPSPSendLetterVersion = getOSType!("spsl");
+		const __gestaltSpeechRecognitionAttr = getOSType!("srta");
+		const __gestaltSpeechRecognitionVersion = getOSType!("srtb");
+		const __gestaltSoftwareVendorCode = getOSType!("srad");
+		const __gestaltSoftwareVendorApple = getOSType!("Appl");
+		const __gestaltSoftwareVendorLicensee = getOSType!("Lcns");
+		const __gestaltStandardFileAttr = getOSType!("stdf");
+		const __gestaltSysArchitecture = getOSType!("sysa");
+		const __gestaltSystemUpdateVersion = getOSType!("sysu");
+		const __gestaltSystemVersion = getOSType!("sysv");
+		const __gestaltSystemVersionMajor = getOSType!("sys1");
+		const __gestaltSystemVersionMinor = getOSType!("sys2");
+		const __gestaltSystemVersionBugFix = getOSType!("sys3");
+		const __gestaltToolboxTable = getOSType!("tbtt");
+		const __gestaltTextEditVersion = getOSType!("te  ");
+		const __gestaltTEAttr = getOSType!("teat");
+		const __gestaltTeleMgrAttr = getOSType!("tele");
+		const __gestaltTermMgrAttr = getOSType!("term");
+		const __gestaltThreadMgrAttr = getOSType!("thds");
+		const __gestaltTimeMgrVersion = getOSType!("tmgr");
+		const __gestaltTSMTEVersion = getOSType!("tmTV");
+		const __gestaltTSMTEAttr = getOSType!("tmTE");
+		const __gestaltAVLTreeAttr = getOSType!("tree");
+		const __gestaltALMAttr = getOSType!("trip");
+		const __gestaltTSMgrVersion = getOSType!("tsmv");
+		const __gestaltTSMgrAttr = getOSType!("tsma");
+		const __gestaltSpeechAttr = getOSType!("ttsc");
+		const __gestaltTVAttr = getOSType!("tv  ");
+		const __gestaltATSUVersion = getOSType!("uisv");
+		const __gestaltATSUFeatures = getOSType!("uisf");
+		const __gestaltUSBAttr = getOSType!("usb ");
+		const __gestaltUSBVersion = getOSType!("usbv");
+		const __gestaltVersion = getOSType!("vers");
+		const __gestaltVIA1Addr = getOSType!("via1");
+		const __gestaltVIA2Addr = getOSType!("via2");
+		const __gestaltVMAttr = getOSType!("vm  ");
+		const __gestaltVMInfoType = getOSType!("vmin");
+		const __gestaltVMBackingStoreFileRefNum = getOSType!("vmbs");
+		const __gestaltALMVers = getOSType!("walk");
+		const __gestaltWindowMgrAttr = getOSType!("wind");
+		const __gestaltX86Features = getOSType!("x86f");
+		const __gestaltX86AdditionalFeatures = getOSType!("x86a");
+		const __gestaltTranslationAttr = getOSType!("xlat");
+		const __gestaltExtToolboxTable = getOSType!("xttt");
+		const __gestaltUSBPrinterSharingVersion = getOSType!("zak ");
+		const __gestaltUSBPrinterSharingAttr = getOSType!("zak ");
+		const __gestaltWorldScriptIIVersion = getOSType!("doub");
+		const __gestaltWorldScriptIIAttr = getOSType!("wsat");
+	}
+}
+
+enum
+{
+	gestaltAddressingModeAttr = getOSType!("addr"),
+	gestalt32BitAddressing = 0,
+	gestalt32BitSysZone = 1,
+	gestalt32BitCapable = 2
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		gestaltAFPClient = getOSType!("afps"),
+		gestaltAFPClientVersionMask = 0x0000FFFF,
+		gestaltAFPClient3_5 = 0x0001,
+		gestaltAFPClient3_6 = 0x0002,
+		gestaltAFPClient3_6_1 = 0x0003,
+		gestaltAFPClient3_6_2 = 0x0004,
+		gestaltAFPClient3_6_3 = 0x0005,
+		gestaltAFPClient3_7 = 0x0006,
+		gestaltAFPClient3_7_2 = 0x0007,
+		gestaltAFPClient3_8 = 0x0008,
+		gestaltAFPClient3_8_1 = 0x0009,
+		gestaltAFPClient3_8_3 = 0x000A,
+		gestaltAFPClient3_8_4 = 0x000B,
+		gestaltAFPClientAttributeMask = 0xFFFF0000L,
+		gestaltAFPClientCfgRsrc = 16,
+		gestaltAFPClientSupportsIP = 29,
+		gestaltAFPClientVMUI = 30,
+		gestaltAFPClientMultiReq = 31
+	}
+}
+
+else
+{
+	enum
+	{
+		gestaltAFPClient = getOSType!("afps"),
+		gestaltAFPClientVersionMask = 0x0000FFFF,
+		gestaltAFPClient3_5 = 0x0001,
+		gestaltAFPClient3_6 = 0x0002,
+		gestaltAFPClient3_6_1 = 0x0003,
+		gestaltAFPClient3_6_2 = 0x0004,
+		gestaltAFPClient3_6_3 = 0x0005,
+		gestaltAFPClient3_7 = 0x0006,
+		gestaltAFPClient3_7_2 = 0x0007,
+		gestaltAFPClient3_8 = 0x0008,
+		gestaltAFPClient3_8_1 = 0x0009,
+		gestaltAFPClient3_8_3 = 0x000A,
+		gestaltAFPClient3_8_4 = 0x000B,
+		gestaltAFPClientAttributeMask = 0xFFFF0000,
+		gestaltAFPClientCfgRsrc = 16,
+		gestaltAFPClientSupportsIP = 29,
+		gestaltAFPClientVMUI = 30,
+		gestaltAFPClientMultiReq = 31
+	}
+}
+
+
+enum
+{
+	gestaltAliasMgrAttr = getOSType!("alis"),
+	gestaltAliasMgrPresent = 0,
+	gestaltAliasMgrSupportsRemoteAppletalk = 1,
+	gestaltAliasMgrSupportsAOCEKeychain = 2,
+	gestaltAliasMgrResolveAliasFileWithMountOptions = 3,
+	gestaltAliasMgrFollowsAliasesWhenResolving = 4,
+	gestaltAliasMgrSupportsExtendedCalls = 5,
+	gestaltAliasMgrSupportsFSCalls = 6,
+	gestaltAliasMgrPrefersPath = 7,
+	gestaltAliasMgrRequiresAccessors = 8
+}
+
+enum
+{
+	gestaltAppearanceAttr = getOSType!("appr"),
+	gestaltAppearanceExists = 0,
+	gestaltAppearanceCompatMode = 1
+}
+
+enum
+{
+	gestaltAppearanceVersion = getOSType!("apvr")
+}
+
+enum
+{
+	gestaltArbitorAttr = getOSType!("arb "),
+	gestaltSerialArbitrationExists = 0
+}
+
+enum
+{
+	gestaltAppleScriptVersion = getOSType!("ascv")
+}
+
+enum
+{
+	gestaltAppleScriptAttr = getOSType!("ascr"),
+	gestaltAppleScriptPresent = 0,
+	gestaltAppleScriptPowerPCSupport = 1
+}
+
+enum
+{
+	gestaltATAAttr = getOSType!("ata "),
+	gestaltATAPresent = 0
+}
+
+enum
+{
+	gestaltATalkVersion = getOSType!("atkv")
+}
+
+enum
+{
+	gestaltAppleTalkVersion = getOSType!("atlk")
+}
+
+enum
+{
+	gestaltAUXVersion = getOSType!("a/ux")
+}
+
+enum
+{
+	gestaltMacOSCompatibilityBoxAttr = getOSType!("bbox"),
+	gestaltMacOSCompatibilityBoxPresent = 0,
+	gestaltMacOSCompatibilityBoxHasSerial = 1,
+	gestaltMacOSCompatibilityBoxless = 2
+}
+
+enum
+{
+	gestaltBusClkSpeed = getOSType!("bclk")
+}
+
+enum
+{
+	gestaltBusClkSpeedMHz = getOSType!("bclm")
+}
+
+enum
+{
+	gestaltCloseViewAttr = getOSType!("BSDa"),
+	gestaltCloseViewEnabled = 0,
+	gestaltCloseViewDisplayMgrFriendly = 1
+}
+
+enum
+{
+	gestaltCarbonVersion = getOSType!("cbon")
+}
+
+enum
+{
+	gestaltCFMAttr = getOSType!("cfrg"),
+	gestaltCFMPresent = 0,
+	gestaltCFMPresentMask = 0x0001,
+	gestaltCFM99Present = 2,
+	gestaltCFM99PresentMask = 0x0004
+}
+
+enum
+{
+	gestaltProcessorCacheLineSize = getOSType!("csiz")
+}
+
+enum
+{
+	gestaltCollectionMgrVersion = getOSType!("cltn")
+}
+
+enum
+{
+	gestaltColorMatchingAttr = getOSType!("cmta"),
+	gestaltHighLevelMatching = 0,
+	gestaltColorMatchingLibLoaded = 1
+}
+
+enum
+{
+	gestaltColorMatchingVersion = getOSType!("cmtc"),
+	gestaltColorSync10 = 0x0100,
+	gestaltColorSync11 = 0x0110,
+	gestaltColorSync104 = 0x0104,
+	gestaltColorSync105 = 0x0105,
+	gestaltColorSync20 = 0x0200,
+	gestaltColorSync21 = 0x0210,
+	gestaltColorSync211 = 0x0211,
+	gestaltColorSync212 = 0x0212,
+	gestaltColorSync213 = 0x0213,
+	gestaltColorSync25 = 0x0250,
+	gestaltColorSync26 = 0x0260,
+	gestaltColorSync261 = 0x0261,
+	gestaltColorSync30 = 0x0300
+}
+
+enum
+{
+	gestaltControlMgrVersion = getOSType!("cmvr")
+}
+
+enum
+{
+	gestaltControlMgrAttr = getOSType!("cntl"),
+	gestaltControlMgrPresent = (1L << 0),
+	gestaltControlMgrPresentBit = 0,
+	gestaltControlMsgPresentMask = (1L << gestaltControlMgrPresentBit)
+}
+
+enum
+{
+	gestaltConnMgrAttr = getOSType!("conn"),
+	gestaltConnMgrPresent = 0,
+	gestaltConnMgrCMSearchFix = 1,
+	gestaltConnMgrErrorString = 2,
+	gestaltConnMgrMultiAsyncIO = 3
+}
+
+enum
+{
+	gestaltColorPickerVersion = getOSType!("cpkr"),
+	gestaltColorPicker = getOSType!("cpkr")
+}
+
+enum
+{
+	gestaltComponentMgr = getOSType!("cpnt"),
+	gestaltComponentPlatform = getOSType!("copl")
+}
+
+enum
+{
+	gestaltNativeCPUtype = getOSType!("cput"),
+	gestaltNativeCPUfamily = getOSType!("cpuf"),
+	gestaltCPU68000 = 0,
+	gestaltCPU68010 = 1,
+	gestaltCPU68020 = 2,
+	gestaltCPU68030 = 3,
+	gestaltCPU68040 = 4,
+	gestaltCPU601 = 0x0101,
+	gestaltCPU603 = 0x0103,
+	gestaltCPU604 = 0x0104,
+	gestaltCPU603e = 0x0106,
+	gestaltCPU603ev = 0x0107,
+	gestaltCPU750 = 0x0108,
+	gestaltCPU604e = 0x0109,
+	gestaltCPU604ev = 0x010A,
+	gestaltCPUG4 = 0x010C,
+	gestaltCPUG47450 = 0x0110
+}
+
+enum
+{
+	gestaltCPUApollo = 0x0111,
+	gestaltCPUG47447 = 0x0112,
+	gestaltCPU750FX = 0x0120,
+	gestaltCPU970 = 0x0139,
+	gestaltCPU970FX = 0x013C,
+	gestaltCPU970MP = 0x0144
+}
+
+enum
+{
+	gestaltCPU486 = getOSType!("i486"),
+	gestaltCPUPentium = getOSType!("i586"),
+	gestaltCPUPentiumPro = getOSType!("i5pr"),
+	gestaltCPUPentiumII = getOSType!("i5ii"),
+	gestaltCPUX86 = getOSType!("ixxx"),
+	gestaltCPUPentium4 = getOSType!("i5iv")
+}
+
+enum
+{
+	gestaltCRMAttr = getOSType!("crm "),
+	gestaltCRMPresent = 0,
+	gestaltCRMPersistentFix = 1,
+	gestaltCRMToolRsrcCalls = 2
+}
+
+enum
+{
+	gestaltControlStripVersion = getOSType!("csvr")
+}
+
+enum
+{
+	gestaltCountOfCPUs = getOSType!("cpus")
+}
+
+enum
+{
+	gestaltCTBVersion = getOSType!("ctbv")
+}
+
+enum
+{
+	gestaltDBAccessMgrAttr = getOSType!("dbac"),
+	gestaltDBAccessMgrPresent = 0
+}
+
+enum
+{
+	gestaltDiskCacheSize = getOSType!("dcsz")
+}
+
+enum
+{
+	gestaltSDPFindVersion = getOSType!("dfnd")
+}
+
+enum
+{
+	gestaltDictionaryMgrAttr = getOSType!("dict"),
+	gestaltDictionaryMgrPresent = 0
+}
+
+enum
+{
+	gestaltDITLExtAttr = getOSType!("ditl"),
+	gestaltDITLExtPresent = 0,
+	gestaltDITLExtSupportsIctb = 1
+}
+
+enum
+{
+	gestaltDialogMgrAttr = getOSType!("dlog"),
+	gestaltDialogMgrPresent = (1L << 0),
+	gestaltDialogMgrPresentBit = 0,
+	gestaltDialogMgrHasAquaAlertBit = 2,
+	gestaltDialogMgrPresentMask = (1L << gestaltDialogMgrPresentBit),
+	gestaltDialogMgrHasAquaAlertMask = (1L << gestaltDialogMgrHasAquaAlertBit),
+	gestaltDialogMsgPresentMask = gestaltDialogMgrPresentMask
+}
+
+enum
+{
+	gestaltDesktopPicturesAttr = getOSType!("dkpx"),
+	gestaltDesktopPicturesInstalled = 0,
+	gestaltDesktopPicturesDisplayed = 1
+}
+
+enum
+{
+	gestaltDisplayMgrVers = getOSType!("dplv")
+}
+
+enum
+{
+	gestaltDisplayMgrAttr = getOSType!("dply"),
+	gestaltDisplayMgrPresent = 0,
+	gestaltDisplayMgrCanSwitchMirrored = 2,
+	gestaltDisplayMgrSetDepthNotifies = 3,
+	gestaltDisplayMgrCanConfirm = 4,
+	gestaltDisplayMgrColorSyncAware = 5,
+	gestaltDisplayMgrGeneratesProfiles = 6,
+	gestaltDisplayMgrSleepNotifies = 7
+}
+
+enum
+{
+	gestaltDragMgrAttr = getOSType!("drag"),
+	gestaltDragMgrPresent = 0,
+	gestaltDragMgrFloatingWind = 1,
+	gestaltPPCDragLibPresent = 2,
+	gestaltDragMgrHasImageSupport = 3,
+	gestaltCanStartDragInFloatWindow = 4,
+	gestaltSetDragImageUpdates = 5
+}
+
+enum
+{
+	gestaltDrawSprocketVersion = getOSType!("dspv")
+}
+
+enum
+{
+	gestaltDigitalSignatureVersion = getOSType!("dsig")
+}
+
+enum
+{
+	gestaltDTPFeatures = getOSType!("dtpf"),
+	kDTPThirdPartySupported = 0x00000004
+}
+
+enum
+{
+	gestaltDTPInfo = getOSType!("dtpx")
+}
+
+enum
+{
+	gestaltEasyAccessAttr = getOSType!("easy"),
+	gestaltEasyAccessOff = 0,
+	gestaltEasyAccessOn = 1,
+	gestaltEasyAccessSticky = 2,
+	gestaltEasyAccessLocked = 3
+}
+
+enum
+{
+	gestaltEditionMgrAttr = getOSType!("edtn"),
+	gestaltEditionMgrPresent = 0,
+	gestaltEditionMgrTranslationAware = 1
+}
+
+enum
+{
+	gestaltAppleEventsAttr = getOSType!("evnt"),
+	gestaltAppleEventsPresent = 0,
+	gestaltScriptingSupport = 1,
+	gestaltOSLInSystem = 2,
+	gestaltSupportsApplicationURL = 4
+}
+
+enum
+{
+	gestaltExtensionTableVersion = getOSType!("etbl")
+}
+
+enum
+{
+	gestaltFBCIndexingState = getOSType!("fbci"),
+	gestaltFBCindexingSafe = 0,
+	gestaltFBCindexingCritical = 1
+}
+
+enum
+{
+	gestaltFBCVersion = getOSType!("fbcv"),
+	gestaltFBCCurrentVersion = 0x0011,
+	gestaltOSXFBCCurrentVersion = 0x0100
+}
+
+enum
+{
+	gestaltFileMappingAttr = getOSType!("flmp"),
+	gestaltFileMappingPresent = 0,
+	gestaltFileMappingMultipleFilesFix = 1
+}
+
+enum
+{
+	gestaltFloppyAttr = getOSType!("flpy"),
+	gestaltFloppyIsMFMOnly = 0,
+	gestaltFloppyIsManualEject = 1,
+	gestaltFloppyUsesDiskInPlace = 2
+}
+
+enum
+{
+	gestaltFinderAttr = getOSType!("fndr"),
+	gestaltFinderDropEvent = 0,
+	gestaltFinderMagicPlacement = 1,
+	gestaltFinderCallsAEProcess = 2,
+	gestaltOSLCompliantFinder = 3,
+	gestaltFinderSupports4GBVolumes = 4,
+	gestaltFinderHasClippings = 6,
+	gestaltFinderFullDragManagerSupport = 7,
+	gestaltFinderFloppyRootComments = 8,
+	gestaltFinderLargeAndNotSavedFlavorsOK = 9,
+	gestaltFinderUsesExtensibleFolderManager = 10,
+	gestaltFinderUnderstandsRedirectedDesktopFolder = 11
+}
+
+enum
+{
+	gestaltFindFolderAttr = getOSType!("fold"),
+	gestaltFindFolderPresent = 0,
+	gestaltFolderDescSupport = 1,
+	gestaltFolderMgrFollowsAliasesWhenResolving = 2,
+	gestaltFolderMgrSupportsExtendedCalls = 3,
+	gestaltFolderMgrSupportsDomains = 4,
+	gestaltFolderMgrSupportsFSCalls = 5
+}
+
+enum
+{
+	gestaltFindFolderRedirectionAttr = getOSType!("fole")
+}
+
+enum
+{
+	gestaltFontMgrAttr = getOSType!("font"),
+	gestaltOutlineFonts = 0
+}
+
+enum
+{
+	gestaltFPUType = getOSType!("fpu "),
+	gestaltNoFPU = 0,
+	gestalt68881 = 1,
+	gestalt68882 = 2,
+	gestalt68040FPU = 3
+}
+
+enum
+{
+	gestaltFSAttr = getOSType!("fs  "),
+	gestaltFullExtFSDispatching = 0,
+	gestaltHasFSSpecCalls = 1,
+	gestaltHasFileSystemManager = 2,
+	gestaltFSMDoesDynamicLoad = 3,
+	gestaltFSSupports4GBVols = 4,
+	gestaltFSSupports2TBVols = 5,
+	gestaltHasExtendedDiskInit = 6,
+	gestaltDTMgrSupportsFSM = 7,
+	gestaltFSNoMFSVols = 8,
+	gestaltFSSupportsHFSPlusVols = 9,
+	gestaltFSIncompatibleDFA82 = 10
+}
+
+enum
+{
+	gestaltFSSupportsDirectIO = 11
+}
+
+enum
+{
+	gestaltHasHFSPlusAPIs = 12,
+	gestaltMustUseFCBAccessors = 13,
+	gestaltFSUsesPOSIXPathsForConversion = 14,
+	gestaltFSSupportsExclusiveLocks = 15,
+	gestaltFSSupportsHardLinkDetection = 16,
+	gestaltFSAllowsConcurrentAsyncIO = 17
+}
+
+enum
+{
+	gestaltAdminFeaturesFlagsAttr = getOSType!("fred"),
+	gestaltFinderUsesSpecialOpenFoldersFile = 0
+}
+
+enum
+{
+	gestaltFSMVersion = getOSType!("fsm ")
+}
+
+enum
+{
+	gestaltFXfrMgrAttr = getOSType!("fxfr"),
+	gestaltFXfrMgrPresent = 0,
+	gestaltFXfrMgrMultiFile = 1,
+	gestaltFXfrMgrErrorString = 2,
+	gestaltFXfrMgrAsync = 3
+}
+
+enum
+{
+	gestaltGraphicsAttr = getOSType!("gfxa"),
+	gestaltGraphicsIsDebugging = 0x00000001,
+	gestaltGraphicsIsLoaded = 0x00000002,
+	gestaltGraphicsIsPowerPC = 0x00000004
+}
+
+enum
+{
+	gestaltGraphicsVersion = getOSType!("grfx"),
+	gestaltCurrentGraphicsVersion = 0x00010200
+}
+
+enum
+{
+	gestaltHardwareAttr = getOSType!("hdwr"),
+	gestaltHasVIA1 = 0,
+	gestaltHasVIA2 = 1,
+	gestaltHasASC = 3,
+	gestaltHasSCC = 4,
+	gestaltHasSCSI = 7,
+	gestaltHasSoftPowerOff = 19,
+	gestaltHasSCSI961 = 21,
+	gestaltHasSCSI962 = 22,
+	gestaltHasUniversalROM = 24,
+	gestaltHasEnhancedLtalk = 30
+}
+
+enum
+{
+	gestaltHelpMgrAttr = getOSType!("help"),
+	gestaltHelpMgrPresent = 0,
+	gestaltHelpMgrExtensions = 1,
+	gestaltAppleGuideIsDebug = 30,
+	gestaltAppleGuidePresent = 31
+}
+
+enum
+{
+	gestaltHardwareVendorCode = getOSType!("hrad"),
+	gestaltHardwareVendorApple = getOSType!("Appl")
+}
+
+enum
+{
+	gestaltCompressionMgr = getOSType!("icmp")
+}
+
+enum
+{
+	gestaltIconUtilitiesAttr = getOSType!("icon"),
+	gestaltIconUtilitiesPresent = 0,
+	gestaltIconUtilitiesHas48PixelIcons = 1,
+	gestaltIconUtilitiesHas32BitIcons = 2,
+	gestaltIconUtilitiesHas8BitDeepMasks = 3,
+	gestaltIconUtilitiesHasIconServices = 4
+}
+
+enum
+{
+	gestaltInternalDisplay = getOSType!("idsp")
+}
+
+enum
+{
+	gestaltKeyboardType = getOSType!("kbd "),
+	gestaltMacKbd = 1,
+	gestaltMacAndPad = 2,
+	gestaltMacPlusKbd = 3,
+	gestaltUnknownThirdPartyKbd = 3,
+	gestaltExtADBKbd = 4,
+	gestaltStdADBKbd = 5,
+	gestaltPrtblADBKbd = 6,
+	gestaltPrtblISOKbd = 7,
+	gestaltStdISOADBKbd = 8,
+	gestaltExtISOADBKbd = 9,
+	gestaltADBKbdII = 10,
+	gestaltADBISOKbdII = 11,
+	gestaltPwrBookADBKbd = 12,
+	gestaltPwrBookISOADBKbd = 13,
+	gestaltAppleAdjustKeypad = 14,
+	gestaltAppleAdjustADBKbd = 15,
+	gestaltAppleAdjustISOKbd = 16,
+	gestaltJapanAdjustADBKbd = 17,
+	gestaltPwrBkExtISOKbd = 20,
+	gestaltPwrBkExtJISKbd = 21,
+	gestaltPwrBkExtADBKbd = 24,
+	gestaltPS2Keyboard = 27,
+	gestaltPwrBkSubDomKbd = 28,
+	gestaltPwrBkSubISOKbd = 29,
+	gestaltPwrBkSubJISKbd = 30,
+	gestaltPortableUSBANSIKbd = 37,
+	gestaltPortableUSBISOKbd = 38,
+	gestaltPortableUSBJISKbd = 39,
+	gestaltThirdPartyANSIKbd = 40,
+	gestaltThirdPartyISOKbd = 41,
+	gestaltThirdPartyJISKbd = 42,
+	gestaltPwrBkEKDomKbd = 195,
+	gestaltPwrBkEKISOKbd = 196,
+	gestaltPwrBkEKJISKbd = 197,
+	gestaltUSBCosmoANSIKbd = 198,
+	gestaltUSBCosmoISOKbd = 199,
+	gestaltUSBCosmoJISKbd = 200,
+	gestaltPwrBk99JISKbd = 201,
+	gestaltUSBAndyANSIKbd = 204,
+	gestaltUSBAndyISOKbd = 205,
+	gestaltUSBAndyJISKbd = 206
+}
+
+enum
+{
+	gestaltPortable2001ANSIKbd = 202,
+	gestaltPortable2001ISOKbd = 203,
+	gestaltPortable2001JISKbd = 207
+}
+
+enum
+{
+	gestaltUSBProF16ANSIKbd = 34,
+	gestaltUSBProF16ISOKbd = 35,
+	gestaltUSBProF16JISKbd = 36,
+	gestaltProF16ANSIKbd = 31,
+	gestaltProF16ISOKbd = 32,
+	gestaltProF16JISKbd = 33
+}
+
+enum
+{
+	gestaltUDFSupport = getOSType!("kudf")
+}
+
+enum
+{
+	gestaltLowMemorySize = getOSType!("lmem")
+}
+
+enum
+{
+	gestaltLogicalRAMSize = getOSType!("lram")
+}
+
+enum
+{
+	gestaltMachineType = getOSType!("mach"),
+	gestaltClassic = 1,
+	gestaltMacXL = 2,
+	gestaltMac512KE = 3,
+	gestaltMacPlus = 4,
+	gestaltMacSE = 5,
+	gestaltMacII = 6,
+	gestaltMacIIx = 7,
+	gestaltMacIIcx = 8,
+	gestaltMacSE030 = 9,
+	gestaltPortable = 10,
+	gestaltMacIIci = 11,
+	gestaltPowerMac8100_120 = 12,
+	gestaltMacIIfx = 13,
+	gestaltMacClassic = 17,
+	gestaltMacIIsi = 18,
+	gestaltMacLC = 19,
+	gestaltMacQuadra900 = 20,
+	gestaltPowerBook170 = 21,
+	gestaltMacQuadra700 = 22,
+	gestaltClassicII = 23,
+	gestaltPowerBook100 = 24,
+	gestaltPowerBook140 = 25,
+	gestaltMacQuadra950 = 26,
+	gestaltMacLCIII = 27,
+	gestaltPerforma450 = gestaltMacLCIII,
+	gestaltPowerBookDuo210 = 29,
+	gestaltMacCentris650 = 30,
+	gestaltPowerBookDuo230 = 32,
+	gestaltPowerBook180 = 33,
+	gestaltPowerBook160 = 34,
+	gestaltMacQuadra800 = 35,
+	gestaltMacQuadra650 = 36,
+	gestaltMacLCII = 37,
+	gestaltPowerBookDuo250 = 38,
+	gestaltAWS9150_80 = 39,
+	gestaltPowerMac8100_110 = 40,
+	gestaltAWS8150_110 = gestaltPowerMac8100_110,
+	gestaltPowerMac5200 = 41,
+	gestaltPowerMac5260 = gestaltPowerMac5200,
+	gestaltPerforma5300 = gestaltPowerMac5200,
+	gestaltPowerMac6200 = 42,
+	gestaltPerforma6300 = gestaltPowerMac6200,
+	gestaltMacIIvi = 44,
+	gestaltMacIIvm = 45,
+	gestaltPerforma600 = gestaltMacIIvm,
+	gestaltPowerMac7100_80 = 47,
+	gestaltMacIIvx = 48,
+	gestaltMacColorClassic = 49,
+	gestaltPerforma250 = gestaltMacColorClassic,
+	gestaltPowerBook165c = 50,
+	gestaltMacCentris610 = 52,
+	gestaltMacQuadra610 = 53,
+	gestaltPowerBook145 = 54,
+	gestaltPowerMac8100_100 = 55,
+	gestaltMacLC520 = 56,
+	gestaltAWS9150_120 = 57,
+	gestaltPowerMac6400 = 58,
+	gestaltPerforma6400 = gestaltPowerMac6400,
+	gestaltPerforma6360 = gestaltPerforma6400,
+	gestaltMacCentris660AV = 60,
+	gestaltMacQuadra660AV = gestaltMacCentris660AV,
+	gestaltPerforma46x = 62,
+	gestaltPowerMac8100_80 = 65,
+	gestaltAWS8150_80 = gestaltPowerMac8100_80,
+	gestaltPowerMac9500 = 67,
+	gestaltPowerMac9600 = gestaltPowerMac9500,
+	gestaltPowerMac7500 = 68,
+	gestaltPowerMac7600 = gestaltPowerMac7500,
+	gestaltPowerMac8500 = 69,
+	gestaltPowerMac8600 = gestaltPowerMac8500,
+	gestaltAWS8550 = gestaltPowerMac7500,
+	gestaltPowerBook180c = 71,
+	gestaltPowerBook520 = 72,
+	gestaltPowerBook520c = gestaltPowerBook520,
+	gestaltPowerBook540 = gestaltPowerBook520,
+	gestaltPowerBook540c = gestaltPowerBook520,
+	gestaltPowerMac5400 = 74,
+	gestaltPowerMac6100_60 = 75,
+	gestaltAWS6150_60 = gestaltPowerMac6100_60,
+	gestaltPowerBookDuo270c = 77,
+	gestaltMacQuadra840AV = 78,
+	gestaltPerforma550 = 80,
+	gestaltPowerBook165 = 84,
+	gestaltPowerBook190 = 85,
+	gestaltMacTV = 88,
+	gestaltMacLC475 = 89,
+	gestaltPerforma47x = gestaltMacLC475,
+	gestaltMacLC575 = 92,
+	gestaltMacQuadra605 = 94,
+	gestaltMacQuadra630 = 98,
+	gestaltMacLC580 = 99,
+	gestaltPerforma580 = gestaltMacLC580,
+	gestaltPowerMac6100_66 = 100,
+	gestaltAWS6150_66 = gestaltPowerMac6100_66,
+	gestaltPowerBookDuo280 = 102,
+	gestaltPowerBookDuo280c = 103,
+	gestaltPowerMacLC475 = 104,
+	gestaltPowerMacPerforma47x = gestaltPowerMacLC475,
+	gestaltPowerMacLC575 = 105,
+	gestaltPowerMacPerforma57x = gestaltPowerMacLC575,
+	gestaltPowerMacQuadra630 = 106,
+	gestaltPowerMacLC630 = gestaltPowerMacQuadra630,
+	gestaltPowerMacPerforma63x = gestaltPowerMacQuadra630,
+	gestaltPowerMac7200 = 108,
+	gestaltPowerMac7300 = 109,
+	gestaltPowerMac7100_66 = 112,
+	gestaltPowerBook150 = 115,
+	gestaltPowerMacQuadra700 = 116,
+	gestaltPowerMacQuadra900 = 117,
+	gestaltPowerMacQuadra950 = 118,
+	gestaltPowerMacCentris610 = 119,
+	gestaltPowerMacCentris650 = 120,
+	gestaltPowerMacQuadra610 = 121,
+	gestaltPowerMacQuadra650 = 122,
+	gestaltPowerMacQuadra800 = 123,
+	gestaltPowerBookDuo2300 = 124,
+	gestaltPowerBook500PPCUpgrade = 126,
+	gestaltPowerBook5300 = 128,
+	gestaltPowerBook1400 = 310,
+	gestaltPowerBook3400 = 306,
+	gestaltPowerBook2400 = 307,
+	gestaltPowerBookG3Series = 312,
+	gestaltPowerBookG3 = 313,
+	gestaltPowerBookG3Series2 = 314,
+	gestaltPowerMacNewWorld = 406,
+	gestaltPowerMacG3 = 510,
+	gestaltPowerMac5500 = 512,
+	gestalt20thAnniversary = gestaltPowerMac5500,
+	gestaltPowerMac6500 = 513,
+	gestaltPowerMac4400_160 = 514,
+	gestaltPowerMac4400 = 515,
+	gestaltMacOSCompatibility = 1206
+}
+
+enum
+{
+	gestaltQuadra605 = gestaltMacQuadra605,
+	gestaltQuadra610 = gestaltMacQuadra610,
+	gestaltQuadra630 = gestaltMacQuadra630,
+	gestaltQuadra650 = gestaltMacQuadra650,
+	gestaltQuadra660AV = gestaltMacQuadra660AV,
+	gestaltQuadra700 = gestaltMacQuadra700,
+	gestaltQuadra800 = gestaltMacQuadra800,
+	gestaltQuadra840AV = gestaltMacQuadra840AV,
+	gestaltQuadra900 = gestaltMacQuadra900,
+	gestaltQuadra950 = gestaltMacQuadra950
+}
+
+enum
+{
+	kMachineNameStrID = -16395
+}
+
+enum
+{
+	gestaltSMPMailerVersion = getOSType!("malr")
+}
+
+enum
+{
+	gestaltMediaBay = getOSType!("mbeh"),
+	gestaltMBLegacy = 0,
+	gestaltMBSingleBay = 1,
+	gestaltMBMultipleBays = 2
+}
+
+enum
+{
+	gestaltMessageMgrVersion = getOSType!("mess")
+}
+
+enum
+{
+	gestaltMenuMgrAttr = getOSType!("menu"),
+	gestaltMenuMgrPresent = (1L << 0),
+	gestaltMenuMgrPresentBit = 0,
+	gestaltMenuMgrAquaLayoutBit = 1,
+	gestaltMenuMgrMultipleItemsWithCommandIDBit = 2,
+	gestaltMenuMgrRetainsIconRefBit = 3,
+	gestaltMenuMgrSendsMenuBoundsToDefProcBit = 4,
+	gestaltMenuMgrMoreThanFiveMenusDeepBit = 5,
+	gestaltMenuMgrCGImageMenuTitleBit = 6,
+	gestaltMenuMgrPresentMask = (1L << gestaltMenuMgrPresentBit),
+	gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit),
+	gestaltMenuMgrMultipleItemsWithCommandIDMask = (1L << gestaltMenuMgrMultipleItemsWithCommandIDBit),
+	gestaltMenuMgrRetainsIconRefMask = (1L << gestaltMenuMgrRetainsIconRefBit),
+	gestaltMenuMgrSendsMenuBoundsToDefProcMask = (1L << gestaltMenuMgrSendsMenuBoundsToDefProcBit),
+	gestaltMenuMgrMoreThanFiveMenusDeepMask = (1L << gestaltMenuMgrMoreThanFiveMenusDeepBit),
+	gestaltMenuMgrCGImageMenuTitleMask = (1L << gestaltMenuMgrCGImageMenuTitleBit)
+}
+
+enum
+{
+	gestaltMultipleUsersState = getOSType!("mfdr")
+}
+
+enum
+{
+	gestaltMachineIcon = getOSType!("micn")
+}
+
+enum
+{
+	gestaltMiscAttr = getOSType!("misc"),
+	gestaltScrollingThrottle = 0,
+	gestaltSquareMenuBar = 2
+}
+
+enum
+{
+	gestaltMixedModeVersion = getOSType!("mixd")
+}
+
+enum
+{
+	gestaltMixedModeAttr = getOSType!("mixd"),
+	gestaltMixedModePowerPC = 0,
+	gestaltPowerPCAware = 0,
+	gestaltMixedModeCFM68K = 1,
+	gestaltMixedModeCFM68KHasTrap = 2,
+	gestaltMixedModeCFM68KHasState = 3
+}
+
+enum
+{
+	gestaltQuickTimeConferencing = getOSType!("mtlk")
+}
+
+enum
+{
+	gestaltMemoryMapAttr = getOSType!("mmap"),
+	gestaltMemoryMapSparse = 0
+}
+
+enum
+{
+	gestaltMMUType = getOSType!("mmu "),
+	gestaltNoMMU = 0,
+	gestaltAMU = 1,
+	gestalt68851 = 2,
+	gestalt68030MMU = 3,
+	gestalt68040MMU = 4,
+	gestaltEMMU1 = 5
+}
+
+enum
+{
+	gestaltUserVisibleMachineName = getOSType!("mnam")
+}
+
+enum
+{
+	gestaltMPCallableAPIsAttr = getOSType!("mpsc"),
+	gestaltMPFileManager = 0,
+	gestaltMPDeviceManager = 1,
+	gestaltMPTrapCalls = 2
+}
+
+enum
+{
+	gestaltStdNBPAttr = getOSType!("nlup"),
+	gestaltStdNBPPresent = 0,
+	gestaltStdNBPSupportsAutoPosition = 1
+}
+
+enum
+{
+	gestaltNotificationMgrAttr = getOSType!("nmgr"),
+	gestaltNotificationPresent = 0
+}
+
+enum
+{
+	gestaltNameRegistryVersion = getOSType!("nreg")
+}
+
+enum
+{
+	gestaltNuBusSlotCount = getOSType!("nubs")
+}
+
+enum
+{
+	gestaltOCEToolboxVersion = getOSType!("ocet"),
+	gestaltOCETB = 0x0102,
+	gestaltSFServer = 0x0100
+}
+
+enum
+{
+	gestaltOCEToolboxAttr = getOSType!("oceu"),
+	gestaltOCETBPresent = 0x01,
+	gestaltOCETBAvailable = 0x02,
+	gestaltOCESFServerAvailable = 0x04,
+	gestaltOCETBNativeGlueAvailable = 0x10
+}
+
+enum
+{
+	gestaltOpenFirmwareInfo = getOSType!("opfw")
+}
+
+enum
+{
+	gestaltOSAttr = getOSType!("os  "),
+	gestaltSysZoneGrowable = 0,
+	gestaltLaunchCanReturn = 1,
+	gestaltLaunchFullFileSpec = 2,
+	gestaltLaunchControl = 3,
+	gestaltTempMemSupport = 4,
+	gestaltRealTempMemory = 5,
+	gestaltTempMemTracked = 6,
+	gestaltIPCSupport = 7,
+	gestaltSysDebuggerSupport = 8,
+	gestaltNativeProcessMgrBit = 19,
+	gestaltAltivecRegistersSwappedCorrectlyBit = 20
+}
+
+enum
+{
+	gestaltOSTable = getOSType!("ostt")
+}
+
+enum
+{
+	gestaltOpenTptNetworkSetup = getOSType!("otcf"),
+	gestaltOpenTptNetworkSetupLegacyImport = 0,
+	gestaltOpenTptNetworkSetupLegacyExport = 1,
+	gestaltOpenTptNetworkSetupSupportsMultihoming = 2
+}
+
+enum
+{
+	gestaltOpenTptNetworkSetupVersion = getOSType!("otcv")
+}
+
+enum
+{
+	gestaltOpenTptRemoteAccess = getOSType!("otra"),
+	gestaltOpenTptRemoteAccessPresent = 0,
+	gestaltOpenTptRemoteAccessLoaded = 1,
+	gestaltOpenTptRemoteAccessClientOnly = 2,
+	gestaltOpenTptRemoteAccessPServer = 3,
+	gestaltOpenTptRemoteAccessMPServer = 4,
+	gestaltOpenTptPPPPresent = 5,
+	gestaltOpenTptARAPPresent = 6
+}
+
+enum
+{
+	gestaltOpenTptRemoteAccessVersion = getOSType!("otrv")
+}
+
+enum
+{
+	gestaltOpenTptVersions = getOSType!("otvr")
+}
+
+enum
+{
+	gestaltOpenTpt = getOSType!("otan"),
+	gestaltOpenTptPresentMask = 0x00000001,
+	gestaltOpenTptLoadedMask = 0x00000002,
+	gestaltOpenTptAppleTalkPresentMask = 0x00000004,
+	gestaltOpenTptAppleTalkLoadedMask = 0x00000008,
+	gestaltOpenTptTCPPresentMask = 0x00000010,
+	gestaltOpenTptTCPLoadedMask = 0x00000020,
+	gestaltOpenTptIPXSPXPresentMask = 0x00000040,
+	gestaltOpenTptIPXSPXLoadedMask = 0x00000080,
+	gestaltOpenTptPresentBit = 0,
+	gestaltOpenTptLoadedBit = 1,
+	gestaltOpenTptAppleTalkPresentBit = 2,
+	gestaltOpenTptAppleTalkLoadedBit = 3,
+	gestaltOpenTptTCPPresentBit = 4,
+	gestaltOpenTptTCPLoadedBit = 5,
+	gestaltOpenTptIPXSPXPresentBit = 6,
+	gestaltOpenTptIPXSPXLoadedBit = 7
+}
+
+enum
+{
+	gestaltPCCard = getOSType!("pccd"),
+	gestaltCardServicesPresent = 0,
+	gestaltPCCardFamilyPresent = 1,
+	gestaltPCCardHasPowerControl = 2,
+	gestaltPCCardSupportsCardBus = 3
+}
+
+enum
+{
+	gestaltProcClkSpeed = getOSType!("pclk")
+}
+
+enum
+{
+	gestaltProcClkSpeedMHz = getOSType!("mclk")
+}
+
+enum
+{
+	gestaltPCXAttr = getOSType!("pcxg"),
+	gestaltPCXHas8and16BitFAT = 0,
+	gestaltPCXHasProDOS = 1,
+	gestaltPCXNewUI = 2,
+	gestaltPCXUseICMapping = 3
+}
+
+enum
+{
+	gestaltLogicalPageSize = getOSType!("pgsz")
+}
+
+enum
+{
+	gestaltScreenCaptureMain = getOSType!("pic1"),
+	gestaltScreenCaptureDir = getOSType!("pic2")
+}
+
+enum
+{
+	gestaltGXPrintingMgrVersion = getOSType!("pmgr")
+}
+
+enum
+{
+	gestaltPopupAttr = getOSType!("pop!"),
+	gestaltPopupPresent = 0
+}
+
+enum
+{
+	gestaltPowerMgrAttr = getOSType!("powr"),
+	gestaltPMgrExists = 0,
+	gestaltPMgrCPUIdle = 1,
+	gestaltPMgrSCC = 2,
+	gestaltPMgrSound = 3,
+	gestaltPMgrDispatchExists = 4,
+	gestaltPMgrSupportsAVPowerStateAtSleepWake = 5
+}
+
+enum
+{
+	gestaltPowerMgrVers = getOSType!("pwrv")
+}
+
+enum
+{
+	gestaltPPCToolboxAttr = getOSType!("ppc "),
+	gestaltPPCToolboxPresent = 0x0000,
+	gestaltPPCSupportsRealTime = 0x1000,
+	gestaltPPCSupportsIncoming = 0x0001,
+	gestaltPPCSupportsOutGoing = 0x0002,
+	gestaltPPCSupportsTCP_IP = 0x0004,
+	gestaltPPCSupportsIncomingAppleTalk = 0x0010,
+	gestaltPPCSupportsIncomingTCP_IP = 0x0020,
+	gestaltPPCSupportsOutgoingAppleTalk = 0x0100,
+	gestaltPPCSupportsOutgoingTCP_IP = 0x0200
+}
+
+enum
+{
+	gestaltPowerPCProcessorFeatures = getOSType!("ppcf"),
+	gestaltPowerPCHasGraphicsInstructions = 0,
+	gestaltPowerPCHasSTFIWXInstruction = 1,
+	gestaltPowerPCHasSquareRootInstructions = 2,
+	gestaltPowerPCHasDCBAInstruction = 3,
+	gestaltPowerPCHasVectorInstructions = 4,
+	gestaltPowerPCHasDataStreams = 5,
+	gestaltPowerPCHas64BitSupport = 6,
+	gestaltPowerPCHasDCBTStreams = 7,
+	gestaltPowerPCASArchitecture = 8,
+	gestaltPowerPCIgnoresDCBST = 9
+}
+
+enum
+{
+	gestaltProcessorType = getOSType!("proc"),
+	gestalt68000 = 1,
+	gestalt68010 = 2,
+	gestalt68020 = 3,
+	gestalt68030 = 4,
+	gestalt68040 = 5
+}
+
+enum
+{
+	gestaltSDPPromptVersion = getOSType!("prpv")
+}
+
+enum
+{
+	gestaltParityAttr = getOSType!("prty"),
+	gestaltHasParityCapability = 0,
+	gestaltParityEnabled = 1
+}
+
+enum
+{
+	gestaltQD3DVersion = getOSType!("q3v ")
+}
+
+enum
+{
+	gestaltQD3DViewer = getOSType!("q3vc"),
+	gestaltQD3DViewerPresent = 0
+}
+
+enum
+{
+	gestaltQuickdrawVersion = getOSType!("qd  "),
+	gestaltOriginalQD = 0x0000,
+	gestalt8BitQD = 0x0100,
+	gestalt32BitQD = 0x0200,
+	gestalt32BitQD11 = 0x0201,
+	gestalt32BitQD12 = 0x0220,
+	gestalt32BitQD13 = 0x0230,
+	gestaltAllegroQD = 0x0250,
+	gestaltMacOSXQD = 0x0300
+}
+
+enum
+{
+	gestaltQD3D = getOSType!("qd3d"),
+	gestaltQD3DPresent = 0
+}
+
+enum
+{
+	gestaltGXVersion = getOSType!("qdgx")
+}
+
+enum
+{
+	gestaltQuickdrawFeatures = getOSType!("qdrw"),
+	gestaltHasColor = 0,
+	gestaltHasDeepGWorlds = 1,
+	gestaltHasDirectPixMaps = 2,
+	gestaltHasGrayishTextOr = 3,
+	gestaltSupportsMirroring = 4,
+	gestaltQDHasLongRowBytes = 5
+}
+
+enum
+{
+	gestaltQDTextVersion = getOSType!("qdtx"),
+	gestaltOriginalQDText = 0x0000,
+	gestaltAllegroQDText = 0x0100,
+	gestaltMacOSXQDText = 0x0200
+}
+
+enum
+{
+	gestaltQDTextFeatures = getOSType!("qdtf"),
+	gestaltWSIISupport = 0,
+	gestaltSbitFontSupport = 1,
+	gestaltAntiAliasedTextAvailable = 2,
+	gestaltOFA2available = 3,
+	gestaltCreatesAliasFontRsrc = 4,
+	gestaltNativeType1FontSupport = 5,
+	gestaltCanUseCGTextRendering = 6
+}
+
+enum
+{
+	gestaltQuickTimeConferencingInfo = getOSType!("qtci")
+}
+
+enum
+{
+	gestaltQuickTimeVersion = getOSType!("qtim"),
+	gestaltQuickTime = getOSType!("qtim")
+}
+
+enum
+{
+	gestaltQuickTimeFeatures = getOSType!("qtrs"),
+	gestaltPPCQuickTimeLibPresent = 0
+}
+
+enum
+{
+	gestaltQuickTimeStreamingFeatures = getOSType!("qtsf")
+}
+
+enum
+{
+	gestaltQuickTimeStreamingVersion = getOSType!("qtst")
+}
+
+enum
+{
+	gestaltQuickTimeThreadSafeFeaturesAttr = getOSType!("qtth"),
+	gestaltQuickTimeThreadSafeICM = 0,
+	gestaltQuickTimeThreadSafeMovieToolbox = 1,
+	gestaltQuickTimeThreadSafeMovieImport = 2,
+	gestaltQuickTimeThreadSafeMovieExport = 3,
+	gestaltQuickTimeThreadSafeGraphicsImport = 4,
+	gestaltQuickTimeThreadSafeGraphicsExport = 5,
+	gestaltQuickTimeThreadSafeMoviePlayback = 6
+}
+
+enum
+{
+	gestaltQTVRMgrAttr = getOSType!("qtvr"),
+	gestaltQTVRMgrPresent = 0,
+	gestaltQTVRObjMoviesPresent = 1,
+	gestaltQTVRCylinderPanosPresent = 2,
+	gestaltQTVRCubicPanosPresent = 3
+}
+
+enum
+{
+	gestaltQTVRMgrVers = getOSType!("qtvv")
+}
+
+enum
+{
+	gestaltPhysicalRAMSize = getOSType!("ram ")
+}
+
+enum
+{
+	gestaltPhysicalRAMSizeInMegabytes = getOSType!("ramm")
+}
+
+enum
+{
+	gestaltRBVAddr = getOSType!("rbv ")
+}
+
+enum
+{
+	gestaltROMSize = getOSType!("rom ")
+}
+
+enum
+{
+	gestaltROMVersion = getOSType!("romv")
+}
+
+enum
+{
+	gestaltResourceMgrAttr = getOSType!("rsrc"),
+	gestaltPartialRsrcs = 0,
+	gestaltHasResourceOverrides = 1
+}
+
+enum
+{
+	gestaltResourceMgrBugFixesAttrs = getOSType!("rmbg"),
+	gestaltRMForceSysHeapRolledIn = 0,
+	gestaltRMFakeAppleMenuItemsRolledIn = 1,
+	gestaltSanityCheckResourceFiles = 2,
+	gestaltSupportsFSpResourceFileAlreadyOpenBit = 3,
+	gestaltRMSupportsFSCalls = 4,
+	gestaltRMTypeIndexOrderingReverse = 8
+}
+
+enum
+{
+	gestaltRealtimeMgrAttr = getOSType!("rtmr"),
+	gestaltRealtimeMgrPresent = 0
+}
+
+enum
+{
+	gestaltSafeOFAttr = getOSType!("safe"),
+	gestaltVMZerosPagesBit = 0,
+	gestaltInitHeapZerosOutHeapsBit = 1,
+	gestaltNewHandleReturnsZeroedMemoryBit = 2,
+	gestaltNewPtrReturnsZeroedMemoryBit = 3,
+	gestaltFileAllocationZeroedBlocksBit = 4
+}
+
+enum
+{
+	gestaltSCCReadAddr = getOSType!("sccr")
+}
+
+enum
+{
+	gestaltSCCWriteAddr = getOSType!("sccw")
+}
+
+enum
+{
+	gestaltScrapMgrAttr = getOSType!("scra"),
+	gestaltScrapMgrTranslationAware = 0
+}
+
+enum
+{
+	gestaltScriptMgrVersion = getOSType!("scri")
+}
+
+enum
+{
+	gestaltScriptCount = getOSType!("scr#")
+}
+
+enum
+{
+	gestaltSCSI = getOSType!("scsi"),
+	gestaltAsyncSCSI = 0,
+	gestaltAsyncSCSIINROM = 1,
+	gestaltSCSISlotBoot = 2,
+	gestaltSCSIPollSIH = 3
+}
+
+enum
+{
+	gestaltControlStripAttr = getOSType!("sdev"),
+	gestaltControlStripExists = 0,
+	gestaltControlStripVersionFixed = 1,
+	gestaltControlStripUserFont = 2,
+	gestaltControlStripUserHotKey = 3
+}
+
+enum
+{
+	gestaltSDPStandardDirectoryVersion = getOSType!("sdvr")
+}
+
+enum
+{
+	gestaltSerialAttr = getOSType!("ser "),
+	gestaltHasGPIaToDCDa = 0,
+	gestaltHasGPIaToRTxCa = 1,
+	gestaltHasGPIbToDCDb = 2,
+	gestaltHidePortA = 3,
+	gestaltHidePortB = 4,
+	gestaltPortADisabled = 5,
+	gestaltPortBDisabled = 6
+}
+
+enum
+{
+	gestaltShutdownAttributes = getOSType!("shut"),
+	gestaltShutdownHassdOnBootVolUnmount = 0
+}
+
+enum
+{
+	gestaltNuBusConnectors = getOSType!("sltc")
+}
+
+enum
+{
+	gestaltSlotAttr = getOSType!("slot"),
+	gestaltSlotMgrExists = 0,
+	gestaltNuBusPresent = 1,
+	gestaltSESlotPresent = 2,
+	gestaltSE30SlotPresent = 3,
+	gestaltPortableSlotPresent = 4
+}
+
+enum
+{
+	gestaltFirstSlotNumber = getOSType!("slt1")
+}
+
+enum
+{
+	gestaltSoundAttr = getOSType!("snd "),
+	gestaltStereoCapability = 0,
+	gestaltStereoMixing = 1,
+	gestaltSoundIOMgrPresent = 3,
+	gestaltBuiltInSoundInput = 4,
+	gestaltHasSoundInputDevice = 5,
+	gestaltPlayAndRecord = 6,
+	gestalt16BitSoundIO = 7,
+	gestaltStereoInput = 8,
+	gestaltLineLevelInput = 9,
+	gestaltSndPlayDoubleBuffer = 10,
+	gestaltMultiChannels = 11,
+	gestalt16BitAudioSupport = 12
+}
+
+enum
+{
+	gestaltSplitOSAttr = getOSType!("spos"),
+	gestaltSplitOSBootDriveIsNetworkVolume = 0,
+	gestaltSplitOSAware = 1,
+	gestaltSplitOSEnablerVolumeIsDifferentFromBootVolume = 2,
+	gestaltSplitOSMachineNameSetToNetworkNameTemp = 3,
+	gestaltSplitOSMachineNameStartupDiskIsNonPersistent = 5
+}
+
+enum
+{
+	gestaltSMPSPSendLetterVersion = getOSType!("spsl")
+}
+
+enum
+{
+	gestaltSpeechRecognitionAttr = getOSType!("srta"),
+	gestaltDesktopSpeechRecognition = 1,
+	gestaltTelephoneSpeechRecognition = 2
+}
+
+enum
+{
+	gestaltSpeechRecognitionVersion = getOSType!("srtb")
+}
+
+enum
+{
+	gestaltSoftwareVendorCode = getOSType!("srad"),
+	gestaltSoftwareVendorApple = getOSType!("Appl"),
+	gestaltSoftwareVendorLicensee = getOSType!("Lcns")
+}
+
+enum
+{
+	gestaltStandardFileAttr = getOSType!("stdf"),
+	gestaltStandardFile58 = 0,
+	gestaltStandardFileTranslationAware = 1,
+	gestaltStandardFileHasColorIcons = 2,
+	gestaltStandardFileUseGenericIcons = 3,
+	gestaltStandardFileHasDynamicVolumeAllocation = 4
+}
+
+enum
+{
+	gestaltSysArchitecture = getOSType!("sysa"),
+	gestalt68k = 1,
+	gestaltPowerPC = 2,
+	gestaltIntel = 10
+}
+
+enum
+{
+	gestaltSystemUpdateVersion = getOSType!("sysu")
+}
+
+enum
+{
+	gestaltSystemVersion = getOSType!("sysv"),
+	gestaltSystemVersionMajor = getOSType!("sys1"),
+	gestaltSystemVersionMinor = getOSType!("sys2"),
+	gestaltSystemVersionBugFix = getOSType!("sys3")
+}
+
+enum
+{
+	gestaltToolboxTable = getOSType!("tbtt")
+}
+
+enum
+{
+	gestaltTextEditVersion = getOSType!("te  "),
+	gestaltTE1 = 1,
+	gestaltTE2 = 2,
+	gestaltTE3 = 3,
+	gestaltTE4 = 4,
+	gestaltTE5 = 5
+}
+
+enum
+{
+	gestaltTE6 = 6
+}
+
+enum
+{
+	gestaltTEAttr = getOSType!("teat"),
+	gestaltTEHasGetHiliteRgn = 0,
+	gestaltTESupportsInlineInput = 1,
+	gestaltTESupportsTextObjects = 2,
+	gestaltTEHasWhiteBackground = 3
+}
+
+enum
+{
+	gestaltTeleMgrAttr = getOSType!("tele"),
+	gestaltTeleMgrPresent = 0,
+	gestaltTeleMgrPowerPCSupport = 1,
+	gestaltTeleMgrSoundStreams = 2,
+	gestaltTeleMgrAutoAnswer = 3,
+	gestaltTeleMgrIndHandset = 4,
+	gestaltTeleMgrSilenceDetect = 5,
+	gestaltTeleMgrNewTELNewSupport = 6
+}
+
+enum
+{
+	gestaltTermMgrAttr = getOSType!("term"),
+	gestaltTermMgrPresent = 0,
+	gestaltTermMgrErrorString = 2
+}
+
+enum
+{
+	gestaltThreadMgrAttr = getOSType!("thds"),
+	gestaltThreadMgrPresent = 0,
+	gestaltSpecificMatchSupport = 1,
+	gestaltThreadsLibraryPresent = 2
+}
+
+enum
+{
+	gestaltTimeMgrVersion = getOSType!("tmgr"),
+	gestaltStandardTimeMgr = 1,
+	gestaltRevisedTimeMgr = 2,
+	gestaltExtendedTimeMgr = 3,
+	gestaltNativeTimeMgr = 4
+}
+
+enum
+{
+	gestaltTSMTEVersion = getOSType!("tmTV"),
+	gestaltTSMTE1 = 0x0100,
+	gestaltTSMTE15 = 0x0150,
+	gestaltTSMTE152 = 0x0152
+}
+
+enum
+{
+	gestaltTSMTEAttr = getOSType!("tmTE"),
+	gestaltTSMTEPresent = 0,
+	gestaltTSMTE = 0
+}
+
+enum
+{
+	gestaltAVLTreeAttr = getOSType!("tree"),
+	gestaltAVLTreePresentBit = 0,
+	gestaltAVLTreeSupportsHandleBasedTreeBit = 1,
+	gestaltAVLTreeSupportsTreeLockingBit = 2
+}
+
+enum
+{
+	gestaltALMAttr = getOSType!("trip"),
+	gestaltALMPresent = 0,
+	gestaltALMHasSFGroup = 1,
+	gestaltALMHasCFMSupport = 2,
+	gestaltALMHasRescanNotifiers = 3
+}
+
+enum
+{
+	gestaltALMHasSFLocation = gestaltALMHasSFGroup
+}
+
+enum
+{
+	gestaltTSMgrVersion = getOSType!("tsmv"),
+	gestaltTSMgr15 = 0x0150,
+	gestaltTSMgr20 = 0x0200,
+	gestaltTSMgr22 = 0x0220,
+	gestaltTSMgr23 = 0x0230
+}
+
+enum
+{
+	gestaltTSMgrAttr = getOSType!("tsma"),
+	gestaltTSMDisplayMgrAwareBit = 0,
+	gestaltTSMdoesTSMTEBit = 1
+}
+
+enum
+{
+	gestaltSpeechAttr = getOSType!("ttsc"),
+	gestaltSpeechMgrPresent = 0,
+	gestaltSpeechHasPPCGlue = 1
+}
+
+enum
+{
+	gestaltTVAttr = getOSType!("tv  "),
+	gestaltHasTVTuner = 0,
+	gestaltHasSoundFader = 1,
+	gestaltHasHWClosedCaptioning = 2,
+	gestaltHasIRRemote = 3,
+	gestaltHasVidDecoderScaler = 4,
+	gestaltHasStereoDecoder = 5,
+	gestaltHasSerialFader = 6,
+	gestaltHasFMTuner = 7,
+	gestaltHasSystemIRFunction = 8,
+	gestaltIRDisabled = 9,
+	gestaltINeedIRPowerOffConfirm = 10,
+	gestaltHasZoomedVideo = 11
+}
+
+enum
+{
+	gestaltATSUVersion = getOSType!("uisv"),
+	gestaltOriginalATSUVersion = (1 << 16),
+	gestaltATSUUpdate1 = (2 << 16),
+	gestaltATSUUpdate2 = (3 << 16),
+	gestaltATSUUpdate3 = (4 << 16),
+	gestaltATSUUpdate4 = (5 << 16),
+	gestaltATSUUpdate5 = (6 << 16),
+	gestaltATSUUpdate6 = (7 << 16),
+	gestaltATSUUpdate7 = (8 << 16)
+}
+
+enum
+{
+	gestaltATSUFeatures = getOSType!("uisf"),
+	gestaltATSUTrackingFeature = 0x00000001,
+	gestaltATSUMemoryFeature = 0x00000001,
+	gestaltATSUFallbacksFeature = 0x00000001,
+	gestaltATSUGlyphBoundsFeature = 0x00000001,
+	gestaltATSULineControlFeature = 0x00000001,
+	gestaltATSULayoutCreateAndCopyFeature = 0x00000001,
+	gestaltATSULayoutCacheClearFeature = 0x00000001,
+	gestaltATSUTextLocatorUsageFeature = 0x00000002,
+	gestaltATSULowLevelOrigFeatures = 0x00000004,
+	gestaltATSUFallbacksObjFeatures = 0x00000008,
+	gestaltATSUIgnoreLeadingFeature = 0x00000008,
+	gestaltATSUByCharacterClusterFeature = 0x00000010,
+	gestaltATSUAscentDescentControlsFeature = 0x00000010,
+	gestaltATSUHighlightInactiveTextFeature = 0x00000010,
+	gestaltATSUPositionToCursorFeature = 0x00000010,
+	gestaltATSUBatchBreakLinesFeature = 0x00000010,
+	gestaltATSUTabSupportFeature = 0x00000010,
+	gestaltATSUDirectAccess = 0x00000010,
+	gestaltATSUDecimalTabFeature = 0x00000020,
+	gestaltATSUBiDiCursorPositionFeature = 0x00000020,
+	gestaltATSUNearestCharLineBreakFeature = 0x00000020,
+	gestaltATSUHighlightColorControlFeature = 0x00000020,
+	gestaltATSUUnderlineOptionsStyleFeature = 0x00000020,
+	gestaltATSUStrikeThroughStyleFeature = 0x00000020,
+	gestaltATSUDropShadowStyleFeature = 0x00000020
+}
+
+enum
+{
+	gestaltUSBAttr = getOSType!("usb "),
+	gestaltUSBPresent = 0,
+	gestaltUSBHasIsoch = 1
+}
+
+enum
+{
+	gestaltUSBVersion = getOSType!("usbv")
+}
+
+enum
+{
+	gestaltVersion = getOSType!("vers"),
+	gestaltValueImplementedVers = 5
+}
+
+enum
+{
+	gestaltVIA1Addr = getOSType!("via1")
+}
+
+enum
+{
+	gestaltVIA2Addr = getOSType!("via2")
+}
+
+enum
+{
+	gestaltVMAttr = getOSType!("vm  "),
+	gestaltVMPresent = 0,
+	gestaltVMHasLockMemoryForOutput = 1,
+	gestaltVMFilemappingOn = 3,
+	gestaltVMHasPagingControl = 4
+}
+
+enum
+{
+	gestaltVMInfoType = getOSType!("vmin"),
+	gestaltVMInfoSizeStorageType = 0,
+	gestaltVMInfoSizeType = 1,
+	gestaltVMInfoSimpleType = 2,
+	gestaltVMInfoNoneType = 3
+}
+
+enum
+{
+	gestaltVMBackingStoreFileRefNum = getOSType!("vmbs")
+}
+
+enum
+{
+	gestaltALMVers = getOSType!("walk")
+}
+
+enum
+{
+	gestaltWindowMgrAttr = getOSType!("wind"),
+	gestaltWindowMgrPresent = (1L << 0),
+	gestaltWindowMgrPresentBit = 0,
+	gestaltExtendedWindowAttributes = 1,
+	gestaltExtendedWindowAttributesBit = 1,
+	gestaltHasFloatingWindows = 2,
+	gestaltHasFloatingWindowsBit = 2,
+	gestaltHasWindowBuffering = 3,
+	gestaltHasWindowBufferingBit = 3,
+	gestaltWindowLiveResizeBit = 4,
+	gestaltWindowMinimizeToDockBit = 5,
+	gestaltHasWindowShadowsBit = 6,
+	gestaltSheetsAreWindowModalBit = 7,
+	gestaltFrontWindowMayBeHiddenBit = 8,
+	gestaltWindowMgrPresentMask = (1L << gestaltWindowMgrPresentBit),
+	gestaltExtendedWindowAttributesMask = (1L << gestaltExtendedWindowAttributesBit),
+	gestaltHasFloatingWindowsMask = (1L << gestaltHasFloatingWindowsBit),
+	gestaltHasWindowBufferingMask = (1L << gestaltHasWindowBufferingBit),
+	gestaltWindowLiveResizeMask = (1L << gestaltWindowLiveResizeBit),
+	gestaltWindowMinimizeToDockMask = (1L << gestaltWindowMinimizeToDockBit),
+	gestaltHasWindowShadowsMask = (1L << gestaltHasWindowShadowsBit),
+	gestaltSheetsAreWindowModalMask = (1L << gestaltSheetsAreWindowModalBit),
+	gestaltFrontWindowMayBeHiddenMask = (1L << gestaltFrontWindowMayBeHiddenBit)
+}
+
+enum
+{
+	gestaltHasSingleWindowModeBit = 8,
+	gestaltHasSingleWindowModeMask = (1L << gestaltHasSingleWindowModeBit)
+}
+
+enum
+{
+	gestaltX86Features = getOSType!("x86f"),
+	gestaltX86HasFPU = 0,
+	gestaltX86HasVME = 1,
+	gestaltX86HasDE = 2,
+	gestaltX86HasPSE = 3,
+	gestaltX86HasTSC = 4,
+	gestaltX86HasMSR = 5,
+	gestaltX86HasPAE = 6,
+	gestaltX86HasMCE = 7,
+	gestaltX86HasCX8 = 8,
+	gestaltX86HasAPIC = 9,
+	gestaltX86HasSEP = 11,
+	gestaltX86HasMTRR = 12,
+	gestaltX86HasPGE = 13,
+	gestaltX86HasMCA = 14,
+	gestaltX86HasCMOV = 15,
+	gestaltX86HasPAT = 16,
+	gestaltX86HasPSE36 = 17,
+	gestaltX86HasPSN = 18,
+	gestaltX86HasCLFSH = 19,
+	gestaltX86Serviced20 = 20,
+	gestaltX86HasDS = 21,
+	gestaltX86ResACPI = 22,
+	gestaltX86HasMMX = 23,
+	gestaltX86HasFXSR = 24,
+	gestaltX86HasSSE = 25,
+	gestaltX86HasSSE2 = 26,
+	gestaltX86HasSS = 27,
+	gestaltX86HasHTT = 28,
+	gestaltX86HasTM = 29
+}
+
+enum
+{
+	gestaltX86AdditionalFeatures = getOSType!("x86a"),
+	gestaltX86HasSSE3 = 0,
+	gestaltX86HasMONITOR = 3,
+	gestaltX86HasDSCPL = 4,
+	gestaltX86HasVMX = 5,
+	gestaltX86HasSMX = 6,
+	gestaltX86HasEST = 7,
+	gestaltX86HasTM2 = 8,
+	gestaltX86HasSupplementalSSE3 = 9,
+	gestaltX86HasCID = 10,
+	gestaltX86HasCX16 = 13,
+	gestaltX86HasxTPR = 14
+}
+
+enum
+{
+	gestaltTranslationAttr = getOSType!("xlat"),
+	gestaltTranslationMgrExists = 0,
+	gestaltTranslationMgrHintOrder = 1,
+	gestaltTranslationPPCAvail = 2,
+	gestaltTranslationGetPathAPIAvail = 3
+}
+
+enum
+{
+	gestaltExtToolboxTable = getOSType!("xttt")
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		gestaltUSBPrinterSharingVersion = getOSType!("zak "),
+		gestaltUSBPrinterSharingVersionMask = 0x0000FFFF,
+		gestaltUSBPrinterSharingAttr = getOSType!("zak "),
+		gestaltUSBPrinterSharingAttrMask = 0xFFFF0000L,
+		gestaltUSBPrinterSharingAttrRunning = 0x80000000L,
+		gestaltUSBPrinterSharingAttrBooted = 0x40000000
+	}
+}
+
+else
+{
+	enum
+	{
+		gestaltUSBPrinterSharingVersion = getOSType!("zak "),
+		gestaltUSBPrinterSharingVersionMask = 0x0000FFFF,
+		gestaltUSBPrinterSharingAttr = getOSType!("zak "),
+		gestaltUSBPrinterSharingAttrMask = 0xFFFF0000,
+		gestaltUSBPrinterSharingAttrRunning = 0x80000000,
+		gestaltUSBPrinterSharingAttrBooted = 0x40000000
+	}
+}
+
+enum
+{
+	gestaltWorldScriptIIVersion = getOSType!("doub"),
+	gestaltWorldScriptIIAttr = getOSType!("wsat"),
+	gestaltWSIICanPrintWithoutPrGeneralBit = 0
+}
+
+extern (C)
+{
+	short Gestalt (uint selector, SInt32* response);
+	short NewGestaltValue (uint selector, int newValue);
+	short ReplaceGestaltValue (uint selector, int replacementValue);
+	short SetGestaltValue (uint selector, int newValue);
+	short DeleteGestaltValue (uint selector);
+	SelectorFunctionUPP NewSelectorFunctionUPP (SelectorFunctionProcPtr userRoutine);
+	void DisposeSelectorFunctionUPP (SelectorFunctionUPP userUPP);
+	short InvokeSelectorFunctionUPP (uint selector, SInt32* response, SelectorFunctionUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/HFSVolumes.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,16 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.HFSVolumes;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.Finder;
+import dstep.coreservices.carboncore.MacTypes;
+//import dstep.hfs.hfs_format;
+
+alias uint HFSCatalogNodeID;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/IntlResources.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,342 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.IntlResources;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+alias byte DateOrders;
+alias Intl0Rec* Intl0Ptr;
+alias Intl0Ptr* Intl0Hndl;
+alias Intl1Rec* Intl1Ptr;
+alias Intl1Ptr* Intl1Hndl;
+alias UntokenTable* UntokenTablePtr;
+alias UntokenTablePtr* UntokenTableHandle;
+alias NumberParts* NumberPartsPtr;
+alias Itl4Rec* Itl4Ptr;
+alias Itl4Ptr* Itl4Handle;
+alias NItl4Rec* NItl4Ptr;
+alias NItl4Ptr* NItl4Handle;
+alias OffPair[3] OffsetTable;
+
+enum
+{
+	itlcShowIcon = 7,
+	itlcDualCaret = 6,
+	itlcSysDirection = 15
+}
+
+enum
+{
+	itlcDisableKeyScriptSync = 3
+}
+
+enum
+{
+	itlcDisableKeyScriptSyncMask = 1 << itlcDisableKeyScriptSync
+}
+
+enum
+{
+	tokLeftQuote = 1,
+	tokRightQuote = 2,
+	tokLeadPlacer = 3,
+	tokLeader = 4,
+	tokNonLeader = 5,
+	tokZeroLead = 6,
+	tokPercent = 7,
+	tokPlusSign = 8,
+	tokMinusSign = 9,
+	tokThousands = 10,
+	tokReserved = 11,
+	tokSeparator = 12,
+	tokEscape = 13,
+	tokDecPoint = 14,
+	tokEPlus = 15,
+	tokEMinus = 16,
+	tokMaxSymbols = 31,
+	curNumberPartsVersion = 1
+}
+
+enum
+{
+	currSymLead = 16,
+	currNegSym = 32,
+	currTrailingZ = 64,
+	currLeadingZ = 128
+}
+
+enum
+{
+	mdy = 0,
+	dmy = 1,
+	ymd = 2,
+	myd = 3,
+	dym = 4,
+	ydm = 5
+}
+
+enum
+{
+	timeCycle24 = 0,
+	timeCycleZero = 1,
+	timeCycle12 = 255,
+	zeroCycle = 1,
+	longDay = 0,
+	longWeek = 1,
+	longMonth = 2,
+	longYear = 3,
+	supDay = 1,
+	supWeek = 2,
+	supMonth = 4,
+	supYear = 8,
+	dayLdingZ = 32,
+	mntLdingZ = 64,
+	century = 128,
+	secLeadingZ = 32,
+	minLeadingZ = 64,
+	hrLeadingZ = 128
+}
+
+union WideChar
+{
+	char[2] a;
+	short b;
+}
+
+struct OffPair
+{
+	short offFirst;
+	short offSecond;
+}
+
+
+struct Intl0Rec
+{
+	byte decimalPt;
+	byte thousSep;
+	byte listSep;
+	byte currSym1;
+	byte currSym2;
+	byte currSym3;
+	ubyte currFmt;
+	ubyte dateOrder;
+	ubyte shrtDateFmt;
+	byte dateSep;
+	ubyte timeCycle;
+	ubyte timeFmt;
+	char* mornStr;
+	char* eveStr;
+	byte timeSep;
+	byte time1Suff;
+	byte time2Suff;
+	byte time3Suff;
+	byte time4Suff;
+	byte time5Suff;
+	byte time6Suff;
+	byte time7Suff;
+	byte time8Suff;
+	ubyte metricSys;
+	short intl0Vers;
+}
+
+
+struct Intl1Rec
+{
+	Str15* days;
+	Str15* months;
+	ubyte suppressDay;
+	ubyte lngDateFmt;
+	ubyte dayLeading0;
+	ubyte abbrLen;
+	char* st0;
+	char* st1;
+	char* st2;
+	char* st3;
+	char* st4;
+	short intl1Vers;
+	short* localRtn;
+}
+
+
+struct Itl1ExtRec
+{
+	Intl1Rec base;
+	short version_;
+	short format;
+	short calendarCode;
+	int extraDaysTableOffset;
+	int extraDaysTableLength;
+	int extraMonthsTableOffset;
+	int extraMonthsTableLength;
+	int abbrevDaysTableOffset;
+	int abbrevDaysTableLength;
+	int abbrevMonthsTableOffset;
+	int abbrevMonthsTableLength;
+	int extraSepsTableOffset;
+	int extraSepsTableLength;
+	short* tables;
+}
+
+
+struct UntokenTable
+{
+	short len;
+	short lastToken;
+	short* index;
+}
+
+
+struct WideCharArr
+{
+	short size;
+	WideChar* data;
+}
+
+
+struct NumberParts
+{
+	short version_;
+	WideChar* data;
+	WideCharArr pePlus;
+	WideCharArr peMinus;
+	WideCharArr peMinusPlus;
+	WideCharArr altNumTable;
+	char* reserved;
+}
+
+
+struct Itl4Rec
+{
+	short flags;
+	int resourceType;
+	short resourceNum;
+	short version_;
+	int resHeader1;
+	int resHeader2;
+	short numTables;
+	int mapOffset;
+	int strOffset;
+	int fetchOffset;
+	int unTokenOffset;
+	int defPartsOffset;
+	int resOffset6;
+	int resOffset7;
+	int resOffset8;
+}
+
+
+struct NItl4Rec
+{
+	short flags;
+	int resourceType;
+	short resourceNum;
+	short version_;
+	short format;
+	short resHeader;
+	int resHeader2;
+	short numTables;
+	int mapOffset;
+	int strOffset;
+	int fetchOffset;
+	int unTokenOffset;
+	int defPartsOffset;
+	int whtSpListOffset;
+	int resOffset7;
+	int resOffset8;
+	short resLength1;
+	short resLength2;
+	short resLength3;
+	short unTokenLength;
+	short defPartsLength;
+	short whtSpListLength;
+	short resLength7;
+	short resLength8;
+}
+
+
+struct TableDirectoryRecord
+{
+	uint tableSignature;
+	uint reserved;
+	uint tableStartOffset;
+	uint tableSize;
+}
+
+
+struct Itl5Record
+{
+	int versionNumber;
+	ushort numberOfTables;
+	ushort* reserved;
+	TableDirectoryRecord* tableDirectory;
+}
+
+
+struct RuleBasedTrslRecord
+{
+	short sourceType;
+	short targetType;
+	short formatNumber;
+	short propertyFlag;
+	short numberOfRules;
+}
+
+
+struct ItlcRecord
+{
+	short itlcSystem;
+	short itlcReserved;
+	byte itlcFontForce;
+	byte itlcIntlForce;
+	byte itlcOldKybd;
+	byte itlcFlags;
+	short itlcIconOffset;
+	byte itlcIconSide;
+	byte itlcIconRsvd;
+	short itlcRegionCode;
+	short itlcSysFlags;
+	char* itlcReserved4;
+}
+
+
+struct ItlbRecord
+{
+	short itlbNumber;
+	short itlbDate;
+	short itlbSort;
+	short itlbFlags;
+	short itlbToken;
+	short itlbEncoding;
+	short itlbLang;
+	byte itlbNumRep;
+	byte itlbDateRep;
+	short itlbKeys;
+	short itlbIcon;
+}
+
+
+struct ItlbExtRecord
+{
+	ItlbRecord base;
+	int itlbLocalSize;
+	short itlbMonoFond;
+	short itlbMonoSize;
+	short itlbPrefFond;
+	short itlbPrefSize;
+	short itlbSmallFond;
+	short itlbSmallSize;
+	short itlbSysFond;
+	short itlbSysSize;
+	short itlbAppFond;
+	short itlbAppSize;
+	short itlbHelpFond;
+	short itlbHelpSize;
+	ubyte itlbValidStyles;
+	ubyte itlbAliasStyle;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/LowMem.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,35 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.LowMem;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacMemory;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.OSUtils;
+import dstep.coreservices.carboncore.Resources;
+
+extern (C)
+{
+	short LMGetBootDrive ();
+	void LMSetBootDrive (short value);
+	short LMGetApFontID ();
+	void LMSetApFontID (short value);
+	short LMGetSysMap ();
+	void LMSetSysMap (short value);
+	ubyte LMGetResLoad ();
+	void LMSetResLoad (ubyte value);
+	short LMGetResErr ();
+	void LMSetResErr (short value);
+	ubyte LMGetTmpResLoad ();
+	void LMSetTmpResLoad (ubyte value);
+	char* LMGetIntlSpec ();
+	void LMSetIntlSpec (char* value);
+	void LMSetSysFontFam (short value);
+	short LMGetSysFontSize ();
+	void LMSetSysFontSize (short value);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MacErrors.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,2794 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MacErrors;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.internal.Types;
+
+enum
+{
+	paramErr = -50,
+	noHardwareErr = -200,
+	notEnoughHardwareErr = -201,
+	userCanceledErr = -128,
+	qErr = -1,
+	vTypErr = -2,
+	corErr = -3,
+	unimpErr = -4,
+	SlpTypeErr = -5,
+	seNoDB = -8,
+	controlErr = -17,
+	statusErr = -18,
+	readErr = -19,
+	writErr = -20,
+	badUnitErr = -21,
+	unitEmptyErr = -22,
+	openErr = -23,
+	closErr = -24,
+	dRemovErr = -25,
+	dInstErr = -26
+}
+
+enum
+{
+	abortErr = -27,
+	iIOAbortErr = -27,
+	notOpenErr = -28,
+	unitTblFullErr = -29,
+	dceExtErr = -30,
+	slotNumErr = -360,
+	gcrOnMFMErr = -400,
+	dirFulErr = -33,
+	dskFulErr = -34,
+	nsvErr = -35,
+	ioErr = -36,
+	bdNamErr = -37,
+	fnOpnErr = -38,
+	eofErr = -39,
+	posErr = -40,
+	mFulErr = -41,
+	tmfoErr = -42,
+	fnfErr = -43,
+	wPrErr = -44,
+	fLckdErr = -45
+}
+
+enum
+{
+	vLckdErr = -46,
+	fBsyErr = -47,
+	dupFNErr = -48,
+	opWrErr = -49,
+	rfNumErr = -51,
+	gfpErr = -52,
+	volOffLinErr = -53,
+	permErr = -54,
+	volOnLinErr = -55,
+	nsDrvErr = -56,
+	noMacDskErr = -57,
+	extFSErr = -58,
+	fsRnErr = -59,
+	badMDBErr = -60,
+	wrPermErr = -61,
+	dirNFErr = -120,
+	tmwdoErr = -121,
+	badMovErr = -122,
+	wrgVolTypErr = -123,
+	volGoneErr = -124
+}
+
+enum
+{
+	fidNotFound = -1300,
+	fidExists = -1301,
+	notAFileErr = -1302,
+	diffVolErr = -1303,
+	catChangedErr = -1304,
+	desktopDamagedErr = -1305,
+	sameFileErr = -1306,
+	badFidErr = -1307,
+	notARemountErr = -1308,
+	fileBoundsErr = -1309,
+	fsDataTooBigErr = -1310,
+	volVMBusyErr = -1311,
+	badFCBErr = -1327,
+	errFSUnknownCall = -1400,
+	errFSBadFSRef = -1401,
+	errFSBadForkName = -1402,
+	errFSBadBuffer = -1403,
+	errFSBadForkRef = -1404,
+	errFSBadInfoBitmap = -1405,
+	errFSMissingCatInfo = -1406,
+	errFSNotAFolder = -1407,
+	errFSForkNotFound = -1409,
+	errFSNameTooLong = -1410,
+	errFSMissingName = -1411,
+	errFSBadPosMode = -1412,
+	errFSBadAllocFlags = -1413,
+	errFSNoMoreItems = -1417,
+	errFSBadItemCount = -1418,
+	errFSBadSearchParams = -1419,
+	errFSRefsDifferent = -1420,
+	errFSForkExists = -1421,
+	errFSBadIteratorFlags = -1422,
+	errFSIteratorNotFound = -1423,
+	errFSIteratorNotSupported = -1424,
+	errFSQuotaExceeded = -1425,
+	errFSOperationNotSupported = -1426,
+	errFSAttributeNotFound = -1427,
+	errFSPropertyNotValid = -1428,
+	errFSNotEnoughSpaceForOperation = -1429,
+	envNotPresent = -5500,
+	envBadVers = -5501,
+	envVersTooBig = -5502,
+	fontDecError = -64,
+	fontNotDeclared = -65,
+	fontSubErr = -66,
+	fontNotOutlineErr = -32615,
+	firstDskErr = -84,
+	lastDskErr = -64,
+	noDriveErr = -64,
+	offLinErr = -65,
+	noNybErr = -66
+}
+
+enum
+{
+	noAdrMkErr = -67,
+	dataVerErr = -68,
+	badCksmErr = -69,
+	badBtSlpErr = -70,
+	noDtaMkErr = -71,
+	badDCksum = -72,
+	badDBtSlp = -73,
+	wrUnderrun = -74,
+	cantStepErr = -75,
+	tk0BadErr = -76,
+	initIWMErr = -77,
+	twoSideErr = -78,
+	spdAdjErr = -79,
+	seekErr = -80,
+	sectNFErr = -81,
+	fmt1Err = -82,
+	fmt2Err = -83,
+	verErr = -84,
+	clkRdErr = -85,
+	clkWrErr = -86,
+	prWrErr = -87,
+	prInitErr = -88,
+	rcvrErr = -89,
+	breakRecd = -90
+}
+
+enum
+{
+	noScrapErr = -100,
+	noTypeErr = -102
+}
+
+enum
+{
+	eLenErr = -92,
+	eMultiErr = -91
+}
+
+enum
+{
+	ddpSktErr = -91,
+	ddpLenErr = -92,
+	noBridgeErr = -93,
+	lapProtErr = -94,
+	excessCollsns = -95,
+	portNotPwr = -96,
+	portInUse = -97,
+	portNotCf = -98
+}
+
+enum
+{
+	memROZWarn = -99,
+	memROZError = -99,
+	memROZErr = -99,
+	memFullErr = -108,
+	nilHandleErr = -109,
+	memWZErr = -111,
+	memPurErr = -112,
+	memAdrErr = -110,
+	memAZErr = -113,
+	memPCErr = -114,
+	memBCErr = -115,
+	memSCErr = -116,
+	memLockedErr = -117
+}
+
+enum
+{
+	iMemFullErr = -108,
+	iIOAbort = -27
+}
+
+enum
+{
+	resourceInMemory = -188,
+	writingPastEnd = -189,
+	inputOutOfBounds = -190,
+	resNotFound = -192,
+	resFNotFound = -193,
+	addResFailed = -194,
+	addRefFailed = -195,
+	rmvResFailed = -196,
+	rmvRefFailed = -197,
+	resAttrErr = -198,
+	mapReadErr = -199,
+	CantDecompress = -186,
+	badExtResource = -185,
+	noMemForPictPlaybackErr = -145,
+	rgnOverflowErr = -147,
+	rgnTooBigError = -147,
+	pixMapTooDeepErr = -148,
+	insufficientStackErr = -149,
+	nsStackErr = -149
+}
+
+enum
+{
+	evtNotEnb = 1
+}
+
+enum
+{
+	cMatchErr = -150,
+	cTempMemErr = -151,
+	cNoMemErr = -152,
+	cRangeErr = -153,
+	cProtectErr = -154,
+	cDevErr = -155,
+	cResErr = -156,
+	cDepthErr = -157,
+	rgnTooBigErr = -500,
+	updPixMemErr = -125,
+	pictInfoVersionErr = -11000,
+	pictInfoIDErr = -11001,
+	pictInfoVerbErr = -11002,
+	cantLoadPickMethodErr = -11003,
+	colorsRequestedErr = -11004,
+	pictureDataErr = -11005
+}
+
+enum
+{
+	cmProfileError = -170,
+	cmMethodError = -171,
+	cmMethodNotFound = -175,
+	cmProfileNotFound = -176,
+	cmProfilesIdentical = -177,
+	cmCantConcatenateError = -178,
+	cmCantXYZ = -179,
+	cmCantDeleteProfile = -180,
+	cmUnsupportedDataType = -181,
+	cmNoCurrentProfile = -182
+}
+
+enum
+{
+	noHardware = noHardwareErr,
+	notEnoughHardware = notEnoughHardwareErr,
+	queueFull = -203,
+	resProblem = -204,
+	badChannel = -205,
+	badFormat = -206,
+	notEnoughBufferSpace = -207,
+	badFileFormat = -208,
+	channelBusy = -209,
+	buffersTooSmall = -210,
+	channelNotBusy = -211,
+	noMoreRealTime = -212,
+	siVBRCompressionNotSupported = -213,
+	siNoSoundInHardware = -220,
+	siBadSoundInDevice = -221,
+	siNoBufferSpecified = -222,
+	siInvalidCompression = -223,
+	siHardDriveTooSlow = -224,
+	siInvalidSampleRate = -225,
+	siInvalidSampleSize = -226,
+	siDeviceBusyErr = -227,
+	siBadDeviceName = -228,
+	siBadRefNum = -229,
+	siInputDeviceErr = -230,
+	siUnknownInfoType = -231,
+	siUnknownQuality = -232
+}
+
+enum
+{
+	noSynthFound = -240,
+	synthOpenFailed = -241,
+	synthNotReady = -242,
+	bufTooSmall = -243,
+	voiceNotFound = -244,
+	incompatibleVoice = -245,
+	badDictFormat = -246,
+	badInputText = -247
+}
+
+enum
+{
+	midiNoClientErr = -250,
+	midiNoPortErr = -251,
+	midiTooManyPortsErr = -252,
+	midiTooManyConsErr = -253,
+	midiVConnectErr = -254,
+	midiVConnectMade = -255,
+	midiVConnectRmvd = -256,
+	midiNoConErr = -257,
+	midiWriteErr = -258,
+	midiNameLenErr = -259,
+	midiDupIDErr = -260,
+	midiInvalidCmdErr = -261
+}
+
+enum
+{
+	nmTypErr = -299
+}
+
+enum
+{
+	siInitSDTblErr = 1,
+	siInitVBLQsErr = 2,
+	siInitSPTblErr = 3,
+	sdmJTInitErr = 10,
+	sdmInitErr = 11,
+	sdmSRTInitErr = 12,
+	sdmPRAMInitErr = 13,
+	sdmPriInitErr = 14
+}
+
+enum
+{
+	smSDMInitErr = -290,
+	smSRTInitErr = -291,
+	smPRAMInitErr = -292,
+	smPriInitErr = -293,
+	smEmptySlot = -300,
+	smCRCFail = -301,
+	smFormatErr = -302,
+	smRevisionErr = -303,
+	smNoDir = -304,
+	smDisabledSlot = -305,
+	smNosInfoArray = -306
+}
+
+enum
+{
+	smResrvErr = -307,
+	smUnExBusErr = -308,
+	smBLFieldBad = -309,
+	smFHBlockRdErr = -310,
+	smFHBlkDispErr = -311,
+	smDisposePErr = -312,
+	smNoBoardSRsrc = -313,
+	smGetPRErr = -314,
+	smNoBoardId = -315,
+	smInitStatVErr = -316,
+	smInitTblVErr = -317,
+	smNoJmpTbl = -318,
+	smReservedSlot = -318,
+	smBadBoardId = -319,
+	smBusErrTO = -320,
+	svTempDisable = -32768L,
+	svDisabled = -32640,
+	smBadRefId = -330,
+	smBadsList = -331,
+	smReservedErr = -332,
+	smCodeRevErr = -333
+}
+
+enum
+{
+	smCPUErr = -334,
+	smsPointerNil = -335,
+	smNilsBlockErr = -336,
+	smSlotOOBErr = -337,
+	smSelOOBErr = -338,
+	smNewPErr = -339,
+	smBlkMoveErr = -340,
+	smCkStatusErr = -341,
+	smGetDrvrNamErr = -342,
+	smDisDrvrNamErr = -343,
+	smNoMoresRsrcs = -344,
+	smsGetDrvrErr = -345,
+	smBadsPtrErr = -346,
+	smByteLanesErr = -347,
+	smOffsetErr = -348,
+	smNoGoodOpens = -349,
+	smSRTOvrFlErr = -350,
+	smRecNotFnd = -351
+}
+
+enum
+{
+	notBTree = -410,
+	btNoSpace = -413,
+	btDupRecErr = -414,
+	btRecNotFnd = -415,
+	btKeyLenErr = -416,
+	btKeyAttrErr = -417,
+	unknownInsertModeErr = -20000,
+	recordDataTooBigErr = -20001,
+	invalidIndexErr = -20002
+}
+
+enum
+{
+	fsmFFSNotFoundErr = -431,
+	fsmBusyFFSErr = -432,
+	fsmBadFFSNameErr = -433,
+	fsmBadFSDLenErr = -434,
+	fsmDuplicateFSIDErr = -435,
+	fsmBadFSDVersionErr = -436,
+	fsmNoAlternateStackErr = -437,
+	fsmUnknownFSMMessageErr = -438
+}
+
+enum
+{
+	editionMgrInitErr = -450,
+	badSectionErr = -451,
+	notRegisteredSectionErr = -452,
+	badEditionFileErr = -453,
+	badSubPartErr = -454,
+	multiplePublisherWrn = -460,
+	containerNotFoundWrn = -461,
+	containerAlreadyOpenWrn = -462,
+	notThePublisherWrn = -463
+}
+
+enum
+{
+	teScrapSizeErr = -501,
+	hwParamErr = -502,
+	driverHardwareGoneErr = -503
+}
+
+enum
+{
+	procNotFound = -600,
+	memFragErr = -601,
+	appModeErr = -602,
+	protocolErr = -603,
+	hardwareConfigErr = -604,
+	appMemFullErr = -605,
+	appIsDaemon = -606,
+	bufferIsSmall = -607,
+	noOutstandingHLE = -608,
+	connectionInvalid = -609,
+	noUserInteractionAllowed = -610
+}
+
+enum
+{
+	wrongApplicationPlatform = -875,
+	appVersionTooOld = -876,
+	notAppropriateForClassic = -877
+}
+
+enum
+{
+	threadTooManyReqsErr = -617,
+	threadNotFoundErr = -618,
+	threadProtocolErr = -619
+}
+
+enum
+{
+	threadBadAppContextErr = -616
+}
+
+enum
+{
+	notEnoughMemoryErr = -620,
+	notHeldErr = -621,
+	cannotMakeContiguousErr = -622,
+	notLockedErr = -623,
+	interruptsMaskedErr = -624,
+	cannotDeferErr = -625,
+	noMMUErr = -626
+}
+
+enum
+{
+	vmMorePhysicalThanVirtualErr = -628,
+	vmKernelMMUInitErr = -629,
+	vmOffErr = -630,
+	vmMemLckdErr = -631,
+	vmBadDriver = -632,
+	vmNoVectorErr = -633
+}
+
+enum
+{
+	vmInvalidBackingFileIDErr = -640,
+	vmMappingPrivilegesErr = -641,
+	vmBusyBackingFileErr = -642,
+	vmNoMoreBackingFilesErr = -643,
+	vmInvalidFileViewIDErr = -644,
+	vmFileViewAccessErr = -645,
+	vmNoMoreFileViewsErr = -646,
+	vmAddressNotInFileViewErr = -647,
+	vmInvalidOwningProcessErr = -648
+}
+
+enum
+{
+	rcDBNull = -800,
+	rcDBValue = -801,
+	rcDBError = -802,
+	rcDBBadType = -803,
+	rcDBBreak = -804,
+	rcDBExec = -805,
+	rcDBBadSessID = -806,
+	rcDBBadSessNum = -807,
+	rcDBBadDDEV = -808,
+	rcDBAsyncNotSupp = -809,
+	rcDBBadAsyncPB = -810,
+	rcDBNoHandler = -811,
+	rcDBWrongVersion = -812,
+	rcDBPackNotInited = -813
+}
+
+enum
+{
+	hmHelpDisabled = -850,
+	hmBalloonAborted = -853,
+	hmSameAsLastBalloon = -854,
+	hmHelpManagerNotInited = -855,
+	hmSkippedBalloon = -857,
+	hmWrongVersion = -858,
+	hmUnknownHelpType = -859,
+	hmOperationUnsupported = -861,
+	hmNoBalloonUp = -862,
+	hmCloseViewActive = -863
+}
+
+enum
+{
+	notInitErr = -900,
+	nameTypeErr = -902,
+	noPortErr = -903,
+	noGlobalsErr = -904,
+	localOnlyErr = -905,
+	destPortErr = -906,
+	sessTableErr = -907,
+	noSessionErr = -908,
+	badReqErr = -909,
+	portNameExistsErr = -910,
+	noUserNameErr = -911,
+	userRejectErr = -912,
+	noMachineNameErr = -913,
+	noToolboxNameErr = -914,
+	noResponseErr = -915,
+	portClosedErr = -916,
+	sessClosedErr = -917,
+	badPortNameErr = -919,
+	noDefaultUserErr = -922,
+	notLoggedInErr = -923,
+	noUserRefErr = -924,
+	networkErr = -925,
+	noInformErr = -926,
+	authFailErr = -927,
+	noUserRecErr = -928,
+	badServiceMethodErr = -930,
+	badLocNameErr = -931,
+	guestNotAllowedErr = -932
+}
+
+enum
+{
+	kFMIterationCompleted = -980L,
+	kFMInvalidFontFamilyErr = -981L,
+	kFMInvalidFontErr = -982L,
+	kFMIterationScopeModifiedErr = -983L,
+	kFMFontTableAccessErr = -984L,
+	kFMFontContainerAccessErr = -985L
+}
+
+enum
+{
+	noMaskFoundErr = -1000
+}
+
+enum
+{
+	nbpBuffOvr = -1024,
+	nbpNoConfirm = -1025,
+	nbpConfDiff = -1026,
+	nbpDuplicate = -1027,
+	nbpNotFound = -1028,
+	nbpNISErr = -1029
+}
+
+enum
+{
+	aspBadVersNum = -1066,
+	aspBufTooSmall = -1067,
+	aspNoMoreSess = -1068,
+	aspNoServers = -1069,
+	aspParamErr = -1070,
+	aspServerBusy = -1071,
+	aspSessClosed = -1072,
+	aspSizeErr = -1073,
+	aspTooMany = -1074,
+	aspNoAck = -1075
+}
+
+enum
+{
+	reqFailed = -1096,
+	tooManyReqs = -1097,
+	tooManySkts = -1098,
+	badATPSkt = -1099,
+	badBuffNum = -1100,
+	noRelErr = -1101,
+	cbNotFound = -1102,
+	noSendResp = -1103,
+	noDataArea = -1104,
+	reqAborted = -1105
+}
+
+enum
+{
+	errRefNum = -1280,
+	errAborted = -1279,
+	errState = -1278,
+	errOpening = -1277,
+	errAttention = -1276,
+	errFwdReset = -1275,
+	errDSPQueueSize = -1274,
+	errOpenDenied = -1273
+}
+
+enum
+{
+	errAECoercionFail = -1700,
+	errAEDescNotFound = -1701,
+	errAECorruptData = -1702,
+	errAEWrongDataType = -1703,
+	errAENotAEDesc = -1704,
+	errAEBadListItem = -1705,
+	errAENewerVersion = -1706,
+	errAENotAppleEvent = -1707,
+	errAEEventNotHandled = -1708,
+	errAEReplyNotValid = -1709,
+	errAEUnknownSendMode = -1710,
+	errAEWaitCanceled = -1711,
+	errAETimeout = -1712,
+	errAENoUserInteraction = -1713,
+	errAENotASpecialFunction = -1714,
+	errAEParamMissed = -1715,
+	errAEUnknownAddressType = -1716,
+	errAEHandlerNotFound = -1717,
+	errAEReplyNotArrived = -1718,
+	errAEIllegalIndex = -1719,
+	errAEImpossibleRange = -1720,
+	errAEWrongNumberArgs = -1721,
+	errAEAccessorNotFound = -1723,
+	errAENoSuchLogical = -1725,
+	errAEBadTestKey = -1726,
+	errAENotAnObjSpec = -1727,
+	errAENoSuchObject = -1728,
+	errAENegativeCount = -1729,
+	errAEEmptyListContainer = -1730,
+	errAEUnknownObjectType = -1731,
+	errAERecordingIsAlreadyOn = -1732,
+	errAEReceiveTerminate = -1733,
+	errAEReceiveEscapeCurrent = -1734,
+	errAEEventFiltered = -1735,
+	errAEDuplicateHandler = -1736,
+	errAEStreamBadNesting = -1737,
+	errAEStreamAlreadyConverted = -1738,
+	errAEDescIsNull = -1739,
+	errAEBuildSyntaxError = -1740,
+	errAEBufferTooSmall = -1741
+}
+
+enum
+{
+	errOSASystemError = -1750,
+	errOSAInvalidID = -1751,
+	errOSABadStorageType = -1752,
+	errOSAScriptError = -1753,
+	errOSABadSelector = -1754,
+	errOSASourceNotAvailable = -1756,
+	errOSANoSuchDialect = -1757,
+	errOSADataFormatObsolete = -1758,
+	errOSADataFormatTooNew = -1759,
+	errOSACorruptData = errAECorruptData,
+	errOSARecordingIsAlreadyOn = errAERecordingIsAlreadyOn,
+	errOSAComponentMismatch = -1761,
+	errOSACantOpenComponent = -1762
+}
+
+enum
+{
+	errOffsetInvalid = -1800,
+	errOffsetIsOutsideOfView = -1801,
+	errTopOfDocument = -1810,
+	errTopOfBody = -1811,
+	errEndOfDocument = -1812,
+	errEndOfBody = -1813
+}
+
+enum
+{
+	badDragRefErr = -1850,
+	badDragItemErr = -1851,
+	badDragFlavorErr = -1852,
+	duplicateFlavorErr = -1853,
+	cantGetFlavorErr = -1854,
+	duplicateHandlerErr = -1855,
+	handlerNotFoundErr = -1856,
+	dragNotAcceptedErr = -1857,
+	unsupportedForPlatformErr = -1858,
+	noSuitableDisplaysErr = -1859,
+	badImageRgnErr = -1860,
+	badImageErr = -1861,
+	nonDragOriginatorErr = -1862
+}
+
+enum
+{
+	couldNotResolveDataRef = -2000,
+	badImageDescription = -2001,
+	badPublicMovieAtom = -2002,
+	cantFindHandler = -2003,
+	cantOpenHandler = -2004,
+	badComponentType = -2005,
+	noMediaHandler = -2006,
+	noDataHandler = -2007,
+	invalidMedia = -2008,
+	invalidTrack = -2009,
+	invalidMovie = -2010,
+	invalidSampleTable = -2011,
+	invalidDataRef = -2012,
+	invalidHandler = -2013,
+	invalidDuration = -2014,
+	invalidTime = -2015,
+	cantPutPublicMovieAtom = -2016,
+	badEditList = -2017,
+	mediaTypesDontMatch = -2018,
+	progressProcAborted = -2019,
+	movieToolboxUninitialized = -2020,
+	noRecordOfApp = movieToolboxUninitialized,
+	wfFileNotFound = -2021,
+	cantCreateSingleForkFile = -2022,
+	invalidEditState = -2023,
+	nonMatchingEditState = -2024,
+	staleEditState = -2025,
+	userDataItemNotFound = -2026,
+	maxSizeToGrowTooSmall = -2027,
+	badTrackIndex = -2028,
+	trackIDNotFound = -2029,
+	trackNotInMovie = -2030,
+	timeNotInTrack = -2031,
+	timeNotInMedia = -2032,
+	badEditIndex = -2033,
+	internalQuickTimeError = -2034,
+	cantEnableTrack = -2035,
+	invalidRect = -2036,
+	invalidSampleNum = -2037,
+	invalidChunkNum = -2038,
+	invalidSampleDescIndex = -2039,
+	invalidChunkCache = -2040,
+	invalidSampleDescription = -2041,
+	dataNotOpenForRead = -2042,
+	dataNotOpenForWrite = -2043,
+	dataAlreadyOpenForWrite = -2044,
+	dataAlreadyClosed = -2045,
+	endOfDataReached = -2046,
+	dataNoDataRef = -2047,
+	noMovieFound = -2048,
+	invalidDataRefContainer = -2049,
+	badDataRefIndex = -2050,
+	noDefaultDataRef = -2051,
+	couldNotUseAnExistingSample = -2052,
+	featureUnsupported = -2053,
+	noVideoTrackInMovieErr = -2054,
+	noSoundTrackInMovieErr = -2055,
+	soundSupportNotAvailableErr = -2056,
+	unsupportedAuxiliaryImportData = -2057,
+	auxiliaryExportDataUnavailable = -2058,
+	samplesAlreadyInMediaErr = -2059,
+	noSourceTreeFoundErr = -2060,
+	sourceNotFoundErr = -2061,
+	movieTextNotFoundErr = -2062,
+	missingRequiredParameterErr = -2063,
+	invalidSpriteWorldPropertyErr = -2064,
+	invalidSpritePropertyErr = -2065,
+	gWorldsNotSameDepthAndSizeErr = -2066,
+	invalidSpriteIndexErr = -2067,
+	invalidImageIndexErr = -2068,
+	invalidSpriteIDErr = -2069
+}
+
+enum
+{
+	internalComponentErr = -2070,
+	notImplementedMusicOSErr = -2071,
+	cantSendToSynthesizerOSErr = -2072,
+	cantReceiveFromSynthesizerOSErr = -2073,
+	illegalVoiceAllocationOSErr = -2074,
+	illegalPartOSErr = -2075,
+	illegalChannelOSErr = -2076,
+	illegalKnobOSErr = -2077,
+	illegalKnobValueOSErr = -2078,
+	illegalInstrumentOSErr = -2079,
+	illegalControllerOSErr = -2080,
+	midiManagerAbsentOSErr = -2081,
+	synthesizerNotRespondingOSErr = -2082,
+	synthesizerOSErr = -2083,
+	illegalNoteChannelOSErr = -2084,
+	noteChannelNotAllocatedOSErr = -2085,
+	tunePlayerFullOSErr = -2086,
+	tuneParseOSErr = -2087,
+	noExportProcAvailableErr = -2089,
+	videoOutputInUseErr = -2090
+}
+
+enum
+{
+	componentDllLoadErr = -2091,
+	componentDllEntryNotFoundErr = -2092,
+	qtmlDllLoadErr = -2093,
+	qtmlDllEntryNotFoundErr = -2094,
+	qtmlUninitialized = -2095,
+	unsupportedOSErr = -2096,
+	unsupportedProcessorErr = -2097,
+	componentNotThreadSafeErr = -2098
+}
+
+enum
+{
+	cannotFindAtomErr = -2101,
+	notLeafAtomErr = -2102,
+	atomsNotOfSameTypeErr = -2103,
+	atomIndexInvalidErr = -2104,
+	duplicateAtomTypeAndIDErr = -2105,
+	invalidAtomErr = -2106,
+	invalidAtomContainerErr = -2107,
+	invalidAtomTypeErr = -2108,
+	cannotBeLeafAtomErr = -2109,
+	pathTooLongErr = -2110,
+	emptyPathErr = -2111,
+	noPathMappingErr = -2112,
+	pathNotVerifiedErr = -2113,
+	unknownFormatErr = -2114,
+	wackBadFileErr = -2115,
+	wackForkNotFoundErr = -2116,
+	wackBadMetaDataErr = -2117,
+	qfcbNotFoundErr = -2118,
+	qfcbNotCreatedErr = -2119,
+	AAPNotCreatedErr = -2120,
+	AAPNotFoundErr = -2121,
+	ASDBadHeaderErr = -2122,
+	ASDBadForkErr = -2123,
+	ASDEntryNotFoundErr = -2124,
+	fileOffsetTooBigErr = -2125,
+	notAllowedToSaveMovieErr = -2126,
+	qtNetworkAlreadyAllocatedErr = -2127,
+	urlDataHHTTPProtocolErr = -2129,
+	urlDataHHTTPNoNetDriverErr = -2130,
+	urlDataHHTTPURLErr = -2131,
+	urlDataHHTTPRedirectErr = -2132,
+	urlDataHFTPProtocolErr = -2133,
+	urlDataHFTPShutdownErr = -2134,
+	urlDataHFTPBadUserErr = -2135,
+	urlDataHFTPBadPasswordErr = -2136,
+	urlDataHFTPServerErr = -2137,
+	urlDataHFTPDataConnectionErr = -2138,
+	urlDataHFTPNoDirectoryErr = -2139,
+	urlDataHFTPQuotaErr = -2140,
+	urlDataHFTPPermissionsErr = -2141,
+	urlDataHFTPFilenameErr = -2142,
+	urlDataHFTPNoNetDriverErr = -2143,
+	urlDataHFTPBadNameListErr = -2144,
+	urlDataHFTPNeedPasswordErr = -2145,
+	urlDataHFTPNoPasswordErr = -2146,
+	urlDataHFTPServerDisconnectedErr = -2147,
+	urlDataHFTPURLErr = -2148,
+	notEnoughDataErr = -2149,
+	qtActionNotHandledErr = -2157,
+	qtXMLParseErr = -2158,
+	qtXMLApplicationErr = -2159
+}
+
+enum
+{
+	digiUnimpErr = -2201,
+	qtParamErr = -2202,
+	matrixErr = -2203,
+	notExactMatrixErr = -2204,
+	noMoreKeyColorsErr = -2205,
+	notExactSizeErr = -2206,
+	badDepthErr = -2207,
+	noDMAErr = -2208,
+	badCallOrderErr = -2209
+}
+
+enum
+{
+	kernelIncompleteErr = -2401,
+	kernelCanceledErr = -2402,
+	kernelOptionsErr = -2403,
+	kernelPrivilegeErr = -2404,
+	kernelUnsupportedErr = -2405,
+	kernelObjectExistsErr = -2406,
+	kernelWritePermissionErr = -2407,
+	kernelReadPermissionErr = -2408,
+	kernelExecutePermissionErr = -2409,
+	kernelDeletePermissionErr = -2410,
+	kernelExecutionLevelErr = -2411,
+	kernelAttributeErr = -2412,
+	kernelAsyncSendLimitErr = -2413,
+	kernelAsyncReceiveLimitErr = -2414,
+	kernelTimeoutErr = -2415,
+	kernelInUseErr = -2416,
+	kernelTerminatedErr = -2417,
+	kernelExceptionErr = -2418,
+	kernelIDErr = -2419,
+	kernelAlreadyFreeErr = -2421,
+	kernelReturnValueErr = -2422,
+	kernelUnrecoverableErr = -2499
+}
+
+enum
+{
+	tsmComponentNoErr = 0,
+	tsmUnsupScriptLanguageErr = -2500,
+	tsmInputMethodNotFoundErr = -2501,
+	tsmNotAnAppErr = -2502,
+	tsmAlreadyRegisteredErr = -2503,
+	tsmNeverRegisteredErr = -2504,
+	tsmInvalidDocIDErr = -2505,
+	tsmTSMDocBusyErr = -2506,
+	tsmDocNotActiveErr = -2507,
+	tsmNoOpenTSErr = -2508,
+	tsmCantOpenComponentErr = -2509,
+	tsmTextServiceNotFoundErr = -2510,
+	tsmDocumentOpenErr = -2511,
+	tsmUseInputWindowErr = -2512,
+	tsmTSHasNoMenuErr = -2513,
+	tsmTSNotOpenErr = -2514,
+	tsmComponentAlreadyOpenErr = -2515,
+	tsmInputMethodIsOldErr = -2516,
+	tsmScriptHasNoIMErr = -2517,
+	tsmUnsupportedTypeErr = -2518,
+	tsmUnknownErr = -2519,
+	tsmInvalidContext = -2520,
+	tsmNoHandler = -2521,
+	tsmNoMoreTokens = -2522,
+	tsmNoStem = -2523,
+	tsmDefaultIsNotInputMethodErr = -2524,
+	tsmDocPropertyNotFoundErr = -2528,
+	tsmDocPropertyBufferTooSmallErr = -2529,
+	tsmCantChangeForcedClassStateErr = -2530,
+	tsmComponentPropertyUnsupportedErr = -2531,
+	tsmComponentPropertyNotFoundErr = -2532,
+	tsmInputModeChangeFailedErr = -2533
+}
+
+enum
+{
+	mmInternalError = -2526
+}
+
+enum
+{
+	nrLockedErr = -2536,
+	nrNotEnoughMemoryErr = -2537,
+	nrInvalidNodeErr = -2538,
+	nrNotFoundErr = -2539,
+	nrNotCreatedErr = -2540,
+	nrNameErr = -2541,
+	nrNotSlotDeviceErr = -2542,
+	nrDataTruncatedErr = -2543,
+	nrPowerErr = -2544,
+	nrPowerSwitchAbortErr = -2545,
+	nrTypeMismatchErr = -2546,
+	nrNotModifiedErr = -2547,
+	nrOverrunErr = -2548,
+	nrResultCodeBase = -2549,
+	nrPathNotFound = -2550,
+	nrPathBufferTooSmall = -2551,
+	nrInvalidEntryIterationOp = -2552,
+	nrPropertyAlreadyExists = -2553,
+	nrIterationDone = -2554,
+	nrExitedIteratorScope = -2555,
+	nrTransactionAborted = -2556,
+	nrCallNotSupported = -2557
+}
+
+enum
+{
+	invalidIconRefErr = -2580,
+	noSuchIconErr = -2581,
+	noIconDataAvailableErr = -2582
+}
+
+enum
+{
+	errOSACantCoerce = errAECoercionFail,
+	errOSACantAccess = errAENoSuchObject,
+	errOSACantAssign = -10006,
+	errOSAGeneralError = -2700,
+	errOSADivideByZero = -2701,
+	errOSANumericOverflow = -2702,
+	errOSACantLaunch = -2703,
+	errOSAAppNotHighLevelEventAware = -2704,
+	errOSACorruptTerminology = -2705,
+	errOSAStackOverflow = -2706,
+	errOSAInternalTableOverflow = -2707,
+	errOSADataBlockTooLarge = -2708,
+	errOSACantGetTerminology = -2709,
+	errOSACantCreate = -2710
+}
+
+enum
+{
+	errOSATypeError = errAEWrongDataType,
+	OSAMessageNotUnderstood = errAEEventNotHandled,
+	OSAUndefinedHandler = errAEHandlerNotFound,
+	OSAIllegalAccess = errAEAccessorNotFound,
+	OSAIllegalIndex = errAEIllegalIndex,
+	OSAIllegalRange = errAEImpossibleRange,
+	OSAIllegalAssign = -10003,
+	OSASyntaxError = -2740,
+	OSASyntaxTypeError = -2741,
+	OSATokenTooLong = -2742,
+	OSAMissingParameter = errAEDescNotFound,
+	OSAParameterMismatch = errAEWrongNumberArgs,
+	OSADuplicateParameter = -2750,
+	OSADuplicateProperty = -2751,
+	OSADuplicateHandler = -2752,
+	OSAUndefinedVariable = -2753,
+	OSAInconsistentDeclarations = -2754,
+	OSAControlFlowError = -2755
+}
+
+enum
+{
+	errASCantConsiderAndIgnore = -2720,
+	errASCantCompareMoreThan32k = -2721,
+	errASTerminologyNestingTooDeep = -2760,
+	errASIllegalFormalParameter = -2761,
+	errASParameterNotForEvent = -2762,
+	errASNoResultReturned = -2763,
+	errASInconsistentNames = -2780
+}
+
+enum
+{
+	cfragFirstErrCode = -2800,
+	cfragContextIDErr = -2800,
+	cfragConnectionIDErr = -2801,
+	cfragNoSymbolErr = -2802,
+	cfragNoSectionErr = -2803,
+	cfragNoLibraryErr = -2804,
+	cfragDupRegistrationErr = -2805,
+	cfragFragmentFormatErr = -2806,
+	cfragUnresolvedErr = -2807,
+	cfragNoPositionErr = -2808,
+	cfragNoPrivateMemErr = -2809,
+	cfragNoClientMemErr = -2810,
+	cfragNoIDsErr = -2811,
+	cfragInitOrderErr = -2812,
+	cfragImportTooOldErr = -2813,
+	cfragImportTooNewErr = -2814,
+	cfragInitLoopErr = -2815,
+	cfragInitAtBootErr = -2816,
+	cfragLibConnErr = -2817,
+	cfragCFMStartupErr = -2818,
+	cfragCFMInternalErr = -2819,
+	cfragFragmentCorruptErr = -2820,
+	cfragInitFunctionErr = -2821,
+	cfragNoApplicationErr = -2822,
+	cfragArchitectureErr = -2823,
+	cfragFragmentUsageErr = -2824,
+	cfragFileSizeErr = -2825,
+	cfragNotClosureErr = -2826,
+	cfragNoRegistrationErr = -2827,
+	cfragContainerIDErr = -2828,
+	cfragClosureIDErr = -2829,
+	cfragAbortClosureErr = -2830,
+	cfragOutputLengthErr = -2831,
+	cfragMapFileErr = -2851,
+	cfragExecFileRefErr = -2854,
+	cfragStdFolderErr = -2855,
+	cfragRsrcForkErr = -2856,
+	cfragCFragRsrcErr = -2857,
+	cfragLastErrCode = -2899
+}
+
+enum
+{
+	cfragFirstReservedCode = -2897,
+	cfragReservedCode_3 = -2897,
+	cfragReservedCode_2 = -2898,
+	cfragReservedCode_1 = -2899
+}
+
+enum
+{
+	invalidComponentID = -3000,
+	validInstancesExist = -3001,
+	componentNotCaptured = -3002,
+	componentDontRegister = -3003,
+	unresolvedComponentDLLErr = -3004,
+	retryComponentRegistrationErr = -3005
+}
+
+enum
+{
+	invalidTranslationPathErr = -3025,
+	couldNotParseSourceFileErr = -3026,
+	noTranslationPathErr = -3030,
+	badTranslationSpecErr = -3031,
+	noPrefAppErr = -3032
+}
+
+enum
+{
+	buf2SmallErr = -3101,
+	noMPPErr = -3102,
+	ckSumErr = -3103,
+	extractErr = -3104,
+	readQErr = -3105,
+	atpLenErr = -3106,
+	atpBadRsp = -3107,
+	recNotFnd = -3108,
+	sktClosedErr = -3109
+}
+
+enum
+{
+	kOTNoError = 0,
+	kOTOutOfMemoryErr = -3211,
+	kOTNotFoundErr = -3201,
+	kOTDuplicateFoundErr = -3216,
+	kOTBadAddressErr = -3150,
+	kOTBadOptionErr = -3151,
+	kOTAccessErr = -3152,
+	kOTBadReferenceErr = -3153,
+	kOTNoAddressErr = -3154,
+	kOTOutStateErr = -3155,
+	kOTBadSequenceErr = -3156,
+	kOTSysErrorErr = -3157,
+	kOTLookErr = -3158,
+	kOTBadDataErr = -3159,
+	kOTBufferOverflowErr = -3160,
+	kOTFlowErr = -3161,
+	kOTNoDataErr = -3162,
+	kOTNoDisconnectErr = -3163,
+	kOTNoUDErrErr = -3164,
+	kOTBadFlagErr = -3165,
+	kOTNoReleaseErr = -3166,
+	kOTNotSupportedErr = -3167,
+	kOTStateChangeErr = -3168,
+	kOTNoStructureTypeErr = -3169,
+	kOTBadNameErr = -3170,
+	kOTBadQLenErr = -3171,
+	kOTAddressBusyErr = -3172,
+	kOTIndOutErr = -3173,
+	kOTProviderMismatchErr = -3174,
+	kOTResQLenErr = -3175,
+	kOTResAddressErr = -3176,
+	kOTQFullErr = -3177,
+	kOTProtocolErr = -3178,
+	kOTBadSyncErr = -3179,
+	kOTCanceledErr = -3180,
+	kEPERMErr = -3200,
+	kENOENTErr = -3201,
+	kENORSRCErr = -3202,
+	kEINTRErr = -3203,
+	kEIOErr = -3204,
+	kENXIOErr = -3205,
+	kEBADFErr = -3208,
+	kEAGAINErr = -3210,
+	kENOMEMErr = -3211,
+	kEACCESErr = -3212,
+	kEFAULTErr = -3213,
+	kEBUSYErr = -3215,
+	kEEXISTErr = -3216,
+	kENODEVErr = -3218,
+	kEINVALErr = -3221,
+	kENOTTYErr = -3224,
+	kEPIPEErr = -3231,
+	kERANGEErr = -3233,
+	kEWOULDBLOCKErr = -3234,
+	kEDEADLKErr = -3234,
+	kEALREADYErr = -3236,
+	kENOTSOCKErr = -3237,
+	kEDESTADDRREQErr = -3238,
+	kEMSGSIZEErr = -3239,
+	kEPROTOTYPEErr = -3240,
+	kENOPROTOOPTErr = -3241,
+	kEPROTONOSUPPORTErr = -3242,
+	kESOCKTNOSUPPORTErr = -3243,
+	kEOPNOTSUPPErr = -3244,
+	kEADDRINUSEErr = -3247,
+	kEADDRNOTAVAILErr = -3248,
+	kENETDOWNErr = -3249,
+	kENETUNREACHErr = -3250,
+	kENETRESETErr = -3251,
+	kECONNABORTEDErr = -3252,
+	kECONNRESETErr = -3253,
+	kENOBUFSErr = -3254,
+	kEISCONNErr = -3255,
+	kENOTCONNErr = -3256,
+	kESHUTDOWNErr = -3257,
+	kETOOMANYREFSErr = -3258,
+	kETIMEDOUTErr = -3259,
+	kECONNREFUSEDErr = -3260,
+	kEHOSTDOWNErr = -3263,
+	kEHOSTUNREACHErr = -3264,
+	kEPROTOErr = -3269,
+	kETIMEErr = -3270,
+	kENOSRErr = -3271,
+	kEBADMSGErr = -3272,
+	kECANCELErr = -3273,
+	kENOSTRErr = -3274,
+	kENODATAErr = -3275,
+	kEINPROGRESSErr = -3276,
+	kESRCHErr = -3277,
+	kENOMSGErr = -3278,
+	kOTClientNotInittedErr = -3279,
+	kOTPortHasDiedErr = -3280,
+	kOTPortWasEjectedErr = -3281,
+	kOTBadConfigurationErr = -3282,
+	kOTConfigurationChangedErr = -3283,
+	kOTUserRequestedErr = -3284,
+	kOTPortLostConnection = -3285
+}
+
+enum
+{
+	kQDNoPalette = -3950,
+	kQDNoColorHWCursorSupport = -3951,
+	kQDCursorAlreadyRegistered = -3952,
+	kQDCursorNotRegistered = -3953,
+	kQDCorruptPICTDataErr = -3954
+}
+
+enum
+{
+	firstPickerError = -4000,
+	invalidPickerType = firstPickerError,
+	requiredFlagsDontMatch = -4001,
+	pickerResourceError = -4002,
+	cantLoadPicker = -4003,
+	cantCreatePickerWindow = -4004,
+	cantLoadPackage = -4005,
+	pickerCantLive = -4006,
+	colorSyncNotInstalled = -4007,
+	badProfileError = -4008,
+	noHelpForItem = -4009
+}
+
+enum
+{
+	kNSL68kContextNotSupported = -4170,
+	kNSLSchedulerError = -4171,
+	kNSLBadURLSyntax = -4172,
+	kNSLNoCarbonLib = -4173,
+	kNSLUILibraryNotAvailable = -4174,
+	kNSLNotImplementedYet = -4175,
+	kNSLErrNullPtrError = -4176,
+	kNSLSomePluginsFailedToLoad = -4177,
+	kNSLNullNeighborhoodPtr = -4178,
+	kNSLNoPluginsForSearch = -4179,
+	kNSLSearchAlreadyInProgress = -4180,
+	kNSLNoPluginsFound = -4181,
+	kNSLPluginLoadFailed = -4182,
+	kNSLBadProtocolTypeErr = -4183,
+	kNSLNullListPtr = -4184,
+	kNSLBadClientInfoPtr = -4185,
+	kNSLCannotContinueLookup = -4186,
+	kNSLBufferTooSmallForData = -4187,
+	kNSLNoContextAvailable = -4188,
+	kNSLRequestBufferAlreadyInList = -4189,
+	kNSLInvalidPluginSpec = -4190,
+	kNSLNoSupportForService = -4191,
+	kNSLBadNetConnection = -4192,
+	kNSLBadDataTypeErr = -4193,
+	kNSLBadServiceTypeErr = -4194,
+	kNSLBadReferenceErr = -4195,
+	kNSLNoElementsInList = -4196,
+	kNSLInsufficientOTVer = -4197,
+	kNSLInsufficientSysVer = -4198,
+	kNSLNotInitialized = -4199,
+	kNSLInitializationFailed = -4200
+}
+
+enum
+{
+	kDTPHoldJobErr = -4200,
+	kDTPStopQueueErr = -4201,
+	kDTPTryAgainErr = -4202,
+	kDTPAbortJobErr = 128
+}
+
+enum
+{
+	cmElementTagNotFound = -4200,
+	cmIndexRangeErr = -4201,
+	cmCantDeleteElement = -4202,
+	cmFatalProfileErr = -4203,
+	cmInvalidProfile = -4204,
+	cmInvalidProfileLocation = -4205,
+	cmCantCopyModifiedV1Profile = -4215,
+	cmInvalidSearch = -4206,
+	cmSearchError = -4207,
+	cmErrIncompatibleProfile = -4208,
+	cmInvalidColorSpace = -4209,
+	cmInvalidSrcMap = -4210,
+	cmInvalidDstMap = -4211,
+	cmNoGDevicesError = -4212,
+	cmInvalidProfileComment = -4213,
+	cmRangeOverFlow = -4214,
+	cmNamedColorNotFound = -4216,
+	cmCantGamutCheckError = -4217
+}
+
+enum
+{
+	badFolderDescErr = -4270,
+	duplicateFolderDescErr = -4271,
+	noMoreFolderDescErr = -4272,
+	invalidFolderTypeErr = -4273,
+	duplicateRoutingErr = -4274,
+	routingNotFoundErr = -4275,
+	badRoutingSizeErr = -4276
+}
+
+enum
+{
+	coreFoundationUnknownErr = -4960
+}
+
+enum
+{
+	errCoreEndianDataTooShortForFormat = -4940,
+	errCoreEndianDataTooLongForFormat = -4941,
+	errCoreEndianDataDoesNotMatchFormat = -4942
+}
+
+enum
+{
+	internalScrapErr = -4988,
+	duplicateScrapFlavorErr = -4989,
+	badScrapRefErr = -4990,
+	processStateIncorrectErr = -4991,
+	scrapPromiseNotKeptErr = -4992,
+	noScrapPromiseKeeperErr = -4993,
+	nilScrapFlavorDataErr = -4994,
+	scrapFlavorFlagsMismatchErr = -4995,
+	scrapFlavorSizeMismatchErr = -4996,
+	illegalScrapFlavorFlagsErr = -4997,
+	illegalScrapFlavorTypeErr = -4998,
+	illegalScrapFlavorSizeErr = -4999,
+	scrapFlavorNotFoundErr = -102,
+	needClearScrapErr = -100
+}
+
+enum
+{
+	afpAccessDenied = -5000,
+	afpAuthContinue = -5001,
+	afpBadUAM = -5002,
+	afpBadVersNum = -5003,
+	afpBitmapErr = -5004,
+	afpCantMove = -5005,
+	afpDenyConflict = -5006,
+	afpDirNotEmpty = -5007,
+	afpDiskFull = -5008,
+	afpEofError = -5009,
+	afpFileBusy = -5010,
+	afpFlatVol = -5011,
+	afpItemNotFound = -5012,
+	afpLockErr = -5013,
+	afpMiscErr = -5014,
+	afpNoMoreLocks = -5015,
+	afpNoServer = -5016,
+	afpObjectExists = -5017,
+	afpObjectNotFound = -5018,
+	afpParmErr = -5019,
+	afpRangeNotLocked = -5020,
+	afpRangeOverlap = -5021,
+	afpSessClosed = -5022,
+	afpUserNotAuth = -5023,
+	afpCallNotSupported = -5024,
+	afpObjectTypeErr = -5025,
+	afpTooManyFilesOpen = -5026,
+	afpServerGoingDown = -5027,
+	afpCantRename = -5028,
+	afpDirNotFound = -5029,
+	afpIconTypeError = -5030,
+	afpVolLocked = -5031,
+	afpObjectLocked = -5032,
+	afpContainsSharedErr = -5033,
+	afpIDNotFound = -5034,
+	afpIDExists = -5035,
+	afpDiffVolErr = -5036,
+	afpCatalogChanged = -5037,
+	afpSameObjectErr = -5038,
+	afpBadIDErr = -5039,
+	afpPwdSameErr = -5040,
+	afpPwdTooShortErr = -5041,
+	afpPwdExpiredErr = -5042,
+	afpInsideSharedErr = -5043,
+	afpInsideTrashErr = -5044,
+	afpPwdNeedsChangeErr = -5045,
+	afpPwdPolicyErr = -5046,
+	afpAlreadyLoggedInErr = -5047,
+	afpCallNotAllowed = -5048
+}
+
+enum
+{
+	afpBadDirIDType = -5060,
+	afpCantMountMoreSrvre = -5061,
+	afpAlreadyMounted = -5062,
+	afpSameNodeErr = -5063
+}
+
+enum
+{
+	numberFormattingNotANumberErr = -5200,
+	numberFormattingOverflowInDestinationErr = -5201,
+	numberFormattingBadNumberFormattingObjectErr = -5202,
+	numberFormattingSpuriousCharErr = -5203,
+	numberFormattingLiteralMissingErr = -5204,
+	numberFormattingDelimiterMissingErr = -5205,
+	numberFormattingEmptyFormatErr = -5206,
+	numberFormattingBadFormatErr = -5207,
+	numberFormattingBadOptionsErr = -5208,
+	numberFormattingBadTokenErr = -5209,
+	numberFormattingUnOrderedCurrencyRangeErr = -5210,
+	numberFormattingBadCurrencyPositionErr = -5211,
+	numberFormattingNotADigitErr = -5212,
+	numberFormattingUnOrdredCurrencyRangeErr = -5210,
+	numberFortmattingNotADigitErr = -5212
+}
+
+enum
+{
+	textParserBadParamErr = -5220,
+	textParserObjectNotFoundErr = -5221,
+	textParserBadTokenValueErr = -5222,
+	textParserBadParserObjectErr = -5223,
+	textParserParamErr = -5224,
+	textParserNoMoreTextErr = -5225,
+	textParserBadTextLanguageErr = -5226,
+	textParserBadTextEncodingErr = -5227,
+	textParserNoSuchTokenFoundErr = -5228,
+	textParserNoMoreTokensErr = -5229
+}
+
+enum
+{
+	errUnknownAttributeTag = -5240,
+	errMarginWilllNotFit = -5241,
+	errNotInImagingMode = -5242,
+	errAlreadyInImagingMode = -5243,
+	errEngineNotFound = -5244,
+	errIteratorReachedEnd = -5245,
+	errInvalidRange = -5246,
+	errOffsetNotOnElementBounday = -5247,
+	errNoHiliteText = -5248,
+	errEmptyScrap = -5249,
+	errReadOnlyText = -5250,
+	errUnknownElement = -5251,
+	errNonContiuousAttribute = -5252,
+	errCannotUndo = -5253
+}
+
+enum
+{
+	hrHTMLRenderingLibNotInstalledErr = -5360,
+	hrMiscellaneousExceptionErr = -5361,
+	hrUnableToResizeHandleErr = -5362,
+	hrURLNotHandledErr = -5363
+}
+
+enum
+{
+	errIANoErr = 0,
+	errIAUnknownErr = -5380,
+	errIAAllocationErr = -5381,
+	errIAParamErr = -5382,
+	errIANoMoreItems = -5383,
+	errIABufferTooSmall = -5384,
+	errIACanceled = -5385,
+	errIAInvalidDocument = -5386,
+	errIATextExtractionErr = -5387,
+	errIAEndOfTextRun = -5388
+}
+
+enum
+{
+	qtsBadSelectorErr = -5400,
+	qtsBadStateErr = -5401,
+	qtsBadDataErr = -5402,
+	qtsUnsupportedDataTypeErr = -5403,
+	qtsUnsupportedRateErr = -5404,
+	qtsUnsupportedFeatureErr = -5405,
+	qtsTooMuchDataErr = -5406,
+	qtsUnknownValueErr = -5407,
+	qtsTimeoutErr = -5408,
+	qtsConnectionFailedErr = -5420,
+	qtsAddressBusyErr = -5421
+}
+
+enum
+{
+	gestaltUnknownErr = -5550,
+	gestaltUndefSelectorErr = -5551,
+	gestaltDupSelectorErr = -5552,
+	gestaltLocationErr = -5553
+}
+
+enum
+{
+	menuPropertyInvalidErr = -5603,
+	menuPropertyInvalid = menuPropertyInvalidErr,
+	menuPropertyNotFoundErr = -5604,
+	menuNotFoundErr = -5620,
+	menuUsesSystemDefErr = -5621,
+	menuItemNotFoundErr = -5622,
+	menuInvalidErr = -5623
+}
+
+enum
+{
+	errInvalidWindowPtr = -5600,
+	errInvalidWindowRef = -5600,
+	errUnsupportedWindowAttributesForClass = -5601,
+	errWindowDoesNotHaveProxy = -5602,
+	errInvalidWindowProperty = -5603,
+	errWindowPropertyNotFound = -5604,
+	errUnrecognizedWindowClass = -5605,
+	errCorruptWindowDescription = -5606,
+	errUserWantsToDragWindow = -5607,
+	errWindowsAlreadyInitialized = -5608,
+	errFloatingWindowsNotInitialized = -5609,
+	errWindowNotFound = -5610,
+	errWindowDoesNotFitOnscreen = -5611,
+	windowAttributeImmutableErr = -5612,
+	windowAttributesConflictErr = -5613,
+	windowManagerInternalErr = -5614,
+	windowWrongStateErr = -5615,
+	windowGroupInvalidErr = -5616,
+	windowAppModalStateAlreadyExistsErr = -5617,
+	windowNoAppModalStateErr = -5618,
+	errWindowDoesntSupportFocus = -30583,
+	errWindowRegionCodeInvalid = -30593
+}
+
+enum
+{
+	dialogNoTimeoutErr = -5640
+}
+
+enum
+{
+	kNavWrongDialogStateErr = -5694,
+	kNavWrongDialogClassErr = -5695,
+	kNavInvalidSystemConfigErr = -5696,
+	kNavCustomControlMessageFailedErr = -5697,
+	kNavInvalidCustomControlMessageErr = -5698,
+	kNavMissingKindStringErr = -5699
+}
+
+enum
+{
+	collectionItemLockedErr = -5750,
+	collectionItemNotFoundErr = -5751,
+	collectionIndexRangeErr = -5752,
+	collectionVersionErr = -5753
+}
+
+enum
+{
+	kQTSSUnknownErr = -6150
+}
+
+enum
+{
+	kDMGenErr = -6220,
+	kDMMirroringOnAlready = -6221,
+	kDMWrongNumberOfDisplays = -6222,
+	kDMMirroringBlocked = -6223,
+	kDMCantBlock = -6224,
+	kDMMirroringNotOn = -6225,
+	kSysSWTooOld = -6226,
+	kDMSWNotInitializedErr = -6227,
+	kDMDriverNotDisplayMgrAwareErr = -6228,
+	kDMDisplayNotFoundErr = -6229,
+	kDMNotFoundErr = -6229,
+	kDMDisplayAlreadyInstalledErr = -6230,
+	kDMMainDisplayCannotMoveErr = -6231,
+	kDMNoDeviceTableclothErr = -6231,
+	kDMFoundErr = -6232
+}
+
+enum
+{
+	laTooSmallBufferErr = -6984,
+	laEnvironmentBusyErr = -6985,
+	laEnvironmentNotFoundErr = -6986,
+	laEnvironmentExistErr = -6987,
+	laInvalidPathErr = -6988,
+	laNoMoreMorphemeErr = -6989,
+	laFailAnalysisErr = -6990,
+	laTextOverFlowErr = -6991,
+	laDictionaryNotOpenedErr = -6992,
+	laDictionaryUnknownErr = -6993,
+	laDictionaryTooManyErr = -6994,
+	laPropertyValueErr = -6995,
+	laPropertyUnknownErr = -6996,
+	laPropertyIsReadOnlyErr = -6997,
+	laPropertyNotFoundErr = -6998,
+	laPropertyErr = -6999,
+	laEngineNotFoundErr = -7000
+}
+
+enum
+{
+	kUSBNoErr = 0,
+	kUSBNoTran = 0,
+	kUSBNoDelay = 0,
+	kUSBPending = 1
+}
+
+enum
+{
+	kUSBNotSent2Err = -6901,
+	kUSBNotSent1Err = -6902,
+	kUSBBufUnderRunErr = -6903,
+	kUSBBufOvrRunErr = -6904,
+	kUSBRes2Err = -6905,
+	kUSBRes1Err = -6906,
+	kUSBUnderRunErr = -6907,
+	kUSBOverRunErr = -6908,
+	kUSBWrongPIDErr = -6909,
+	kUSBPIDCheckErr = -6910,
+	kUSBNotRespondingErr = -6911,
+	kUSBEndpointStallErr = -6912,
+	kUSBDataToggleErr = -6913,
+	kUSBBitstufErr = -6914,
+	kUSBCRCErr = -6915,
+	kUSBLinkErr = -6916
+}
+
+enum
+{
+	kUSBQueueFull = -6948,
+	kUSBNotHandled = -6987,
+	kUSBUnknownNotification = -6949,
+	kUSBBadDispatchTable = -6950
+}
+
+enum
+{
+	kUSBInternalReserved10 = -6951,
+	kUSBInternalReserved9 = -6952,
+	kUSBInternalReserved8 = -6953,
+	kUSBInternalReserved7 = -6954,
+	kUSBInternalReserved6 = -6955,
+	kUSBInternalReserved5 = -6956,
+	kUSBInternalReserved4 = -6957,
+	kUSBInternalReserved3 = -6958,
+	kUSBInternalReserved2 = -6959,
+	kUSBInternalReserved1 = -6960
+}
+
+enum
+{
+	kUSBPortDisabled = -6969,
+	kUSBQueueAborted = -6970,
+	kUSBTimedOut = -6971,
+	kUSBDeviceDisconnected = -6972,
+	kUSBDeviceNotSuspended = -6973,
+	kUSBDeviceSuspended = -6974,
+	kUSBInvalidBuffer = -6975,
+	kUSBDevicePowerProblem = -6976,
+	kUSBDeviceBusy = -6977,
+	kUSBUnknownInterfaceErr = -6978,
+	kUSBPipeStalledError = -6979,
+	kUSBPipeIdleError = -6980,
+	kUSBNoBandwidthError = -6981,
+	kUSBAbortedError = -6982,
+	kUSBFlagsError = -6983,
+	kUSBCompletionError = -6984,
+	kUSBPBLengthError = -6985,
+	kUSBPBVersionError = -6986,
+	kUSBNotFound = -6987,
+	kUSBOutOfMemoryErr = -6988,
+	kUSBDeviceErr = -6989,
+	kUSBNoDeviceErr = -6990,
+	kUSBAlreadyOpenErr = -6991,
+	kUSBTooManyTransactionsErr = -6992,
+	kUSBUnknownRequestErr = -6993,
+	kUSBRqErr = -6994,
+	kUSBIncorrectTypeErr = -6995,
+	kUSBTooManyPipesErr = -6996,
+	kUSBUnknownPipeErr = -6997,
+	kUSBUnknownDeviceErr = -6998,
+	kUSBInternalErr = -6999
+}
+
+enum
+{
+	dcmParamErr = -7100,
+	dcmNotDictionaryErr = -7101,
+	dcmBadDictionaryErr = -7102,
+	dcmPermissionErr = -7103,
+	dcmDictionaryNotOpenErr = -7104,
+	dcmDictionaryBusyErr = -7105,
+	dcmBlockFullErr = -7107,
+	dcmNoRecordErr = -7108,
+	dcmDupRecordErr = -7109,
+	dcmNecessaryFieldErr = -7110,
+	dcmBadFieldInfoErr = -7111,
+	dcmBadFieldTypeErr = -7112,
+	dcmNoFieldErr = -7113,
+	dcmBadKeyErr = -7115,
+	dcmTooManyKeyErr = -7116,
+	dcmBadDataSizeErr = -7117,
+	dcmBadFindMethodErr = -7118,
+	dcmBadPropertyErr = -7119,
+	dcmProtectedErr = -7121,
+	dcmNoAccessMethodErr = -7122,
+	dcmBadFeatureErr = -7124,
+	dcmIterationCompleteErr = -7126,
+	dcmBufferOverflowErr = -7127
+}
+
+enum
+{
+	kRAInvalidParameter = -7100,
+	kRAInvalidPort = -7101,
+	kRAStartupFailed = -7102,
+	kRAPortSetupFailed = -7103,
+	kRAOutOfMemory = -7104,
+	kRANotSupported = -7105,
+	kRAMissingResources = -7106,
+	kRAIncompatiblePrefs = -7107,
+	kRANotConnected = -7108,
+	kRAConnectionCanceled = -7109,
+	kRAUnknownUser = -7110,
+	kRAInvalidPassword = -7111,
+	kRAInternalError = -7112,
+	kRAInstallationDamaged = -7113,
+	kRAPortBusy = -7114,
+	kRAUnknownPortState = -7115,
+	kRAInvalidPortState = -7116,
+	kRAInvalidSerialProtocol = -7117,
+	kRAUserLoginDisabled = -7118,
+	kRAUserPwdChangeRequired = -7119,
+	kRAUserPwdEntryRequired = -7120,
+	kRAUserInteractionRequired = -7121,
+	kRAInitOpenTransportFailed = -7122,
+	kRARemoteAccessNotReady = -7123,
+	kRATCPIPInactive = -7124,
+	kRATCPIPNotConfigured = -7125,
+	kRANotPrimaryInterface = -7126,
+	kRAConfigurationDBInitErr = -7127,
+	kRAPPPProtocolRejected = -7128,
+	kRAPPPAuthenticationFailed = -7129,
+	kRAPPPNegotiationFailed = -7130,
+	kRAPPPUserDisconnected = -7131,
+	kRAPPPPeerDisconnected = -7132,
+	kRAPeerNotResponding = -7133,
+	kRAATalkInactive = -7134,
+	kRAExtAuthenticationFailed = -7135,
+	kRANCPRejectedbyPeer = -7136,
+	kRADuplicateIPAddr = -7137,
+	kRACallBackFailed = -7138,
+	kRANotEnabled = -7139
+}
+
+enum
+{
+	kATSUInvalidTextLayoutErr = -8790,
+	kATSUInvalidStyleErr = -8791,
+	kATSUInvalidTextRangeErr = -8792,
+	kATSUFontsMatched = -8793,
+	kATSUFontsNotMatched = -8794,
+	kATSUNoCorrespondingFontErr = -8795,
+	kATSUInvalidFontErr = -8796,
+	kATSUInvalidAttributeValueErr = -8797,
+	kATSUInvalidAttributeSizeErr = -8798,
+	kATSUInvalidAttributeTagErr = -8799,
+	kATSUInvalidCacheErr = -8800,
+	kATSUNotSetErr = -8801,
+	kATSUNoStyleRunsAssignedErr = -8802,
+	kATSUQuickDrawTextErr = -8803,
+	kATSULowLevelErr = -8804,
+	kATSUNoFontCmapAvailableErr = -8805,
+	kATSUNoFontScalerAvailableErr = -8806,
+	kATSUCoordinateOverflowErr = -8807,
+	kATSULineBreakInWord = -8808,
+	kATSUBusyObjectErr = -8809
+}
+
+enum
+{
+	kTextUnsupportedEncodingErr = -8738,
+	kTextMalformedInputErr = -8739,
+	kTextUndefinedElementErr = -8740,
+	kTECMissingTableErr = -8745,
+	kTECTableChecksumErr = -8746,
+	kTECTableFormatErr = -8747,
+	kTECCorruptConverterErr = -8748,
+	kTECNoConversionPathErr = -8749,
+	kTECBufferBelowMinimumSizeErr = -8750,
+	kTECArrayFullErr = -8751,
+	kTECBadTextRunErr = -8752,
+	kTECPartialCharErr = -8753,
+	kTECUnmappableElementErr = -8754,
+	kTECIncompleteElementErr = -8755,
+	kTECDirectionErr = -8756,
+	kTECGlobalsUnavailableErr = -8770,
+	kTECItemUnavailableErr = -8771,
+	kTECUsedFallbacksStatus = -8783,
+	kTECNeedFlushStatus = -8784,
+	kTECOutputBufferFullStatus = -8785,
+	unicodeChecksumErr = -8769,
+	unicodeNoTableErr = -8768,
+	unicodeVariantErr = -8767,
+	unicodeFallbacksErr = -8766,
+	unicodePartConvertErr = -8765,
+	unicodeBufErr = -8764,
+	unicodeCharErr = -8763,
+	unicodeElementErr = -8762,
+	unicodeNotFoundErr = -8761,
+	unicodeTableFormatErr = -8760,
+	unicodeDirectionErr = -8759,
+	unicodeContextualErr = -8758,
+	unicodeTextEncodingDataErr = -8757
+}
+
+enum
+{
+	kUTCUnderflowErr = -8850,
+	kUTCOverflowErr = -8851,
+	kIllegalClockValueErr = -8852
+}
+
+enum
+{
+	kATSUInvalidFontFallbacksErr = -8900,
+	kATSUUnsupportedStreamFormatErr = -8901,
+	kATSUBadStreamErr = -8902,
+	kATSUOutputBufferTooSmallErr = -8903,
+	kATSUInvalidCallInsideCallbackErr = -8904,
+	kATSUNoFontNameErr = -8905,
+	kATSULastErr = -8959
+}
+
+enum
+{
+	codecErr = -8960,
+	noCodecErr = -8961,
+	codecUnimpErr = -8962,
+	codecSizeErr = -8963,
+	codecScreenBufErr = -8964,
+	codecImageBufErr = -8965,
+	codecSpoolErr = -8966,
+	codecAbortErr = -8967,
+	codecWouldOffscreenErr = -8968,
+	codecBadDataErr = -8969,
+	codecDataVersErr = -8970,
+	codecExtensionNotFoundErr = -8971,
+	scTypeNotFoundErr = codecExtensionNotFoundErr,
+	codecConditionErr = -8972,
+	codecOpenErr = -8973,
+	codecCantWhenErr = -8974,
+	codecCantQueueErr = -8975,
+	codecNothingToBlitErr = -8976,
+	codecNoMemoryPleaseWaitErr = -8977,
+	codecDisabledErr = -8978,
+	codecNeedToFlushChainErr = -8979,
+	lockPortBitsBadSurfaceErr = -8980,
+	lockPortBitsWindowMovedErr = -8981,
+	lockPortBitsWindowResizedErr = -8982,
+	lockPortBitsWindowClippedErr = -8983,
+	lockPortBitsBadPortErr = -8984,
+	lockPortBitsSurfaceLostErr = -8985,
+	codecParameterDialogConfirm = -8986,
+	codecNeedAccessKeyErr = -8987,
+	codecOffscreenFailedErr = -8988,
+	codecDroppedFrameErr = -8989,
+	directXObjectAlreadyExists = -8990,
+	lockPortBitsWrongGDeviceErr = -8991,
+	codecOffscreenFailedPleaseRetryErr = -8992,
+	badCodecCharacterizationErr = -8993,
+	noThumbnailFoundErr = -8994
+}
+
+enum
+{
+	kBadAdapterErr = -9050,
+	kBadAttributeErr = -9051,
+	kBadBaseErr = -9052,
+	kBadEDCErr = -9053,
+	kBadIRQErr = -9054,
+	kBadOffsetErr = -9055,
+	kBadPageErr = -9056,
+	kBadSizeErr = -9057,
+	kBadSocketErr = -9058,
+	kBadTypeErr = -9059,
+	kBadVccErr = -9060,
+	kBadVppErr = -9061,
+	kBadWindowErr = -9062,
+	kBadArgLengthErr = -9063,
+	kBadArgsErr = -9064,
+	kBadHandleErr = -9065,
+	kBadCISErr = -9066,
+	kBadSpeedErr = -9067,
+	kReadFailureErr = -9068,
+	kWriteFailureErr = -9069,
+	kGeneralFailureErr = -9070,
+	kNoCardErr = -9071,
+	kUnsupportedFunctionErr = -9072,
+	kUnsupportedModeErr = -9073,
+	kBusyErr = -9074,
+	kWriteProtectedErr = -9075,
+	kConfigurationLockedErr = -9076,
+	kInUseErr = -9077,
+	kNoMoreItemsErr = -9078,
+	kOutOfResourceErr = -9079,
+	kNoCardSevicesSocketsErr = -9080,
+	kInvalidRegEntryErr = -9081,
+	kBadLinkErr = -9082,
+	kBadDeviceErr = -9083,
+	k16BitCardErr = -9084,
+	kCardBusCardErr = -9085,
+	kPassCallToChainErr = -9086,
+	kCantConfigureCardErr = -9087,
+	kPostCardEventErr = -9088,
+	kInvalidDeviceNumber = -9089,
+	kUnsupportedVsErr = -9090,
+	kInvalidCSClientErr = -9091,
+	kBadTupleDataErr = -9092,
+	kBadCustomIFIDErr = -9093,
+	kNoIOWindowRequestedErr = -9094,
+	kNoMoreTimerClientsErr = -9095,
+	kNoMoreInterruptSlotsErr = -9096,
+	kNoClientTableErr = -9097,
+	kUnsupportedCardErr = -9098,
+	kNoCardEnablersFoundErr = -9099,
+	kNoEnablerForCardErr = -9100,
+	kNoCompatibleNameErr = -9101,
+	kClientRequestDenied = -9102,
+	kNotReadyErr = -9103,
+	kTooManyIOWindowsErr = -9104,
+	kAlreadySavedStateErr = -9105,
+	kAttemptDupCardEntryErr = -9106,
+	kCardPowerOffErr = -9107,
+	kNotZVCapableErr = -9108,
+	kNoCardBusCISErr = -9109
+}
+
+enum
+{
+	noDeviceForChannel = -9400,
+	grabTimeComplete = -9401,
+	cantDoThatInCurrentMode = -9402,
+	notEnoughMemoryToGrab = -9403,
+	notEnoughDiskSpaceToGrab = -9404,
+	couldntGetRequiredComponent = -9405,
+	badSGChannel = -9406,
+	seqGrabInfoNotAvailable = -9407,
+	deviceCantMeetRequest = -9408,
+	badControllerHeight = -9994,
+	editingNotAllowed = -9995,
+	controllerBoundsNotExact = -9996,
+	cannotSetWidthOfAttachedController = -9997,
+	controllerHasFixedHeight = -9998,
+	cannotMoveAttachedController = -9999
+}
+
+enum
+{
+	errAEBadKeyForm = -10002,
+	errAECantHandleClass = -10010,
+	errAECantSupplyType = -10009,
+	errAECantUndo = -10015,
+	errAEEventFailed = -10000,
+	errAEIndexTooLarge = -10007,
+	errAEInTransaction = -10011,
+	errAELocalOnly = -10016,
+	errAENoSuchTransaction = -10012,
+	errAENotAnElement = -10008,
+	errAENotASingleObject = -10014,
+	errAENotModifiable = -10003,
+	errAENoUserSelection = -10013,
+	errAEPrivilegeError = -10004,
+	errAEReadDenied = -10005,
+	errAETypeError = -10001,
+	errAEWriteDenied = -10006,
+	errAENotAnEnumMember = -10023,
+	errAECantPutThatThere = -10024,
+	errAEPropertiesClash = -10025
+}
+
+enum
+{
+	telGenericError = -1,
+	telNoErr = 0,
+	telNoTools = 8,
+	telBadTermErr = -10001,
+	telBadDNErr = -10002,
+	telBadCAErr = -10003,
+	telBadHandErr = -10004,
+	telBadProcErr = -10005,
+	telCAUnavail = -10006,
+	telNoMemErr = -10007,
+	telNoOpenErr = -10008,
+	telBadHTypeErr = -10010,
+	telHTypeNotSupp = -10011,
+	telBadLevelErr = -10012,
+	telBadVTypeErr = -10013,
+	telVTypeNotSupp = -10014,
+	telBadAPattErr = -10015,
+	telAPattNotSupp = -10016,
+	telBadIndex = -10017,
+	telIndexNotSupp = -10018,
+	telBadStateErr = -10019,
+	telStateNotSupp = -10020,
+	telBadIntExt = -10021,
+	telIntExtNotSupp = -10022,
+	telBadDNDType = -10023,
+	telDNDTypeNotSupp = -10024,
+	telFeatNotSub = -10030,
+	telFeatNotAvail = -10031,
+	telFeatActive = -10032,
+	telFeatNotSupp = -10033,
+	telConfLimitErr = -10040,
+	telConfNoLimit = -10041,
+	telConfErr = -10042,
+	telConfRej = -10043,
+	telTransferErr = -10044,
+	telTransferRej = -10045,
+	telCBErr = -10046,
+	telConfLimitExceeded = -10047,
+	telBadDNType = -10050,
+	telBadPageID = -10051,
+	telBadIntercomID = -10052,
+	telBadFeatureID = -10053,
+	telBadFwdType = -10054,
+	telBadPickupGroupID = -10055,
+	telBadParkID = -10056,
+	telBadSelect = -10057,
+	telBadBearerType = -10058,
+	telBadRate = -10059,
+	telDNTypeNotSupp = -10060,
+	telFwdTypeNotSupp = -10061,
+	telBadDisplayMode = -10062,
+	telDisplayModeNotSupp = -10063,
+	telNoCallbackRef = -10064,
+	telAlreadyOpen = -10070,
+	telStillNeeded = -10071,
+	telTermNotOpen = -10072,
+	telCANotAcceptable = -10080,
+	telCANotRejectable = -10081,
+	telCANotDeflectable = -10082,
+	telPBErr = -10090,
+	telBadFunction = -10091,
+	telNoSuchTool = -10102,
+	telUnknownErr = -10103,
+	telNoCommFolder = -10106,
+	telInitFailed = -10107,
+	telBadCodeResource = -10108,
+	telDeviceNotFound = -10109,
+	telBadProcID = -10110,
+	telValidateFailed = -10111,
+	telAutoAnsNotOn = -10112,
+	telDetAlreadyOn = -10113,
+	telBadSWErr = -10114,
+	telBadSampleRate = -10115,
+	telNotEnoughdspBW = -10116
+}
+
+enum
+{
+	errTaskNotFound = -10780
+}
+
+enum
+{
+	pmBusyErr = -13000,
+	pmReplyTOErr = -13001,
+	pmSendStartErr = -13002,
+	pmSendEndErr = -13003,
+	pmRecvStartErr = -13004,
+	pmRecvEndErr = -13005
+}
+
+enum
+{
+	kPowerHandlerExistsForDeviceErr = -13006,
+	kPowerHandlerNotFoundForDeviceErr = -13007,
+	kPowerHandlerNotFoundForProcErr = -13008,
+	kPowerMgtMessageNotHandled = -13009,
+	kPowerMgtRequestDenied = -13010,
+	kCantReportProcessorTemperatureErr = -13013,
+	kProcessorTempRoutineRequiresMPLib2 = -13014,
+	kNoSuchPowerSource = -13020,
+	kBridgeSoftwareRunningCantSleep = -13038
+}
+
+enum
+{
+	debuggingExecutionContextErr = -13880,
+	debuggingDuplicateSignatureErr = -13881,
+	debuggingDuplicateOptionErr = -13882,
+	debuggingInvalidSignatureErr = -13883,
+	debuggingInvalidOptionErr = -13884,
+	debuggingInvalidNameErr = -13885,
+	debuggingNoCallbackErr = -13886,
+	debuggingNoMatchErr = -13887
+}
+
+enum
+{
+	kHIDVersionIncompatibleErr = -13909,
+	kHIDDeviceNotReady = -13910
+}
+
+enum
+{
+	kHIDSuccess = 0,
+	kHIDInvalidRangePageErr = -13923,
+	kHIDReportIDZeroErr = -13924,
+	kHIDReportCountZeroErr = -13925,
+	kHIDReportSizeZeroErr = -13926,
+	kHIDUnmatchedDesignatorRangeErr = -13927,
+	kHIDUnmatchedStringRangeErr = -13928,
+	kHIDInvertedUsageRangeErr = -13929,
+	kHIDUnmatchedUsageRangeErr = -13930,
+	kHIDInvertedPhysicalRangeErr = -13931,
+	kHIDInvertedLogicalRangeErr = -13932,
+	kHIDBadLogicalMaximumErr = -13933,
+	kHIDBadLogicalMinimumErr = -13934,
+	kHIDUsagePageZeroErr = -13935,
+	kHIDEndOfDescriptorErr = -13936,
+	kHIDNotEnoughMemoryErr = -13937,
+	kHIDBadParameterErr = -13938,
+	kHIDNullPointerErr = -13939,
+	kHIDInvalidReportLengthErr = -13940,
+	kHIDInvalidReportTypeErr = -13941,
+	kHIDBadLogPhysValuesErr = -13942,
+	kHIDIncompatibleReportErr = -13943,
+	kHIDInvalidPreparsedDataErr = -13944,
+	kHIDNotValueArrayErr = -13945,
+	kHIDUsageNotFoundErr = -13946,
+	kHIDValueOutOfRangeErr = -13947,
+	kHIDBufferTooSmallErr = -13948,
+	kHIDNullStateErr = -13949,
+	kHIDBaseError = -13950
+}
+
+enum
+{
+	kModemOutOfMemory = -14000,
+	kModemPreferencesMissing = -14001,
+	kModemScriptMissing = -14002
+}
+
+enum
+{
+	kTXNEndIterationErr = -22000,
+	kTXNCannotAddFrameErr = -22001,
+	kTXNInvalidFrameIDErr = -22002,
+	kTXNIllegalToCrossDataBoundariesErr = -22003,
+	kTXNUserCanceledOperationErr = -22004,
+	kTXNBadDefaultFileTypeWarning = -22005,
+	kTXNCannotSetAutoIndentErr = -22006,
+	kTXNRunIndexOutofBoundsErr = -22007,
+	kTXNNoMatchErr = -22008,
+	kTXNAttributeTagInvalidForRunErr = -22009,
+	kTXNSomeOrAllTagsInvalidForRunErr = -22010,
+	kTXNInvalidRunIndex = -22011,
+	kTXNAlreadyInitializedErr = -22012,
+	kTXNCannotTurnTSMOffWhenUsingUnicodeErr = -22013,
+	kTXNCopyNotAllowedInEchoModeErr = -22014,
+	kTXNDataTypeNotAllowedErr = -22015,
+	kTXNATSUIIsNotInstalledErr = -22016,
+	kTXNOutsideOfLineErr = -22017,
+	kTXNOutsideOfFrameErr = -22018
+}
+
+enum
+{
+	printerStatusOpCodeNotSupportedErr = -25280
+}
+
+enum
+{
+	errKCNotAvailable = -25291,
+	errKCReadOnly = -25292,
+	errKCAuthFailed = -25293,
+	errKCNoSuchKeychain = -25294,
+	errKCInvalidKeychain = -25295,
+	errKCDuplicateKeychain = -25296,
+	errKCDuplicateCallback = -25297,
+	errKCInvalidCallback = -25298,
+	errKCDuplicateItem = -25299,
+	errKCItemNotFound = -25300,
+	errKCBufferTooSmall = -25301,
+	errKCDataTooLarge = -25302,
+	errKCNoSuchAttr = -25303,
+	errKCInvalidItemRef = -25304,
+	errKCInvalidSearchRef = -25305,
+	errKCNoSuchClass = -25306,
+	errKCNoDefaultKeychain = -25307,
+	errKCInteractionNotAllowed = -25308,
+	errKCReadOnlyAttr = -25309,
+	errKCWrongKCVersion = -25310,
+	errKCKeySizeNotAllowed = -25311,
+	errKCNoStorageModule = -25312,
+	errKCNoCertificateModule = -25313,
+	errKCNoPolicyModule = -25314,
+	errKCInteractionRequired = -25315,
+	errKCDataNotAvailable = -25316,
+	errKCDataNotModifiable = -25317,
+	errKCCreateChainFailed = -25318
+}
+
+enum
+{
+	kUCOutputBufferTooSmall = -25340,
+	kUCTextBreakLocatorMissingType = -25341
+}
+
+enum
+{
+	kUCTSNoKeysAddedToObjectErr = -25342,
+	kUCTSSearchListErr = -25343
+}
+
+enum
+{
+	kUCTokenizerIterationFinished = -25344,
+	kUCTokenizerUnknownLang = -25345,
+	kUCTokenNotFound = -25346
+}
+
+enum
+{
+	kMPIterationEndErr = -29275,
+	kMPPrivilegedErr = -29276,
+	kMPProcessCreatedErr = -29288,
+	kMPProcessTerminatedErr = -29289,
+	kMPTaskCreatedErr = -29290,
+	kMPTaskBlockedErr = -29291,
+	kMPTaskStoppedErr = -29292,
+	kMPBlueBlockingErr = -29293,
+	kMPDeletedErr = -29295,
+	kMPTimeoutErr = -29296,
+	kMPTaskAbortedErr = -29297,
+	kMPInsufficientResourcesErr = -29298,
+	kMPInvalidIDErr = -29299
+}
+
+enum
+{
+	kMPNanokernelNeedsMemoryErr = -29294
+}
+
+enum
+{
+	kCollateAttributesNotFoundErr = -29500,
+	kCollateInvalidOptions = -29501,
+	kCollateMissingUnicodeTableErr = -29502,
+	kCollateUnicodeConvertFailedErr = -29503,
+	kCollatePatternNotFoundErr = -29504,
+	kCollateInvalidChar = -29505,
+	kCollateBufferTooSmall = -29506,
+	kCollateInvalidCollationRef = -29507
+}
+
+enum
+{
+	kFNSInvalidReferenceErr = -29580,
+	kFNSBadReferenceVersionErr = -29581,
+	kFNSInvalidProfileErr = -29582,
+	kFNSBadProfileVersionErr = -29583,
+	kFNSDuplicateReferenceErr = -29584,
+	kFNSMismatchErr = -29585,
+	kFNSInsufficientDataErr = -29586,
+	kFNSBadFlattenedSizeErr = -29587,
+	kFNSNameNotFoundErr = -29589
+}
+
+enum
+{
+	kLocalesBufferTooSmallErr = -30001,
+	kLocalesTableFormatErr = -30002,
+	kLocalesDefaultDisplayStatus = -30029
+}
+
+enum
+{
+	kALMInternalErr = -30049,
+	kALMGroupNotFoundErr = -30048,
+	kALMNoSuchModuleErr = -30047,
+	kALMModuleCommunicationErr = -30046,
+	kALMDuplicateModuleErr = -30045,
+	kALMInstallationErr = -30044,
+	kALMDeferSwitchErr = -30043,
+	kALMRebootFlagsLevelErr = -30042
+}
+
+enum
+{
+	kALMLocationNotFoundErr = kALMGroupNotFoundErr
+}
+
+enum
+{
+	kSSpInternalErr = -30340,
+	kSSpVersionErr = -30341,
+	kSSpCantInstallErr = -30342,
+	kSSpParallelUpVectorErr = -30343,
+	kSSpScaleToZeroErr = -30344
+}
+
+enum
+{
+	kNSpInitializationFailedErr = -30360,
+	kNSpAlreadyInitializedErr = -30361,
+	kNSpTopologyNotSupportedErr = -30362,
+	kNSpPipeFullErr = -30364,
+	kNSpHostFailedErr = -30365,
+	kNSpProtocolNotAvailableErr = -30366,
+	kNSpInvalidGameRefErr = -30367,
+	kNSpInvalidParameterErr = -30369,
+	kNSpOTNotPresentErr = -30370,
+	kNSpOTVersionTooOldErr = -30371,
+	kNSpMemAllocationErr = -30373,
+	kNSpAlreadyAdvertisingErr = -30374,
+	kNSpNotAdvertisingErr = -30376,
+	kNSpInvalidAddressErr = -30377,
+	kNSpFreeQExhaustedErr = -30378,
+	kNSpRemovePlayerFailedErr = -30379,
+	kNSpAddressInUseErr = -30380,
+	kNSpFeatureNotImplementedErr = -30381,
+	kNSpNameRequiredErr = -30382,
+	kNSpInvalidPlayerIDErr = -30383,
+	kNSpInvalidGroupIDErr = -30384,
+	kNSpNoPlayersErr = -30385,
+	kNSpNoGroupsErr = -30386,
+	kNSpNoHostVolunteersErr = -30387,
+	kNSpCreateGroupFailedErr = -30388,
+	kNSpAddPlayerFailedErr = -30389,
+	kNSpInvalidDefinitionErr = -30390,
+	kNSpInvalidProtocolRefErr = -30391,
+	kNSpInvalidProtocolListErr = -30392,
+	kNSpTimeoutErr = -30393,
+	kNSpGameTerminatedErr = -30394,
+	kNSpConnectFailedErr = -30395,
+	kNSpSendFailedErr = -30396,
+	kNSpMessageTooBigErr = -30397,
+	kNSpCantBlockErr = -30398,
+	kNSpJoinFailedErr = -30399
+}
+
+enum
+{
+	kISpInternalErr = -30420,
+	kISpSystemListErr = -30421,
+	kISpBufferToSmallErr = -30422,
+	kISpElementInListErr = -30423,
+	kISpElementNotInListErr = -30424,
+	kISpSystemInactiveErr = -30425,
+	kISpDeviceInactiveErr = -30426,
+	kISpSystemActiveErr = -30427,
+	kISpDeviceActiveErr = -30428,
+	kISpListBusyErr = -30429
+}
+
+enum
+{
+	kDSpNotInitializedErr = -30440L,
+	kDSpSystemSWTooOldErr = -30441L,
+	kDSpInvalidContextErr = -30442L,
+	kDSpInvalidAttributesErr = -30443L,
+	kDSpContextAlreadyReservedErr = -30444L,
+	kDSpContextNotReservedErr = -30445L,
+	kDSpContextNotFoundErr = -30446L,
+	kDSpFrameRateNotReadyErr = -30447L,
+	kDSpConfirmSwitchWarning = -30448L,
+	kDSpInternalErr = -30449L,
+	kDSpStereoContextErr = -30450L
+}
+
+enum
+{
+	kFBCvTwinExceptionErr = -30500,
+	kFBCnoIndexesFound = -30501,
+	kFBCallocFailed = -30502,
+	kFBCbadParam = -30503,
+	kFBCfileNotIndexed = -30504,
+	kFBCbadIndexFile = -30505,
+	kFBCcompactionFailed = -30506,
+	kFBCvalidationFailed = -30507,
+	kFBCindexingFailed = -30508,
+	kFBCcommitFailed = -30509,
+	kFBCdeletionFailed = -30510,
+	kFBCmoveFailed = -30511,
+	kFBCtokenizationFailed = -30512,
+	kFBCmergingFailed = -30513,
+	kFBCindexCreationFailed = -30514,
+	kFBCaccessorStoreFailed = -30515,
+	kFBCaddDocFailed = -30516,
+	kFBCflushFailed = -30517,
+	kFBCindexNotFound = -30518,
+	kFBCnoSearchSession = -30519,
+	kFBCindexingCanceled = -30520,
+	kFBCaccessCanceled = -30521,
+	kFBCindexFileDestroyed = -30522,
+	kFBCindexNotAvailable = -30523,
+	kFBCsearchFailed = -30524,
+	kFBCsomeFilesNotIndexed = -30525,
+	kFBCillegalSessionChange = -30526,
+	kFBCanalysisNotAvailable = -30527,
+	kFBCbadIndexFileVersion = -30528,
+	kFBCsummarizationCanceled = -30529,
+	kFBCindexDiskIOFailed = -30530,
+	kFBCbadSearchSession = -30531,
+	kFBCnoSuchHit = -30532
+}
+
+enum
+{
+	notAQTVRMovieErr = -30540,
+	constraintReachedErr = -30541,
+	callNotSupportedByNodeErr = -30542,
+	selectorNotSupportedByNodeErr = -30543,
+	invalidNodeIDErr = -30544,
+	invalidViewStateErr = -30545,
+	timeNotInViewErr = -30546,
+	propertyNotSupportedByNodeErr = -30547,
+	settingNotSupportedByNodeErr = -30548,
+	limitReachedErr = -30549,
+	invalidNodeFormatErr = -30550,
+	invalidHotSpotIDErr = -30551,
+	noMemoryNodeFailedInitialize = -30552,
+	streamingNodeNotReadyErr = -30553,
+	qtvrLibraryLoadErr = -30554,
+	qtvrUninitialized = -30555
+}
+
+enum
+{
+	themeInvalidBrushErr = -30560,
+	themeProcessRegisteredErr = -30561,
+	themeProcessNotRegisteredErr = -30562,
+	themeBadTextColorErr = -30563,
+	themeHasNoAccentsErr = -30564,
+	themeBadCursorIndexErr = -30565,
+	themeScriptFontNotFoundErr = -30566,
+	themeMonitorDepthNotSupportedErr = -30567,
+	themeNoAppropriateBrushErr = -30568
+}
+
+enum
+{
+	errMessageNotSupported = -30580,
+	errDataNotSupported = -30581,
+	errControlDoesntSupportFocus = -30582,
+	errUnknownControl = -30584,
+	errCouldntSetFocus = -30585,
+	errNoRootControl = -30586,
+	errRootAlreadyExists = -30587,
+	errInvalidPartCode = -30588,
+	errControlsAlreadyExist = -30589,
+	errControlIsNotEmbedder = -30590,
+	errDataSizeMismatch = -30591,
+	errControlHiddenOrDisabled = -30592,
+	errCantEmbedIntoSelf = -30594,
+	errCantEmbedRoot = -30595,
+	errItemNotControl = -30596,
+	controlInvalidDataVersionErr = -30597,
+	controlPropertyInvalid = -5603,
+	controlPropertyNotFoundErr = -5604,
+	controlHandleInvalidErr = -30599
+}
+
+enum
+{
+	kURLInvalidURLReferenceError = -30770,
+	kURLProgressAlreadyDisplayedError = -30771,
+	kURLDestinationExistsError = -30772,
+	kURLInvalidURLError = -30773,
+	kURLUnsupportedSchemeError = -30774,
+	kURLServerBusyError = -30775,
+	kURLAuthenticationError = -30776,
+	kURLPropertyNotYetKnownError = -30777,
+	kURLUnknownPropertyError = -30778,
+	kURLPropertyBufferTooSmallError = -30779,
+	kURLUnsettablePropertyError = -30780,
+	kURLInvalidCallError = -30781,
+	kURLFileEmptyError = -30783,
+	kURLExtensionFailureError = -30785,
+	kURLInvalidConfigurationError = -30786,
+	kURLAccessNotAvailableError = -30787,
+	kURL68kNotSupportedError = -30788
+}
+
+enum
+{
+	errCppGeneral = -32000,
+	errCppbad_alloc = -32001,
+	errCppbad_cast = -32002,
+	errCppbad_exception = -32003,
+	errCppbad_typeid = -32004,
+	errCpplogic_error = -32005,
+	errCppdomain_error = -32006,
+	errCppinvalid_argument = -32007,
+	errCpplength_error = -32008,
+	errCppout_of_range = -32009,
+	errCppruntime_error = -32010,
+	errCppoverflow_error = -32011,
+	errCpprange_error = -32012,
+	errCppunderflow_error = -32013,
+	errCppios_base_failure = -32014,
+	errCppLastSystemDefinedError = -32020,
+	errCppLastUserDefinedError = -32049
+}
+
+enum
+{
+	badComponentInstance = cast(c_long)0x80008001,
+	badComponentSelector = cast(c_long)0x80008002
+}
+
+enum
+{
+	dsBusError = 1,
+	dsAddressErr = 2,
+	dsIllInstErr = 3,
+	dsZeroDivErr = 4,
+	dsChkErr = 5,
+	dsOvflowErr = 6,
+	dsPrivErr = 7,
+	dsTraceErr = 8,
+	dsLineAErr = 9,
+	dsLineFErr = 10,
+	dsMiscErr = 11,
+	dsCoreErr = 12,
+	dsIrqErr = 13,
+	dsIOCoreErr = 14,
+	dsLoadErr = 15,
+	dsFPErr = 16,
+	dsNoPackErr = 17,
+	dsNoPk1 = 18,
+	dsNoPk2 = 19
+}
+
+enum
+{
+	dsNoPk3 = 20,
+	dsNoPk4 = 21,
+	dsNoPk5 = 22,
+	dsNoPk6 = 23,
+	dsNoPk7 = 24,
+	dsMemFullErr = 25,
+	dsBadLaunch = 26,
+	dsFSErr = 27,
+	dsStknHeap = 28,
+	negZcbFreeErr = 33,
+	dsFinderErr = 41,
+	dsBadSlotInt = 51,
+	dsBadSANEOpcode = 81,
+	dsBadPatchHeader = 83,
+	menuPrgErr = 84,
+	dsMBarNFnd = 85,
+	dsHMenuFindErr = 86,
+	dsWDEFNotFound = 87,
+	dsCDEFNotFound = 88,
+	dsMDEFNotFound = 89
+}
+
+enum
+{
+	dsNoFPU = 90,
+	dsNoPatch = 98,
+	dsBadPatch = 99,
+	dsParityErr = 101,
+	dsOldSystem = 102,
+	ds32BitMode = 103,
+	dsNeedToWriteBootBlocks = 104,
+	dsNotEnoughRAMToBoot = 105,
+	dsBufPtrTooLow = 106,
+	dsVMDeferredFuncTableFull = 112,
+	dsVMBadBackingStore = 113,
+	dsCantHoldSystemHeap = 114,
+	dsSystemRequiresPowerPC = 116,
+	dsGibblyMovedToDisabledFolder = 117,
+	dsUnBootableSystem = 118,
+	dsMustUseFCBAccessors = 119,
+	dsMacOSROMVersionTooOld = 120,
+	dsLostConnectionToNetworkDisk = 121,
+	dsRAMDiskTooBig = 122,
+	dsWriteToSupervisorStackGuardPage = 128,
+	dsReinsert = 30,
+	shutDownAlert = 42,
+	dsShutDownOrRestart = 20000,
+	dsSwitchOffOrRestart = 20001,
+	dsForcedQuit = 20002,
+	dsRemoveDisk = 20003,
+	dsDirtyDisk = 20004,
+	dsShutDownOrResume = 20109,
+	dsSCSIWarn = 20010,
+	dsMBSysError = 29200,
+	dsMBFlpySysError = 29201,
+	dsMBATASysError = 29202,
+	dsMBATAPISysError = 29203,
+	dsMBExternFlpySysError = 29204,
+	dsPCCardATASysError = 29205
+}
+
+enum
+{
+	dsNoExtsMacsBug = -1,
+	dsNoExtsDisassembler = -2,
+	dsMacsBugInstalled = -10,
+	dsDisassemblerInstalled = -11,
+	dsExtensionsDisabled = -13,
+	dsGreeting = 40,
+	dsSysErr = 32767,
+	WDEFNFnd = dsWDEFNotFound
+}
+
+enum
+{
+	CDEFNFnd = dsCDEFNotFound,
+	dsNotThe1 = 31,
+	dsBadStartupDisk = 42,
+	dsSystemFileErr = 43,
+	dsHD20Installed = -12,
+	mBarNFnd = -126,
+	fsDSIntErr = -127,
+	hMenuFindErr = -127,
+	userBreak = -490,
+	strUserBreak = -491,
+	exUserBreak = -492
+}
+
+enum
+{
+	dsBadLibrary = 1010,
+	dsMixedModeFailure = 1011
+}
+
+enum
+{
+	kPOSIXErrorBase = 100000L,
+	kPOSIXErrorEPERM = 100001L,
+	kPOSIXErrorENOENT = 100002L,
+	kPOSIXErrorESRCH = 100003L,
+	kPOSIXErrorEINTR = 100004L,
+	kPOSIXErrorEIO = 100005L,
+	kPOSIXErrorENXIO = 100006L,
+	kPOSIXErrorE2BIG = 100007L,
+	kPOSIXErrorENOEXEC = 100008L,
+	kPOSIXErrorEBADF = 100009L,
+	kPOSIXErrorECHILD = 100010L,
+	kPOSIXErrorEDEADLK = 100011L,
+	kPOSIXErrorENOMEM = 100012L,
+	kPOSIXErrorEACCES = 100013L,
+	kPOSIXErrorEFAULT = 100014L,
+	kPOSIXErrorENOTBLK = 100015L,
+	kPOSIXErrorEBUSY = 100016L,
+	kPOSIXErrorEEXIST = 100017L,
+	kPOSIXErrorEXDEV = 100018L,
+	kPOSIXErrorENODEV = 100019L,
+	kPOSIXErrorENOTDIR = 100020L,
+	kPOSIXErrorEISDIR = 100021L,
+	kPOSIXErrorEINVAL = 100022L,
+	kPOSIXErrorENFILE = 100023L,
+	kPOSIXErrorEMFILE = 100024L,
+	kPOSIXErrorENOTTY = 100025L,
+	kPOSIXErrorETXTBSY = 100026L,
+	kPOSIXErrorEFBIG = 100027L,
+	kPOSIXErrorENOSPC = 100028L,
+	kPOSIXErrorESPIPE = 100029L,
+	kPOSIXErrorEROFS = 100030L,
+	kPOSIXErrorEMLINK = 100031L,
+	kPOSIXErrorEPIPE = 100032L,
+	kPOSIXErrorEDOM = 100033L,
+	kPOSIXErrorERANGE = 100034L,
+	kPOSIXErrorEAGAIN = 100035L,
+	kPOSIXErrorEINPROGRESS = 100036L,
+	kPOSIXErrorEALREADY = 100037L,
+	kPOSIXErrorENOTSOCK = 100038L,
+	kPOSIXErrorEDESTADDRREQ = 100039L,
+	kPOSIXErrorEMSGSIZE = 100040L,
+	kPOSIXErrorEPROTOTYPE = 100041L,
+	kPOSIXErrorENOPROTOOPT = 100042L,
+	kPOSIXErrorEPROTONOSUPPORT = 100043L,
+	kPOSIXErrorESOCKTNOSUPPORT = 100044L,
+	kPOSIXErrorENOTSUP = 100045L,
+	kPOSIXErrorEPFNOSUPPORT = 100046L,
+	kPOSIXErrorEAFNOSUPPORT = 100047L,
+	kPOSIXErrorEADDRINUSE = 100048L,
+	kPOSIXErrorEADDRNOTAVAIL = 100049L,
+	kPOSIXErrorENETDOWN = 100050L,
+	kPOSIXErrorENETUNREACH = 100051L,
+	kPOSIXErrorENETRESET = 100052L,
+	kPOSIXErrorECONNABORTED = 100053L,
+	kPOSIXErrorECONNRESET = 100054L,
+	kPOSIXErrorENOBUFS = 100055L,
+	kPOSIXErrorEISCONN = 100056L,
+	kPOSIXErrorENOTCONN = 100057L,
+	kPOSIXErrorESHUTDOWN = 100058L,
+	kPOSIXErrorETOOMANYREFS = 100059L,
+	kPOSIXErrorETIMEDOUT = 100060L,
+	kPOSIXErrorECONNREFUSED = 100061L,
+	kPOSIXErrorELOOP = 100062L,
+	kPOSIXErrorENAMETOOLONG = 100063L,
+	kPOSIXErrorEHOSTDOWN = 100064L,
+	kPOSIXErrorEHOSTUNREACH = 100065L,
+	kPOSIXErrorENOTEMPTY = 100066L,
+	kPOSIXErrorEPROCLIM = 100067L,
+	kPOSIXErrorEUSERS = 100068L,
+	kPOSIXErrorEDQUOT = 100069L,
+	kPOSIXErrorESTALE = 100070L,
+	kPOSIXErrorEREMOTE = 100071L,
+	kPOSIXErrorEBADRPC = 100072L,
+	kPOSIXErrorERPCMISMATCH = 100073L,
+	kPOSIXErrorEPROGUNAVAIL = 100074L,
+	kPOSIXErrorEPROGMISMATCH = 100075L,
+	kPOSIXErrorEPROCUNAVAIL = 100076L,
+	kPOSIXErrorENOLCK = 100077L,
+	kPOSIXErrorENOSYS = 100078L,
+	kPOSIXErrorEFTYPE = 100079L,
+	kPOSIXErrorEAUTH = 100080L,
+	kPOSIXErrorENEEDAUTH = 100081L,
+	kPOSIXErrorEPWROFF = 100082L,
+	kPOSIXErrorEDEVERR = 100083L,
+	kPOSIXErrorEOVERFLOW = 100084L,
+	kPOSIXErrorEBADEXEC = 100085L,
+	kPOSIXErrorEBADARCH = 100086L,
+	kPOSIXErrorESHLIBVERS = 100087L,
+	kPOSIXErrorEBADMACHO = 100088L,
+	kPOSIXErrorECANCELED = 100089L,
+	kPOSIXErrorEIDRM = 100090L,
+	kPOSIXErrorENOMSG = 100091L,
+	kPOSIXErrorEILSEQ = 100092L,
+	kPOSIXErrorENOATTR = 100093L,
+	kPOSIXErrorEBADMSG = 100094L,
+	kPOSIXErrorEMULTIHOP = 100095L,
+	kPOSIXErrorENODATA = 100096L,
+	kPOSIXErrorENOLINK = 100097L,
+	kPOSIXErrorENOSR = 100098L,
+	kPOSIXErrorENOSTR = 100099L,
+	kPOSIXErrorEPROTO = 100100L,
+	kPOSIXErrorETIME = 100101L,
+	kPOSIXErrorEOPNOTSUPP = 100102L
+}
+
+extern (C)
+{
+	void SysError (short errorCode);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MacLocales.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,59 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MacLocales;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+
+struct OpaqueLocaleRef;
+
+alias OpaqueLocaleRef* LocaleRef;
+alias uint LocalePartMask;
+alias uint LocaleOperationClass;
+alias uint LocaleOperationVariant;
+alias uint LocaleNameMask;
+
+enum
+{
+	kLocaleLanguageMask = 1L << 0,
+	kLocaleLanguageVariantMask = 1L << 1,
+	kLocaleScriptMask = 1L << 2,
+	kLocaleScriptVariantMask = 1L << 3,
+	kLocaleRegionMask = 1L << 4,
+	kLocaleRegionVariantMask = 1L << 5,
+	kLocaleAllPartsMask = 0x0000003F
+}
+
+enum
+{
+	kLocaleNameMask = 1L << 0,
+	kLocaleOperationVariantNameMask = 1L << 1,
+	kLocaleAndVariantNameMask = 0x00000003
+}
+
+struct LocaleAndVariant
+{
+	LocaleRef locale;
+	uint opVariant;
+}
+
+extern (C)
+{
+	int LocaleRefFromLangOrRegionCode (short lang, short region, LocaleRef* locale);
+	int LocaleRefFromLocaleString (char* localeString, LocaleRef* locale);
+	int LocaleRefGetPartString (LocaleRef locale, uint partMask, uint maxStringLen, char* partString);
+	int LocaleStringToLangAndRegionCodes (char* localeString, LangCode* lang, RegionCode* region);
+	int LocaleOperationCountLocales (uint opClass, ItemCount* localeCount);
+	int LocaleOperationGetLocales (uint opClass, uint maxLocaleCount, ItemCount* actualLocaleCount, LocaleAndVariant* localeVariantList);
+	int LocaleGetName (LocaleRef locale, uint opVariant, uint nameMask, LocaleRef displayLocale, uint maxNameLen, UniCharCount* actualNameLen, wchar* displayName);
+	int LocaleCountNames (LocaleRef locale, uint opVariant, uint nameMask, ItemCount* nameCount);
+	int LocaleGetIndName (LocaleRef locale, uint opVariant, uint nameMask, uint nameIndex, uint maxNameLen, UniCharCount* actualNameLen, wchar* displayName, LocaleRef* displayLocale);
+	int LocaleOperationGetName (uint opClass, LocaleRef displayLocale, uint maxNameLen, UniCharCount* actualNameLen, wchar* displayName);
+	int LocaleOperationCountNames (uint opClass, ItemCount* nameCount);
+	int LocaleOperationGetIndName (uint opClass, uint nameIndex, uint maxNameLen, UniCharCount* actualNameLen, wchar* displayName, LocaleRef* displayLocale);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MacMemory.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,87 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MacMemory;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+//import dstep.string;
+
+enum
+{
+	maxSize = 0x7FFFFFF0
+}
+
+enum
+{
+	defaultPhysicalEntryCount = 8
+}
+
+enum
+{
+	kPageInMemory = 0,
+	kPageOnDisk = 1,
+	kNotPaged = 2
+}
+
+enum
+{
+	k32BitHeap = 1,
+	kNewStyleHeap = 2,
+	kNewDebugHeap = 4
+}
+
+enum
+{
+	kHandleIsResourceBit = 5,
+	kHandlePurgeableBit = 6,
+	kHandleLockedBit = 7
+}
+
+enum
+{
+	kHandleIsResourceMask = 0x20,
+	kHandlePurgeableMask = 0x40,
+	kHandleLockedMask = 0x80
+}
+
+extern (C)
+{
+	short MemError ();
+	short LMGetMemErr ();
+	void LMSetMemErr (short value);
+	Handle NewHandle (int byteCount);
+	Handle NewHandleClear (int byteCount);
+	Handle RecoverHandle (char* p);
+	char* NewPtr (int byteCount);
+	char* NewPtrClear (int byteCount);
+	Handle NewEmptyHandle ();
+	void HLock (Handle h);
+	void HLockHi (Handle h);
+	void HUnlock (Handle h);
+	Handle TempNewHandle (int logicalSize, OSErr* resultCode);
+	void DisposePtr (char* p);
+	int GetPtrSize (char* p);
+	void SetPtrSize (char* p, int newSize);
+	void DisposeHandle (Handle h);
+	void SetHandleSize (Handle h, int newSize);
+	int GetHandleSize (Handle h);
+	void ReallocateHandle (Handle h, int byteCount);
+	void EmptyHandle (Handle h);
+	void HSetRBit (Handle h);
+	void HClrRBit (Handle h);
+	byte HGetState (Handle h);
+	void HSetState (Handle h, byte flags);
+	short HandToHand (Handle* theHndl);
+	short PtrToXHand (void* srcPtr, Handle dstHndl, int size);
+	short PtrToHand (void* srcPtr, Handle* dstHndl, int size);
+	short HandAndHand (Handle hand1, Handle hand2);
+	short PtrAndHand (void* ptr1, Handle hand2, int size);
+	ubyte IsHeapValid ();
+	ubyte IsHandleValid (Handle h);
+	ubyte IsPointerValid (char* p);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MacTypes.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,273 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MacTypes;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.internal.Types;
+//import dstep.stdbool;
+//import dstep.sys.types;
+
+struct TimeBaseRecord;
+
+alias ubyte UInt8;
+alias byte SInt8;
+alias ushort UInt16;
+alias short SInt16;
+alias uint UInt32;
+alias int SInt32;
+alias long SInt64;
+alias ulong UInt64;
+alias int Fixed;
+alias Fixed* FixedPtr;
+alias int Fract;
+alias Fract* FractPtr;
+alias uint UnsignedFixed;
+alias UnsignedFixed* UnsignedFixedPtr;
+alias short ShortFixed;
+alias ShortFixed* ShortFixedPtr;
+alias float Float32;
+alias double Float64;
+alias char* Ptr;
+alias Ptr* Handle;
+alias int Size;
+alias short OSErr;
+alias int OSStatus;
+alias void* LogicalAddress;
+alias void* ConstLogicalAddress;
+alias void* PhysicalAddress;
+alias char* BytePtr;
+alias uint ByteCount;
+alias uint ByteOffset;
+alias int Duration;
+alias UnsignedWide AbsoluteTime;
+alias uint OptionBits;
+alias uint ItemCount;
+alias uint PBVersion;
+alias short ScriptCode;
+alias short LangCode;
+alias short RegionCode;
+alias uint FourCharCode;
+alias uint OSType;
+alias uint ResType;
+alias OSType* OSTypePtr;
+alias ResType* ResTypePtr;
+alias bool Boolean;
+alias ProcPtr UniversalProcPtr;
+alias ProcPtr* ProcHandle;
+alias UniversalProcPtr* UniversalProcHandle;
+alias void* PRefCon;
+alias void* URefCon;
+alias void* SRefCon;
+alias uint UnicodeScalarValue;
+alias dchar UTF32Char;
+alias wchar UniChar;
+alias wchar UTF16Char;
+alias char UTF8Char;
+alias wchar* UniCharPtr;
+alias c_ulong UniCharCount;
+alias UniCharCount* UniCharCountPtr;
+alias char[256] Str255;
+alias char[64] Str63;
+alias char[33] Str32;
+alias char[32] Str31;
+alias char[28] Str28;
+alias char[16] Str15;
+alias Str63 StrFileName;
+alias char* StringPtr;
+alias StringPtr* StringHandle;
+alias char* ConstStringPtr;
+alias char* ConstStr255Param;
+alias char* ConstStr63Param;
+alias char* ConstStr32Param;
+alias char* ConstStr31Param;
+alias char* ConstStr27Param;
+alias char* ConstStr15Param;
+alias char* ConstStrFileNameParam;
+alias ProcessSerialNumber* ProcessSerialNumberPtr;
+alias Point* PointPtr;
+alias Rect* RectPtr;
+alias short CharParameter;
+alias ubyte Style;
+alias short StyleParameter;
+alias ubyte StyleField;
+alias int TimeValue;
+alias int TimeScale;
+alias wide CompTimeValue;
+alias long TimeValue64;
+alias TimeBaseRecord* TimeBase;
+alias NumVersionVariant* NumVersionVariantPtr;
+alias NumVersionVariantPtr* NumVersionVariantHandle;
+alias VersRec* VersRecPtr;
+alias VersRecPtr* VersRecHndl;
+alias ubyte Byte;
+alias byte SignedByte;
+alias wide* WidePtr;
+alias UnsignedWide* UnsignedWidePtr;
+alias Float80[] extended80;
+alias Float96[][] extended96;
+alias byte VHSelect;
+
+extern (C)
+{
+	alias c_long function () Register68kProcPtr;
+	alias void function () ProcPtr;
+}
+
+enum
+{
+	noErr = 0
+}
+
+enum
+{
+	kNilOptions = 0
+}
+
+enum
+{
+	kVariableLengthArray = 1
+}
+
+enum
+{
+	kUnknownType = 0x3F3F3F3F
+}
+
+enum
+{
+	normal = 0,
+	bold = 1,
+	italic = 2,
+	underline = 4,
+	outline = 8,
+	shadow = 0x10,
+	condense = 0x20,
+	extend = 0x40
+}
+
+enum
+{
+	developStage = 0x20,
+	alphaStage = 0x40,
+	betaStage = 0x60,
+	finalStage = 0x80
+}
+
+union NumVersionVariant
+{
+	NumVersion parts;
+	uint whole;
+}
+
+struct wide
+{
+	uint lo;
+	int hi;
+}
+
+
+struct UnsignedWide
+{
+	uint lo;
+	uint hi;
+}
+
+
+struct Float80
+{
+	short exp;
+	UInt16* man;
+}
+
+
+struct Float96
+{
+	SInt16* exp;
+	UInt16* man;
+}
+
+
+struct Float32Point
+{
+	float x;
+	float y;
+}
+
+
+struct ProcessSerialNumber
+{
+	uint highLongOfPSN;
+	uint lowLongOfPSN;
+}
+
+
+struct Point
+{
+	short v;
+	short h;
+}
+
+
+struct Rect
+{
+	short top;
+	short left;
+	short bottom;
+	short right;
+}
+
+
+struct FixedPoint
+{
+	int x;
+	int y;
+}
+
+
+struct FixedRect
+{
+	int left;
+	int top;
+	int right;
+	int bottom;
+}
+
+
+struct TimeRecord
+{
+	CompTimeValue value;
+	int scale;
+	TimeBase base;
+}
+
+
+struct NumVersion
+{
+	ubyte nonRelRev;
+	ubyte stage;
+	ubyte minorAndBugRev;
+	ubyte majorRev;
+}
+
+
+struct VersRec
+{
+	NumVersion numericVersion;
+	short countryCode;
+	ubyte[256] shortVersion;
+	ubyte[256] reserved;
+}
+
+extern (C)
+{
+	void Debugger ();
+	void DebugStr (char* debuggerMsg);
+	void SysBreak ();
+	void SysBreakStr (char* debuggerMsg);
+	void SysBreakFunc (char* debuggerMsg);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MachineExceptions.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,243 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MachineExceptions;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Types;
+import dstep.internal.Version;
+//import dstep.xmmintrin;
+
+struct OpaqueAreaID;
+
+alias OpaqueAreaID* AreaID;
+alias uint MemoryReferenceKind;
+alias uint ExceptionKind;
+alias MachineInformationIntel MachineInformation;
+alias RegisterInformationIntel RegisterInformation;
+alias FPUInformationIntel FPUInformation;
+alias VectorInformationIntel VectorInformation;
+alias ExceptionHandlerProcPtr ExceptionHandlerUPP;
+alias ExceptionHandlerUPP ExceptionHandlerTPP;
+alias ExceptionHandlerTPP ExceptionHandler;
+alias ubyte[10] FPRegIntel;
+
+extern (C)
+{
+	alias int function (ExceptionInformation*) ExceptionHandlerProcPtr;
+}
+
+enum
+{
+	kWriteReference = 0,
+	kReadReference = 1,
+	kFetchReference = 2,
+	writeReference = kWriteReference,
+	readReference = kReadReference,
+	fetchReference = kFetchReference
+}
+
+enum
+{
+	kUnknownException = 0,
+	kIllegalInstructionException = 1,
+	kTrapException = 2,
+	kAccessException = 3,
+	kUnmappedMemoryException = 4,
+	kExcludedMemoryException = 5,
+	kReadOnlyMemoryException = 6,
+	kUnresolvablePageFaultException = 7,
+	kPrivilegeViolationException = 8,
+	kTraceException = 9,
+	kInstructionBreakpointException = 10,
+	kDataBreakpointException = 11,
+	kIntegerException = 12,
+	kFloatingPointException = 13,
+	kStackOverflowException = 14,
+	kTaskTerminationException = 15,
+	kTaskCreationException = 16,
+	kDataAlignmentException = 17
+}
+
+union Vector128
+{
+	c_ulong[4] l;
+	ushort[8] s;
+	ubyte[16] c;
+}
+
+union ExceptionInfo
+{
+	MemoryExceptionInformation* memoryInfo;
+}
+
+static if (X86 || X86_64)
+{
+	union Vector128Intel
+	{
+		float s;
+		int si;
+		int sd;
+		ubyte[16] c;
+	}
+}
+
+struct MachineInformationPowerPC
+{
+	UnsignedWide CTR;
+	UnsignedWide LR;
+	UnsignedWide PC;
+	uint CRRegister;
+	uint XER;
+	uint MSR;
+	uint MQ;
+	uint ExceptKind;
+	uint DSISR;
+	UnsignedWide DAR;
+	UnsignedWide Reserved;
+}
+
+
+struct RegisterInformationPowerPC
+{
+	UnsignedWide R0;
+	UnsignedWide R1;
+	UnsignedWide R2;
+	UnsignedWide R3;
+	UnsignedWide R4;
+	UnsignedWide R5;
+	UnsignedWide R6;
+	UnsignedWide R7;
+	UnsignedWide R8;
+	UnsignedWide R9;
+	UnsignedWide R10;
+	UnsignedWide R11;
+	UnsignedWide R12;
+	UnsignedWide R13;
+	UnsignedWide R14;
+	UnsignedWide R15;
+	UnsignedWide R16;
+	UnsignedWide R17;
+	UnsignedWide R18;
+	UnsignedWide R19;
+	UnsignedWide R20;
+	UnsignedWide R21;
+	UnsignedWide R22;
+	UnsignedWide R23;
+	UnsignedWide R24;
+	UnsignedWide R25;
+	UnsignedWide R26;
+	UnsignedWide R27;
+	UnsignedWide R28;
+	UnsignedWide R29;
+	UnsignedWide R30;
+	UnsignedWide R31;
+}
+
+
+struct FPUInformationPowerPC
+{
+	UnsignedWide* Registers;
+	uint FPSCR;
+	uint Reserved;
+}
+
+
+struct VectorInformationPowerPC
+{
+	Vector128* Registers;
+	Vector128 VSCR;
+	uint VRsave;
+}
+
+
+struct MemoryExceptionInformation
+{
+	AreaID theArea;
+	LogicalAddress theAddress;
+	int theError;
+	uint theReference;
+}
+
+
+struct ExceptionInformationPowerPC
+{
+	uint theKind;
+	MachineInformationPowerPC* machineState;
+	RegisterInformationPowerPC* registerImage;
+	FPUInformationPowerPC* FPUImage;
+	ExceptionInfo info;
+	VectorInformationPowerPC* vectorImage;
+}
+
+
+struct MachineInformationIntel
+{
+	uint CS;
+	uint DS;
+	uint SS;
+	uint ES;
+	uint FS;
+	uint GS;
+	uint EFLAGS;
+	uint EIP;
+	uint ExceptTrap;
+	uint ExceptErr;
+	uint ExceptAddr;
+}
+
+
+struct RegisterInformationIntel
+{
+	uint EAX;
+	uint EBX;
+	uint ECX;
+	uint EDX;
+	uint ESI;
+	uint EDI;
+	uint EBP;
+	uint ESP;
+}
+
+
+struct FPUInformationIntel
+{
+	FPRegIntel* Registers;
+	ushort Control;
+	ushort Status;
+	ushort Tag;
+	ushort Opcode;
+	uint EIP;
+	uint DP;
+	uint DS;
+}
+
+
+struct VectorInformationIntel
+{
+	Vector128Intel* Registers;
+}
+
+
+struct ExceptionInformation
+{
+	uint theKind;
+	MachineInformation* machineState;
+	RegisterInformation* registerImage;
+	FPUInformation* FPUImage;
+	ExceptionInfo info;
+	VectorInformation* vectorImage;
+}
+
+extern (C)
+{
+	ExceptionHandlerUPP NewExceptionHandlerUPP (ExceptionHandlerProcPtr userRoutine);
+	void DisposeExceptionHandlerUPP (ExceptionHandlerUPP userUPP);
+	int InvokeExceptionHandlerUPP (ExceptionInformation* theException, ExceptionHandlerUPP userUPP);
+	ExceptionHandlerTPP InstallExceptionHandler (ExceptionHandlerTPP theHandler);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Math64.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,65 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Math64;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+extern (C)
+{
+	long S64Max ();
+	long S64Min ();
+	long S64Add (long left, long right);
+	long S64Subtract (long left, long right);
+	long S64Negate (long value);
+	long S64Multiply (long left, long right);
+	long S64Mod (long dividend, long divisor);
+	long S64Divide (long dividend, long divisor, SInt64* remainder);
+	long S64Div (long dividend, long divisor);
+	long S64Set (int value);
+	long S64SetU (uint value);
+	int S32Set (long value);
+	ubyte S64And (long left, long right);
+	ubyte S64Or (long left, long right);
+	ubyte S64Eor (long left, long right);
+	ubyte S64Not (long value);
+	int S64Compare (long left, long right);
+	long S64BitwiseAnd (long left, long right);
+	long S64BitwiseOr (long left, long right);
+	long S64BitwiseEor (long left, long right);
+	long S64BitwiseNot (long value);
+	long S64ShiftRight (long value, uint shift);
+	long S64ShiftLeft (long value, uint shift);
+	double SInt64ToLongDouble (long value);
+	long LongDoubleToSInt64 (double value);
+	ulong U64Max ();
+	ulong U64Add (ulong left, ulong right);
+	ulong U64Subtract (ulong left, ulong right);
+	ulong U64Multiply (ulong left, ulong right);
+	ulong U64Mod (ulong dividend, ulong divisor);
+	ulong U64Divide (ulong dividend, ulong divisor, UInt64* remainder);
+	ulong U64Div (ulong dividend, ulong divisor);
+	ulong U64Set (int value);
+	ulong U64SetU (uint value);
+	uint U32SetU (ulong value);
+	ubyte U64And (ulong left, ulong right);
+	ubyte U64Or (ulong left, ulong right);
+	ubyte U64Eor (ulong left, ulong right);
+	ubyte U64Not (ulong value);
+	int U64Compare (ulong left, ulong right);
+	ulong U64BitwiseAnd (ulong left, ulong right);
+	ulong U64BitwiseOr (ulong left, ulong right);
+	ulong U64BitwiseEor (ulong left, ulong right);
+	ulong U64BitwiseNot (ulong value);
+	ulong U64ShiftRight (ulong value, uint shift);
+	ulong U64ShiftLeft (ulong value, uint shift);
+	double UInt64ToLongDouble (ulong value);
+	ulong LongDoubleToUInt64 (double value);
+	long UInt64ToSInt64 (ulong value);
+	ulong SInt64ToUInt64 (long value);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MixedMode.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,233 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MixedMode;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.internal.Types;
+
+alias ushort CallingConventionType;
+alias byte ISAType;
+alias byte RTAType;
+alias ushort registerSelectorType;
+alias uint ProcInfoType;
+alias ushort RoutineFlagsType;
+alias RoutineRecord* RoutineRecordPtr;
+alias RoutineRecordPtr* RoutineRecordHandle;
+alias ubyte RDFlagsType;
+alias RoutineDescriptor* RoutineDescriptorPtr;
+alias RoutineDescriptorPtr* RoutineDescriptorHandle;
+
+enum
+{
+	kRoutineDescriptorVersion = 7
+}
+
+enum
+{
+	_MixedModeMagic = 0xAAFE
+}
+
+enum
+{
+	kCurrentMixedModeStateRecord = 1
+}
+
+enum
+{
+	kPascalStackBased = 0,
+	kCStackBased = 1,
+	kRegisterBased = 2,
+	kD0DispatchedPascalStackBased = 8,
+	kD1DispatchedPascalStackBased = 12,
+	kD0DispatchedCStackBased = 9,
+	kStackDispatchedPascalStackBased = 14,
+	kThinkCStackBased = 5
+}
+
+enum
+{
+	kM68kISA = 0,
+	kPowerPCISA = 1
+}
+
+enum
+{
+	kX86ISA = 2
+}
+
+enum
+{
+	kOld68kRTA = 0 << 4,
+	kPowerPCRTA = 0 << 4,
+	kCFM68kRTA = 1 << 4
+}
+
+enum
+{
+	kX86RTA = 2 << 4
+}
+
+enum
+{
+	kRegisterD0 = 0,
+	kRegisterD1 = 1,
+	kRegisterD2 = 2,
+	kRegisterD3 = 3,
+	kRegisterD4 = 8,
+	kRegisterD5 = 9,
+	kRegisterD6 = 10,
+	kRegisterD7 = 11,
+	kRegisterA0 = 4,
+	kRegisterA1 = 5,
+	kRegisterA2 = 6,
+	kRegisterA3 = 7,
+	kRegisterA4 = 12,
+	kRegisterA5 = 13,
+	kRegisterA6 = 14,
+	kCCRegisterCBit = 16,
+	kCCRegisterVBit = 17,
+	kCCRegisterZBit = 18,
+	kCCRegisterNBit = 19,
+	kCCRegisterXBit = 20
+}
+
+enum
+{
+	kNoByteCode = 0,
+	kOneByteCode = 1,
+	kTwoByteCode = 2,
+	kFourByteCode = 3
+}
+
+enum
+{
+	kProcDescriptorIsAbsolute = 0x00,
+	kProcDescriptorIsRelative = 0x01
+}
+
+enum
+{
+	kFragmentIsPrepared = 0x00,
+	kFragmentNeedsPreparing = 0x02
+}
+
+enum
+{
+	kUseCurrentISA = 0x00,
+	kUseNativeISA = 0x04
+}
+
+enum
+{
+	kPassSelector = 0x00,
+	kDontPassSelector = 0x08
+}
+
+enum
+{
+	kRoutineIsNotDispatchedDefaultRoutine = 0x00,
+	kRoutineIsDispatchedDefaultRoutine = 0x10
+}
+
+enum
+{
+	kProcDescriptorIsProcPtr = 0x00,
+	kProcDescriptorIsIndex = 0x20
+}
+
+enum
+{
+	kSelectorsAreNotIndexable = 0x00,
+	kSelectorsAreIndexable = 0x01
+}
+
+enum
+{
+	kCallingConventionWidth = 4,
+	kCallingConventionPhase = 0,
+	kCallingConventionMask = 0x0F,
+	kResultSizeWidth = 2,
+	kResultSizePhase = kCallingConventionWidth,
+	kResultSizeMask = 0x30,
+	kStackParameterWidth = 2,
+	kStackParameterPhase = (kCallingConventionWidth + kResultSizeWidth),
+	kStackParameterMask = cast(c_long)0xFFFFFFC0,
+	kRegisterResultLocationWidth = 5,
+	kRegisterResultLocationPhase = (kCallingConventionWidth + kResultSizeWidth),
+	kRegisterParameterWidth = 5,
+	kRegisterParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kRegisterResultLocationWidth),
+	kRegisterParameterMask = 0x7FFFF800,
+	kRegisterParameterSizePhase = 0,
+	kRegisterParameterSizeWidth = 2,
+	kRegisterParameterWhichPhase = kRegisterParameterSizeWidth,
+	kRegisterParameterWhichWidth = 3,
+	kDispatchedSelectorSizeWidth = 2,
+	kDispatchedSelectorSizePhase = (kCallingConventionWidth + kResultSizeWidth),
+	kDispatchedParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kDispatchedSelectorSizeWidth),
+	kSpecialCaseSelectorWidth = 6,
+	kSpecialCaseSelectorPhase = kCallingConventionWidth,
+	kSpecialCaseSelectorMask = 0x03F0
+}
+
+enum
+{
+	kSpecialCase = 0x000F
+}
+
+enum
+{
+	kSpecialCaseHighHook = 0,
+	kSpecialCaseCaretHook = 0,
+	kSpecialCaseEOLHook = 1,
+	kSpecialCaseWidthHook = 2,
+	kSpecialCaseTextWidthHook = 2,
+	kSpecialCaseNWidthHook = 3,
+	kSpecialCaseDrawHook = 4,
+	kSpecialCaseHitTestHook = 5,
+	kSpecialCaseTEFindWord = 6,
+	kSpecialCaseProtocolHandler = 7,
+	kSpecialCaseSocketListener = 8,
+	kSpecialCaseTERecalc = 9,
+	kSpecialCaseTEDoText = 10,
+	kSpecialCaseGNEFilterProc = 11,
+	kSpecialCaseMBarHook = 12
+}
+
+struct RoutineRecord
+{
+	uint procInfo;
+	byte reserved1;
+	byte ISA;
+	ushort routineFlags;
+	ProcPtr procDescriptor;
+	uint reserved2;
+	uint selector;
+}
+
+
+struct RoutineDescriptor
+{
+	ushort goMixedModeTrap;
+	byte version_;
+	ubyte routineDescriptorFlags;
+	uint reserved1;
+	ubyte reserved2;
+	ubyte selectorInfo;
+	ushort routineCount;
+	RoutineRecord* routineRecords;
+}
+
+
+struct MixedModeStateRecord
+{
+	uint state1;
+	uint state2;
+	uint state3;
+	uint state4;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Multiprocessing.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,298 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Multiprocessing;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+//import dstep.stdarg;
+
+struct OpaqueMPProcessID;
+struct OpaqueMPTaskID;
+struct OpaqueMPQueueID;
+struct OpaqueMPSemaphoreID;
+struct OpaqueMPCriticalRegionID;
+struct OpaqueMPTimerID;
+struct OpaqueMPEventID;
+struct OpaqueMPAddressSpaceID;
+struct OpaqueMPNotificationID;
+struct OpaqueMPCoherenceID;
+struct OpaqueMPCpuID;
+struct OpaqueMPAreaID;
+struct OpaqueMPConsoleID;
+struct OpaqueMPOpaqueID;
+
+
+alias OpaqueMPProcessID* MPProcessID;
+alias OpaqueMPTaskID* MPTaskID;
+alias OpaqueMPQueueID* MPQueueID;
+alias OpaqueMPSemaphoreID* MPSemaphoreID;
+alias OpaqueMPCriticalRegionID* MPCriticalRegionID;
+alias OpaqueMPTimerID* MPTimerID;
+alias OpaqueMPEventID* MPEventID;
+alias OpaqueMPAddressSpaceID* MPAddressSpaceID;
+alias OpaqueMPNotificationID* MPNotificationID;
+alias OpaqueMPCoherenceID* MPCoherenceID;
+alias OpaqueMPCpuID* MPCpuID;
+alias OpaqueMPAreaID* MPAreaID;
+alias OpaqueMPConsoleID* MPConsoleID;
+alias OpaqueMPOpaqueID* MPOpaqueID;
+alias uint MPOpaqueIDClass;
+alias uint MPTaskOptions;
+alias uint TaskStorageIndex;
+alias LogicalAddress TaskStorageValue;
+alias uint MPSemaphoreCount;
+alias uint MPTaskWeight;
+alias uint MPEventFlags;
+alias uint MPExceptionKind;
+alias uint MPTaskStateKind;
+alias uint MPPageSizeClass;
+alias uint MPDebuggerLevel;
+alias ubyte MPRemoteContext;
+
+extern (C)
+{
+	alias ubyte function () MPIsFullyInitializedProc;
+	alias void * function (void*) MPRemoteProcedure;
+	alias int function (void*) TaskProc;
+}
+
+enum
+{
+	MPLibrary_MajorVersion = 2,
+	MPLibrary_MinorVersion = 3,
+	MPLibrary_Release = 1,
+	MPLibrary_DevelopmentRevision = 1
+}
+
+enum
+{
+	kOpaqueAnyID = 0,
+	kOpaqueProcessID = 1,
+	kOpaqueTaskID = 2,
+	kOpaqueTimerID = 3,
+	kOpaqueQueueID = 4,
+	kOpaqueSemaphoreID = 5,
+	kOpaqueCriticalRegionID = 6,
+	kOpaqueCpuID = 7,
+	kOpaqueAddressSpaceID = 8,
+	kOpaqueEventID = 9,
+	kOpaqueCoherenceID = 10,
+	kOpaqueAreaID = 11,
+	kOpaqueNotificationID = 12,
+	kOpaqueConsoleID = 13
+}
+
+enum
+{
+	kMPNoID = 0
+}
+
+enum
+{
+	kDurationImmediate = 0L,
+	kDurationForever = 0x7FFFFFFF,
+	kDurationMillisecond = 1,
+	kDurationMicrosecond = -1
+}
+
+enum
+{
+	kMPCreateTaskSuspendedMask = 1L << 0,
+	kMPCreateTaskTakesAllExceptionsMask = 1L << 1,
+	kMPCreateTaskNotDebuggableMask = 1L << 2,
+	kMPCreateTaskValidOptionsMask = kMPCreateTaskSuspendedMask | kMPCreateTaskTakesAllExceptionsMask | kMPCreateTaskNotDebuggableMask
+}
+
+enum
+{
+	kMPPreserveTimerIDMask = 1L << 0,
+	kMPTimeIsDeltaMask = 1L << 1,
+	kMPTimeIsDurationMask = 1L << 2
+}
+
+enum
+{
+	kMPMaxAllocSize = 1024L * 1024 * 1024
+}
+
+enum
+{
+	kMPAllocateDefaultAligned = 0,
+	kMPAllocate8ByteAligned = 3,
+	kMPAllocate16ByteAligned = 4,
+	kMPAllocate32ByteAligned = 5,
+	kMPAllocate1024ByteAligned = 10,
+	kMPAllocate4096ByteAligned = 12,
+	kMPAllocateMaxAlignment = 16,
+	kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned,
+	kMPAllocateVMXAligned = kMPAllocateAltiVecAligned,
+	kMPAllocateVMPageAligned = 254,
+	kMPAllocateInterlockAligned = 255
+}
+
+enum
+{
+	kMPAllocateClearMask = 0x0001,
+	kMPAllocateGloballyMask = 0x0002,
+	kMPAllocateResidentMask = 0x0004,
+	kMPAllocateNoGrowthMask = 0x0010,
+	kMPAllocateNoCreateMask = 0x0020
+}
+
+enum
+{
+	kMPTaskStateRegisters = 0,
+	kMPTaskStateFPU = 1,
+	kMPTaskStateVectors = 2,
+	kMPTaskStateMachine = 3,
+	kMPTaskState32BitMemoryException = 4,
+	kMPTaskStateTaskInfo = 5
+}
+
+enum
+{
+	kMPTaskPropagate = 0,
+	kMPTaskResumeStep = 1,
+	kMPTaskResumeBranch = 2,
+	kMPTaskResumeMask = 0x0000,
+	kMPTaskPropagateMask = 1 << kMPTaskPropagate,
+	kMPTaskResumeStepMask = 1 << kMPTaskResumeStep,
+	kMPTaskResumeBranchMask = 1 << kMPTaskResumeBranch
+}
+
+enum
+{
+	kMPTaskBlocked = 0,
+	kMPTaskReady = 1,
+	kMPTaskRunning = 2
+}
+
+enum
+{
+	kMPTaskInfoVersion = 3
+}
+
+enum
+{
+	kMPLowLevelDebugger = 0x00000000,
+	kMPMidLevelDebugger = 0x10000000,
+	kMPHighLevelDebugger = 0x20000000
+}
+
+enum
+{
+	kMPAnyRemoteContext = 0,
+	kMPOwningProcessRemoteContext = 1,
+	kMPInterruptRemoteContext = 2,
+	kMPAsyncInterruptRemoteContext = 3
+}
+
+struct MPTaskInfoVersion2
+{
+	uint version_;
+	uint name;
+	uint queueName;
+	ushort runState;
+	ushort lastCPU;
+	uint weight;
+	MPProcessID processID;
+	AbsoluteTime cpuTime;
+	AbsoluteTime schedTime;
+	AbsoluteTime creationTime;
+	uint codePageFaults;
+	uint dataPageFaults;
+	uint preemptions;
+	MPCpuID cpuID;
+}
+
+
+struct MPTaskInfo
+{
+	uint version_;
+	uint name;
+	uint queueName;
+	ushort runState;
+	ushort lastCPU;
+	uint weight;
+	MPProcessID processID;
+	AbsoluteTime cpuTime;
+	AbsoluteTime schedTime;
+	AbsoluteTime creationTime;
+	uint codePageFaults;
+	uint dataPageFaults;
+	uint preemptions;
+	MPCpuID cpuID;
+	MPOpaqueID blockedObject;
+	MPAddressSpaceID spaceID;
+	LogicalAddress stackBase;
+	LogicalAddress stackLimit;
+	LogicalAddress stackCurr;
+}
+
+extern (C)
+{
+	uint MPProcessors ();
+	uint MPProcessorsScheduled ();
+	int MPCreateTask (TaskProc entryPoint, void* parameter, uint stackSize, MPQueueID notifyQueue, void* terminationParameter1, void* terminationParameter2, uint options, MPTaskID* task);
+	int MPTerminateTask (MPTaskID task, int terminationStatus);
+	int MPSetTaskWeight (MPTaskID task, uint weight);
+	ubyte MPTaskIsPreemptive (MPTaskID taskID);
+	void MPExit (int status);
+	void MPYield ();
+	MPTaskID MPCurrentTaskID ();
+	int MPSetTaskType (MPTaskID task, uint taskType);
+	int MPAllocateTaskStorageIndex (TaskStorageIndex* taskIndex);
+	int MPDeallocateTaskStorageIndex (uint taskIndex);
+	int MPSetTaskStorageValue (uint taskIndex, TaskStorageValue value);
+	TaskStorageValue MPGetTaskStorageValue (uint taskIndex);
+	int MPCreateQueue (MPQueueID* queue);
+	int MPDeleteQueue (MPQueueID queue);
+	int MPNotifyQueue (MPQueueID queue, void* param1, void* param2, void* param3);
+	int MPWaitOnQueue (MPQueueID queue, void** param1, void** param2, void** param3, int timeout);
+	int MPSetQueueReserve (MPQueueID queue, uint count);
+	int MPCreateSemaphore (uint maximumValue, uint initialValue, MPSemaphoreID* semaphore);
+	int MPDeleteSemaphore (MPSemaphoreID semaphore);
+	int MPSignalSemaphore (MPSemaphoreID semaphore);
+	int MPWaitOnSemaphore (MPSemaphoreID semaphore, int timeout);
+	int MPCreateCriticalRegion (MPCriticalRegionID* criticalRegion);
+	int MPDeleteCriticalRegion (MPCriticalRegionID criticalRegion);
+	int MPEnterCriticalRegion (MPCriticalRegionID criticalRegion, int timeout);
+	int MPExitCriticalRegion (MPCriticalRegionID criticalRegion);
+	int MPCreateEvent (MPEventID* event);
+	int MPDeleteEvent (MPEventID event);
+	int MPSetEvent (MPEventID event, uint flags);
+	int MPWaitForEvent (MPEventID event, MPEventFlags* flags, int timeout);
+	int MPCreateNotification (MPNotificationID* notificationID);
+	int MPDeleteNotification (MPNotificationID notificationID);
+	int MPModifyNotification (MPNotificationID notificationID, MPOpaqueID anID, void* notifyParam1, void* notifyParam2, void* notifyParam3);
+	int MPModifyNotificationParameters (MPNotificationID notificationID, uint kind, void* notifyParam1, void* notifyParam2, void* notifyParam3);
+	int MPCauseNotification (MPNotificationID notificationID);
+	int MPDelayUntil (AbsoluteTime* expirationTime);
+	int MPCreateTimer (MPTimerID* timerID);
+	int MPDeleteTimer (MPTimerID timerID);
+	int MPSetTimerNotify (MPTimerID timerID, MPOpaqueID anID, void* notifyParam1, void* notifyParam2, void* notifyParam3);
+	int MPArmTimer (MPTimerID timerID, AbsoluteTime* expirationTime, uint options);
+	int MPCancelTimer (MPTimerID timerID, AbsoluteTime* timeRemaining);
+	LogicalAddress MPAllocateAligned (uint size, ubyte alignment, uint options);
+	LogicalAddress MPAllocate (uint size);
+	void MPFree (LogicalAddress object);
+	uint MPGetAllocatedBlockSize (LogicalAddress object);
+	void MPBlockCopy (LogicalAddress source, LogicalAddress destination, uint size);
+	void MPBlockClear (LogicalAddress address, uint size);
+	int MPSetExceptionHandler (MPTaskID task, MPQueueID exceptionQ);
+	int MPDisposeTaskException (MPTaskID task, uint action);
+	int MPExtractTaskState (MPTaskID task, uint kind, void* info);
+	int MPSetTaskState (MPTaskID task, uint kind, void* info);
+	int MPThrowException (MPTaskID task, uint kind);
+	int MPRegisterDebugger (MPQueueID queue, uint level);
+	int MPUnregisterDebugger (MPQueueID queue);
+	void* MPRemoteCall (MPRemoteProcedure remoteProc, void* parameter, ubyte context);
+	void* MPRemoteCallCFM (MPRemoteProcedure remoteProc, void* parameter, ubyte context);
+	ubyte _MPIsFullyInitialized ();
+	void _MPLibraryVersion (char** versionCString, UInt32* major, UInt32* minor, UInt32* release, UInt32* revision);
+	ubyte _MPLibraryIsCompatible (char* versionCString, uint major, uint minor, uint release, uint revision);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/MultiprocessingInfo.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,102 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.MultiprocessingInfo;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.Multiprocessing;
+
+
+enum
+{
+	kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16),
+	kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16),
+	kMPEventInfoVersion = 1L | (kOpaqueEventID << 16),
+	kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16),
+	kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16),
+	kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16)
+}
+
+struct MPQueueInfo
+{
+	uint version_;
+	MPProcessID processID;
+	uint queueName;
+	uint nWaiting;
+	MPTaskID waitingTaskID;
+	uint nMessages;
+	uint nReserved;
+	void* p1;
+	void* p2;
+	void* p3;
+}
+
+
+struct MPSemaphoreInfo
+{
+	uint version_;
+	MPProcessID processID;
+	uint semaphoreName;
+	uint nWaiting;
+	MPTaskID waitingTaskID;
+	uint maximum;
+	uint count;
+}
+
+
+struct MPEventInfo
+{
+	uint version_;
+	MPProcessID processID;
+	uint eventName;
+	uint nWaiting;
+	MPTaskID waitingTaskID;
+	uint events;
+}
+
+
+struct MPCriticalRegionInfo
+{
+	uint version_;
+	MPProcessID processID;
+	uint regionName;
+	uint nWaiting;
+	MPTaskID waitingTaskID;
+	MPTaskID owningTask;
+	uint count;
+}
+
+
+struct MPNotificationInfo
+{
+	uint version_;
+	MPProcessID processID;
+	uint notificationName;
+	MPQueueID queueID;
+	void* p1;
+	void* p2;
+	void* p3;
+	MPEventID eventID;
+	uint events;
+	MPSemaphoreID semaphoreID;
+}
+
+
+struct MPAddressSpaceInfo
+{
+	uint version_;
+	MPProcessID processID;
+	MPCoherenceID groupID;
+	uint nTasks;
+	UInt32* vsid;
+}
+
+extern (C)
+{
+	int MPGetNextCpuID (MPCoherenceID owningCoherenceID, MPCpuID* cpuID);
+	int MPGetNextTaskID (MPProcessID owningProcessID, MPTaskID* taskID);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/NumberFormatting.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,66 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.NumberFormatting;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.IntlResources;
+import dstep.coreservices.carboncore.MacTypes;
+
+alias NumFormatString[] NumFormatStringRec;
+alias short FormatStatus;
+alias byte FormatClass;
+alias byte FormatResultType;
+
+enum
+{
+	fVNumber = 0
+}
+
+enum
+{
+	fPositive = 0,
+	fNegative = 1,
+	fZero = 2
+}
+
+enum
+{
+	fFormatOK = 0,
+	fBestGuess = 1,
+	fOutOfSynch = 2,
+	fSpuriousChars = 3,
+	fMissingDelimiter = 4,
+	fExtraDecimal = 5,
+	fMissingLiteral = 6,
+	fExtraExp = 7,
+	fFormatOverflow = 8,
+	fFormStrIsNAN = 9,
+	fBadPartsTable = 10,
+	fExtraPercent = 11,
+	fExtraSeparator = 12,
+	fEmptyFormatString = 13
+}
+
+struct NumFormatString
+{
+	ubyte fLength;
+	ubyte fVersion;
+	char* data;
+}
+
+
+struct FVector
+{
+	short start;
+	short length;
+}
+
+extern (C)
+{
+	void numtostring (int theNum, char* theString);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/OSUtils.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,125 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.OSUtils;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.DateTimeUtils;
+import dstep.coreservices.carboncore.MacMemory;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.corefoundation.CFBase;
+import dstep.internal.Types;
+
+alias byte QTypes;
+alias QElem* QElemPtr;
+alias QHdr* QHdrPtr;
+alias void* SysPPtr;
+alias DeferredTaskProcPtr DeferredTaskUPP;
+alias DeferredTask* DeferredTaskPtr;
+
+extern (C)
+{
+	alias void function (int) DeferredTaskProcPtr;
+}
+
+enum
+{
+	sortsBefore = -1,
+	sortsEqual = 0,
+	sortsAfter = 1
+}
+
+enum
+{
+	dummyType = 0,
+	vType = 1,
+	ioQType = 2,
+	drvQType = 3,
+	evType = 4,
+	fsQType = 5,
+	sIQType = 6,
+	dtQType = 7,
+	nmType = 8
+}
+
+enum
+{
+	useFree = 0,
+	useATalk = 1,
+	useAsync = 2,
+	useExtClk = 3,
+	useMIDI = 4
+}
+
+enum
+{
+	false32b = 0,
+	true32b = 1
+}
+
+struct QElem
+{
+	QElem* qLink;
+	short qType;
+	short* qData;
+}
+
+
+struct QHdr
+{
+	short qFlags;
+	QElemPtr qHead;
+	QElemPtr qTail;
+}
+
+
+struct MachineLocation
+{
+	Fract latitude;
+	Fract longitude;
+	
+	union
+	{
+		version (BigEndian)
+			byte dlsDelta;
+		
+		c_long gmtDelta;
+		
+		struct
+		{
+			version (LittleEndian)
+				byte[3] pad;
+			
+			byte Delta;
+		}
+	}
+}
+
+struct DeferredTask
+{
+	short qLink;
+	short qType;
+	short dtFlags;
+	int dtAddr;
+	int dtParam;
+	c_long dtReserved;
+}
+
+extern (C)
+{
+	ubyte IsMetric ();
+	void Delay (c_ulong numTicks, c_ulong* finalTicks);
+	void Enqueue (QElemPtr qElement, QHdrPtr qHeader);
+	short Dequeue (QElemPtr qElement, QHdrPtr qHeader);
+	void ReadLocation (MachineLocation* loc);
+	uint TickCount ();
+	CFStringRef CSCopyUserName (ubyte useShortName);
+	CFStringRef CSCopyMachineName ();
+	DeferredTaskUPP NewDeferredTaskUPP (DeferredTaskProcPtr userRoutine);
+	void DisposeDeferredTaskUPP (DeferredTaskUPP userUPP);
+	void InvokeDeferredTaskUPP (int dtParam, DeferredTaskUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/PEFBinaryFormat.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,372 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.PEFBinaryFormat;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.internal.Types;
+import dstep.objc.bridge.TypeEncoding;
+
+alias ushort PEFRelocChunk;
+alias PEFExportedSymbolHashSlot XLibExportedSymbolHashSlot;
+alias PEFExportedSymbolKey XLibExportedSymbolKey;
+
+struct PEFContainerHeader
+{
+	uint tag1;
+	uint tag2;
+	uint architecture;
+	uint formatVersion;
+	uint dateTimeStamp;
+	uint oldDefVersion;
+	uint oldImpVersion;
+	uint currentVersion;
+	ushort sectionCount;
+	ushort instSectionCount;
+	uint reservedA;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kPEFTag1 = getOSType!("Joy!");
+		const __kPEFTag2 = getOSType!("peff");
+		const __kPEFVersion = getOSType!("x0000000");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kVLibTag2 = getOSType!("VLib");
+		const __kBLibTag2 = getOSType!("BLib");
+		const __kXLibVersion = getOSType!("x0000000");
+
+	}
+}
+
+enum
+{
+	kPEFTag1 = getOSType!("Joy!"),
+	kPEFTag2 = getOSType!("peff"),
+	kPEFVersion = 0x00000001
+}
+
+enum
+{
+	kPEFFirstSectionHeaderOffset = PEFContainerHeader.sizeof
+}
+
+enum
+{
+	kPEFCodeSection = 0,
+	kPEFUnpackedDataSection = 1,
+	kPEFPackedDataSection = 2,
+	kPEFConstantSection = 3,
+	kPEFExecDataSection = 6,
+	kPEFLoaderSection = 4,
+	kPEFDebugSection = 5,
+	kPEFExceptionSection = 7,
+	kPEFTracebackSection = 8
+}
+
+enum
+{
+	kPEFProcessShare = 1,
+	kPEFGlobalShare = 4,
+	kPEFProtectedShare = 5
+}
+
+enum
+{
+	kPEFPkDataZero = 0,
+	kPEFPkDataBlock = 1,
+	kPEFPkDataRepeat = 2,
+	kPEFPkDataRepeatBlock = 3,
+	kPEFPkDataRepeatZero = 4
+}
+
+enum
+{
+	kPEFPkDataOpcodeShift = 5,
+	kPEFPkDataCount5Mask = 0x1F,
+	kPEFPkDataMaxCount5 = 31,
+	kPEFPkDataVCountShift = 7,
+	kPEFPkDataVCountMask = 0x7F,
+	kPEFPkDataVCountEndMask = 0x80
+}
+
+enum
+{
+	kPEFWeakImportLibMask = 0x40,
+	kPEFInitLibBeforeMask = 0x80
+}
+
+enum
+{
+	kPEFImpSymClassShift = 24,
+	kPEFImpSymNameOffsetMask = 0x00FFFFFF,
+	kPEFImpSymMaxNameOffset = 0x00FFFFFF
+}
+
+enum
+{
+	kPEFCodeSymbol = 0x00,
+	kPEFDataSymbol = 0x01,
+	kPEFTVectorSymbol = 0x02,
+	kPEFTOCSymbol = 0x03,
+	kPEFGlueSymbol = 0x04,
+	kPEFUndefinedSymbol = 0x0F,
+	kPEFWeakImportSymMask = 0x80
+}
+
+enum
+{
+	kPEFHashSlotSymCountShift = 18,
+	kPEFHashSlotFirstKeyMask = 0x0003FFFF,
+	kPEFHashSlotMaxSymbolCount = 0x00003FFF,
+	kPEFHashSlotMaxKeyIndex = 0x0003FFFF
+}
+
+enum
+{
+	kPEFHashLengthShift = 16,
+	kPEFHashValueMask = 0x0000FFFF,
+	kPEFHashMaxLength = 0x0000FFFF
+}
+
+enum
+{
+	kPEFExpSymClassShift = 24,
+	kPEFExpSymNameOffsetMask = 0x00FFFFFF,
+	kPEFExpSymMaxNameOffset = 0x00FFFFFF
+}
+
+enum
+{
+	kPEFAbsoluteExport = -2,
+	kPEFReexportedImport = -3
+}
+
+enum
+{
+	kPEFRelocBasicOpcodeRange = 128
+}
+
+enum
+{
+	kPEFRelocBySectDWithSkip = 0x00,
+	kPEFRelocBySectC = 0x20,
+	kPEFRelocBySectD = 0x21,
+	kPEFRelocTVector12 = 0x22,
+	kPEFRelocTVector8 = 0x23,
+	kPEFRelocVTable8 = 0x24,
+	kPEFRelocImportRun = 0x25,
+	kPEFRelocSmByImport = 0x30,
+	kPEFRelocSmSetSectC = 0x31,
+	kPEFRelocSmSetSectD = 0x32,
+	kPEFRelocSmBySection = 0x33,
+	kPEFRelocIncrPosition = 0x40,
+	kPEFRelocSmRepeat = 0x48,
+	kPEFRelocSetPosition = 0x50,
+	kPEFRelocLgByImport = 0x52,
+	kPEFRelocLgRepeat = 0x58,
+	kPEFRelocLgSetOrBySection = 0x5A,
+	kPEFRelocUndefinedOpcode = 0xFF
+}
+
+enum
+{
+	kPEFRelocLgBySectionSubopcode = 0x00,
+	kPEFRelocLgSetSectCSubopcode = 0x01,
+	kPEFRelocLgSetSectDSubopcode = 0x02
+}
+
+enum
+{
+	kPEFRelocWithSkipMaxSkipCount = 255,
+	kPEFRelocWithSkipMaxRelocCount = 63
+}
+
+enum
+{
+	kPEFRelocRunMaxRunLength = 512
+}
+
+enum
+{
+	kPEFRelocSmIndexMaxIndex = 511
+}
+
+enum
+{
+	kPEFRelocIncrPositionMaxOffset = 4096
+}
+
+enum
+{
+	kPEFRelocSmRepeatMaxChunkCount = 16,
+	kPEFRelocSmRepeatMaxRepeatCount = 256
+}
+
+enum
+{
+	kPEFRelocSetPosMaxOffset = 0x03FFFFFF
+}
+
+enum
+{
+	kPEFRelocLgByImportMaxIndex = 0x03FFFFFF
+}
+
+enum
+{
+	kPEFRelocLgRepeatMaxChunkCount = 16,
+	kPEFRelocLgRepeatMaxRepeatCount = 0x003FFFFF
+}
+
+enum
+{
+	kPEFRelocLgSetOrBySectionMaxIndex = 0x003FFFFF
+}
+
+enum
+{
+	kXLibTag1 = cast(c_long)0xF04D6163,
+	kVLibTag2 = getOSType!("VLib"),
+	kBLibTag2 = getOSType!("BLib"),
+	kXLibVersion = 0x00000001
+}
+
+struct PEFSectionHeader
+{
+	int nameOffset;
+	uint defaultAddress;
+	uint totalLength;
+	uint unpackedLength;
+	uint containerLength;
+	uint containerOffset;
+	ubyte sectionKind;
+	ubyte shareKind;
+	ubyte alignment;
+	ubyte reservedA;
+}
+
+
+struct PEFLoaderInfoHeader
+{
+	int mainSection;
+	uint mainOffset;
+	int initSection;
+	uint initOffset;
+	int termSection;
+	uint termOffset;
+	uint importedLibraryCount;
+	uint totalImportedSymbolCount;
+	uint relocSectionCount;
+	uint relocInstrOffset;
+	uint loaderStringsOffset;
+	uint exportHashOffset;
+	uint exportHashTablePower;
+	uint exportedSymbolCount;
+}
+
+
+struct PEFImportedLibrary
+{
+	uint nameOffset;
+	uint oldImpVersion;
+	uint currentVersion;
+	uint importedSymbolCount;
+	uint firstImportedSymbol;
+	ubyte options;
+	ubyte reservedA;
+	ushort reservedB;
+}
+
+
+struct PEFImportedSymbol
+{
+	uint classAndName;
+}
+
+
+struct PEFExportedSymbolHashSlot
+{
+	uint countAndStart;
+}
+
+
+struct PEFSplitHashWord
+{
+	ushort nameLength;
+	ushort hashValue;
+}
+
+
+struct PEFExportedSymbolKey
+{
+	 union
+	 {
+		 uint fullHashWord;
+		 PEFSplitHashWord splitHashWord;
+	 }
+}
+
+struct PEFExportedSymbol
+{
+	uint classAndName;
+	short symbolValue;
+	SInt16 sectionIndex;
+}
+
+
+struct PEFLoaderRelocationHeader
+{
+	ushort sectionIndex;
+	uint reservedA;
+	uint relocCount;
+	UInt32 firstRelocOffset;
+}
+
+
+struct XLibContainerHeader
+{
+	uint tag1;
+	uint tag2;
+	uint currentFormat;
+	uint containerStringsOffset;
+	uint exportHashOffset;
+	uint exportKeyOffset;
+	uint exportSymbolOffset;
+	uint exportNamesOffset;
+	uint exportHashTablePower;
+	uint exportedSymbolCount;
+	uint fragNameOffset;
+	uint fragNameLength;
+	uint dylibPathOffset;
+	uint dylibPathLength;
+	uint cpuFamily;
+	uint cpuModel;
+	uint dateTimeStamp;
+	uint currentVersion;
+	uint oldDefVersion;
+	UInt32 oldImpVersion;
+}
+
+
+struct XLibExportedSymbol
+{
+	uint classAndName;
+	UInt32 bpOffset;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/PLStringFuncs.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,27 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.PLStringFuncs;
+
+//import dstep.AvailabilityMacros;
+//import dstep.carboncore.MacTypes;
+
+extern (C)
+{
+	short PLstrcmp (char* str1, char* str2);
+	short PLstrncmp (char* str1, char* str2, short num);
+	char* PLstrcpy (char* dest, char* source);
+	char* PLstrncpy (char* dest, char* source, short num);
+	char* PLstrcat (char* str, char* append);
+	char* PLstrncat (char* str1, char* append, short num);
+	char* PLstrchr (char* str1, short ch1);
+	char* PLstrrchr (char* str1, short ch1);
+	char* PLstrpbrk (char* str1, char* charSet);
+	short PLstrspn (char* str1, char* charSet);
+	char* PLstrstr (char* str1, char* searchStr);
+	short PLstrlen (char* str);
+	short PLpos (char* str1, char* searchStr);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Resources.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,135 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Resources;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+
+alias short ResID;
+alias short ResAttributes;
+alias short ResFileAttributes;
+alias short ResourceCount;
+alias short ResourceIndex;
+alias short ResFileRefNum;
+alias ResErrProcPtr ResErrUPP;
+alias short RsrcChainLocation;
+
+extern (C)
+{
+	alias void function (short) ResErrProcPtr;
+	alias short function (Handle, ubyte) ResourceEndianFilterPtr;
+}
+
+enum
+{
+	resSysRefBit = 7,
+	resSysHeapBit = 6,
+	resPurgeableBit = 5,
+	resLockedBit = 4,
+	resProtectedBit = 3,
+	resPreloadBit = 2,
+	resChangedBit = 1
+}
+
+enum
+{
+	resSysHeap = 64,
+	resPurgeable = 32,
+	resLocked = 16,
+	resProtected = 8,
+	resPreload = 4,
+	resChanged = 2
+}
+
+enum
+{
+	mapReadOnlyBit = 7,
+	mapCompactBit = 6,
+	mapChangedBit = 5
+}
+
+enum
+{
+	mapReadOnly = 128,
+	mapCompact = 64,
+	mapChanged = 32
+}
+
+enum
+{
+	kResFileNotOpened = -1,
+	kSystemResFile = 0
+}
+
+enum
+{
+	kRsrcChainBelowSystemMap = 0,
+	kRsrcChainBelowApplicationMap = 1,
+	kRsrcChainAboveApplicationMap = 2,
+	kRsrcChainAboveAllMaps = 4
+}
+
+extern (C)
+{
+	ResErrUPP NewResErrUPP (ResErrProcPtr userRoutine);
+	void DisposeResErrUPP (ResErrUPP userUPP);
+	void InvokeResErrUPP (short thErr, ResErrUPP userUPP);
+	void CloseResFile (short refNum);
+	short ResError ();
+	short CurResFile ();
+	short HomeResFile (Handle theResource);
+	void UseResFile (short refNum);
+	short CountTypes ();
+	short Count1Types ();
+	void GetIndType (ResType* theType, short itemIndex);
+	void Get1IndType (ResType* theType, short itemIndex);
+	void SetResLoad (ubyte load);
+	short CountResources (uint theType);
+	short Count1Resources (uint theType);
+	Handle GetIndResource (uint theType, short itemIndex);
+	Handle Get1IndResource (uint theType, short itemIndex);
+	Handle GetResource (uint theType, short theID);
+	Handle Get1Resource (uint theType, short theID);
+	Handle GetNamedResource (uint theType, char* name);
+	Handle Get1NamedResource (uint theType, char* name);
+	void LoadResource (Handle theResource);
+	void ReleaseResource (Handle theResource);
+	void DetachResource (Handle theResource);
+	short UniqueID (uint theType);
+	short Unique1ID (uint theType);
+	short GetResAttrs (Handle theResource);
+	void GetResInfo (Handle theResource, ResID* theID, ResType* theType, ubyte[256] name);
+	void SetResInfo (Handle theResource, short theID, char* name);
+	void AddResource (Handle theData, uint theType, short theID, char* name);
+	int GetResourceSizeOnDisk (Handle theResource);
+	int GetMaxResourceSize (Handle theResource);
+	void SetResAttrs (Handle theResource, short attrs);
+	void ChangedResource (Handle theResource);
+	void RemoveResource (Handle theResource);
+	void UpdateResFile (short refNum);
+	void WriteResource (Handle theResource);
+	void SetResPurge (ubyte install);
+	short GetResFileAttrs (short refNum);
+	void SetResFileAttrs (short refNum, short attrs);
+	void ReadPartialResource (Handle theResource, int offset, void* buffer, int count);
+	void WritePartialResource (Handle theResource, int offset, void* buffer, int count);
+	void SetResourceSize (Handle theResource, int newSize);
+	Handle GetNextFOND (Handle fondHandle);
+	short InsertResourceFile (short refNum, short where);
+	short DetachResourceFile (short refNum);
+	short GetTopResourceFile (ResFileRefNum* refNum);
+	short GetNextResourceFile (short curRefNum, ResFileRefNum* nextRefNum);
+	short FSOpenResFile (FSRef* ref_, byte permission);
+	void FSCreateResFile (FSRef* parentRef, uint nameLength, wchar* name, uint whichInfo, FSCatalogInfo* catalogInfo, FSRef* newRef, FSSpecPtr newSpec);
+	ubyte FSResourceFileAlreadyOpen (FSRef* resourceFileRef, char* inChain, ResFileRefNum* refNum);
+	short FSOpenOrphanResFile (FSRef* ref_, byte permission, ResFileRefNum* refNum);
+	short FSCreateResourceFile (FSRef* parentRef, uint nameLength, wchar* name, uint whichInfo, FSCatalogInfo* catalogInfo, uint forkNameLength, wchar* forkName, FSRef* newRef, FSSpecPtr newSpec);
+	short FSCreateResourceFork (FSRef* ref_, uint forkNameLength, wchar* forkName, uint flags);
+	short FSOpenResourceFile (FSRef* ref_, uint forkNameLength, wchar* forkName, byte permissions, ResFileRefNum* refNum);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Script.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,846 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Script;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.IntlResources;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.internal.Types;
+
+alias byte TokenResults;
+alias short ScriptTokenType;
+alias TokenRec* TokenRecPtr;
+alias TokenBlock* TokenBlockPtr;
+
+enum
+{
+	smSystemScript = -1,
+	smCurrentScript = -2,
+	smAllScripts = -3
+}
+
+enum
+{
+	smRoman = 0,
+	smJapanese = 1,
+	smTradChinese = 2,
+	smKorean = 3,
+	smArabic = 4,
+	smHebrew = 5,
+	smGreek = 6,
+	smCyrillic = 7,
+	smRSymbol = 8,
+	smDevanagari = 9,
+	smGurmukhi = 10,
+	smGujarati = 11,
+	smOriya = 12,
+	smBengali = 13,
+	smTamil = 14,
+	smTelugu = 15,
+	smKannada = 16,
+	smMalayalam = 17,
+	smSinhalese = 18,
+	smBurmese = 19,
+	smKhmer = 20,
+	smThai = 21,
+	smLao = 22,
+	smGeorgian = 23,
+	smArmenian = 24,
+	smSimpChinese = 25,
+	smTibetan = 26,
+	smMongolian = 27,
+	smEthiopic = 28,
+	smGeez = 28,
+	smCentralEuroRoman = 29,
+	smVietnamese = 30,
+	smExtArabic = 31,
+	smUninterp = 32
+}
+
+enum
+{
+	smUnicodeScript = 0x7E
+}
+
+enum
+{
+	smChinese = 2,
+	smRussian = 7,
+	smLaotian = 22,
+	smAmharic = 28,
+	smSlavic = 29,
+	smEastEurRoman = 29,
+	smSindhi = 31,
+	smKlingon = 32
+}
+
+enum
+{
+	langEnglish = 0,
+	langFrench = 1,
+	langGerman = 2,
+	langItalian = 3,
+	langDutch = 4,
+	langSwedish = 5,
+	langSpanish = 6,
+	langDanish = 7,
+	langPortuguese = 8,
+	langNorwegian = 9,
+	langHebrew = 10,
+	langJapanese = 11,
+	langArabic = 12,
+	langFinnish = 13,
+	langGreek = 14,
+	langIcelandic = 15,
+	langMaltese = 16,
+	langTurkish = 17,
+	langCroatian = 18,
+	langTradChinese = 19,
+	langUrdu = 20,
+	langHindi = 21,
+	langThai = 22,
+	langKorean = 23
+}
+
+enum
+{
+	langLithuanian = 24,
+	langPolish = 25,
+	langHungarian = 26,
+	langEstonian = 27,
+	langLatvian = 28,
+	langSami = 29,
+	langFaroese = 30,
+	langFarsi = 31,
+	langPersian = 31,
+	langRussian = 32,
+	langSimpChinese = 33,
+	langFlemish = 34,
+	langIrishGaelic = 35,
+	langAlbanian = 36,
+	langRomanian = 37,
+	langCzech = 38,
+	langSlovak = 39,
+	langSlovenian = 40,
+	langYiddish = 41,
+	langSerbian = 42,
+	langMacedonian = 43,
+	langBulgarian = 44,
+	langUkrainian = 45,
+	langByelorussian = 46,
+	langBelorussian = 46
+}
+
+enum
+{
+	langUzbek = 47,
+	langKazakh = 48,
+	langAzerbaijani = 49,
+	langAzerbaijanAr = 50,
+	langArmenian = 51,
+	langGeorgian = 52,
+	langMoldavian = 53,
+	langKirghiz = 54,
+	langTajiki = 55,
+	langTurkmen = 56,
+	langMongolian = 57,
+	langMongolianCyr = 58,
+	langPashto = 59,
+	langKurdish = 60,
+	langKashmiri = 61,
+	langSindhi = 62,
+	langTibetan = 63,
+	langNepali = 64,
+	langSanskrit = 65,
+	langMarathi = 66,
+	langBengali = 67,
+	langAssamese = 68,
+	langGujarati = 69,
+	langPunjabi = 70
+}
+
+enum
+{
+	langOriya = 71,
+	langMalayalam = 72,
+	langKannada = 73,
+	langTamil = 74,
+	langTelugu = 75,
+	langSinhalese = 76,
+	langBurmese = 77,
+	langKhmer = 78,
+	langLao = 79,
+	langVietnamese = 80,
+	langIndonesian = 81,
+	langTagalog = 82,
+	langMalayRoman = 83,
+	langMalayArabic = 84,
+	langAmharic = 85,
+	langTigrinya = 86,
+	langOromo = 87,
+	langSomali = 88,
+	langSwahili = 89,
+	langKinyarwanda = 90,
+	langRuanda = 90,
+	langRundi = 91,
+	langNyanja = 92,
+	langChewa = 92,
+	langMalagasy = 93,
+	langEsperanto = 94
+}
+
+enum
+{
+	langWelsh = 128,
+	langBasque = 129,
+	langCatalan = 130,
+	langLatin = 131,
+	langQuechua = 132,
+	langGuarani = 133,
+	langAymara = 134,
+	langTatar = 135,
+	langUighur = 136,
+	langDzongkha = 137,
+	langJavaneseRom = 138,
+	langSundaneseRom = 139,
+	langGalician = 140,
+	langAfrikaans = 141
+}
+
+enum
+{
+	langBreton = 142,
+	langInuktitut = 143,
+	langScottishGaelic = 144,
+	langManxGaelic = 145,
+	langIrishGaelicScript = 146,
+	langTongan = 147,
+	langGreekAncient = 148,
+	langGreenlandic = 149,
+	langAzerbaijanRoman = 150,
+	langNynorsk = 151
+}
+
+enum
+{
+	langUnspecified = 32767
+}
+
+enum
+{
+	langPortugese = 8,
+	langMalta = 16,
+	langYugoslavian = 18,
+	langChinese = 19,
+	langLettish = 28,
+	langLapponian = 29,
+	langLappish = 29,
+	langSaamisk = 29,
+	langFaeroese = 30,
+	langIrish = 35,
+	langGalla = 87,
+	langAfricaans = 141,
+	langGreekPoly = 148
+}
+
+enum
+{
+	verUS = 0,
+	verFrance = 1,
+	verBritain = 2,
+	verGermany = 3,
+	verItaly = 4,
+	verNetherlands = 5,
+	verFlemish = 6,
+	verSweden = 7,
+	verSpain = 8,
+	verDenmark = 9,
+	verPortugal = 10,
+	verFrCanada = 11,
+	verNorway = 12,
+	verIsrael = 13,
+	verJapan = 14,
+	verAustralia = 15,
+	verArabic = 16,
+	verFinland = 17,
+	verFrSwiss = 18,
+	verGrSwiss = 19,
+	verGreece = 20,
+	verIceland = 21,
+	verMalta = 22,
+	verCyprus = 23,
+	verTurkey = 24,
+	verYugoCroatian = 25
+}
+
+enum
+{
+	verNetherlandsComma = 26,
+	verFlemishPoint = 27,
+	verCanadaComma = 28,
+	verCanadaPoint = 29,
+	vervariantPortugal = 30,
+	vervariantNorway = 31,
+	vervariantDenmark = 32
+}
+
+enum
+{
+	verIndiaHindi = 33,
+	verPakistanUrdu = 34,
+	verTurkishModified = 35,
+	verItalianSwiss = 36,
+	verInternational = 37,
+	verRomania = 39,
+	verGreekAncient = 40,
+	verLithuania = 41,
+	verPoland = 42,
+	verHungary = 43,
+	verEstonia = 44,
+	verLatvia = 45,
+	verSami = 46,
+	verFaroeIsl = 47,
+	verIran = 48,
+	verRussia = 49,
+	verIreland = 50,
+	verKorea = 51,
+	verChina = 52,
+	verTaiwan = 53,
+	verThailand = 54,
+	verScriptGeneric = 55,
+	verCzech = 56,
+	verSlovak = 57,
+	verEastAsiaGeneric = 58,
+	verMagyar = 59,
+	verBengali = 60,
+	verBelarus = 61
+}
+
+enum
+{
+	verUkraine = 62,
+	verGreeceAlt = 64,
+	verSerbian = 65,
+	verSlovenian = 66,
+	verMacedonian = 67,
+	verCroatia = 68,
+	verGermanReformed = 70,
+	verBrazil = 71,
+	verBulgaria = 72,
+	verCatalonia = 73,
+	verMultilingual = 74,
+	verScottishGaelic = 75,
+	verManxGaelic = 76,
+	verBreton = 77,
+	verNunavut = 78,
+	verWelsh = 79,
+	verIrishGaelicScript = 81,
+	verEngCanada = 82,
+	verBhutan = 83,
+	verArmenian = 84,
+	verGeorgian = 85,
+	verSpLatinAmerica = 86,
+	verTonga = 88,
+	verFrenchUniversal = 91,
+	verAustria = 92,
+	verGujarati = 94,
+	verPunjabi = 95,
+	verIndiaUrdu = 96,
+	verVietnam = 97
+}
+
+enum
+{
+	verFrBelgium = 98,
+	verUzbek = 99,
+	verSingapore = 100,
+	verNynorsk = 101,
+	verAfrikaans = 102,
+	verEsperanto = 103,
+	verMarathi = 104,
+	verTibetan = 105,
+	verNepal = 106,
+	verGreenland = 107,
+	verIrelandEnglish = 108
+}
+
+enum
+{
+	verFrBelgiumLux = 6,
+	verBelgiumLux = 6,
+	verArabia = 16,
+	verYugoslavia = 25,
+	verBelgiumLuxPoint = 27,
+	verIndia = 33,
+	verPakistan = 34,
+	verRumania = 39,
+	verGreecePoly = 40,
+	verLapland = 46,
+	verFaeroeIsl = 47,
+	verGenericFE = 58,
+	verFarEastGeneric = 58,
+	verByeloRussian = 61,
+	verUkrania = 62,
+	verAlternateGr = 64,
+	verSerbia = 65,
+	verSlovenia = 66,
+	verMacedonia = 67,
+	verBrittany = 77,
+	verWales = 79,
+	verArmenia = 84,
+	verGeorgia = 85,
+	verAustriaGerman = 92,
+	verTibet = 105
+}
+
+enum
+{
+	minCountry = verUS,
+	maxCountry = verIrelandEnglish
+}
+
+enum
+{
+	calGregorian = 0,
+	calArabicCivil = 1,
+	calArabicLunar = 2,
+	calJapanese = 3,
+	calJewish = 4,
+	calCoptic = 5,
+	calPersian = 6
+}
+
+enum
+{
+	intWestern = 0,
+	intArabic = 1,
+	intRoman = 2,
+	intJapanese = 3,
+	intEuropean = 4,
+	intOutputMask = 0x8000
+}
+
+enum
+{
+	smSingleByte = 0,
+	smFirstByte = -1,
+	smLastByte = 1,
+	smMiddleByte = 2
+}
+
+enum
+{
+	smcTypeMask = 0x000F,
+	smcReserved = 0x00F0,
+	smcClassMask = 0x0F00,
+	smcOrientationMask = 0x1000,
+	smcRightMask = 0x2000,
+	smcUpperMask = 0x4000,
+	smcDoubleMask = 0x8000
+}
+
+enum
+{
+	smCharPunct = 0x0000,
+	smCharAscii = 0x0001,
+	smCharEuro = 0x0007,
+	smCharExtAscii = 0x0007,
+	smCharKatakana = 0x0002,
+	smCharHiragana = 0x0003,
+	smCharIdeographic = 0x0004,
+	smCharTwoByteGreek = 0x0005,
+	smCharTwoByteRussian = 0x0006,
+	smCharBidirect = 0x0008,
+	smCharContextualLR = 0x0009,
+	smCharNonContextualLR = 0x000A,
+	smCharHangul = 0x000C,
+	smCharJamo = 0x000D,
+	smCharBopomofo = 0x000E,
+	smCharGanaKana = 0x000F,
+	smCharFISKana = 0x0002,
+	smCharFISGana = 0x0003,
+	smCharFISIdeo = 0x0004
+}
+
+enum
+{
+	smCharFISGreek = 0x0005,
+	smCharFISRussian = 0x0006,
+	smPunctNormal = 0x0000,
+	smPunctNumber = 0x0100,
+	smPunctSymbol = 0x0200,
+	smPunctBlank = 0x0300,
+	smPunctRepeat = 0x0400,
+	smPunctGraphic = 0x0500,
+	smKanaSmall = 0x0100,
+	smKanaHardOK = 0x0200,
+	smKanaSoftOK = 0x0300,
+	smIdeographicLevel1 = 0x0000,
+	smIdeographicLevel2 = 0x0100,
+	smIdeographicUser = 0x0200,
+	smFISClassLvl1 = 0x0000,
+	smFISClassLvl2 = 0x0100,
+	smFISClassUser = 0x0200,
+	smJamoJaeum = 0x0000,
+	smJamoBogJaeum = 0x0100,
+	smJamoMoeum = 0x0200,
+	smJamoBogMoeum = 0x0300
+}
+
+enum
+{
+	smCharHorizontal = 0x0000,
+	smCharVertical = 0x1000,
+	smCharLeft = 0x0000,
+	smCharRight = 0x2000,
+	smCharLower = 0x0000,
+	smCharUpper = 0x4000,
+	smChar1byte = 0x0000,
+	smChar2byte = 0x8000
+}
+
+enum
+{
+	smTransAscii = 0,
+	smTransNative = 1,
+	smTransCase = 0xFE,
+	smTransSystem = 0xFF,
+	smTransAscii1 = 2,
+	smTransAscii2 = 3,
+	smTransKana1 = 4,
+	smTransKana2 = 5
+}
+
+enum
+{
+	smTransGana2 = 7,
+	smTransHangul2 = 8,
+	smTransJamo2 = 9,
+	smTransBopomofo2 = 10,
+	smTransLower = 0x4000,
+	smTransUpper = 0x8000,
+	smTransRuleBaseFormat = 1,
+	smTransHangulFormat = 2,
+	smTransPreDoubleByting = 1,
+	smTransPreLowerCasing = 2
+}
+
+enum
+{
+	smMaskAll = cast(c_long)0xFFFFFFFF,
+	smMaskAscii = 0x00000001,
+	smMaskNative = 0x00000002,
+	smMaskAscii1 = 0x00000004,
+	smMaskAscii2 = 0x00000008,
+	smMaskKana1 = 0x00000010,
+	smMaskKana2 = 0x00000020,
+	smMaskGana2 = 0x00000080,
+	smMaskHangul2 = 0x00000100,
+	smMaskJamo2 = 0x00000200,
+	smMaskBopomofo2 = 0x00000400
+}
+
+enum
+{
+	iuSystemScript = -1,
+	iuCurrentScript = -2
+}
+
+enum
+{
+	smKeyNextScript = -1,
+	smKeySysScript = -2,
+	smKeySwapScript = -3,
+	smKeyNextKybd = -4,
+	smKeySwapKybd = -5,
+	smKeyDisableKybds = -6,
+	smKeyEnableKybds = -7,
+	smKeyToggleInline = -8,
+	smKeyToggleDirection = -9,
+	smKeyNextInputMethod = -10,
+	smKeySwapInputMethod = -11,
+	smKeyDisableKybdSwitch = -12,
+	smKeySetDirLeftRight = -15,
+	smKeySetDirRightLeft = -16,
+	smKeyRoman = -17
+}
+
+enum
+{
+	smKeyForceKeyScriptBit = 7,
+	smKeyForceKeyScriptMask = 1 << smKeyForceKeyScriptBit
+}
+
+enum
+{
+	romanSysFond = 0x3FFF,
+	romanAppFond = 3,
+	romanFlags = 0x0007,
+	smFondStart = 0x4000,
+	smFondEnd = 0xC000,
+	smUprHalfCharSet = 0x80
+}
+
+enum
+{
+	diaeresisUprY = 0xD9,
+	fraction = 0xDA,
+	intlCurrency = 0xDB,
+	leftSingGuillemet = 0xDC,
+	rightSingGuillemet = 0xDD,
+	fiLigature = 0xDE,
+	flLigature = 0xDF,
+	dblDagger = 0xE0,
+	centeredDot = 0xE1,
+	baseSingQuote = 0xE2,
+	baseDblQuote = 0xE3,
+	perThousand = 0xE4,
+	circumflexUprA = 0xE5,
+	circumflexUprE = 0xE6,
+	acuteUprA = 0xE7,
+	diaeresisUprE = 0xE8,
+	graveUprE = 0xE9,
+	acuteUprI = 0xEA,
+	circumflexUprI = 0xEB,
+	diaeresisUprI = 0xEC,
+	graveUprI = 0xED,
+	acuteUprO = 0xEE,
+	circumflexUprO = 0xEF,
+	appleLogo = 0xF0,
+	graveUprO = 0xF1,
+	acuteUprU = 0xF2,
+	circumflexUprU = 0xF3,
+	graveUprU = 0xF4,
+	dotlessLwrI = 0xF5,
+	circumflex = 0xF6,
+	tilde = 0xF7,
+	macron = 0xF8,
+	breveMark = 0xF9,
+	overDot = 0xFA,
+	ringMark = 0xFB,
+	cedilla = 0xFC,
+	doubleAcute = 0xFD,
+	ogonek = 0xFE,
+	hachek = 0xFF
+}
+
+enum
+{
+	tokenIntl = 4,
+	tokenEmpty = -1
+}
+
+enum
+{
+	tokenUnknown = 0,
+	tokenWhite = 1,
+	tokenLeftLit = 2,
+	tokenRightLit = 3,
+	tokenAlpha = 4,
+	tokenNumeric = 5,
+	tokenNewLine = 6,
+	tokenLeftComment = 7,
+	tokenRightComment = 8,
+	tokenLiteral = 9,
+	tokenEscape = 10,
+	tokenAltNum = 11,
+	tokenRealNum = 12,
+	tokenAltReal = 13,
+	tokenReserve1 = 14,
+	tokenReserve2 = 15,
+	tokenLeftParen = 16,
+	tokenRightParen = 17,
+	tokenLeftBracket = 18,
+	tokenRightBracket = 19
+}
+
+enum
+{
+	tokenLeftCurly = 20,
+	tokenRightCurly = 21,
+	tokenLeftEnclose = 22,
+	tokenRightEnclose = 23,
+	tokenPlus = 24,
+	tokenMinus = 25,
+	tokenAsterisk = 26,
+	tokenDivide = 27,
+	tokenPlusMinus = 28,
+	tokenSlash = 29,
+	tokenBackSlash = 30,
+	tokenLess = 31,
+	tokenGreat = 32,
+	tokenEqual = 33,
+	tokenLessEqual2 = 34,
+	tokenLessEqual1 = 35,
+	tokenGreatEqual2 = 36,
+	tokenGreatEqual1 = 37,
+	token2Equal = 38,
+	tokenColonEqual = 39
+}
+
+enum
+{
+	tokenNotEqual = 40,
+	tokenLessGreat = 41,
+	tokenExclamEqual = 42,
+	tokenExclam = 43,
+	tokenTilde = 44,
+	tokenComma = 45,
+	tokenPeriod = 46,
+	tokenLeft2Quote = 47,
+	tokenRight2Quote = 48,
+	tokenLeft1Quote = 49,
+	tokenRight1Quote = 50,
+	token2Quote = 51,
+	token1Quote = 52,
+	tokenSemicolon = 53,
+	tokenPercent = 54,
+	tokenCaret = 55,
+	tokenUnderline = 56,
+	tokenAmpersand = 57,
+	tokenAtSign = 58,
+	tokenBar = 59
+}
+
+enum
+{
+	tokenQuestion = 60,
+	tokenPi = 61,
+	tokenRoot = 62,
+	tokenSigma = 63,
+	tokenIntegral = 64,
+	tokenMicro = 65,
+	tokenCapPi = 66,
+	tokenInfinity = 67,
+	tokenColon = 68,
+	tokenHash = 69,
+	tokenDollar = 70,
+	tokenNoBreakSpace = 71,
+	tokenFraction = 72,
+	tokenIntlCurrency = 73,
+	tokenLeftSingGuillemet = 74,
+	tokenRightSingGuillemet = 75,
+	tokenPerThousand = 76,
+	tokenEllipsis = 77,
+	tokenCenterDot = 78,
+	tokenNil = 127
+}
+
+enum
+{
+	delimPad = -2,
+	tokenTilda = 44,
+	tokenCarat = 55
+}
+
+enum
+{
+	smWordSelectTable = 0,
+	smWordWrapTable = 1,
+	smNumberPartsTable = 2,
+	smUnTokenTable = 3,
+	smWhiteSpaceList = 4,
+	iuWordSelectTable = 0,
+	iuWordWrapTable = 1,
+	iuNumberPartsTable = 2,
+	iuUnTokenTable = 3,
+	iuWhiteSpaceList = 4
+}
+
+enum
+{
+	tokenOK = 0,
+	tokenOverflow = 1,
+	stringOverflow = 2,
+	badDelim = 3,
+	badEnding = 4,
+	crash = 5
+}
+
+enum
+{
+	smNotInstalled = 0,
+	smBadVerb = -1,
+	smBadScript = -2
+}
+
+enum
+{
+	smfShowIcon = 31,
+	smfDualCaret = 30,
+	smfNameTagEnab = 29,
+	smfUseAssocFontInfo = 28,
+	smfDisableKeyScriptSync = 27
+}
+
+enum
+{
+	smfDisableKeyScriptSyncMask = 1L << smfDisableKeyScriptSync
+}
+
+enum
+{
+	smSysScript = 18,
+	smKeyScript = 22,
+	smKCHRCache = 38,
+	smRegionCode = 40
+}
+
+enum
+{
+	smsfIntellCP = 0,
+	smsfSingByte = 1,
+	smsfNatCase = 2,
+	smsfContext = 3,
+	smsfNoForceFont = 4,
+	smsfB0Digits = 5,
+	smsfAutoInit = 6,
+	smsfUnivExt = 7,
+	smsfSynchUnstyledTE = 8,
+	smsfForms = 13,
+	smsfLigatures = 14,
+	smsfReverse = 15
+}
+
+struct TokenRec
+{
+	short theToken;
+	char* position;
+	int length;
+	char* stringPosition;
+}
+
+
+struct TokenBlock
+{
+	char* source;
+	int sourceLength;
+	char* tokenList;
+	int tokenLength;
+	int tokenCount;
+	char* stringList;
+	int stringLength;
+	int stringCount;
+	ubyte doString;
+	ubyte doAppend;
+	ubyte doAlphanumeric;
+	ubyte doNest;
+	ScriptTokenType* leftDelims;
+	ScriptTokenType* rightDelims;
+	ScriptTokenType* leftComment;
+	ScriptTokenType* rightComment;
+	short escapeCode;
+	short decimalCode;
+	Handle itlResource;
+	long* reserved;
+}
+
+extern (C)
+{
+	int GetScriptManagerVariable (short selector);
+	short SetScriptManagerVariable (short selector, int param);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/StringCompare.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,50 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.StringCompare;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.Script;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.internal.Version;
+
+enum
+{
+	systemCurLang = -2,
+	systemDefLang = -3,
+	currentCurLang = -4,
+	currentDefLang = -5,
+	scriptCurLang = -6,
+	scriptDefLang = -7
+}
+
+enum
+{
+	iuSystemCurLang = systemCurLang,
+	iuSystemDefLang = systemDefLang,
+	iuCurrentCurLang = currentCurLang,
+	iuCurrentDefLang = currentDefLang,
+	iuScriptCurLang = scriptCurLang,
+	iuScriptDefLang = scriptDefLang
+}
+
+static if (!D_LP64):
+extern (C):
+	
+short MacReplaceText (Handle baseText, Handle substitutionText, Str15 key);
+short ScriptOrder (ScriptCode script1, ScriptCode script2);
+short MacCompareString (ConstStr255Param aStr, ConstStr255Param bStr, Handle itl2Handle);
+short IdenticalString (ConstStr255Param aStr, ConstStr255Param bStr, Handle itl2Handle);
+short StringOrder (ConstStr255Param aStr, ConstStr255Param bStr, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang);
+short CompareText (/*const*/ void* aPtr, /*const*/ void* bPtr, short aLen, short bLen, Handle itl2Handle);
+short IdenticalText (/*const*/ void* aPtr, /*const*/ void* bPtr, short aLen, short bLen, Handle itl2Handle);
+short TextOrder (/*const*/ void* aPtr, /*const*/ void* bPtr, short aLen, short bLen, ScriptCode aScript, ScriptCode bScript, LangCode aLang, LangCode bLang);
+short LanguageOrder (LangCode language1, LangCode language2);
+short RelString (ConstStr255Param str1, ConstStr255Param str2, bool caseSensitive, bool diacSensitive);
+bool EqualString (ConstStr255Param str1, ConstStr255Param str2, bool caseSensitive, bool diacSensitive);
+short relstring (/*const*/ char* str1, /*const*/ char* str2, bool caseSensitive, bool diacSensitive);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/TextCommon.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,628 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.TextCommon;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+alias uint TextEncodingBase;
+alias uint TextEncodingVariant;
+alias uint TextEncodingFormat;
+alias uint TextEncoding;
+alias uint TextEncodingNameSelector;
+alias TextEncodingRun* TextEncodingRunPtr;
+alias TextEncodingRun* ConstTextEncodingRunPtr;
+alias ScriptCodeRun* ScriptCodeRunPtr;
+alias ScriptCodeRun* ConstScriptCodeRunPtr;
+alias char* TextPtr;
+alias char* ConstTextPtr;
+alias wchar* UniCharArrayPtr;
+alias wchar* ConstUniCharArrayPtr;
+alias UniCharArrayPtr* UniCharArrayHandle;
+alias uint UniCharArrayOffset;
+alias TECInfo*[][][][] TECInfoPtr;
+alias TECInfoPtr* TECInfoHandle;
+alias int UCCharPropertyType;
+alias uint UCCharPropertyValue;
+
+enum
+{
+	kTextFlushDefault = 0,
+	kTextCenter = 1,
+	kTextFlushRight = -1,
+	kTextFlushLeft = -2
+}
+
+enum
+{
+	kTextEncodingMacRoman = 0L,
+	kTextEncodingMacJapanese = 1,
+	kTextEncodingMacChineseTrad = 2,
+	kTextEncodingMacKorean = 3,
+	kTextEncodingMacArabic = 4,
+	kTextEncodingMacHebrew = 5,
+	kTextEncodingMacGreek = 6,
+	kTextEncodingMacCyrillic = 7,
+	kTextEncodingMacDevanagari = 9,
+	kTextEncodingMacGurmukhi = 10,
+	kTextEncodingMacGujarati = 11,
+	kTextEncodingMacOriya = 12,
+	kTextEncodingMacBengali = 13,
+	kTextEncodingMacTamil = 14,
+	kTextEncodingMacTelugu = 15,
+	kTextEncodingMacKannada = 16,
+	kTextEncodingMacMalayalam = 17,
+	kTextEncodingMacSinhalese = 18,
+	kTextEncodingMacBurmese = 19,
+	kTextEncodingMacKhmer = 20,
+	kTextEncodingMacThai = 21,
+	kTextEncodingMacLaotian = 22,
+	kTextEncodingMacGeorgian = 23,
+	kTextEncodingMacArmenian = 24,
+	kTextEncodingMacChineseSimp = 25,
+	kTextEncodingMacTibetan = 26,
+	kTextEncodingMacMongolian = 27,
+	kTextEncodingMacEthiopic = 28,
+	kTextEncodingMacCentralEurRoman = 29,
+	kTextEncodingMacVietnamese = 30,
+	kTextEncodingMacExtArabic = 31,
+	kTextEncodingMacSymbol = 33,
+	kTextEncodingMacDingbats = 34,
+	kTextEncodingMacTurkish = 35,
+	kTextEncodingMacCroatian = 36,
+	kTextEncodingMacIcelandic = 37,
+	kTextEncodingMacRomanian = 38,
+	kTextEncodingMacCeltic = 39,
+	kTextEncodingMacGaelic = 40,
+	kTextEncodingMacKeyboardGlyphs = 41
+}
+
+enum
+{
+	kTextEncodingMacTradChinese = kTextEncodingMacChineseTrad,
+	kTextEncodingMacRSymbol = 8,
+	kTextEncodingMacSimpChinese = kTextEncodingMacChineseSimp,
+	kTextEncodingMacGeez = kTextEncodingMacEthiopic,
+	kTextEncodingMacEastEurRoman = kTextEncodingMacCentralEurRoman,
+	kTextEncodingMacUninterp = 32
+}
+
+enum
+{
+	kTextEncodingMacUnicode = 0x7E
+}
+
+enum
+{
+	kTextEncodingMacFarsi = 0x8C,
+	kTextEncodingMacUkrainian = 0x98,
+	kTextEncodingMacInuit = 0xEC,
+	kTextEncodingMacVT100 = 0xFC
+}
+
+enum
+{
+	kTextEncodingMacHFS = 0xFF
+}
+
+enum
+{
+	kTextEncodingUnicodeDefault = 0x0100,
+	kTextEncodingUnicodeV1_1 = 0x0101,
+	kTextEncodingISO10646_1993 = 0x0101,
+	kTextEncodingUnicodeV2_0 = 0x0103,
+	kTextEncodingUnicodeV2_1 = 0x0103,
+	kTextEncodingUnicodeV3_0 = 0x0104,
+	kTextEncodingUnicodeV3_1 = 0x0105,
+	kTextEncodingUnicodeV3_2 = 0x0106,
+	kTextEncodingUnicodeV4_0 = 0x0108,
+	kTextEncodingUnicodeV5_0 = 0x010A
+}
+
+enum
+{
+	kTextEncodingISOLatin1 = 0x0201,
+	kTextEncodingISOLatin2 = 0x0202,
+	kTextEncodingISOLatin3 = 0x0203,
+	kTextEncodingISOLatin4 = 0x0204,
+	kTextEncodingISOLatinCyrillic = 0x0205,
+	kTextEncodingISOLatinArabic = 0x0206,
+	kTextEncodingISOLatinGreek = 0x0207,
+	kTextEncodingISOLatinHebrew = 0x0208,
+	kTextEncodingISOLatin5 = 0x0209,
+	kTextEncodingISOLatin6 = 0x020A,
+	kTextEncodingISOLatin7 = 0x020D,
+	kTextEncodingISOLatin8 = 0x020E,
+	kTextEncodingISOLatin9 = 0x020F,
+	kTextEncodingISOLatin10 = 0x0210
+}
+
+enum
+{
+	kTextEncodingDOSLatinUS = 0x0400,
+	kTextEncodingDOSGreek = 0x0405,
+	kTextEncodingDOSBalticRim = 0x0406,
+	kTextEncodingDOSLatin1 = 0x0410,
+	kTextEncodingDOSGreek1 = 0x0411,
+	kTextEncodingDOSLatin2 = 0x0412,
+	kTextEncodingDOSCyrillic = 0x0413,
+	kTextEncodingDOSTurkish = 0x0414,
+	kTextEncodingDOSPortuguese = 0x0415,
+	kTextEncodingDOSIcelandic = 0x0416,
+	kTextEncodingDOSHebrew = 0x0417,
+	kTextEncodingDOSCanadianFrench = 0x0418,
+	kTextEncodingDOSArabic = 0x0419,
+	kTextEncodingDOSNordic = 0x041A,
+	kTextEncodingDOSRussian = 0x041B,
+	kTextEncodingDOSGreek2 = 0x041C,
+	kTextEncodingDOSThai = 0x041D,
+	kTextEncodingDOSJapanese = 0x0420,
+	kTextEncodingDOSChineseSimplif = 0x0421,
+	kTextEncodingDOSKorean = 0x0422,
+	kTextEncodingDOSChineseTrad = 0x0423,
+	kTextEncodingWindowsLatin1 = 0x0500,
+	kTextEncodingWindowsANSI = 0x0500,
+	kTextEncodingWindowsLatin2 = 0x0501,
+	kTextEncodingWindowsCyrillic = 0x0502,
+	kTextEncodingWindowsGreek = 0x0503,
+	kTextEncodingWindowsLatin5 = 0x0504,
+	kTextEncodingWindowsHebrew = 0x0505,
+	kTextEncodingWindowsArabic = 0x0506,
+	kTextEncodingWindowsBalticRim = 0x0507,
+	kTextEncodingWindowsVietnamese = 0x0508,
+	kTextEncodingWindowsKoreanJohab = 0x0510
+}
+
+enum
+{
+	kTextEncodingUS_ASCII = 0x0600,
+	kTextEncodingANSEL = 0x0601,
+	kTextEncodingJIS_X0201_76 = 0x0620,
+	kTextEncodingJIS_X0208_83 = 0x0621,
+	kTextEncodingJIS_X0208_90 = 0x0622,
+	kTextEncodingJIS_X0212_90 = 0x0623,
+	kTextEncodingJIS_C6226_78 = 0x0624,
+	kTextEncodingShiftJIS_X0213 = 0x0628,
+	kTextEncodingJIS_X0213_MenKuTen = 0x0629,
+	kTextEncodingGB_2312_80 = 0x0630,
+	kTextEncodingGBK_95 = 0x0631,
+	kTextEncodingGB_18030_2000 = 0x0632,
+	kTextEncodingKSC_5601_87 = 0x0640,
+	kTextEncodingKSC_5601_92_Johab = 0x0641,
+	kTextEncodingCNS_11643_92_P1 = 0x0651,
+	kTextEncodingCNS_11643_92_P2 = 0x0652,
+	kTextEncodingCNS_11643_92_P3 = 0x0653
+}
+
+enum
+{
+	kTextEncodingISO_2022_JP = 0x0820,
+	kTextEncodingISO_2022_JP_2 = 0x0821,
+	kTextEncodingISO_2022_JP_1 = 0x0822,
+	kTextEncodingISO_2022_JP_3 = 0x0823,
+	kTextEncodingISO_2022_CN = 0x0830,
+	kTextEncodingISO_2022_CN_EXT = 0x0831,
+	kTextEncodingISO_2022_KR = 0x0840
+}
+
+enum
+{
+	kTextEncodingEUC_JP = 0x0920,
+	kTextEncodingEUC_CN = 0x0930,
+	kTextEncodingEUC_TW = 0x0931,
+	kTextEncodingEUC_KR = 0x0940
+}
+
+enum
+{
+	kTextEncodingShiftJIS = 0x0A01,
+	kTextEncodingKOI8_R = 0x0A02,
+	kTextEncodingBig5 = 0x0A03,
+	kTextEncodingMacRomanLatin1 = 0x0A04,
+	kTextEncodingHZ_GB_2312 = 0x0A05,
+	kTextEncodingBig5_HKSCS_1999 = 0x0A06,
+	kTextEncodingVISCII = 0x0A07,
+	kTextEncodingKOI8_U = 0x0A08,
+	kTextEncodingBig5_E = 0x0A09
+}
+
+enum
+{
+	kTextEncodingNextStepLatin = 0x0B01,
+	kTextEncodingNextStepJapanese = 0x0B02
+}
+
+enum
+{
+	kTextEncodingEBCDIC_US = 0x0C01,
+	kTextEncodingEBCDIC_CP037 = 0x0C02
+}
+
+enum
+{
+	kTextEncodingMultiRun = 0x0FFF,
+	kTextEncodingUnknown = 0xFFFF
+}
+
+enum
+{
+	kTextEncodingDefaultVariant = 0
+}
+
+enum
+{
+	kMacRomanDefaultVariant = 0,
+	kMacRomanCurrencySignVariant = 1,
+	kMacRomanEuroSignVariant = 2
+}
+
+enum
+{
+	kMacCyrillicDefaultVariant = 0,
+	kMacCyrillicCurrSignStdVariant = 1,
+	kMacCyrillicCurrSignUkrVariant = 2,
+	kMacCyrillicEuroSignVariant = 3
+}
+
+enum
+{
+	kMacIcelandicStdDefaultVariant = 0,
+	kMacIcelandicTTDefaultVariant = 1,
+	kMacIcelandicStdCurrSignVariant = 2,
+	kMacIcelandicTTCurrSignVariant = 3,
+	kMacIcelandicStdEuroSignVariant = 4,
+	kMacIcelandicTTEuroSignVariant = 5
+}
+
+enum
+{
+	kMacCroatianDefaultVariant = 0,
+	kMacCroatianCurrencySignVariant = 1,
+	kMacCroatianEuroSignVariant = 2
+}
+
+enum
+{
+	kMacRomanianDefaultVariant = 0,
+	kMacRomanianCurrencySignVariant = 1,
+	kMacRomanianEuroSignVariant = 2
+}
+
+enum
+{
+	kMacJapaneseStandardVariant = 0,
+	kMacJapaneseStdNoVerticalsVariant = 1,
+	kMacJapaneseBasicVariant = 2,
+	kMacJapanesePostScriptScrnVariant = 3,
+	kMacJapanesePostScriptPrintVariant = 4,
+	kMacJapaneseVertAtKuPlusTenVariant = 5
+}
+
+enum
+{
+	kMacArabicStandardVariant = 0,
+	kMacArabicTrueTypeVariant = 1,
+	kMacArabicThuluthVariant = 2,
+	kMacArabicAlBayanVariant = 3
+}
+
+enum
+{
+	kMacFarsiStandardVariant = 0,
+	kMacFarsiTrueTypeVariant = 1
+}
+
+enum
+{
+	kMacHebrewStandardVariant = 0,
+	kMacHebrewFigureSpaceVariant = 1
+}
+
+enum
+{
+	kMacGreekDefaultVariant = 0,
+	kMacGreekNoEuroSignVariant = 1,
+	kMacGreekEuroSignVariant = 2
+}
+
+enum
+{
+	kMacVT100DefaultVariant = 0,
+	kMacVT100CurrencySignVariant = 1,
+	kMacVT100EuroSignVariant = 2
+}
+
+enum
+{
+	kUnicodeNoSubset = 0,
+	kUnicodeNormalizationFormD = 5,
+	kUnicodeNormalizationFormC = 3,
+	kUnicodeHFSPlusDecompVariant = 8,
+	kUnicodeHFSPlusCompVariant = 9
+}
+
+enum
+{
+	kISOLatin1StandardVariant = 0,
+	kISOLatin1MusicCDVariant = 1
+}
+
+enum
+{
+	kISOLatinArabicImplicitOrderVariant = 0,
+	kISOLatinArabicVisualOrderVariant = 1,
+	kISOLatinArabicExplicitOrderVariant = 2
+}
+
+enum
+{
+	kISOLatinHebrewImplicitOrderVariant = 0,
+	kISOLatinHebrewVisualOrderVariant = 1,
+	kISOLatinHebrewExplicitOrderVariant = 2
+}
+
+enum
+{
+	kWindowsLatin1StandardVariant = 0,
+	kWindowsLatin1PalmVariant = 1
+}
+
+enum
+{
+	kDOSJapaneseStandardVariant = 0,
+	kDOSJapanesePalmVariant = 1
+}
+
+enum
+{
+	kEUC_CN_BasicVariant = 0,
+	kEUC_CN_DOSVariant = 1
+}
+
+enum
+{
+	kEUC_KR_BasicVariant = 0,
+	kEUC_KR_DOSVariant = 1
+}
+
+enum
+{
+	kShiftJIS_BasicVariant = 0,
+	kShiftJIS_DOSVariant = 1,
+	kShiftJIS_MusicCDVariant = 2
+}
+
+enum
+{
+	kBig5_BasicVariant = 0,
+	kBig5_StandardVariant = 1,
+	kBig5_ETenVariant = 2,
+	kBig5_DOSVariant = 3
+}
+
+enum
+{
+	kMacRomanLatin1DefaultVariant = 0,
+	kMacRomanLatin1StandardVariant = 2,
+	kMacRomanLatin1TurkishVariant = 6,
+	kMacRomanLatin1CroatianVariant = 8,
+	kMacRomanLatin1IcelandicVariant = 11,
+	kMacRomanLatin1RomanianVariant = 14
+}
+
+enum
+{
+	kUnicodeNoCompatibilityVariant = 1,
+	kUnicodeNoCorporateVariant = 4
+}
+
+enum
+{
+	kMacRomanStandardVariant = 0,
+	kMacIcelandicStandardVariant = 0,
+	kMacIcelandicTrueTypeVariant = 1,
+	kJapaneseStandardVariant = 0,
+	kJapaneseStdNoVerticalsVariant = 1,
+	kJapaneseBasicVariant = 2,
+	kJapanesePostScriptScrnVariant = 3,
+	kJapanesePostScriptPrintVariant = 4,
+	kJapaneseVertAtKuPlusTenVariant = 5,
+	kTextEncodingShiftJIS_X0213_00 = 0x0628,
+	kHebrewStandardVariant = 0,
+	kHebrewFigureSpaceVariant = 1,
+	kUnicodeCanonicalDecompVariant = 2,
+	kUnicodeMaxDecomposedVariant = 2,
+	kUnicodeCanonicalCompVariant = 3,
+	kUnicodeNoComposedVariant = 3
+}
+
+enum
+{
+	kTextEncodingDefaultFormat = 0,
+	kUnicodeUTF16Format = 0,
+	kUnicodeUTF7Format = 1,
+	kUnicodeUTF8Format = 2,
+	kUnicodeUTF32Format = 3,
+	kUnicodeUTF16BEFormat = 4,
+	kUnicodeUTF16LEFormat = 5,
+	kUnicodeUTF32BEFormat = 6,
+	kUnicodeUTF32LEFormat = 7,
+	kUnicodeSCSUFormat = 8,
+	kUnicode16BitFormat = 0,
+	kUnicode32BitFormat = 3
+}
+
+enum
+{
+	kTextEncodingFullName = 0,
+	kTextEncodingBaseName = 1,
+	kTextEncodingVariantName = 2,
+	kTextEncodingFormatName = 3
+}
+
+enum
+{
+	kTextScriptDontCare = -128,
+	kTextLanguageDontCare = -128,
+	kTextRegionDontCare = -128
+}
+
+enum
+{
+	kTECInfoCurrentFormat = 2
+}
+
+enum
+{
+	kTECKeepInfoFixBit = 0,
+	kTECFallbackTextLengthFixBit = 1,
+	kTECTextRunBitClearFixBit = 2,
+	kTECTextToUnicodeScanFixBit = 3,
+	kTECAddForceASCIIChangesBit = 4,
+	kTECPreferredEncodingFixBit = 5,
+	kTECAddTextRunHeuristicsBit = 6,
+	kTECAddFallbackInterruptBit = 7
+}
+
+enum
+{
+	kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit,
+	kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit,
+	kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit,
+	kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit,
+	kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit,
+	kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit,
+	kTECAddTextRunHeuristicsMask = 1L << kTECAddTextRunHeuristicsBit,
+	kTECAddFallbackInterruptMask = 1L << kTECAddFallbackInterruptBit
+}
+
+enum
+{
+	kUnicodeByteOrderMark = 0xFEFF,
+	kUnicodeObjectReplacement = 0xFFFC,
+	kUnicodeReplacementChar = 0xFFFD,
+	kUnicodeSwappedByteOrderMark = 0xFFFE,
+	kUnicodeNotAChar = 0xFFFF
+}
+
+enum
+{
+	kUCCharPropTypeGenlCategory = 1,
+	kUCCharPropTypeCombiningClass = 2,
+	kUCCharPropTypeBidiCategory = 3,
+	kUCCharPropTypeDecimalDigitValue = 4
+}
+
+enum
+{
+	kUCGenlCatOtherNotAssigned = 0,
+	kUCGenlCatOtherControl = 1,
+	kUCGenlCatOtherFormat = 2,
+	kUCGenlCatOtherSurrogate = 3,
+	kUCGenlCatOtherPrivateUse = 4,
+	kUCGenlCatMarkNonSpacing = 5,
+	kUCGenlCatMarkSpacingCombining = 6,
+	kUCGenlCatMarkEnclosing = 7,
+	kUCGenlCatNumberDecimalDigit = 8,
+	kUCGenlCatNumberLetter = 9,
+	kUCGenlCatNumberOther = 10,
+	kUCGenlCatSeparatorSpace = 11,
+	kUCGenlCatSeparatorLine = 12,
+	kUCGenlCatSeparatorParagraph = 13,
+	kUCGenlCatLetterUppercase = 14,
+	kUCGenlCatLetterLowercase = 15,
+	kUCGenlCatLetterTitlecase = 16,
+	kUCGenlCatLetterModifier = 17,
+	kUCGenlCatLetterOther = 18,
+	kUCGenlCatPunctConnector = 20,
+	kUCGenlCatPunctDash = 21,
+	kUCGenlCatPunctOpen = 22,
+	kUCGenlCatPunctClose = 23,
+	kUCGenlCatPunctInitialQuote = 24,
+	kUCGenlCatPunctFinalQuote = 25,
+	kUCGenlCatPunctOther = 26,
+	kUCGenlCatSymbolMath = 28,
+	kUCGenlCatSymbolCurrency = 29,
+	kUCGenlCatSymbolModifier = 30,
+	kUCGenlCatSymbolOther = 31
+}
+
+enum
+{
+	kUCBidiCatNotApplicable = 0,
+	kUCBidiCatLeftRight = 1,
+	kUCBidiCatRightLeft = 2,
+	kUCBidiCatEuroNumber = 3,
+	kUCBidiCatEuroNumberSeparator = 4,
+	kUCBidiCatEuroNumberTerminator = 5,
+	kUCBidiCatArabicNumber = 6,
+	kUCBidiCatCommonNumberSeparator = 7,
+	kUCBidiCatBlockSeparator = 8,
+	kUCBidiCatSegmentSeparator = 9,
+	kUCBidiCatWhitespace = 10,
+	kUCBidiCatOtherNeutral = 11,
+	kUCBidiCatRightLeftArabic = 12,
+	kUCBidiCatLeftRightEmbedding = 13,
+	kUCBidiCatRightLeftEmbedding = 14,
+	kUCBidiCatLeftRightOverride = 15,
+	kUCBidiCatRightLeftOverride = 16,
+	kUCBidiCatPopDirectionalFormat = 17,
+	kUCBidiCatNonSpacingMark = 18,
+	kUCBidiCatBoundaryNeutral = 19
+}
+
+enum
+{
+	kUCHighSurrogateRangeStart = 0xD800,
+	kUCHighSurrogateRangeEnd = 0xDBFF,
+	kUCLowSurrogateRangeStart = 0xDC00,
+	kUCLowSurrogateRangeEnd = 0xDFFF
+}
+
+struct TextEncodingRun
+{
+	uint offset;
+	uint textEncoding;
+}
+
+
+struct ScriptCodeRun
+{
+	uint offset;
+	short script;
+}
+
+
+struct TECInfo
+{
+	ushort format;
+	ushort tecVersion;
+	uint tecTextConverterFeatures;
+	uint tecUnicodeConverterFeatures;
+	uint tecTextCommonFeatures;
+	ubyte[32] tecTextEncodingsFolderName;
+	ubyte[32] tecExtensionFileName;
+	ushort tecLowestTEFileVersion;
+	ushort tecHighestTEFileVersion;
+}
+
+extern (C)
+{
+	uint CreateTextEncoding (uint encodingBase, uint encodingVariant, uint encodingFormat);
+	uint GetTextEncodingBase (uint encoding);
+	uint GetTextEncodingVariant (uint encoding);
+	uint GetTextEncodingFormat (uint encoding);
+	uint ResolveDefaultTextEncoding (uint encoding);
+	int GetTextEncodingName (uint iEncoding, uint iNamePartSelector, short iPreferredRegion, uint iPreferredEncoding, uint iOutputBufLen, ByteCount* oNameLength, RegionCode* oActualRegion, TextEncoding* oActualEncoding, char* oEncodingName);
+	int TECGetInfo (TECInfoHandle* tecInfo);
+	int UpgradeScriptInfoToTextEncoding (short iTextScriptID, short iTextLanguageID, short iRegionID, char* iTextFontname, TextEncoding* oEncoding);
+	int RevertTextEncodingToScriptInfo (uint iEncoding, ScriptCode* oTextScriptID, LangCode* oTextLanguageID, ubyte[256] oTextFontname);
+	int GetTextEncodingFromScriptInfo (short iTextScriptID, short iTextLanguageID, short iTextRegionID, TextEncoding* oEncoding);
+	int GetScriptInfoFromTextEncoding (uint iEncoding, ScriptCode* oTextScriptID, LangCode* oTextLanguageID);
+	int NearestMacTextEncodings (uint generalEncoding, TextEncoding* bestMacEncoding, TextEncoding* alternateMacEncoding);
+	int UCGetCharProperty (wchar* charPtr, uint textLength, int propType, UCCharPropertyValue* propValue);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/TextEncodingConverter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,104 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.TextEncodingConverter;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.corefoundation.CFString;
+import dstep.objc.bridge.TypeEncoding;
+
+struct OpaqueTECObjectRef;
+struct OpaqueTECSnifferObjectRef;
+
+alias uint TECPluginSignature;
+alias uint TECPluginVersion;
+alias OpaqueTECObjectRef* TECObjectRef;
+alias OpaqueTECSnifferObjectRef* TECSnifferObjectRef;
+alias uint TECPluginSig;
+alias uint TECInternetNameUsageMask;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kTECSignature = getOSType!("encv");
+		const __kTECUnicodePluginSignature = getOSType!("puni");
+		const __kTECJapanesePluginSignature = getOSType!("pjpn");
+		const __kTECChinesePluginSignature = getOSType!("pzho");
+		const __kTECKoreanPluginSignature = getOSType!("pkor");
+
+	}
+}
+
+enum
+{
+	kTECSignature = getOSType!("encv"),
+	kTECUnicodePluginSignature = getOSType!("puni"),
+	kTECJapanesePluginSignature = getOSType!("pjpn"),
+	kTECChinesePluginSignature = getOSType!("pzho"),
+	kTECKoreanPluginSignature = getOSType!("pkor")
+}
+
+enum
+{
+	kTECInternetNameDefaultUsageMask = 0,
+	kTECInternetNameStrictUsageMask = 1,
+	kTECInternetNameTolerantUsageMask = 2
+}
+
+enum
+{
+	kTEC_MIBEnumDontCare = -1
+}
+
+struct TECConversionInfo
+{
+	uint sourceEncoding;
+	uint destinationEncoding;
+	ushort reserved1;
+	ushort reserved2;
+}
+
+extern (C)
+{
+	int TECCountAvailableTextEncodings (ItemCount* numberEncodings);
+	int TECGetAvailableTextEncodings (TextEncoding* availableEncodings, uint maxAvailableEncodings, ItemCount* actualAvailableEncodings);
+	int TECCountDirectTextEncodingConversions (ItemCount* numberOfEncodings);
+	int TECGetDirectTextEncodingConversions (TECConversionInfo* availableConversions, uint maxAvailableConversions, ItemCount* actualAvailableConversions);
+	int TECCountDestinationTextEncodings (uint inputEncoding, ItemCount* numberOfEncodings);
+	int TECGetDestinationTextEncodings (uint inputEncoding, TextEncoding* destinationEncodings, uint maxDestinationEncodings, ItemCount* actualDestinationEncodings);
+	int TECGetTextEncodingInternetName (uint textEncoding, ubyte[256] encodingName);
+	int TECGetTextEncodingFromInternetName (TextEncoding* textEncoding, char* encodingName);
+	int TECCreateConverter (TECObjectRef* newEncodingConverter, uint inputEncoding, uint outputEncoding);
+	int TECCreateConverterFromPath (TECObjectRef* newEncodingConverter, TextEncoding* inPath, uint inEncodings);
+	int TECDisposeConverter (TECObjectRef newEncodingConverter);
+	int TECClearConverterContextInfo (TECObjectRef encodingConverter);
+	int TECConvertText (TECObjectRef encodingConverter, char* inputBuffer, uint inputBufferLength, ByteCount* actualInputLength, char* outputBuffer, uint outputBufferLength, ByteCount* actualOutputLength);
+	int TECFlushText (TECObjectRef encodingConverter, char* outputBuffer, uint outputBufferLength, ByteCount* actualOutputLength);
+	int TECCountSubTextEncodings (uint inputEncoding, ItemCount* numberOfEncodings);
+	int TECGetSubTextEncodings (uint inputEncoding, TextEncoding* subEncodings, uint maxSubEncodings, ItemCount* actualSubEncodings);
+	int TECGetEncodingList (TECObjectRef encodingConverter, ItemCount* numEncodings, Handle* encodingList);
+	int TECCreateOneToManyConverter (TECObjectRef* newEncodingConverter, uint inputEncoding, uint numOutputEncodings, TextEncoding* outputEncodings);
+	int TECConvertTextToMultipleEncodings (TECObjectRef encodingConverter, char* inputBuffer, uint inputBufferLength, ByteCount* actualInputLength, char* outputBuffer, uint outputBufferLength, ByteCount* actualOutputLength, TextEncodingRun* outEncodingsBuffer, uint maxOutEncodingRuns, ItemCount* actualOutEncodingRuns);
+	int TECFlushMultipleEncodings (TECObjectRef encodingConverter, char* outputBuffer, uint outputBufferLength, ByteCount* actualOutputLength, TextEncodingRun* outEncodingsBuffer, uint maxOutEncodingRuns, ItemCount* actualOutEncodingRuns);
+	int TECCountWebTextEncodings (short locale, ItemCount* numberEncodings);
+	int TECGetWebTextEncodings (short locale, TextEncoding* availableEncodings, uint maxAvailableEncodings, ItemCount* actualAvailableEncodings);
+	int TECCountMailTextEncodings (short locale, ItemCount* numberEncodings);
+	int TECGetMailTextEncodings (short locale, TextEncoding* availableEncodings, uint maxAvailableEncodings, ItemCount* actualAvailableEncodings);
+	int TECCountAvailableSniffers (ItemCount* numberOfEncodings);
+	int TECGetAvailableSniffers (TextEncoding* availableSniffers, uint maxAvailableSniffers, ItemCount* actualAvailableSniffers);
+	int TECCreateSniffer (TECSnifferObjectRef* encodingSniffer, TextEncoding* testEncodings, uint numTextEncodings);
+	int TECSniffTextEncoding (TECSnifferObjectRef encodingSniffer, char* inputBuffer, uint inputBufferLength, TextEncoding* testEncodings, uint numTextEncodings, ItemCount* numErrsArray, uint maxErrs, ItemCount* numFeaturesArray, uint maxFeatures);
+	int TECDisposeSniffer (TECSnifferObjectRef encodingSniffer);
+	int TECClearSnifferContextInfo (TECSnifferObjectRef encodingSniffer);
+	int TECSetBasicOptions (TECObjectRef encodingConverter, uint controlFlags);
+	int TECCopyTextEncodingInternetNameAndMIB (uint textEncoding, uint usage, CFStringRef* encodingNamePtr, SInt32* mibEnumPtr);
+	int TECGetTextEncodingFromInternetNameOrMIB (TextEncoding* textEncodingPtr, uint usage, CFStringRef encodingName, int mibEnum);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/TextEncodingPlugin.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,285 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.TextEncodingPlugin;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.coreservices.carboncore.TextEncodingConverter;
+import dstep.objc.bridge.TypeEncoding;
+
+alias TECEncodingsListRec* TECEncodingsListPtr;
+alias TECEncodingsListPtr* TECEncodingsListHandle;
+alias TECSubTextEncodingsRec* TECSubTextEncodingsPtr;
+alias TECSubTextEncodingsPtr* TECSubTextEncodingsHandle;
+alias TECEncodingPairsRec* TECEncodingPairsPtr;
+alias TECEncodingPairsPtr* TECEncodingPairsHandle;
+alias TECLocaleListToEncodingListRec* TECLocaleListToEncodingListPtr;
+alias TECLocaleToEncodingsListRec* TECLocaleToEncodingsListPtr;
+alias TECLocaleToEncodingsListPtr* TECLocaleToEncodingsListHandle;
+alias TECInternetNamesRec* TECInternetNamesPtr;
+alias TECInternetNamesPtr* TECInternetNamesHandle;
+
+extern (C)
+{
+	alias int function (TextEncoding*, uint, ItemCount*) TECPluginGetCountAvailableSniffersPtr;
+	alias int function (uint, TextEncoding*, uint, ItemCount*) TECPluginGetCountSubTextEncodingsPtr;
+	alias int function (uint, TextEncoding*, uint, ItemCount*) TECPluginGetCountDestinationTextEncodingsPtr;
+	alias int function (TECObjectRef, TECConverterContextRec*) TECPluginFlushConversionPtr;
+	alias int function (TECObjectRef, TECConverterContextRec*) TECPluginClearContextInfoPtr;
+	alias int function (TextEncoding*, uint, ItemCount*) TECPluginGetCountWebEncodingsPtr;
+	alias int function (TECConversionInfo*, uint, ItemCount*) TECPluginGetCountAvailableTextEncodingPairsPtr;
+	alias int function (TECSnifferObjectRef, TECSnifferContextRec*) TECPluginDisposeEncodingSnifferPtr;
+	alias int function (TECSnifferObjectRef, TECSnifferContextRec*) TECPluginClearSnifferContextInfoPtr;
+	alias int function (TECObjectRef, TECConverterContextRec*) TECPluginConvertTextEncodingPtr;
+	alias int function (TECSnifferObjectRef*, TECSnifferContextRec*, uint) TECPluginNewEncodingSnifferPtr;
+	alias int function (TextEncoding*, uint, ItemCount*) TECPluginGetCountMailEncodingsPtr;
+	alias int function (TextEncoding*, char*) TECPluginGetTextEncodingFromInternetNamePtr;
+	alias TECPluginDispatchTable * function () TECPluginGetPluginDispatchTablePtr;
+	alias int function (TECSnifferObjectRef, TECSnifferContextRec*) TECPluginSniffTextEncodingPtr;
+	alias int function (TECObjectRef, TECConverterContextRec*) TECPluginDisposeEncodingConverterPtr;
+	alias int function (uint, Str255) TECPluginGetTextEncodingInternetNamePtr;
+	alias int function (TextEncoding*, uint, ItemCount*) TECPluginGetCountAvailableTextEncodingsPtr;
+	alias int function (TECObjectRef*, TECConverterContextRec*, uint, uint) TECPluginNewEncodingConverterPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kTECAvailableEncodingsResType = getOSType!("cven");
+		const __kTECAvailableSniffersResType = getOSType!("cvsf");
+		const __kTECSubTextEncodingsResType = getOSType!("cvsb");
+		const __kTECConversionInfoResType = getOSType!("cvif");
+		const __kTECMailEncodingsResType = getOSType!("cvml");
+		const __kTECWebEncodingsResType = getOSType!("cvwb");
+		const __kTECInternetNamesResType = getOSType!("cvmm");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kTECPluginType = getOSType!("ecpg");
+		const __kTECPluginCreator = getOSType!("encv");
+		const __kTECPluginOneToOne = getOSType!("otoo");
+		const __kTECPluginOneToMany = getOSType!("otom");
+		const __kTECPluginManyToOne = getOSType!("mtoo");
+		const __kTECPluginSniffObj = getOSType!("snif");
+
+	}
+}
+
+enum
+{
+	kTECAvailableEncodingsResType = getOSType!("cven"),
+	kTECAvailableSniffersResType = getOSType!("cvsf"),
+	kTECSubTextEncodingsResType = getOSType!("cvsb"),
+	kTECConversionInfoResType = getOSType!("cvif"),
+	kTECMailEncodingsResType = getOSType!("cvml"),
+	kTECWebEncodingsResType = getOSType!("cvwb"),
+	kTECInternetNamesResType = getOSType!("cvmm")
+}
+
+enum
+{
+	kTECPluginType = getOSType!("ecpg"),
+	kTECPluginCreator = getOSType!("encv"),
+	kTECPluginOneToOne = getOSType!("otoo"),
+	kTECPluginOneToMany = getOSType!("otom"),
+	kTECPluginManyToOne = getOSType!("mtoo"),
+	kTECPluginSniffObj = getOSType!("snif")
+}
+
+enum
+{
+	verUnspecified = 32767,
+	kTECResourceID = 128
+}
+
+enum
+{
+	kTECPluginDispatchTableVersion1 = 0x00010000,
+	kTECPluginDispatchTableVersion1_1 = 0x00010001,
+	kTECPluginDispatchTableVersion1_2 = 0x00010002,
+	kTECPluginDispatchTableCurrentVersion = kTECPluginDispatchTableVersion1_2
+}
+
+struct TextEncodingRec
+{
+	uint base;
+	uint variant;
+	uint format;
+}
+
+
+struct TECEncodingsListRec
+{
+	uint count;
+	TextEncodingRec encodings;
+}
+
+
+struct TECSubTextEncodingRec
+{
+	uint offset;
+	TextEncodingRec searchEncoding;
+	uint count;
+	TextEncodingRec subEncodings;
+}
+
+
+struct TECSubTextEncodingsRec
+{
+	uint count;
+	TECSubTextEncodingRec subTextEncodingRec;
+}
+
+
+struct TECEncodingPairRec
+{
+	TextEncodingRec source;
+	TextEncodingRec dest;
+}
+
+
+struct TECEncodingPairs
+{
+	TECEncodingPairRec encodingPair;
+	uint flags;
+	uint speed;
+}
+
+
+struct TECEncodingPairsRec
+{
+	uint count;
+	TECEncodingPairs encodingPairs;
+}
+
+
+struct TECLocaleListToEncodingListRec
+{
+	uint offset;
+	uint count;
+	short locales;
+}
+
+
+struct TECLocaleToEncodingsListRec
+{
+	uint count;
+	TECLocaleListToEncodingListRec localeListToEncodingList;
+}
+
+
+struct TECInternetNameRec
+{
+	uint offset;
+	TextEncodingRec searchEncoding;
+	ubyte encodingNameLength;
+	char* encodingName;
+}
+
+
+struct TECInternetNamesRec
+{
+	uint count;
+	TECInternetNameRec InternetNames;
+}
+
+
+struct TECBufferContextRec
+{
+	char* textInputBuffer;
+	char* textInputBufferEnd;
+	char* textOutputBuffer;
+	char* textOutputBufferEnd;
+	ConstTextEncodingRunPtr encodingInputBuffer;
+	ConstTextEncodingRunPtr encodingInputBufferEnd;
+	TextEncodingRunPtr encodingOutputBuffer;
+	TextEncodingRunPtr encodingOutputBufferEnd;
+}
+
+
+struct TECPluginStateRec
+{
+	ubyte state1;
+	ubyte state2;
+	ubyte state3;
+	ubyte state4;
+	uint longState1;
+	uint longState2;
+	uint longState3;
+	uint longState4;
+}
+
+
+struct TECConverterContextRec
+{
+	char* pluginRec;
+	uint sourceEncoding;
+	uint destEncoding;
+	uint reserved1;
+	uint reserved2;
+	TECBufferContextRec bufferContext;
+	uint contextRefCon;
+	ProcPtr conversionProc;
+	ProcPtr flushProc;
+	ProcPtr clearContextInfoProc;
+	uint options1;
+	uint options2;
+	TECPluginStateRec pluginState;
+}
+
+
+struct TECSnifferContextRec
+{
+	char* pluginRec;
+	uint encoding;
+	uint maxErrors;
+	uint maxFeatures;
+	char* textInputBuffer;
+	char* textInputBufferEnd;
+	uint numFeatures;
+	uint numErrors;
+	uint contextRefCon;
+	ProcPtr sniffProc;
+	ProcPtr clearContextInfoProc;
+	TECPluginStateRec pluginState;
+}
+
+
+struct TECPluginDispatchTable
+{
+	uint version_;
+	uint compatibleVersion;
+	uint PluginID;
+	TECPluginNewEncodingConverterPtr PluginNewEncodingConverter;
+	TECPluginClearContextInfoPtr PluginClearContextInfo;
+	TECPluginConvertTextEncodingPtr PluginConvertTextEncoding;
+	TECPluginFlushConversionPtr PluginFlushConversion;
+	TECPluginDisposeEncodingConverterPtr PluginDisposeEncodingConverter;
+	TECPluginNewEncodingSnifferPtr PluginNewEncodingSniffer;
+	TECPluginClearSnifferContextInfoPtr PluginClearSnifferContextInfo;
+	TECPluginSniffTextEncodingPtr PluginSniffTextEncoding;
+	TECPluginDisposeEncodingSnifferPtr PluginDisposeEncodingSniffer;
+	TECPluginGetCountAvailableTextEncodingsPtr PluginGetCountAvailableTextEncodings;
+	TECPluginGetCountAvailableTextEncodingPairsPtr PluginGetCountAvailableTextEncodingPairs;
+	TECPluginGetCountDestinationTextEncodingsPtr PluginGetCountDestinationTextEncodings;
+	TECPluginGetCountSubTextEncodingsPtr PluginGetCountSubTextEncodings;
+	TECPluginGetCountAvailableSniffersPtr PluginGetCountAvailableSniffers;
+	TECPluginGetCountWebEncodingsPtr PluginGetCountWebTextEncodings;
+	TECPluginGetCountMailEncodingsPtr PluginGetCountMailTextEncodings;
+	TECPluginGetTextEncodingInternetNamePtr PluginGetTextEncodingInternetName;
+	TECPluginGetTextEncodingFromInternetNamePtr PluginGetTextEncodingFromInternetName;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/TextUtils.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,83 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.TextUtils;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.DateTimeUtils;
+import dstep.coreservices.carboncore.IntlResources;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.NumberFormatting;
+import dstep.coreservices.carboncore.StringCompare;
+import dstep.internal.Types;
+import dstep.internal.Version;
+
+extern (C)
+{
+	int Munger (Handle h, int offset, void* ptr1, int len1, void* ptr2, int len2);
+}
+
+static if (!D_LP64)
+{
+	struct ScriptRunStatus
+	{
+		byte script;
+		byte runVariant;
+	}
+	
+	struct BreakTable
+	{
+		char[256] charTypes;
+		short tripleLength;
+		short[1] triples;
+	}
+	
+	alias BreakTable* BreakTablePtr;
+	
+	struct NBreakTable
+	{
+		byte flags1;
+		byte flags2;
+		short version_;
+		short classTableOff;
+		short auxCTableOff;
+		short backwdTableOff;
+		short forwdTableOff;
+		short doBackup;
+		short length;
+		char[256] charTypes;
+		short[1] tables;
+	}
+	
+	alias NBreakTable* NBreakTablePtr;
+	
+	extern (C)
+	{
+		StringHandle NewString (ConstStr255Param theString);
+		void SetString (StringHandle theString, ConstStr255Param);
+		StringHandle GetString (short stringID);
+		void GetIndString (Str255 theString, short strListID, short itemIndex);
+		void FindWordBreaks (Ptr textPtr, short textLength, short offset, bool leadingEdge, BreakTablePtr breaks, OffsetTable offsets, ScriptCode script);
+		void LowercaseText (Ptr textPtr, short len, ScriptCode script);
+		void UppercaseText (Ptr textPtr, short len, ScriptCode script);
+		void StripDiacritics (Ptr textPtr, short len, ScriptCode script);
+		void UppercaseStripDiacritics (Ptr textPtr, short len, ScriptCode script);
+		ScriptRunStatus FindScriptRun (Ptr textPtr, c_long textLen, c_long lenUsed);
+		void UpperString (Str255 theString, bool diacSensitive);
+		void upperstring (char* theString, bool diacSensitive);
+		void c2pstrcpy (Str255 dst, /*const*/ char* src);
+		void p2cstrcpy (char* dst, ConstStr255Param src);
+		void CopyPascalStringToC (ConstStr255Param src, char* dst);
+		void CopyCStringToPascal (/*const*/ char* src, Str255 dst);
+		StringPtr c2pstr (char* aStr);
+		StringPtr C2PStr (Ptr cString);
+		char* p2cstr (StringPtr aStr);
+		Ptr P2CStr (StringPtr pString);
+	}
+}
+
+extern (C):
+c_long Munger (Handle h, c_long offset, /*const*/ void* ptr1, c_long len1, /*const*/ void* ptr2, c_long len2);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Threads.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,127 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Threads;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+
+alias ushort ThreadState;
+alias void* ThreadTaskRef;
+alias uint ThreadStyle;
+alias uint ThreadID;
+alias uint ThreadOptions;
+alias SchedulerInfoRec* SchedulerInfoRecPtr;
+alias void* voidPtr;
+alias ThreadEntryProcPtr ThreadEntryUPP;
+alias ThreadSchedulerProcPtr ThreadSchedulerUPP;
+alias ThreadSwitchProcPtr ThreadSwitchUPP;
+alias ThreadTerminationProcPtr ThreadTerminationUPP;
+alias DebuggerNewThreadProcPtr DebuggerNewThreadUPP;
+alias DebuggerDisposeThreadProcPtr DebuggerDisposeThreadUPP;
+alias DebuggerThreadSchedulerProcPtr DebuggerThreadSchedulerUPP;
+alias ThreadEntryUPP ThreadEntryTPP;
+alias ThreadSchedulerUPP ThreadSchedulerTPP;
+alias ThreadSwitchUPP ThreadSwitchTPP;
+alias ThreadTerminationUPP ThreadTerminationTPP;
+alias DebuggerNewThreadUPP DebuggerNewThreadTPP;
+alias DebuggerDisposeThreadUPP DebuggerDisposeThreadTPP;
+alias DebuggerThreadSchedulerUPP DebuggerThreadSchedulerTPP;
+
+extern (C)
+{
+	alias uint function (SchedulerInfoRecPtr) ThreadSchedulerProcPtr;
+	alias void function (uint, void*) ThreadTerminationProcPtr;
+	alias void function (uint, void*) ThreadSwitchProcPtr;
+	alias void function (uint) DebuggerDisposeThreadProcPtr;
+	alias voidPtr function (void*) ThreadEntryProcPtr;
+	alias uint function (SchedulerInfoRecPtr) DebuggerThreadSchedulerProcPtr;
+	alias void function (uint) DebuggerNewThreadProcPtr;
+}
+
+enum
+{
+	kReadyThreadState = 0,
+	kStoppedThreadState = 1,
+	kRunningThreadState = 2
+}
+
+enum
+{
+	kCooperativeThread = 1L << 0,
+	kPreemptiveThread = 1L << 1
+}
+
+enum
+{
+	kNoThreadID = 0,
+	kCurrentThreadID = 1,
+	kApplicationThreadID = 2
+}
+
+enum
+{
+	kNewSuspend = (1 << 0),
+	kUsePremadeThread = (1 << 1),
+	kCreateIfNeeded = (1 << 2),
+	kFPUNotNeeded = (1 << 3),
+	kExactMatchThread = (1 << 4)
+}
+
+struct SchedulerInfoRec
+{
+	uint InfoRecSize;
+	uint CurrentThreadID;
+	uint SuggestedThreadID;
+	uint InterruptedCoopThreadID;
+}
+
+extern (C)
+{
+	ThreadEntryUPP NewThreadEntryUPP (ThreadEntryProcPtr userRoutine);
+	ThreadSchedulerUPP NewThreadSchedulerUPP (ThreadSchedulerProcPtr userRoutine);
+	ThreadSwitchUPP NewThreadSwitchUPP (ThreadSwitchProcPtr userRoutine);
+	ThreadTerminationUPP NewThreadTerminationUPP (ThreadTerminationProcPtr userRoutine);
+	DebuggerNewThreadUPP NewDebuggerNewThreadUPP (DebuggerNewThreadProcPtr userRoutine);
+	DebuggerDisposeThreadUPP NewDebuggerDisposeThreadUPP (DebuggerDisposeThreadProcPtr userRoutine);
+	DebuggerThreadSchedulerUPP NewDebuggerThreadSchedulerUPP (DebuggerThreadSchedulerProcPtr userRoutine);
+	void DisposeThreadEntryUPP (ThreadEntryUPP userUPP);
+	void DisposeThreadSchedulerUPP (ThreadSchedulerUPP userUPP);
+	void DisposeThreadSwitchUPP (ThreadSwitchUPP userUPP);
+	void DisposeThreadTerminationUPP (ThreadTerminationUPP userUPP);
+	void DisposeDebuggerNewThreadUPP (DebuggerNewThreadUPP userUPP);
+	void DisposeDebuggerDisposeThreadUPP (DebuggerDisposeThreadUPP userUPP);
+	void DisposeDebuggerThreadSchedulerUPP (DebuggerThreadSchedulerUPP userUPP);
+	voidPtr InvokeThreadEntryUPP (void* threadParam, ThreadEntryUPP userUPP);
+	uint InvokeThreadSchedulerUPP (SchedulerInfoRecPtr schedulerInfo, ThreadSchedulerUPP userUPP);
+	void InvokeThreadSwitchUPP (uint threadBeingSwitched, void* switchProcParam, ThreadSwitchUPP userUPP);
+	void InvokeThreadTerminationUPP (uint threadTerminated, void* terminationProcParam, ThreadTerminationUPP userUPP);
+	void InvokeDebuggerNewThreadUPP (uint threadCreated, DebuggerNewThreadUPP userUPP);
+	void InvokeDebuggerDisposeThreadUPP (uint threadDeleted, DebuggerDisposeThreadUPP userUPP);
+	uint InvokeDebuggerThreadSchedulerUPP (SchedulerInfoRecPtr schedulerInfo, DebuggerThreadSchedulerUPP userUPP);
+	short NewThread (uint threadStyle, ThreadEntryTPP threadEntry, void* threadParam, int stackSize, uint options, void** threadResult, ThreadID* threadMade);
+	short SetThreadScheduler (ThreadSchedulerTPP threadScheduler);
+	short SetThreadSwitcher (uint thread, ThreadSwitchTPP threadSwitcher, void* switchProcParam, ubyte inOrOut);
+	short SetThreadTerminator (uint thread, ThreadTerminationTPP threadTerminator, void* terminationProcParam);
+	short SetDebuggerNotificationProcs (DebuggerNewThreadTPP notifyNewThread, DebuggerDisposeThreadTPP notifyDisposeThread, DebuggerThreadSchedulerTPP notifyThreadScheduler);
+	short CreateThreadPool (uint threadStyle, short numToCreate, int stackSize);
+	short GetDefaultThreadStackSize (uint threadStyle, Size* stackSize);
+	short ThreadCurrentStackSpace (uint thread, ByteCount* freeStack);
+	short DisposeThread (uint threadToDump, void* threadResult, ubyte recycleThread);
+	short YieldToThread (uint suggestedThread);
+	short YieldToAnyThread ();
+	short GetCurrentThread (ThreadID* currentThreadID);
+	short GetThreadState (uint threadToGet, ThreadState* threadState);
+	short SetThreadState (uint threadToSet, ushort newState, uint suggestedThread);
+	short SetThreadStateEndCritical (uint threadToSet, ushort newState, uint suggestedThread);
+	short ThreadBeginCritical ();
+	short ThreadEndCritical ();
+	short GetThreadCurrentTaskRef (ThreadTaskRef* threadTRef);
+	short GetThreadStateGivenTaskRef (ThreadTaskRef threadTRef, uint threadToGet, ThreadState* threadState);
+	short SetThreadReadyGivenTaskRef (ThreadTaskRef threadTRef, uint threadToSet);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/Timer.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,51 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.Timer;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.OSUtils;
+
+alias TMTask* TMTaskPtr;
+alias TimerProcPtr TimerUPP;
+
+extern (C)
+{
+	alias void function (TMTaskPtr) TimerProcPtr;
+}
+
+enum
+{
+	kTMTaskActive = (1L << 15)
+}
+
+struct TMTask
+{
+	QElemPtr qLink;
+	short qType;
+	TimerUPP tmAddr;
+	int tmCount;
+	int tmWakeUp;
+	int tmReserved;
+}
+
+extern (C)
+{
+	void Microseconds (UnsignedWide* microTickCount);
+	void InsTime (QElemPtr tmTaskPtr);
+	void InsXTime (QElemPtr tmTaskPtr);
+	void PrimeTime (QElemPtr tmTaskPtr, int count);
+	void RmvTime (QElemPtr tmTaskPtr);
+	short InstallTimeTask (QElemPtr tmTaskPtr);
+	short InstallXTimeTask (QElemPtr tmTaskPtr);
+	short PrimeTimeTask (QElemPtr tmTaskPtr, int count);
+	short RemoveTimeTask (QElemPtr tmTaskPtr);
+	TimerUPP NewTimerUPP (TimerProcPtr userRoutine);
+	void DisposeTimerUPP (TimerUPP userUPP);
+	void InvokeTimerUPP (TMTaskPtr tmTaskPtr, TimerUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/ToolUtils.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,22 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.ToolUtils;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+
+extern (C)
+{
+	ubyte BitTst (void* bytePtr, int bitNum);
+	void BitSet (void* bytePtr, int bitNum);
+	void BitClr (void* bytePtr, int bitNum);
+	int BitAnd (int value1, int value2);
+	int BitOr (int value1, int value2);
+	int BitXor (int value1, int value2);
+	int BitNot (int value);
+	int BitShift (int value, short count);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/UTCUtils.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,37 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.UTCUtils;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+
+alias UTCDateTime* UTCDateTimePtr;
+alias UTCDateTimePtr* UTCDateTimeHandle;
+alias LocalDateTime* LocalDateTimePtr;
+alias LocalDateTimePtr* LocalDateTimeHandle;
+
+enum
+{
+	kUTCDefaultOptions = 0
+}
+
+struct UTCDateTime
+{
+	ushort highSeconds;
+	uint lowSeconds;
+	ushort fraction;
+}
+
+
+struct LocalDateTime
+{
+	ushort highSeconds;
+	uint lowSeconds;
+	ushort fraction;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/UnicodeConverter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,165 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.UnicodeConverter;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.TextCommon;
+
+struct OpaqueTextToUnicodeInfo;
+struct OpaqueUnicodeToTextInfo;
+struct OpaqueUnicodeToTextRunInfo;
+
+alias OpaqueTextToUnicodeInfo* TextToUnicodeInfo;
+alias OpaqueUnicodeToTextInfo* UnicodeToTextInfo;
+alias OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo;
+alias TextToUnicodeInfo ConstTextToUnicodeInfo;
+alias UnicodeToTextInfo ConstUnicodeToTextInfo;
+alias int UnicodeMapVersion;
+alias UnicodeMapping* UnicodeMappingPtr;
+alias UnicodeMapping* ConstUnicodeMappingPtr;
+alias UnicodeToTextFallbackProcPtr UnicodeToTextFallbackUPP;
+
+extern (C)
+{
+	alias int function (wchar*, uint, ByteCount*, char*, uint, ByteCount*, LogicalAddress, ConstUnicodeMappingPtr) UnicodeToTextFallbackProcPtr;
+}
+
+enum
+{
+	kUnicodeUseLatestMapping = -1,
+	kUnicodeUseHFSPlusMapping = 4
+}
+
+enum
+{
+	kUnicodeUseFallbacksBit = 0,
+	kUnicodeKeepInfoBit = 1,
+	kUnicodeDirectionalityBits = 2,
+	kUnicodeVerticalFormBit = 4,
+	kUnicodeLooseMappingsBit = 5,
+	kUnicodeStringUnterminatedBit = 6,
+	kUnicodeTextRunBit = 7,
+	kUnicodeKeepSameEncodingBit = 8,
+	kUnicodeForceASCIIRangeBit = 9,
+	kUnicodeNoHalfwidthCharsBit = 10,
+	kUnicodeTextRunHeuristicsBit = 11,
+	kUnicodeMapLineFeedToReturnBit = 12,
+	kUnicodeUseExternalEncodingFormBit = 13
+}
+
+enum
+{
+	kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit,
+	kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit,
+	kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits,
+	kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit,
+	kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit,
+	kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit,
+	kUnicodeTextRunMask = 1L << kUnicodeTextRunBit,
+	kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit,
+	kUnicodeForceASCIIRangeMask = 1L << kUnicodeForceASCIIRangeBit,
+	kUnicodeNoHalfwidthCharsMask = 1L << kUnicodeNoHalfwidthCharsBit,
+	kUnicodeTextRunHeuristicsMask = 1L << kUnicodeTextRunHeuristicsBit,
+	kUnicodeMapLineFeedToReturnMask = 1L << kUnicodeMapLineFeedToReturnBit,
+	kUnicodeUseExternalEncodingFormMask = 1L << kUnicodeUseExternalEncodingFormBit
+}
+
+enum
+{
+	kUnicodeDefaultDirection = 0,
+	kUnicodeLeftToRight = 1,
+	kUnicodeRightToLeft = 2
+}
+
+enum
+{
+	kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits,
+	kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits,
+	kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits
+}
+
+enum
+{
+	kUnicodeMatchUnicodeBaseBit = 0,
+	kUnicodeMatchUnicodeVariantBit = 1,
+	kUnicodeMatchUnicodeFormatBit = 2,
+	kUnicodeMatchOtherBaseBit = 3,
+	kUnicodeMatchOtherVariantBit = 4,
+	kUnicodeMatchOtherFormatBit = 5
+}
+
+enum
+{
+	kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit,
+	kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit,
+	kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit,
+	kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit,
+	kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit,
+	kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit
+}
+
+enum
+{
+	kUnicodeFallbackSequencingBits = 0
+}
+
+enum
+{
+	kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits,
+	kUnicodeFallbackInterruptSafeMask = 1L << 2
+}
+
+enum
+{
+	kUnicodeFallbackDefaultOnly = 0L,
+	kUnicodeFallbackCustomOnly = 1L,
+	kUnicodeFallbackDefaultFirst = 2L,
+	kUnicodeFallbackCustomFirst = 3L
+}
+
+struct UnicodeMapping
+{
+	uint unicodeEncoding;
+	uint otherEncoding;
+	int mappingVersion;
+}
+
+extern (C)
+{
+	UnicodeToTextFallbackUPP NewUnicodeToTextFallbackUPP (UnicodeToTextFallbackProcPtr userRoutine);
+	void DisposeUnicodeToTextFallbackUPP (UnicodeToTextFallbackUPP userUPP);
+	int InvokeUnicodeToTextFallbackUPP (wchar* iSrcUniStr, uint iSrcUniStrLen, ByteCount* oSrcConvLen, char* oDestStr, uint iDestStrLen, ByteCount* oDestConvLen, LogicalAddress iInfoPtr, ConstUnicodeMappingPtr iUnicodeMappingPtr, UnicodeToTextFallbackUPP userUPP);
+	int CreateTextToUnicodeInfo (ConstUnicodeMappingPtr iUnicodeMapping, TextToUnicodeInfo* oTextToUnicodeInfo);
+	int CreateTextToUnicodeInfoByEncoding (uint iEncoding, TextToUnicodeInfo* oTextToUnicodeInfo);
+	int CreateUnicodeToTextInfo (ConstUnicodeMappingPtr iUnicodeMapping, UnicodeToTextInfo* oUnicodeToTextInfo);
+	int CreateUnicodeToTextInfoByEncoding (uint iEncoding, UnicodeToTextInfo* oUnicodeToTextInfo);
+	int CreateUnicodeToTextRunInfo (uint iNumberOfMappings, UnicodeMapping* iUnicodeMappings, UnicodeToTextRunInfo* oUnicodeToTextInfo);
+	int CreateUnicodeToTextRunInfoByEncoding (uint iNumberOfEncodings, TextEncoding* iEncodings, UnicodeToTextRunInfo* oUnicodeToTextInfo);
+	int CreateUnicodeToTextRunInfoByScriptCode (uint iNumberOfScriptCodes, ScriptCode* iScripts, UnicodeToTextRunInfo* oUnicodeToTextInfo);
+	int ChangeTextToUnicodeInfo (TextToUnicodeInfo ioTextToUnicodeInfo, ConstUnicodeMappingPtr iUnicodeMapping);
+	int ChangeUnicodeToTextInfo (UnicodeToTextInfo ioUnicodeToTextInfo, ConstUnicodeMappingPtr iUnicodeMapping);
+	int DisposeTextToUnicodeInfo (TextToUnicodeInfo* ioTextToUnicodeInfo);
+	int DisposeUnicodeToTextInfo (UnicodeToTextInfo* ioUnicodeToTextInfo);
+	int DisposeUnicodeToTextRunInfo (UnicodeToTextRunInfo* ioUnicodeToTextRunInfo);
+	int ConvertFromTextToUnicode (TextToUnicodeInfo iTextToUnicodeInfo, uint iSourceLen, ConstLogicalAddress iSourceStr, uint iControlFlags, uint iOffsetCount, ByteOffset* iOffsetArray, ItemCount* oOffsetCount, ByteOffset* oOffsetArray, uint iOutputBufLen, ByteCount* oSourceRead, ByteCount* oUnicodeLen, wchar* oUnicodeStr);
+	int ConvertFromUnicodeToText (UnicodeToTextInfo iUnicodeToTextInfo, uint iUnicodeLen, wchar* iUnicodeStr, uint iControlFlags, uint iOffsetCount, ByteOffset* iOffsetArray, ItemCount* oOffsetCount, ByteOffset* oOffsetArray, uint iOutputBufLen, ByteCount* oInputRead, ByteCount* oOutputLen, LogicalAddress oOutputStr);
+	int ConvertFromUnicodeToTextRun (UnicodeToTextRunInfo iUnicodeToTextInfo, uint iUnicodeLen, wchar* iUnicodeStr, uint iControlFlags, uint iOffsetCount, ByteOffset* iOffsetArray, ItemCount* oOffsetCount, ByteOffset* oOffsetArray, uint iOutputBufLen, ByteCount* oInputRead, ByteCount* oOutputLen, LogicalAddress oOutputStr, uint iEncodingRunBufLen, ItemCount* oEncodingRunOutLen, TextEncodingRun* oEncodingRuns);
+	int ConvertFromUnicodeToScriptCodeRun (UnicodeToTextRunInfo iUnicodeToTextInfo, uint iUnicodeLen, wchar* iUnicodeStr, uint iControlFlags, uint iOffsetCount, ByteOffset* iOffsetArray, ItemCount* oOffsetCount, ByteOffset* oOffsetArray, uint iOutputBufLen, ByteCount* oInputRead, ByteCount* oOutputLen, LogicalAddress oOutputStr, uint iScriptRunBufLen, ItemCount* oScriptRunOutLen, ScriptCodeRun* oScriptCodeRuns);
+	int TruncateForTextToUnicode (ConstTextToUnicodeInfo iTextToUnicodeInfo, uint iSourceLen, ConstLogicalAddress iSourceStr, uint iMaxLen, ByteCount* oTruncatedLen);
+	int TruncateForUnicodeToText (ConstUnicodeToTextInfo iUnicodeToTextInfo, uint iSourceLen, wchar* iSourceStr, uint iControlFlags, uint iMaxLen, ByteCount* oTruncatedLen);
+	int ConvertFromPStringToUnicode (TextToUnicodeInfo iTextToUnicodeInfo, char* iPascalStr, uint iOutputBufLen, ByteCount* oUnicodeLen, wchar* oUnicodeStr);
+	int ConvertFromUnicodeToPString (UnicodeToTextInfo iUnicodeToTextInfo, uint iUnicodeLen, wchar* iUnicodeStr, ubyte[256] oPascalStr);
+	int CountUnicodeMappings (uint iFilter, ConstUnicodeMappingPtr iFindMapping, ItemCount* oActualCount);
+	int QueryUnicodeMappings (uint iFilter, ConstUnicodeMappingPtr iFindMapping, uint iMaxCount, ItemCount* oActualCount, UnicodeMapping* oReturnedMappings);
+	int SetFallbackUnicodeToText (UnicodeToTextInfo iUnicodeToTextInfo, UnicodeToTextFallbackUPP iFallback, uint iControlFlags, LogicalAddress iInfoPtr);
+	int SetFallbackUnicodeToTextRun (UnicodeToTextRunInfo iUnicodeToTextRunInfo, UnicodeToTextFallbackUPP iFallback, uint iControlFlags, LogicalAddress iInfoPtr);
+	int ResetTextToUnicodeInfo (TextToUnicodeInfo ioTextToUnicodeInfo);
+	int ResetUnicodeToTextInfo (UnicodeToTextInfo ioUnicodeToTextInfo);
+	int ResetUnicodeToTextRunInfo (UnicodeToTextRunInfo ioUnicodeToTextRunInfo);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/UnicodeUtilities.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,302 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.UnicodeUtilities;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.coreservices.carboncore.MacLocales;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.TextCommon;
+import dstep.corefoundation.CFCharacterSet;
+import dstep.objc.bridge.TypeEncoding;
+
+struct OpaqueCollatorRef;
+struct OpaqueUCTypeSelectRef;
+struct OpaqueTextBreakLocatorRef;
+
+alias ushort UCKeyOutput;
+alias ushort UCKeyCharSeq;
+alias OpaqueCollatorRef* CollatorRef;
+alias uint UCCollateOptions;
+alias uint UCCollationValue;
+alias OpaqueUCTypeSelectRef* UCTypeSelectRef;
+alias int UCTypeSelectCompareResult;
+alias ushort UCTSWalkDirection;
+alias ushort UCTypeSelectOptions;
+alias IndexToUCStringProcPtr IndexToUCStringUPP;
+alias OpaqueTextBreakLocatorRef* TextBreakLocatorRef;
+alias uint UCTextBreakType;
+alias uint UCTextBreakOptions;
+
+extern (C)
+{
+	alias ubyte function (uint, void*, void*, CFStringRef*, UCTypeSelectOptions*) IndexToUCStringProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kUnicodeCollationClass = getOSType!("ucol");
+
+	}
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kUnicodeTextBreakClass = getOSType!("ubrk");
+
+	}
+}
+
+enum
+{
+	kUCKeyOutputStateIndexMask = 0x4000,
+	kUCKeyOutputSequenceIndexMask = 0x8000,
+	kUCKeyOutputTestForIndexMask = 0xC000,
+	kUCKeyOutputGetIndexMask = 0x3FFF
+}
+
+enum
+{
+	kUCKeyStateEntryTerminalFormat = 0x0001,
+	kUCKeyStateEntryRangeFormat = 0x0002
+}
+
+enum
+{
+	kUCKeyLayoutHeaderFormat = 0x1002,
+	kUCKeyLayoutFeatureInfoFormat = 0x2001,
+	kUCKeyModifiersToTableNumFormat = 0x3001,
+	kUCKeyToCharTableIndexFormat = 0x4001,
+	kUCKeyStateRecordsIndexFormat = 0x5001,
+	kUCKeyStateTerminatorsFormat = 0x6001,
+	kUCKeySequenceDataIndexFormat = 0x7001
+}
+
+enum
+{
+	kUCKeyActionDown = 0,
+	kUCKeyActionUp = 1,
+	kUCKeyActionAutoKey = 2,
+	kUCKeyActionDisplay = 3
+}
+
+enum
+{
+	kUCKeyTranslateNoDeadKeysBit = 0
+}
+
+enum
+{
+	kUCKeyTranslateNoDeadKeysMask = 1L << kUCKeyTranslateNoDeadKeysBit
+}
+
+enum
+{
+	kUnicodeCollationClass = getOSType!("ucol")
+}
+
+enum
+{
+	kUCCollateComposeInsensitiveMask = 1L << 1,
+	kUCCollateWidthInsensitiveMask = 1L << 2,
+	kUCCollateCaseInsensitiveMask = 1L << 3,
+	kUCCollateDiacritInsensitiveMask = 1L << 4,
+	kUCCollatePunctuationSignificantMask = 1L << 15,
+	kUCCollateDigitsOverrideMask = 1L << 16,
+	kUCCollateDigitsAsNumberMask = 1L << 17
+}
+
+enum
+{
+	kUCCollateStandardOptions = kUCCollateComposeInsensitiveMask | kUCCollateWidthInsensitiveMask
+}
+
+enum
+{
+	kUCCollateTypeHFSExtended = 1
+}
+
+enum
+{
+	kUCCollateTypeSourceMask = 0x000000FF,
+	kUCCollateTypeShiftBits = 24
+}
+
+enum
+{
+	kUCCollateTypeMask = kUCCollateTypeSourceMask << kUCCollateTypeShiftBits
+}
+
+enum
+{
+	kUCTSDirectionNext = 0,
+	kUCTSDirectionPrevious = 1
+}
+
+enum
+{
+	kUCTSOptionsNoneMask = 0,
+	kUCTSOptionsReleaseStringMask = 1,
+	kUCTSOptionsDataIsOrderedMask = 2
+}
+
+enum
+{
+	kUCTypeSelectMaxListSize = cast(uint)0xFFFFFFFF
+}
+
+enum
+{
+	kUnicodeTextBreakClass = getOSType!("ubrk")
+}
+
+enum
+{
+	kUCTextBreakCharMask = 1L << 0,
+	kUCTextBreakClusterMask = 1L << 2,
+	kUCTextBreakWordMask = 1L << 4,
+	kUCTextBreakLineMask = 1L << 6,
+	kUCTextBreakParagraphMask = 1L << 8
+}
+
+enum
+{
+	kUCTextBreakLeadingEdgeMask = 1L << 0,
+	kUCTextBreakGoBackwardsMask = 1L << 1,
+	kUCTextBreakIterateMask = 1L << 2
+}
+
+struct UCKeyStateRecord
+{
+	ushort stateZeroCharData;
+	ushort stateZeroNextState;
+	ushort stateEntryCount;
+	ushort stateEntryFormat;
+	UInt32* stateEntryData;
+}
+
+
+struct UCKeyStateEntryTerminal
+{
+	ushort curState;
+	ushort charData;
+}
+
+
+struct UCKeyStateEntryRange
+{
+	ushort curStateStart;
+	ubyte curStateRange;
+	ubyte deltaMultiplier;
+	ushort charData;
+	ushort nextState;
+}
+
+
+struct UCKeyboardTypeHeader
+{
+	uint keyboardTypeFirst;
+	uint keyboardTypeLast;
+	uint keyModifiersToTableNumOffset;
+	uint keyToCharTableIndexOffset;
+	uint keyStateRecordsIndexOffset;
+	uint keyStateTerminatorsOffset;
+	uint keySequenceDataIndexOffset;
+}
+
+
+struct UCKeyboardLayout
+{
+	ushort keyLayoutHeaderFormat;
+	ushort keyLayoutDataVersion;
+	uint keyLayoutFeatureInfoOffset;
+	uint keyboardTypeCount;
+	UCKeyboardTypeHeader* keyboardTypeList;
+}
+
+
+struct UCKeyLayoutFeatureInfo
+{
+	ushort keyLayoutFeatureInfoFormat;
+	ushort reserved;
+	uint maxOutputStringLength;
+}
+
+
+struct UCKeyModifiersToTableNum
+{
+	ushort keyModifiersToTableNumFormat;
+	ushort defaultTableNum;
+	uint modifiersCount;
+	char* tableNum;
+}
+
+
+struct UCKeyToCharTableIndex
+{
+	ushort keyToCharTableIndexFormat;
+	ushort keyToCharTableSize;
+	uint keyToCharTableCount;
+	UInt32* keyToCharTableOffsets;
+}
+
+
+struct UCKeyStateRecordsIndex
+{
+	ushort keyStateRecordsIndexFormat;
+	ushort keyStateRecordCount;
+	UInt32* keyStateRecordOffsets;
+}
+
+
+struct UCKeyStateTerminators
+{
+	ushort keyStateTerminatorsFormat;
+	ushort keyStateTerminatorCount;
+	UCKeyCharSeq* keyStateTerminators;
+}
+
+
+struct UCKeySequenceDataIndex
+{
+	ushort keySequenceDataIndexFormat;
+	ushort charSequenceCount;
+	UInt16* charSequenceOffsets;
+}
+
+extern (C)
+{
+	IndexToUCStringUPP NewIndexToUCStringUPP (IndexToUCStringProcPtr userRoutine);
+	void DisposeIndexToUCStringUPP (IndexToUCStringUPP userUPP);
+	ubyte InvokeIndexToUCStringUPP (uint index, void* listDataPtr, void* refcon, CFStringRef* outString, UCTypeSelectOptions* tsOptions, IndexToUCStringUPP userUPP);
+	int UCKeyTranslate (UCKeyboardLayout* keyLayoutPtr, ushort virtualKeyCode, ushort keyAction, uint modifierKeyState, uint keyboardType, uint keyTranslateOptions, UInt32* deadKeyState, uint maxStringLength, UniCharCount* actualStringLength, wchar* unicodeString);
+	int UCCreateCollator (LocaleRef locale, uint opVariant, uint options, CollatorRef* collatorRef);
+	int UCGetCollationKey (CollatorRef collatorRef, wchar* textPtr, uint textLength, uint maxKeySize, ItemCount* actualKeySize, UCCollationValue* collationKey);
+	int UCCompareCollationKeys (UCCollationValue* key1Ptr, uint key1Length, UCCollationValue* key2Ptr, uint key2Length, char* equivalent, SInt32* order);
+	int UCCompareText (CollatorRef collatorRef, wchar* text1Ptr, uint text1Length, wchar* text2Ptr, uint text2Length, char* equivalent, SInt32* order);
+	int UCDisposeCollator (CollatorRef* collatorRef);
+	int UCCompareTextDefault (uint options, wchar* text1Ptr, uint text1Length, wchar* text2Ptr, uint text2Length, char* equivalent, SInt32* order);
+	int UCCompareTextNoLocale (uint options, wchar* text1Ptr, uint text1Length, wchar* text2Ptr, uint text2Length, char* equivalent, SInt32* order);
+	int UCCreateTextBreakLocator (LocaleRef locale, uint opVariant, uint breakTypes, TextBreakLocatorRef* breakRef);
+	int UCFindTextBreak (TextBreakLocatorRef breakRef, uint breakType, uint options, wchar* textPtr, uint textLength, uint startOffset, UniCharArrayOffset* breakOffset);
+	int UCDisposeTextBreakLocator (TextBreakLocatorRef* breakRef);
+	int UCTypeSelectCreateSelector (LocaleRef locale, uint opVariant, uint options, UCTypeSelectRef* newSelector);
+	int UCTypeSelectFlushSelectorData (UCTypeSelectRef ref_);
+	int UCTypeSelectReleaseSelector (UCTypeSelectRef* ref_);
+	ubyte UCTypeSelectWouldResetBuffer (UCTypeSelectRef inRef, CFStringRef inText, double inEventTime);
+	int UCTypeSelectAddKeyToSelector (UCTypeSelectRef inRef, CFStringRef inText, double inEventTime, char* updateFlag);
+	int UCTypeSelectCompare (UCTypeSelectRef ref_, CFStringRef inText, UCTypeSelectCompareResult* result);
+	int UCTypeSelectFindItem (UCTypeSelectRef ref_, uint listSize, void* listDataPtr, void* refcon, IndexToUCStringUPP userUPP, UInt32* closestItem);
+	int UCTypeSelectWalkList (UCTypeSelectRef ref_, CFStringRef currSelect, ushort direction, uint listSize, void* listDataPtr, void* refcon, IndexToUCStringUPP userUPP, UInt32* closestItem);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/carboncore/fp.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,80 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.carboncore.fp;
+
+version (Tango)
+	import tango.stdc.math;
+
+else
+	import std.c.math;
+
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.internal.Version;
+
+
+alias short relop;
+
+const SIGDIGLEN = 36;
+
+extern (C)
+{
+	extern
+	{
+		const double pi;
+	}
+}
+
+enum
+{
+	GREATERTHAN = 0,
+	LESSTHAN = 1,
+	EQUALTO = 2,
+	UNORDERED = 3
+}
+
+struct decimal
+{
+	byte sgn;
+	byte unused;
+	short exp;
+	
+	struct
+	{
+		ubyte length;
+		ubyte[SIGDIGLEN] text;
+		ubyte unused_;
+	}
+}
+
+struct decform
+{
+	byte style;
+	short unused;
+	short digits;
+}
+
+extern (C)
+{
+	double compound (double rate, double periods);
+	double annuity (double rate, double periods);
+	double randomx (double* x);
+	short relation (double x, double y);
+	void num2dec (decform* f, double x, decimal* d);
+	double dec2num (decimal* d);
+	void dec2str (decform* f, decimal* d, char* s);
+	void str2dec (char* s, short* ix, decimal* d, short* vp);
+	float dec2f (decimal* d);
+	short dec2s (decimal* d);
+	int dec2l (decimal* d);
+	double x80tod (extended80* x80);
+	void dtox80 (double* x, extended80* x80);
+	void x80told (extended80* x80, double* x);
+	void ldtox80 (double* x, extended80* x80);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFFTPStream.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,49 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFFTPStream;
+
+//import dstep.Availability;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFStream;
+import dstep.corefoundation.CFURL;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+
+extern (C)
+{
+	extern
+	{
+		const int kCFStreamErrorDomainFTP;
+		const CFStringRef kCFStreamPropertyFTPUserName;
+		const CFStringRef kCFStreamPropertyFTPPassword;
+		const CFStringRef kCFStreamPropertyFTPUsePassiveMode;
+		const CFStringRef kCFStreamPropertyFTPResourceSize;
+		const CFStringRef kCFStreamPropertyFTPFetchResourceInfo;
+		const CFStringRef kCFStreamPropertyFTPFileTransferOffset;
+		const CFStringRef kCFStreamPropertyFTPAttemptPersistentConnection;
+		const CFStringRef kCFStreamPropertyFTPProxy;
+		const CFStringRef kCFStreamPropertyFTPProxyHost;
+		const CFStringRef kCFStreamPropertyFTPProxyPort;
+		const CFStringRef kCFStreamPropertyFTPProxyUser;
+		const CFStringRef kCFStreamPropertyFTPProxyPassword;
+		const CFStringRef kCFFTPResourceMode;
+		const CFStringRef kCFFTPResourceName;
+		const CFStringRef kCFFTPResourceOwner;
+		const CFStringRef kCFFTPResourceGroup;
+		const CFStringRef kCFFTPResourceLink;
+		const CFStringRef kCFFTPResourceSize;
+		const CFStringRef kCFFTPResourceType;
+		const CFStringRef kCFFTPResourceModDate;
+	}
+}
+
+extern (C)
+{
+	CFReadStreamRef CFReadStreamCreateWithFTPURL (CFAllocatorRef alloc, CFURLRef ftpURL);
+	int CFFTPCreateParsedResourceListing (CFAllocatorRef alloc, char* buffer, int bufferLength, CFDictionaryRef* parsed);
+	CFWriteStreamRef CFWriteStreamCreateWithFTPURL (CFAllocatorRef alloc, CFURLRef ftpURL);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFHTTPAuthentication.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,50 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFHTTPAuthentication;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFHTTPMessage;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CoreFoundation;
+
+struct _CFHTTPAuthentication;
+
+alias _CFHTTPAuthentication* CFHTTPAuthenticationRef;
+alias int CFStreamErrorHTTPAuthentication;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFHTTPAuthenticationUsername;
+		const CFStringRef kCFHTTPAuthenticationPassword;
+		const CFStringRef kCFHTTPAuthenticationAccountDomain;
+	}
+}
+
+enum /*CFStreamErrorHTTPAuthentication*/ 
+{
+	kCFStreamErrorHTTPAuthenticationTypeUnsupported = -1000,
+	kCFStreamErrorHTTPAuthenticationBadUserName = -1001,
+	kCFStreamErrorHTTPAuthenticationBadPassword = -1002
+}
+
+extern (C)
+{
+	uint CFHTTPAuthenticationGetTypeID ();
+	CFHTTPAuthenticationRef CFHTTPAuthenticationCreateFromResponse (CFAllocatorRef alloc, CFHTTPMessageRef response);
+	ubyte CFHTTPAuthenticationIsValid (CFHTTPAuthenticationRef auth, CFStreamError* error);
+	ubyte CFHTTPAuthenticationAppliesToRequest (CFHTTPAuthenticationRef auth, CFHTTPMessageRef request);
+	ubyte CFHTTPAuthenticationRequiresOrderedRequests (CFHTTPAuthenticationRef auth);
+	ubyte CFHTTPMessageApplyCredentials (CFHTTPMessageRef request, CFHTTPAuthenticationRef auth, CFStringRef username, CFStringRef password, CFStreamError* error);
+	ubyte CFHTTPMessageApplyCredentialDictionary (CFHTTPMessageRef request, CFHTTPAuthenticationRef auth, CFDictionaryRef dict, CFStreamError* error);
+	CFStringRef CFHTTPAuthenticationCopyRealm (CFHTTPAuthenticationRef auth);
+	CFArrayRef CFHTTPAuthenticationCopyDomains (CFHTTPAuthenticationRef auth);
+	CFStringRef CFHTTPAuthenticationCopyMethod (CFHTTPAuthenticationRef auth);
+	ubyte CFHTTPAuthenticationRequiresUserNameAndPassword (CFHTTPAuthenticationRef auth);
+	ubyte CFHTTPAuthenticationRequiresAccountDomain (CFHTTPAuthenticationRef auth);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFHTTPMessage.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,56 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFHTTPMessage;
+
+//import dstep.Availability;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+
+struct __CFHTTPMessage;
+
+alias __CFHTTPMessage* CFHTTPMessageRef;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFHTTPVersion1_0;
+		const CFStringRef kCFHTTPVersion1_1;
+		const CFStringRef kCFHTTPAuthenticationSchemeBasic;
+		const CFStringRef kCFHTTPAuthenticationSchemeDigest;
+		const CFStringRef kCFHTTPAuthenticationSchemeNTLM;
+		const CFStringRef kCFHTTPAuthenticationSchemeNegotiate;
+	}
+}
+
+extern (C)
+{
+	uint CFHTTPMessageGetTypeID ();
+	CFHTTPMessageRef CFHTTPMessageCreateRequest (CFAllocatorRef alloc, CFStringRef requestMethod, CFURLRef url, CFStringRef httpVersion);
+	CFHTTPMessageRef CFHTTPMessageCreateResponse (CFAllocatorRef alloc, int statusCode, CFStringRef statusDescription, CFStringRef httpVersion);
+	CFHTTPMessageRef CFHTTPMessageCreateEmpty (CFAllocatorRef alloc, ubyte isRequest);
+	CFHTTPMessageRef CFHTTPMessageCreateCopy (CFAllocatorRef alloc, CFHTTPMessageRef message);
+	ubyte CFHTTPMessageIsRequest (CFHTTPMessageRef message);
+	CFStringRef CFHTTPMessageCopyVersion (CFHTTPMessageRef message);
+	CFDataRef CFHTTPMessageCopyBody (CFHTTPMessageRef message);
+	void CFHTTPMessageSetBody (CFHTTPMessageRef message, CFDataRef bodyData);
+	CFStringRef CFHTTPMessageCopyHeaderFieldValue (CFHTTPMessageRef message, CFStringRef headerField);
+	CFDictionaryRef CFHTTPMessageCopyAllHeaderFields (CFHTTPMessageRef message);
+	void CFHTTPMessageSetHeaderFieldValue (CFHTTPMessageRef message, CFStringRef headerField, CFStringRef value);
+	ubyte CFHTTPMessageAppendBytes (CFHTTPMessageRef message, char* newBytes, int numBytes);
+	ubyte CFHTTPMessageIsHeaderComplete (CFHTTPMessageRef message);
+	CFDataRef CFHTTPMessageCopySerializedMessage (CFHTTPMessageRef request);
+	CFURLRef CFHTTPMessageCopyRequestURL (CFHTTPMessageRef request);
+	CFStringRef CFHTTPMessageCopyRequestMethod (CFHTTPMessageRef request);
+	ubyte CFHTTPMessageAddAuthentication (CFHTTPMessageRef request, CFHTTPMessageRef authenticationFailureResponse, CFStringRef username, CFStringRef password, CFStringRef authenticationScheme, ubyte forProxy);
+	int CFHTTPMessageGetResponseStatusCode (CFHTTPMessageRef response);
+	CFStringRef CFHTTPMessageCopyResponseStatusLine (CFHTTPMessageRef response);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFHTTPStream.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,49 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFHTTPStream;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFHTTPMessage;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFStream;
+
+alias int CFStreamErrorHTTP;
+
+extern (C)
+{
+	extern
+	{
+		const int kCFStreamErrorDomainHTTP;
+		const CFStringRef kCFStreamPropertyHTTPResponseHeader;
+		const CFStringRef kCFStreamPropertyHTTPFinalURL;
+		const CFStringRef kCFStreamPropertyHTTPFinalRequest;
+		const CFStringRef kCFStreamPropertyHTTPProxy;
+		const CFStringRef kCFStreamPropertyHTTPProxyHost;
+		const CFStringRef kCFStreamPropertyHTTPProxyPort;
+		const CFStringRef kCFStreamPropertyHTTPSProxyHost;
+		const CFStringRef kCFStreamPropertyHTTPSProxyPort;
+		const CFStringRef kCFStreamPropertyHTTPShouldAutoredirect;
+		const CFStringRef kCFStreamPropertyHTTPAttemptPersistentConnection;
+		const CFStringRef kCFStreamPropertyHTTPRequestBytesWrittenCount;
+	}
+}
+
+enum /*CFStreamErrorHTTP*/ 
+{
+	kCFStreamErrorHTTPParseFailure = -1,
+	kCFStreamErrorHTTPRedirectionLoop = -2,
+	kCFStreamErrorHTTPBadURL = -3
+}
+
+extern (C)
+{
+	CFReadStreamRef CFReadStreamCreateForHTTPRequest (CFAllocatorRef alloc, CFHTTPMessageRef request);
+	CFReadStreamRef CFReadStreamCreateForStreamedHTTPRequest (CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody);
+	void CFHTTPReadStreamSetRedirectsAutomatically (CFReadStreamRef httpStream, ubyte shouldAutoRedirect);
+	void CFHTTPReadStreamSetProxy (CFReadStreamRef httpStream, CFStringRef proxyHost, int proxyPort);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFHost.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,63 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFHost;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFStream;
+import dstep.corefoundation.CoreFoundation;
+
+struct __CFHost;
+
+alias __CFHost* CFHostRef;
+alias int CFHostInfoType;
+
+extern (C)
+{
+	alias void function (CFHostRef, int, CFStreamError*, void*) CFHostClientCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const int kCFStreamErrorDomainNetDB;
+		const int kCFStreamErrorDomainSystemConfiguration;
+	}
+}
+
+enum /*CFHostInfoType*/ 
+{
+	kCFHostAddresses = 0,
+	kCFHostNames = 1,
+	kCFHostReachability = 2
+}
+
+struct CFHostClientContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+}
+
+extern (C)
+{
+	uint CFHostGetTypeID ();
+	CFHostRef CFHostCreateWithName (CFAllocatorRef allocator, CFStringRef hostname);
+	CFHostRef CFHostCreateWithAddress (CFAllocatorRef allocator, CFDataRef addr);
+	CFHostRef CFHostCreateCopy (CFAllocatorRef alloc, CFHostRef host);
+	ubyte CFHostStartInfoResolution (CFHostRef theHost, int info, CFStreamError* error);
+	CFArrayRef CFHostGetAddressing (CFHostRef theHost, char* hasBeenResolved);
+	CFArrayRef CFHostGetNames (CFHostRef theHost, char* hasBeenResolved);
+	CFDataRef CFHostGetReachability (CFHostRef theHost, char* hasBeenResolved);
+	void CFHostCancelInfoResolution (CFHostRef theHost, int info);
+	ubyte CFHostSetClient (CFHostRef theHost, CFHostClientCallBack clientCB, CFHostClientContext* clientContext);
+	void CFHostScheduleWithRunLoop (CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFHostUnscheduleFromRunLoop (CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFNetDiagnostics.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,36 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFNetDiagnostics;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CoreFoundation;
+//import dstep.stdint;
+
+struct __CFNetDiagnostic;
+
+alias __CFNetDiagnostic* CFNetDiagnosticRef;
+alias int CFNetDiagnosticStatusValues;
+alias int CFNetDiagnosticStatus;
+
+enum /*CFNetDiagnosticStatusValues*/ 
+{
+	kCFNetDiagnosticNoErr = 0,
+	kCFNetDiagnosticErr = -66560L,
+	kCFNetDiagnosticConnectionUp = -66559L,
+	kCFNetDiagnosticConnectionIndeterminate = -66558L,
+	kCFNetDiagnosticConnectionDown = -66557L
+}
+
+extern (C)
+{
+	CFNetDiagnosticRef CFNetDiagnosticCreateWithStreams (CFAllocatorRef alloc, CFReadStreamRef readStream, CFWriteStreamRef writeStream);
+	CFNetDiagnosticRef CFNetDiagnosticCreateWithURL (CFAllocatorRef alloc, CFURLRef url);
+	void CFNetDiagnosticSetName (CFNetDiagnosticRef details, CFStringRef name);
+	int CFNetDiagnosticDiagnoseProblemInteractively (CFNetDiagnosticRef details);
+	int CFNetDiagnosticCopyNetworkStatusPassively (CFNetDiagnosticRef details, CFStringRef* description);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFNetServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,124 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFNetServices;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFStream;
+
+struct __CFNetService;
+struct __CFNetServiceMonitor;
+struct __CFNetServiceBrowser;
+
+alias __CFNetService* CFNetServiceRef;
+alias __CFNetServiceMonitor* CFNetServiceMonitorRef;
+alias __CFNetServiceBrowser* CFNetServiceBrowserRef;
+alias int CFNetServicesError;
+alias int CFNetServiceMonitorType;
+
+extern (C)
+{
+	alias void function (CFNetServiceRef, CFStreamError*, void*) CFNetServiceClientCallBack;
+	alias void function (CFNetServiceBrowserRef, uint, CFTypeRef, CFStreamError*, void*) CFNetServiceBrowserClientCallBack;
+	alias void function (CFNetServiceMonitorRef, CFNetServiceRef, int, CFDataRef, CFStreamError*, void*) CFNetServiceMonitorClientCallBack;
+}
+
+extern (C)
+{
+	extern
+	{
+		const int kCFStreamErrorDomainMach;
+		const int kCFStreamErrorDomainNetServices;
+	}
+}
+
+enum /*CFNetServicesError*/ 
+{
+	kCFNetServicesErrorUnknown = -72000L,
+	kCFNetServicesErrorCollision = -72001L,
+	kCFNetServicesErrorNotFound = -72002L,
+	kCFNetServicesErrorInProgress = -72003L,
+	kCFNetServicesErrorBadArgument = -72004L,
+	kCFNetServicesErrorCancel = -72005L,
+	kCFNetServicesErrorInvalid = -72006L,
+	kCFNetServicesErrorTimeout = -72007L
+}
+
+enum /*CFNetServiceMonitorType*/ 
+{
+	kCFNetServiceMonitorTXT = 1
+}
+
+enum
+{
+	kCFNetServiceFlagNoAutoRename = 1
+}
+
+enum
+{
+	kCFNetServiceFlagMoreComing = 1,
+	kCFNetServiceFlagIsDomain = 2,
+	kCFNetServiceFlagIsDefault = 4,
+	kCFNetServiceFlagIsRegistrationDomain = 4,
+	kCFNetServiceFlagRemove = 8
+}
+
+struct CFNetServiceClientContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+}
+
+extern (C)
+{
+	uint CFNetServiceGetTypeID ();
+	uint CFNetServiceMonitorGetTypeID ();
+	uint CFNetServiceBrowserGetTypeID ();
+	CFNetServiceRef CFNetServiceCreate (CFAllocatorRef alloc, CFStringRef domain, CFStringRef serviceType, CFStringRef name, int port);
+	CFNetServiceRef CFNetServiceCreateCopy (CFAllocatorRef alloc, CFNetServiceRef service);
+	CFStringRef CFNetServiceGetDomain (CFNetServiceRef theService);
+	CFStringRef CFNetServiceGetType (CFNetServiceRef theService);
+	CFStringRef CFNetServiceGetName (CFNetServiceRef theService);
+	ubyte CFNetServiceRegisterWithOptions (CFNetServiceRef theService, uint options, CFStreamError* error);
+	ubyte CFNetServiceResolveWithTimeout (CFNetServiceRef theService, double timeout, CFStreamError* error);
+	void CFNetServiceCancel (CFNetServiceRef theService);
+	CFStringRef CFNetServiceGetTargetHost (CFNetServiceRef theService);
+	int CFNetServiceGetPortNumber (CFNetServiceRef theService);
+	CFArrayRef CFNetServiceGetAddressing (CFNetServiceRef theService);
+	CFDataRef CFNetServiceGetTXTData (CFNetServiceRef theService);
+	ubyte CFNetServiceSetTXTData (CFNetServiceRef theService, CFDataRef txtRecord);
+	CFDictionaryRef CFNetServiceCreateDictionaryWithTXTData (CFAllocatorRef alloc, CFDataRef txtRecord);
+	CFDataRef CFNetServiceCreateTXTDataWithDictionary (CFAllocatorRef alloc, CFDictionaryRef keyValuePairs);
+	ubyte CFNetServiceSetClient (CFNetServiceRef theService, CFNetServiceClientCallBack clientCB, CFNetServiceClientContext* clientContext);
+	void CFNetServiceScheduleWithRunLoop (CFNetServiceRef theService, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFNetServiceUnscheduleFromRunLoop (CFNetServiceRef theService, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	CFNetServiceMonitorRef CFNetServiceMonitorCreate (CFAllocatorRef alloc, CFNetServiceRef theService, CFNetServiceMonitorClientCallBack clientCB, CFNetServiceClientContext* clientContext);
+	void CFNetServiceMonitorInvalidate (CFNetServiceMonitorRef monitor);
+	ubyte CFNetServiceMonitorStart (CFNetServiceMonitorRef monitor, int recordType, CFStreamError* error);
+	void CFNetServiceMonitorStop (CFNetServiceMonitorRef monitor, CFStreamError* error);
+	void CFNetServiceMonitorScheduleWithRunLoop (CFNetServiceMonitorRef monitor, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFNetServiceMonitorUnscheduleFromRunLoop (CFNetServiceMonitorRef monitor, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	CFNetServiceBrowserRef CFNetServiceBrowserCreate (CFAllocatorRef alloc, CFNetServiceBrowserClientCallBack clientCB, CFNetServiceClientContext* clientContext);
+	void CFNetServiceBrowserInvalidate (CFNetServiceBrowserRef browser);
+	ubyte CFNetServiceBrowserSearchForDomains (CFNetServiceBrowserRef browser, ubyte registrationDomains, CFStreamError* error);
+	ubyte CFNetServiceBrowserSearchForServices (CFNetServiceBrowserRef browser, CFStringRef domain, CFStringRef serviceType, CFStreamError* error);
+	void CFNetServiceBrowserStopSearch (CFNetServiceBrowserRef browser, CFStreamError* error);
+	void CFNetServiceBrowserScheduleWithRunLoop (CFNetServiceBrowserRef browser, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CFNetServiceBrowserUnscheduleFromRunLoop (CFNetServiceBrowserRef browser, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	ubyte CFNetServiceRegister (CFNetServiceRef theService, CFStreamError* error);
+	ubyte CFNetServiceResolve (CFNetServiceRef theService, CFStreamError* error);
+	CFStringRef CFNetServiceGetProtocolSpecificInformation (CFNetServiceRef theService);
+	void CFNetServiceSetProtocolSpecificInformation (CFNetServiceRef theService, CFStringRef theInfo);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFNetwork.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,23 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFNetwork;
+
+public:
+
+import dstep.coreservices.cfnetwork.CFFTPStream;
+import dstep.coreservices.cfnetwork.CFHTTPAuthentication;
+import dstep.coreservices.cfnetwork.CFHTTPMessage;
+import dstep.coreservices.cfnetwork.CFHTTPStream;
+import dstep.coreservices.cfnetwork.CFHost;
+import dstep.coreservices.cfnetwork.CFNetDiagnostics;
+import dstep.coreservices.cfnetwork.CFNetServices;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.coreservices.cfnetwork.CFNetworkErrors;
+import dstep.coreservices.cfnetwork.CFProxySupport;
+import dstep.coreservices.cfnetwork.CFSocketStream;
+import dstep.corefoundation.CoreFoundation;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFNetworkDefs.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,7 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFNetworkDefs;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFNetworkErrors.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,66 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFNetworkErrors;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFString;
+
+alias int CFNetworkErrors;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFErrorDomainCFNetwork;
+		const CFStringRef kCFErrorDomainWinSock;
+		const CFStringRef kCFGetAddrInfoFailureKey;
+		const CFStringRef kCFSOCKSStatusCodeKey;
+		const CFStringRef kCFSOCKSVersionKey;
+		const CFStringRef kCFSOCKSNegotiationMethodKey;
+		const CFStringRef kCFDNSServiceFailureKey;
+		const CFStringRef kCFFTPStatusCodeKey;
+	}
+}
+
+enum /*CFNetworkErrors*/ 
+{
+	kCFHostErrorHostNotFound = 1,
+	kCFHostErrorUnknown = 2,
+	kCFSOCKSErrorUnknownClientVersion = 100,
+	kCFSOCKSErrorUnsupportedServerVersion = 101,
+	kCFSOCKS4ErrorRequestFailed = 110,
+	kCFSOCKS4ErrorIdentdFailed = 111,
+	kCFSOCKS4ErrorIdConflict = 112,
+	kCFSOCKS4ErrorUnknownStatusCode = 113,
+	kCFSOCKS5ErrorBadState = 120,
+	kCFSOCKS5ErrorBadResponseAddr = 121,
+	kCFSOCKS5ErrorBadCredentials = 122,
+	kCFSOCKS5ErrorUnsupportedNegotiationMethod = 123,
+	kCFSOCKS5ErrorNoAcceptableMethod = 124,
+	kCFNetServiceErrorUnknown = -72000L,
+	kCFNetServiceErrorCollision = -72001L,
+	kCFNetServiceErrorNotFound = -72002L,
+	kCFNetServiceErrorInProgress = -72003L,
+	kCFNetServiceErrorBadArgument = -72004L,
+	kCFNetServiceErrorCancel = -72005L,
+	kCFNetServiceErrorInvalid = -72006L,
+	kCFNetServiceErrorTimeout = -72007L,
+	kCFNetServiceErrorDNSServiceFailure = -73000L,
+	kCFFTPErrorUnexpectedStatusCode = 200,
+	kCFErrorHTTPAuthenticationTypeUnsupported = 300,
+	kCFErrorHTTPBadCredentials = 301,
+	kCFErrorHTTPConnectionLost = 302,
+	kCFErrorHTTPParseFailure = 303,
+	kCFErrorHTTPRedirectionLoopDetected = 304,
+	kCFErrorHTTPBadURL = 305,
+	kCFErrorHTTPProxyConnectionFailure = 306,
+	kCFErrorHTTPBadProxyCredentials = 307,
+	kCFErrorPACFileError = 308
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFProxySupport.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,51 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFProxySupport;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFError;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFStream;
+import dstep.corefoundation.CFString;
+import dstep.corefoundation.CFURL;
+
+extern (C)
+{
+	alias void function (void*, CFArrayRef, CFErrorRef) CFProxyAutoConfigurationResultCallback;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFProxyTypeKey;
+		const CFStringRef kCFProxyHostNameKey;
+		const CFStringRef kCFProxyPortNumberKey;
+		const CFStringRef kCFProxyAutoConfigurationURLKey;
+		const CFStringRef kCFProxyUsernameKey;
+		const CFStringRef kCFProxyPasswordKey;
+		const CFStringRef kCFProxyTypeNone;
+		const CFStringRef kCFProxyTypeHTTP;
+		const CFStringRef kCFProxyTypeHTTPS;
+		const CFStringRef kCFProxyTypeSOCKS;
+		const CFStringRef kCFProxyTypeFTP;
+		const CFStringRef kCFProxyTypeAutoConfigurationURL;
+	}
+}
+
+extern (C)
+{
+	CFArrayRef CFNetworkCopyProxiesForURL (CFURLRef url, CFDictionaryRef proxySettings);
+	CFArrayRef CFNetworkCopyProxiesForAutoConfigurationScript (CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL, CFErrorRef* error);
+	CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationScript (CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL, CFProxyAutoConfigurationResultCallback cb, CFStreamClientContext* clientContext);
+	CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationURL (CFURLRef proxyAutoConfigURL, CFURLRef targetURL, CFProxyAutoConfigurationResultCallback cb, CFStreamClientContext* clientContext);
+	CFDictionaryRef CFNetworkCopySystemProxySettings ();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/cfnetwork/CFSocketStream.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,99 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.cfnetwork.CFSocketStream;
+
+//import dstep.Availability;
+import dstep.coreservices.cfnetwork.CFHost;
+import dstep.coreservices.cfnetwork.CFNetServices;
+import dstep.coreservices.cfnetwork.CFNetworkDefs;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFStream;
+
+alias int CFStreamSocketSecurityProtocol;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCFStreamPropertySSLPeerCertificates;
+		const CFStringRef kCFStreamPropertySSLSettings;
+		const CFStringRef kCFStreamSSLLevel;
+		const CFStringRef kCFStreamSSLAllowsExpiredCertificates;
+		const CFStringRef kCFStreamSSLAllowsExpiredRoots;
+		const CFStringRef kCFStreamSSLAllowsAnyRoot;
+		const CFStringRef kCFStreamSSLValidatesCertificateChain;
+		const CFStringRef kCFStreamSSLPeerName;
+		const CFStringRef kCFStreamSSLCertificates;
+		const CFStringRef kCFStreamSSLIsServer;
+		const int kCFStreamErrorDomainWinSock;
+		const int kCFStreamErrorDomainSOCKS;
+		const CFStringRef kCFStreamPropertySOCKSProxy;
+		const CFStringRef kCFStreamPropertySOCKSProxyHost;
+		const CFStringRef kCFStreamPropertySOCKSProxyPort;
+		const CFStringRef kCFStreamPropertySOCKSVersion;
+		const CFStringRef kCFStreamSocketSOCKSVersion4;
+		const CFStringRef kCFStreamSocketSOCKSVersion5;
+		const CFStringRef kCFStreamPropertySOCKSUser;
+		const CFStringRef kCFStreamPropertySOCKSPassword;
+		const int kCFStreamErrorDomainSSL;
+		const CFStringRef kCFStreamPropertySocketSecurityLevel;
+		const CFStringRef kCFStreamSocketSecurityLevelNone;
+		const CFStringRef kCFStreamSocketSecurityLevelSSLv2;
+		const CFStringRef kCFStreamSocketSecurityLevelSSLv3;
+		const CFStringRef kCFStreamSocketSecurityLevelTLSv1;
+		const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL;
+		const CFStringRef kCFStreamPropertyShouldCloseNativeSocket;
+		const CFStringRef kCFStreamPropertySocketRemoteHost;
+		const CFStringRef kCFStreamPropertySocketRemoteNetService;
+		const CFStringRef kCFStreamPropertyProxyLocalBypass;
+	}
+}
+
+enum
+{
+	kCFStreamErrorSOCKSSubDomainNone = 0,
+	kCFStreamErrorSOCKSSubDomainVersionCode = 1,
+	kCFStreamErrorSOCKS4SubDomainResponse = 2,
+	kCFStreamErrorSOCKS5SubDomainUserPass = 3,
+	kCFStreamErrorSOCKS5SubDomainMethod = 4,
+	kCFStreamErrorSOCKS5SubDomainResponse = 5
+}
+
+enum
+{
+	kCFStreamErrorSOCKS5BadResponseAddr = 1,
+	kCFStreamErrorSOCKS5BadState = 2,
+	kCFStreamErrorSOCKSUnknownClientVersion = 3
+}
+
+enum
+{
+	kCFStreamErrorSOCKS4RequestFailed = 91,
+	kCFStreamErrorSOCKS4IdentdFailed = 92,
+	kCFStreamErrorSOCKS4IdConflict = 93
+}
+
+enum
+{
+	kSOCKS5NoAcceptableMethod = 0xFF
+}
+
+enum /*CFStreamSocketSecurityProtocol*/ 
+{
+	kCFStreamSocketSecurityNone = 0,
+	kCFStreamSocketSecuritySSLv2 = 1,
+	kCFStreamSocketSecuritySSLv3 = 2,
+	kCFStreamSocketSecuritySSLv23 = 3,
+	kCFStreamSocketSecurityTLSv1 = 4
+}
+
+extern (C)
+{
+	void CFStreamCreatePairWithSocketToCFHost (CFAllocatorRef alloc, CFHostRef host, int port, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream);
+	void CFStreamCreatePairWithSocketToNetService (CFAllocatorRef alloc, CFNetServiceRef service, CFReadStreamRef* readStream, CFWriteStreamRef* writeStream);
+	ubyte CFSocketStreamPairSetSecurityProtocol (CFReadStreamRef socketReadStream, CFWriteStreamRef socketWriteStream, int securityProtocol);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/dictionaryservices/DictionaryServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,21 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.dictionaryservices.DictionaryServices;
+
+public:
+
+import dstep.corefoundation.CoreFoundation;
+
+struct __DCSDictionary;
+
+alias __DCSDictionary* DCSDictionaryRef;
+
+extern (C)
+{
+	CFRange DCSGetTermRangeInString (DCSDictionaryRef dictionary, CFStringRef textString, int offset);
+	CFStringRef DCSCopyTextDefinition (DCSDictionaryRef dictionary, CFStringRef textString, CFRange range);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/IconsCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,570 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.IconsCore;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.coreservices.osservices.OSServices;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+
+struct OpaqueIconRef;
+
+alias OpaqueIconRef* IconRef;
+alias uint IconServicesUsageFlags;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSystemIconsCreator = getOSType!("macs");
+		const __kClipboardIcon = getOSType!("CLIP");
+		const __kClippingUnknownTypeIcon = getOSType!("clpu");
+		const __kClippingPictureTypeIcon = getOSType!("clpp");
+		const __kClippingTextTypeIcon = getOSType!("clpt");
+		const __kClippingSoundTypeIcon = getOSType!("clps");
+		const __kDesktopIcon = getOSType!("desk");
+		const __kFinderIcon = getOSType!("FNDR");
+		const __kComputerIcon = getOSType!("root");
+		const __kFontSuitcaseIcon = getOSType!("FFIL");
+		const __kFullTrashIcon = getOSType!("ftrh");
+		const __kGenericApplicationIcon = getOSType!("APPL");
+		const __kGenericCDROMIcon = getOSType!("cddr");
+		const __kGenericControlPanelIcon = getOSType!("APPC");
+		const __kGenericControlStripModuleIcon = getOSType!("sdev");
+		const __kGenericComponentIcon = getOSType!("thng");
+		const __kGenericDeskAccessoryIcon = getOSType!("APPD");
+		const __kGenericDocumentIcon = getOSType!("docu");
+		const __kGenericEditionFileIcon = getOSType!("edtf");
+		const __kGenericExtensionIcon = getOSType!("INIT");
+		const __kGenericFileServerIcon = getOSType!("srvr");
+		const __kGenericFontIcon = getOSType!("ffil");
+		const __kGenericFontScalerIcon = getOSType!("sclr");
+		const __kGenericFloppyIcon = getOSType!("flpy");
+		const __kGenericHardDiskIcon = getOSType!("hdsk");
+		const __kGenericIDiskIcon = getOSType!("idsk");
+		const __kGenericRemovableMediaIcon = getOSType!("rmov");
+		const __kGenericMoverObjectIcon = getOSType!("movr");
+		const __kGenericPCCardIcon = getOSType!("pcmc");
+		const __kGenericPreferencesIcon = getOSType!("pref");
+		const __kGenericQueryDocumentIcon = getOSType!("qery");
+		const __kGenericRAMDiskIcon = getOSType!("ramd");
+		const __kGenericSharedLibaryIcon = getOSType!("shlb");
+		const __kGenericStationeryIcon = getOSType!("sdoc");
+		const __kGenericSuitcaseIcon = getOSType!("suit");
+		const __kGenericURLIcon = getOSType!("gurl");
+		const __kGenericWORMIcon = getOSType!("worm");
+		const __kInternationalResourcesIcon = getOSType!("ifil");
+		const __kKeyboardLayoutIcon = getOSType!("kfil");
+		const __kSoundFileIcon = getOSType!("sfil");
+		const __kSystemSuitcaseIcon = getOSType!("zsys");
+		const __kTrashIcon = getOSType!("trsh");
+		const __kTrueTypeFontIcon = getOSType!("tfil");
+		const __kTrueTypeFlatFontIcon = getOSType!("sfnt");
+		const __kTrueTypeMultiFlatFontIcon = getOSType!("ttcf");
+		const __kUserIDiskIcon = getOSType!("udsk");
+		const __kUnknownFSObjectIcon = getOSType!("unfs");
+		const __kInternetLocationHTTPIcon = getOSType!("ilht");
+		const __kInternetLocationFTPIcon = getOSType!("ilft");
+		const __kInternetLocationAppleShareIcon = getOSType!("ilaf");
+		const __kInternetLocationAppleTalkZoneIcon = getOSType!("ilat");
+		const __kInternetLocationFileIcon = getOSType!("ilfi");
+		const __kInternetLocationMailIcon = getOSType!("ilma");
+		const __kInternetLocationNewsIcon = getOSType!("ilnw");
+		const __kInternetLocationNSLNeighborhoodIcon = getOSType!("ilns");
+		const __kInternetLocationGenericIcon = getOSType!("ilge");
+		const __kGenericFolderIcon = getOSType!("fldr");
+		const __kDropFolderIcon = getOSType!("dbox");
+		const __kMountedFolderIcon = getOSType!("mntd");
+		const __kOpenFolderIcon = getOSType!("ofld");
+		const __kOwnedFolderIcon = getOSType!("ownd");
+		const __kPrivateFolderIcon = getOSType!("prvf");
+		const __kSharedFolderIcon = getOSType!("shfl");
+		const __kSharingPrivsNotApplicableIcon = getOSType!("shna");
+		const __kSharingPrivsReadOnlyIcon = getOSType!("shro");
+		const __kSharingPrivsReadWriteIcon = getOSType!("shrw");
+		const __kSharingPrivsUnknownIcon = getOSType!("shuk");
+		const __kSharingPrivsWritableIcon = getOSType!("writ");
+		const __kUserFolderIcon = getOSType!("ufld");
+		const __kWorkgroupFolderIcon = getOSType!("wfld");
+		const __kGuestUserIcon = getOSType!("gusr");
+		const __kUserIcon = getOSType!("user");
+		const __kOwnerIcon = getOSType!("susr");
+		const __kGroupIcon = getOSType!("grup");
+		const __kAppearanceFolderIcon = getOSType!("appr");
+		const __kAppleMenuFolderIcon = getOSType!("amnu");
+		const __kApplicationsFolderIcon = getOSType!("apps");
+		const __kApplicationSupportFolderIcon = getOSType!("asup");
+		const __kColorSyncFolderIcon = getOSType!("prof");
+		const __kContextualMenuItemsFolderIcon = getOSType!("cmnu");
+		const __kControlPanelDisabledFolderIcon = getOSType!("ctrD");
+		const __kControlPanelFolderIcon = getOSType!("ctrl");
+		const __kDocumentsFolderIcon = getOSType!("docs");
+		const __kExtensionsDisabledFolderIcon = getOSType!("extD");
+		const __kExtensionsFolderIcon = getOSType!("extn");
+		const __kFavoritesFolderIcon = getOSType!("favs");
+		const __kFontsFolderIcon = getOSType!("font");
+		const __kInternetSearchSitesFolderIcon = getOSType!("issf");
+		const __kPublicFolderIcon = getOSType!("pubf");
+		const __kPrinterDescriptionFolderIcon = getOSType!("ppdf");
+		const __kPrintMonitorFolderIcon = getOSType!("prnt");
+		const __kRecentApplicationsFolderIcon = getOSType!("rapp");
+		const __kRecentDocumentsFolderIcon = getOSType!("rdoc");
+		const __kRecentServersFolderIcon = getOSType!("rsrv");
+		const __kShutdownItemsDisabledFolderIcon = getOSType!("shdD");
+		const __kShutdownItemsFolderIcon = getOSType!("shdf");
+		const __kSpeakableItemsFolder = getOSType!("spki");
+		const __kStartupItemsDisabledFolderIcon = getOSType!("strD");
+		const __kStartupItemsFolderIcon = getOSType!("strt");
+		const __kSystemExtensionDisabledFolderIcon = getOSType!("macD");
+		const __kSystemFolderIcon = getOSType!("macs");
+		const __kVoicesFolderIcon = getOSType!("fvoc");
+		const __kAppleScriptBadgeIcon = getOSType!("scrp");
+		const __kLockedBadgeIcon = getOSType!("lbdg");
+		const __kMountedBadgeIcon = getOSType!("mbdg");
+		const __kSharedBadgeIcon = getOSType!("sbdg");
+		const __kAliasBadgeIcon = getOSType!("abdg");
+		const __kAlertCautionBadgeIcon = getOSType!("cbdg");
+		const __kAlertNoteIcon = getOSType!("note");
+		const __kAlertCautionIcon = getOSType!("caut");
+		const __kAlertStopIcon = getOSType!("stop");
+		const __kAppleTalkIcon = getOSType!("atlk");
+		const __kAppleTalkZoneIcon = getOSType!("atzn");
+		const __kAFPServerIcon = getOSType!("afps");
+		const __kFTPServerIcon = getOSType!("ftps");
+		const __kHTTPServerIcon = getOSType!("htps");
+		const __kGenericNetworkIcon = getOSType!("gnet");
+		const __kIPFileServerIcon = getOSType!("isrv");
+		const __kToolbarCustomizeIcon = getOSType!("tcus");
+		const __kToolbarDeleteIcon = getOSType!("tdel");
+		const __kToolbarFavoritesIcon = getOSType!("tfav");
+		const __kToolbarHomeIcon = getOSType!("thom");
+		const __kAppleLogoIcon = getOSType!("capl");
+		const __kAppleMenuIcon = getOSType!("sapl");
+		const __kBackwardArrowIcon = getOSType!("baro");
+		const __kFavoriteItemsIcon = getOSType!("favr");
+		const __kForwardArrowIcon = getOSType!("faro");
+		const __kGridIcon = getOSType!("grid");
+		const __kHelpIcon = getOSType!("help");
+		const __kKeepArrangedIcon = getOSType!("arng");
+		const __kLockedIcon = getOSType!("lock");
+		const __kNoFilesIcon = getOSType!("nfil");
+		const __kNoFolderIcon = getOSType!("nfld");
+		const __kNoWriteIcon = getOSType!("nwrt");
+		const __kProtectedApplicationFolderIcon = getOSType!("papp");
+		const __kProtectedSystemFolderIcon = getOSType!("psys");
+		const __kRecentItemsIcon = getOSType!("rcnt");
+		const __kShortcutIcon = getOSType!("shrt");
+		const __kSortAscendingIcon = getOSType!("asnd");
+		const __kSortDescendingIcon = getOSType!("dsnd");
+		const __kUnlockedIcon = getOSType!("ulck");
+		const __kConnectToIcon = getOSType!("cnct");
+		const __kGenericWindowIcon = getOSType!("gwin");
+		const __kQuestionMarkIcon = getOSType!("ques");
+		const __kDeleteAliasIcon = getOSType!("dali");
+		const __kEjectMediaIcon = getOSType!("ejec");
+		const __kBurningIcon = getOSType!("burn");
+		const __kRightContainerArrowIcon = getOSType!("rcar");
+	}
+}
+
+enum
+{
+	kGenericDocumentIconResource = -4000,
+	kGenericStationeryIconResource = -3985,
+	kGenericEditionFileIconResource = -3989,
+	kGenericApplicationIconResource = -3996,
+	kGenericDeskAccessoryIconResource = -3991,
+	kGenericFolderIconResource = -3999,
+	kPrivateFolderIconResource = -3994,
+	kFloppyIconResource = -3998,
+	kTrashIconResource = -3993,
+	kGenericRAMDiskIconResource = -3988,
+	kGenericCDROMIconResource = -3987
+}
+
+enum
+{
+	kDesktopIconResource = -3992,
+	kOpenFolderIconResource = -3997,
+	kGenericHardDiskIconResource = -3995,
+	kGenericFileServerIconResource = -3972,
+	kGenericSuitcaseIconResource = -3970,
+	kGenericMoverObjectIconResource = -3969
+}
+
+enum
+{
+	kGenericPreferencesIconResource = -3971,
+	kGenericQueryDocumentIconResource = -16506,
+	kGenericExtensionIconResource = -16415,
+	kSystemFolderIconResource = -3983,
+	kHelpIconResource = -20271,
+	kAppleMenuFolderIconResource = -3982
+}
+
+enum
+{
+	genericDocumentIconResource = kGenericDocumentIconResource,
+	genericStationeryIconResource = kGenericStationeryIconResource,
+	genericEditionFileIconResource = kGenericEditionFileIconResource,
+	genericApplicationIconResource = kGenericApplicationIconResource,
+	genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource,
+	genericFolderIconResource = kGenericFolderIconResource,
+	privateFolderIconResource = kPrivateFolderIconResource,
+	floppyIconResource = kFloppyIconResource,
+	trashIconResource = kTrashIconResource,
+	genericRAMDiskIconResource = kGenericRAMDiskIconResource,
+	genericCDROMIconResource = kGenericCDROMIconResource,
+	desktopIconResource = kDesktopIconResource,
+	openFolderIconResource = kOpenFolderIconResource,
+	genericHardDiskIconResource = kGenericHardDiskIconResource,
+	genericFileServerIconResource = kGenericFileServerIconResource,
+	genericSuitcaseIconResource = kGenericSuitcaseIconResource,
+	genericMoverObjectIconResource = kGenericMoverObjectIconResource,
+	genericPreferencesIconResource = kGenericPreferencesIconResource,
+	genericQueryDocumentIconResource = kGenericQueryDocumentIconResource,
+	genericExtensionIconResource = kGenericExtensionIconResource,
+	systemFolderIconResource = kSystemFolderIconResource,
+	appleMenuFolderIconResource = kAppleMenuFolderIconResource
+}
+
+enum
+{
+	kStartupFolderIconResource = -3981,
+	kOwnedFolderIconResource = -3980,
+	kDropFolderIconResource = -3979,
+	kSharedFolderIconResource = -3978,
+	kMountedFolderIconResource = -3977,
+	kControlPanelFolderIconResource = -3976,
+	kPrintMonitorFolderIconResource = -3975,
+	kPreferencesFolderIconResource = -3974,
+	kExtensionsFolderIconResource = -3973,
+	kFontsFolderIconResource = -3968,
+	kFullTrashIconResource = -3984
+}
+
+enum
+{
+	startupFolderIconResource = kStartupFolderIconResource,
+	ownedFolderIconResource = kOwnedFolderIconResource,
+	dropFolderIconResource = kDropFolderIconResource,
+	sharedFolderIconResource = kSharedFolderIconResource,
+	mountedFolderIconResource = kMountedFolderIconResource,
+	controlPanelFolderIconResource = kControlPanelFolderIconResource,
+	printMonitorFolderIconResource = kPrintMonitorFolderIconResource,
+	preferencesFolderIconResource = kPreferencesFolderIconResource,
+	extensionsFolderIconResource = kExtensionsFolderIconResource,
+	fontsFolderIconResource = kFontsFolderIconResource,
+	fullTrashIconResource = kFullTrashIconResource
+}
+
+enum
+{
+	kSystemIconsCreator = getOSType!("macs")
+}
+
+enum
+{
+	kClipboardIcon = getOSType!("CLIP"),
+	kClippingUnknownTypeIcon = getOSType!("clpu"),
+	kClippingPictureTypeIcon = getOSType!("clpp"),
+	kClippingTextTypeIcon = getOSType!("clpt"),
+	kClippingSoundTypeIcon = getOSType!("clps"),
+	kDesktopIcon = getOSType!("desk"),
+	kFinderIcon = getOSType!("FNDR"),
+	kComputerIcon = getOSType!("root"),
+	kFontSuitcaseIcon = getOSType!("FFIL"),
+	kFullTrashIcon = getOSType!("ftrh"),
+	kGenericApplicationIcon = getOSType!("APPL"),
+	kGenericCDROMIcon = getOSType!("cddr"),
+	kGenericControlPanelIcon = getOSType!("APPC"),
+	kGenericControlStripModuleIcon = getOSType!("sdev"),
+	kGenericComponentIcon = getOSType!("thng"),
+	kGenericDeskAccessoryIcon = getOSType!("APPD"),
+	kGenericDocumentIcon = getOSType!("docu"),
+	kGenericEditionFileIcon = getOSType!("edtf"),
+	kGenericExtensionIcon = getOSType!("INIT"),
+	kGenericFileServerIcon = getOSType!("srvr"),
+	kGenericFontIcon = getOSType!("ffil"),
+	kGenericFontScalerIcon = getOSType!("sclr"),
+	kGenericFloppyIcon = getOSType!("flpy"),
+	kGenericHardDiskIcon = getOSType!("hdsk"),
+	kGenericIDiskIcon = getOSType!("idsk"),
+	kGenericRemovableMediaIcon = getOSType!("rmov"),
+	kGenericMoverObjectIcon = getOSType!("movr"),
+	kGenericPCCardIcon = getOSType!("pcmc"),
+	kGenericPreferencesIcon = getOSType!("pref"),
+	kGenericQueryDocumentIcon = getOSType!("qery"),
+	kGenericRAMDiskIcon = getOSType!("ramd"),
+	kGenericSharedLibaryIcon = getOSType!("shlb"),
+	kGenericStationeryIcon = getOSType!("sdoc"),
+	kGenericSuitcaseIcon = getOSType!("suit"),
+	kGenericURLIcon = getOSType!("gurl"),
+	kGenericWORMIcon = getOSType!("worm"),
+	kInternationalResourcesIcon = getOSType!("ifil"),
+	kKeyboardLayoutIcon = getOSType!("kfil"),
+	kSoundFileIcon = getOSType!("sfil"),
+	kSystemSuitcaseIcon = getOSType!("zsys"),
+	kTrashIcon = getOSType!("trsh"),
+	kTrueTypeFontIcon = getOSType!("tfil"),
+	kTrueTypeFlatFontIcon = getOSType!("sfnt"),
+	kTrueTypeMultiFlatFontIcon = getOSType!("ttcf"),
+	kUserIDiskIcon = getOSType!("udsk"),
+	kUnknownFSObjectIcon = getOSType!("unfs"),
+	kInternationResourcesIcon = kInternationalResourcesIcon
+}
+
+enum
+{
+	kInternetLocationHTTPIcon = getOSType!("ilht"),
+	kInternetLocationFTPIcon = getOSType!("ilft"),
+	kInternetLocationAppleShareIcon = getOSType!("ilaf"),
+	kInternetLocationAppleTalkZoneIcon = getOSType!("ilat"),
+	kInternetLocationFileIcon = getOSType!("ilfi"),
+	kInternetLocationMailIcon = getOSType!("ilma"),
+	kInternetLocationNewsIcon = getOSType!("ilnw"),
+	kInternetLocationNSLNeighborhoodIcon = getOSType!("ilns"),
+	kInternetLocationGenericIcon = getOSType!("ilge")
+}
+
+enum
+{
+	kGenericFolderIcon = getOSType!("fldr"),
+	kDropFolderIcon = getOSType!("dbox"),
+	kMountedFolderIcon = getOSType!("mntd"),
+	kOpenFolderIcon = getOSType!("ofld"),
+	kOwnedFolderIcon = getOSType!("ownd"),
+	kPrivateFolderIcon = getOSType!("prvf"),
+	kSharedFolderIcon = getOSType!("shfl")
+}
+
+enum
+{
+	kSharingPrivsNotApplicableIcon = getOSType!("shna"),
+	kSharingPrivsReadOnlyIcon = getOSType!("shro"),
+	kSharingPrivsReadWriteIcon = getOSType!("shrw"),
+	kSharingPrivsUnknownIcon = getOSType!("shuk"),
+	kSharingPrivsWritableIcon = getOSType!("writ")
+}
+
+enum
+{
+	kUserFolderIcon = getOSType!("ufld"),
+	kWorkgroupFolderIcon = getOSType!("wfld"),
+	kGuestUserIcon = getOSType!("gusr"),
+	kUserIcon = getOSType!("user"),
+	kOwnerIcon = getOSType!("susr"),
+	kGroupIcon = getOSType!("grup")
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		kAppearanceFolderIcon = getOSType!("appr"),
+		kAppleExtrasFolderIcon = 0x616578C4,
+		kAppleMenuFolderIcon = getOSType!("amnu"),
+		kApplicationsFolderIcon = getOSType!("apps"),
+		kApplicationSupportFolderIcon = getOSType!("asup"),
+		kAssistantsFolderIcon = 0x617374C4,
+		kColorSyncFolderIcon = getOSType!("prof"),
+		kContextualMenuItemsFolderIcon = getOSType!("cmnu"),
+		kControlPanelDisabledFolderIcon = getOSType!("ctrD"),
+		kControlPanelFolderIcon = getOSType!("ctrl"),
+		kControlStripModulesFolderIcon = 0x736476C4,
+		kDocumentsFolderIcon = getOSType!("docs"),
+		kExtensionsDisabledFolderIcon = getOSType!("extD"),
+		kExtensionsFolderIcon = getOSType!("extn"),
+		kFavoritesFolderIcon = getOSType!("favs"),
+		kFontsFolderIcon = getOSType!("font"),
+		kHelpFolderIcon = 0xC4686C70,
+		kInternetFolderIcon = 0x696E74C4,
+		kInternetPlugInFolderIcon = 0xC46E6574,
+		kInternetSearchSitesFolderIcon = getOSType!("issf"),
+		kLocalesFolderIcon = 0xC46C6F63,
+		kMacOSReadMeFolderIcon = 0x6D6F72C4,
+		kPublicFolderIcon = getOSType!("pubf"),
+		kPreferencesFolderIcon = 0x707266C4,
+		kPrinterDescriptionFolderIcon = getOSType!("ppdf"),
+		kPrinterDriverFolderIcon = 0xC4707264,
+		kPrintMonitorFolderIcon = getOSType!("prnt"),
+		kRecentApplicationsFolderIcon = getOSType!("rapp"),
+		kRecentDocumentsFolderIcon = getOSType!("rdoc"),
+		kRecentServersFolderIcon = getOSType!("rsrv"),
+		kScriptingAdditionsFolderIcon = 0xC4736372,
+		kSharedLibrariesFolderIcon = 0xC46C6962,
+		kScriptsFolderIcon = 0x736372C4,
+		kShutdownItemsDisabledFolderIcon = getOSType!("shdD"),
+		kShutdownItemsFolderIcon = getOSType!("shdf"),
+		kSpeakableItemsFolder = getOSType!("spki"),
+		kStartupItemsDisabledFolderIcon = getOSType!("strD"),
+		kStartupItemsFolderIcon = getOSType!("strt"),
+		kSystemExtensionDisabledFolderIcon = getOSType!("macD"),
+		kSystemFolderIcon = getOSType!("macs"),
+		kTextEncodingsFolderIcon = 0xC4746578,
+		kUsersFolderIcon = 0x757372C4,
+		kUtilitiesFolderIcon = 0x757469C4,
+		kVoicesFolderIcon = getOSType!("fvoc")
+	}
+}
+
+else
+{
+	enum
+	{
+		kAppearanceFolderIcon = getOSType!("appr"),
+		kAppleExtrasFolderIcon = 0x616578C4,
+		kAppleMenuFolderIcon = getOSType!("amnu"),
+		kApplicationsFolderIcon = getOSType!("apps"),
+		kApplicationSupportFolderIcon = getOSType!("asup"),
+		kAssistantsFolderIcon = 0x617374C4,
+		kColorSyncFolderIcon = getOSType!("prof"),
+		kContextualMenuItemsFolderIcon = getOSType!("cmnu"),
+		kControlPanelDisabledFolderIcon = getOSType!("ctrD"),
+		kControlPanelFolderIcon = getOSType!("ctrl"),
+		kControlStripModulesFolderIcon = 0x736476C4,
+		kDocumentsFolderIcon = getOSType!("docs"),
+		kExtensionsDisabledFolderIcon = getOSType!("extD"),
+		kExtensionsFolderIcon = getOSType!("extn"),
+		kFavoritesFolderIcon = getOSType!("favs"),
+		kFontsFolderIcon = getOSType!("font"),
+		kHelpFolderIcon = 0xC4686C70,
+		kInternetFolderIcon = 0x696E74C4,
+		kInternetPlugInFolderIcon = 0xC46E6574,
+		kInternetSearchSitesFolderIcon = getOSType!("issf"),
+		kLocalesFolderIcon = 0xC46C6F63,
+		kMacOSReadMeFolderIcon = 0x6D6F72C4,
+		kPublicFolderIcon = getOSType!("pubf"),
+		kPreferencesFolderIcon = 0x707266C4,
+		kPrinterDescriptionFolderIcon = getOSType!("ppdf"),
+		kPrinterDriverFolderIcon = 0xC4707264,
+		kPrintMonitorFolderIcon = getOSType!("prnt"),
+		kRecentApplicationsFolderIcon = getOSType!("rapp"),
+		kRecentDocumentsFolderIcon = getOSType!("rdoc"),
+		kRecentServersFolderIcon = getOSType!("rsrv"),
+		kScriptingAdditionsFolderIcon = 0xC4736372,
+		kSharedLibrariesFolderIcon = 0xC46C6962,
+		kScriptsFolderIcon = 0x736372C4,
+		kShutdownItemsDisabledFolderIcon = getOSType!("shdD"),
+		kShutdownItemsFolderIcon = getOSType!("shdf"),
+		kSpeakableItemsFolder = getOSType!("spki"),
+		kStartupItemsDisabledFolderIcon = getOSType!("strD"),
+		kStartupItemsFolderIcon = getOSType!("strt"),
+		kSystemExtensionDisabledFolderIcon = getOSType!("macD"),
+		kSystemFolderIcon = getOSType!("macs"),
+		kTextEncodingsFolderIcon = 0xC4746578,
+		kUsersFolderIcon = 0x757372C4,
+		kUtilitiesFolderIcon = 0x757469C4,
+		kVoicesFolderIcon = getOSType!("fvoc")
+	}
+}
+
+enum
+{
+	kAppleScriptBadgeIcon = getOSType!("scrp"),
+	kLockedBadgeIcon = getOSType!("lbdg"),
+	kMountedBadgeIcon = getOSType!("mbdg"),
+	kSharedBadgeIcon = getOSType!("sbdg"),
+	kAliasBadgeIcon = getOSType!("abdg"),
+	kAlertCautionBadgeIcon = getOSType!("cbdg")
+}
+
+enum
+{
+	kAlertNoteIcon = getOSType!("note"),
+	kAlertCautionIcon = getOSType!("caut"),
+	kAlertStopIcon = getOSType!("stop")
+}
+
+enum
+{
+	kAppleTalkIcon = getOSType!("atlk"),
+	kAppleTalkZoneIcon = getOSType!("atzn"),
+	kAFPServerIcon = getOSType!("afps"),
+	kFTPServerIcon = getOSType!("ftps"),
+	kHTTPServerIcon = getOSType!("htps"),
+	kGenericNetworkIcon = getOSType!("gnet"),
+	kIPFileServerIcon = getOSType!("isrv")
+}
+
+enum
+{
+	kToolbarCustomizeIcon = getOSType!("tcus"),
+	kToolbarDeleteIcon = getOSType!("tdel"),
+	kToolbarFavoritesIcon = getOSType!("tfav"),
+	kToolbarHomeIcon = getOSType!("thom")
+}
+
+enum
+{
+	kAppleLogoIcon = getOSType!("capl"),
+	kAppleMenuIcon = getOSType!("sapl"),
+	kBackwardArrowIcon = getOSType!("baro"),
+	kFavoriteItemsIcon = getOSType!("favr"),
+	kForwardArrowIcon = getOSType!("faro"),
+	kGridIcon = getOSType!("grid"),
+	kHelpIcon = getOSType!("help"),
+	kKeepArrangedIcon = getOSType!("arng"),
+	kLockedIcon = getOSType!("lock"),
+	kNoFilesIcon = getOSType!("nfil"),
+	kNoFolderIcon = getOSType!("nfld"),
+	kNoWriteIcon = getOSType!("nwrt"),
+	kProtectedApplicationFolderIcon = getOSType!("papp"),
+	kProtectedSystemFolderIcon = getOSType!("psys"),
+	kRecentItemsIcon = getOSType!("rcnt"),
+	kShortcutIcon = getOSType!("shrt"),
+	kSortAscendingIcon = getOSType!("asnd"),
+	kSortDescendingIcon = getOSType!("dsnd"),
+	kUnlockedIcon = getOSType!("ulck"),
+	kConnectToIcon = getOSType!("cnct"),
+	kGenericWindowIcon = getOSType!("gwin"),
+	kQuestionMarkIcon = getOSType!("ques"),
+	kDeleteAliasIcon = getOSType!("dali"),
+	kEjectMediaIcon = getOSType!("ejec"),
+	kBurningIcon = getOSType!("burn"),
+	kRightContainerArrowIcon = getOSType!("rcar")
+}
+
+enum
+{
+	kIconServicesNormalUsageFlag = 0x00000000,
+	kIconServicesNoBadgeFlag = 0x00000001,
+	kIconServicesUpdateIfNeededFlag = 0x00000002
+}
+
+enum
+{
+	kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess | kFSCatInfoPermissions | kFSCatInfoContentMod)
+}
+
+extern (C)
+{
+	short GetIconRefOwners (IconRef theIconRef, UInt16* owners);
+	short AcquireIconRef (IconRef theIconRef);
+	short ReleaseIconRef (IconRef theIconRef);
+	short GetIconRef (short vRefNum, uint creator, uint iconType, IconRef* theIconRef);
+	short GetIconRefFromFolder (short vRefNum, int parentFolderID, int folderID, byte attributes, byte accessPrivileges, IconRef* theIconRef);
+	int GetIconRefFromFileInfo (FSRef* inRef, uint inFileNameLength, wchar* inFileName, uint inWhichInfo, FSCatalogInfo* inCatalogInfo, uint inUsageFlags, IconRef* outIconRef, SInt16* outLabel);
+	short GetIconRefFromTypeInfo (uint inCreator, uint inType, CFStringRef inExtension, CFStringRef inMIMEType, uint inUsageFlags, IconRef* outIconRef);
+	int GetIconRefFromIconFamilyPtr (IconFamilyResource* inIconFamilyPtr, int inSize, IconRef* outIconRef);
+	int GetIconRefFromComponent (Component inComponent, IconRef* outIconRef);
+	short RegisterIconRefFromIconFamily (uint creator, uint iconType, IconFamilyHandle iconFamily, IconRef* theIconRef);
+	int RegisterIconRefFromFSRef (uint creator, uint iconType, FSRef* iconFile, IconRef* theIconRef);
+	short UnregisterIconRef (uint creator, uint iconType);
+	short UpdateIconRef (IconRef theIconRef);
+	short OverrideIconRef (IconRef oldIconRef, IconRef newIconRef);
+	short RemoveIconRefOverride (IconRef theIconRef);
+	short CompositeIconRef (IconRef backgroundIconRef, IconRef foregroundIconRef, IconRef* compositeIconRef);
+	short IsIconRefComposite (IconRef compositeIconRef, IconRef* backgroundIconRef, IconRef* foregroundIconRef);
+	ubyte IsValidIconRef (IconRef theIconRef);
+	ubyte IsDataAvailableInIconRef (uint inIconKind, IconRef inIconRef);
+	short SetCustomIconsEnabled (short vRefNum, ubyte enableCustomIcons);
+	short GetCustomIconsEnabled (short vRefNum, char* customIconsEnabled);
+	int ReadIconFromFSRef (FSRef* ref_, IconFamilyHandle* iconFamily);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/LSInfo.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,176 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.LSInfo;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.corefoundation.CoreFoundation;
+
+alias uint LSInitializeFlags;
+alias uint LSRequestedInfo;
+alias uint LSItemInfoFlags;
+alias uint LSRolesMask;
+alias uint LSAcceptanceFlags;
+alias uint LSHandlerOptions;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kLSItemContentType;
+		const CFStringRef kLSItemFileType;
+		const CFStringRef kLSItemFileCreator;
+		const CFStringRef kLSItemExtension;
+		const CFStringRef kLSItemDisplayName;
+		const CFStringRef kLSItemDisplayKind;
+		const CFStringRef kLSItemRoleHandlerDisplayName;
+		const CFStringRef kLSItemIsInvisible;
+		const CFStringRef kLSItemExtensionIsHidden;
+		const CFStringRef kLSItemQuarantineProperties;
+	}
+}
+
+enum
+{
+	kLSAppInTrashErr = -10660,
+	kLSExecutableIncorrectFormat = -10661,
+	kLSAttributeNotFoundErr = -10662,
+	kLSAttributeNotSettableErr = -10663,
+	kLSUnknownErr = -10810,
+	kLSNotAnApplicationErr = -10811,
+	kLSNotInitializedErr = -10812,
+	kLSDataUnavailableErr = -10813,
+	kLSApplicationNotFoundErr = -10814,
+	kLSUnknownTypeErr = -10815,
+	kLSDataTooOldErr = -10816,
+	kLSDataErr = -10817,
+	kLSLaunchInProgressErr = -10818,
+	kLSNotRegisteredErr = -10819,
+	kLSAppDoesNotClaimTypeErr = -10820,
+	kLSAppDoesNotSupportSchemeWarning = -10821,
+	kLSServerCommunicationErr = -10822,
+	kLSCannotSetInfoErr = -10823,
+	kLSNoRegistrationInfoErr = -10824,
+	kLSIncompatibleSystemVersionErr = -10825,
+	kLSNoLaunchPermissionErr = -10826,
+	kLSNoExecutableErr = -10827,
+	kLSNoClassicEnvironmentErr = -10828,
+	kLSMultipleSessionsNotSupportedErr = -10829
+}
+
+enum
+{
+	kLSInitializeDefaults = 0x00000001
+}
+
+enum
+{
+	kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
+}
+
+enum
+{
+	kLSRequestExtension = 0x00000001,
+	kLSRequestTypeCreator = 0x00000002,
+	kLSRequestBasicFlagsOnly = 0x00000004,
+	kLSRequestAppTypeFlags = 0x00000008,
+	kLSRequestAllFlags = 0x00000010,
+	kLSRequestIconAndKind = 0x00000020,
+	kLSRequestExtensionFlagsOnly = 0x00000040,
+	kLSRequestAllInfo = cast(uint)0xFFFFFFFF
+}
+
+enum
+{
+	kLSItemInfoIsPlainFile = 0x00000001,
+	kLSItemInfoIsPackage = 0x00000002,
+	kLSItemInfoIsApplication = 0x00000004,
+	kLSItemInfoIsContainer = 0x00000008,
+	kLSItemInfoIsAliasFile = 0x00000010,
+	kLSItemInfoIsSymlink = 0x00000020,
+	kLSItemInfoIsInvisible = 0x00000040,
+	kLSItemInfoIsNativeApp = 0x00000080,
+	kLSItemInfoIsClassicApp = 0x00000100,
+	kLSItemInfoAppPrefersNative = 0x00000200,
+	kLSItemInfoAppPrefersClassic = 0x00000400,
+	kLSItemInfoAppIsScriptable = 0x00000800,
+	kLSItemInfoIsVolume = 0x00001000,
+	kLSItemInfoExtensionIsHidden = 0x00100000
+}
+
+enum
+{
+	kLSRolesNone = 0x00000001,
+	kLSRolesViewer = 0x00000002,
+	kLSRolesEditor = 0x00000004,
+	kLSRolesShell = 0x00000008,
+	kLSRolesAll = cast(uint)0xFFFFFFFF
+}
+
+enum
+{
+	kLSUnknownType = 0,
+	kLSUnknownCreator = 0
+}
+
+enum
+{
+	kLSAcceptDefault = 0x00000001,
+	kLSAcceptAllowLoginUI = 0x00000002
+}
+
+enum
+{
+	kLSHandlerOptionsDefault = 0,
+	kLSHandlerOptionsIgnoreCreator = 1
+}
+
+struct LSItemInfoRecord
+{
+	uint flags;
+	uint filetype;
+	uint creator;
+	CFStringRef extension;
+}
+
+extern (C)
+{
+	int LSInit (uint inFlags);
+	int LSTerm ();
+	int LSCopyItemInfoForRef (FSRef* inItemRef, uint inWhichInfo, LSItemInfoRecord* outItemInfo);
+	int LSCopyItemInfoForURL (CFURLRef inURL, uint inWhichInfo, LSItemInfoRecord* outItemInfo);
+	int LSGetExtensionInfo (uint inNameLen, wchar* inNameBuffer, UniCharCount* outExtStartIndex);
+	int LSCopyDisplayNameForRef (FSRef* inRef, CFStringRef* outDisplayName);
+	int LSCopyDisplayNameForURL (CFURLRef inURL, CFStringRef* outDisplayName);
+	int LSSetExtensionHiddenForRef (FSRef* inRef, ubyte inHide);
+	int LSSetExtensionHiddenForURL (CFURLRef inURL, ubyte inHide);
+	int LSCopyKindStringForRef (FSRef* inFSRef, CFStringRef* outKindString);
+	int LSCopyKindStringForURL (CFURLRef inURL, CFStringRef* outKindString);
+	int LSCopyKindStringForTypeInfo (uint inType, uint inCreator, CFStringRef inExtension, CFStringRef* outKindString);
+	int LSCopyKindStringForMIMEType (CFStringRef inMIMEType, CFStringRef* outKindString);
+	int LSGetApplicationForItem (FSRef* inItemRef, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
+	int LSGetApplicationForInfo (uint inType, uint inCreator, CFStringRef inExtension, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
+	int LSCopyApplicationForMIMEType (CFStringRef inMIMEType, uint inRoleMask, CFURLRef* outAppURL);
+	int LSGetApplicationForURL (CFURLRef inURL, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
+	int LSFindApplicationForInfo (uint inCreator, CFStringRef inBundleID, CFStringRef inName, FSRef* outAppRef, CFURLRef* outAppURL);
+	int LSCanRefAcceptItem (FSRef* inItemFSRef, FSRef* inTargetRef, uint inRoleMask, uint inFlags, char* outAcceptsItem);
+	int LSCanURLAcceptURL (CFURLRef inItemURL, CFURLRef inTargetURL, uint inRoleMask, uint inFlags, char* outAcceptsItem);
+	int LSRegisterURL (CFURLRef inURL, ubyte inUpdate);
+	int LSRegisterFSRef (FSRef* inRef, ubyte inUpdate);
+	CFArrayRef LSCopyApplicationURLsForURL (CFURLRef inURL, uint inRoleMask);
+	int LSCopyItemAttribute (FSRef* inItem, uint inRoles, CFStringRef inAttributeName, CFTypeRef* outValue);
+	int LSCopyItemAttributes (FSRef* inItem, uint inRoles, CFArrayRef inAttributeNames, CFDictionaryRef* outValues);
+	int LSSetItemAttribute (FSRef* inItem, uint inRoles, CFStringRef inAttributeName, CFTypeRef inValue);
+	CFStringRef LSCopyDefaultRoleHandlerForContentType (CFStringRef inContentType, uint inRole);
+	CFArrayRef LSCopyAllRoleHandlersForContentType (CFStringRef inContentType, uint inRole);
+	int LSSetDefaultRoleHandlerForContentType (CFStringRef inContentType, uint inRole, CFStringRef inHandlerBundleID);
+	uint LSGetHandlerOptionsForContentType (CFStringRef inContentType);
+	int LSSetHandlerOptionsForContentType (CFStringRef inContentType, uint inOptions);
+	CFStringRef LSCopyDefaultHandlerForURLScheme (CFStringRef inURLScheme);
+	CFArrayRef LSCopyAllHandlersForURLScheme (CFStringRef inURLScheme);
+	int LSSetDefaultHandlerForURLScheme (CFStringRef inURLScheme, CFStringRef inHandlerBundleID);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/LSOpen.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,80 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.LSOpen;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.ae.AE;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.coreservices.launchservices.LSInfo;
+
+alias uint LSLaunchFlags;
+
+enum
+{
+	kLSLaunchDefaults = 0x00000001,
+	kLSLaunchAndPrint = 0x00000002,
+	kLSLaunchReserved2 = 0x00000004,
+	kLSLaunchReserved3 = 0x00000008,
+	kLSLaunchReserved4 = 0x00000010,
+	kLSLaunchReserved5 = 0x00000020,
+	kLSLaunchAndDisplayErrors = 0x00000040,
+	kLSLaunchInhibitBGOnly = 0x00000080,
+	kLSLaunchDontAddToRecents = 0x00000100,
+	kLSLaunchDontSwitch = 0x00000200,
+	kLSLaunchNoParams = 0x00000800,
+	kLSLaunchAsync = 0x00010000,
+	kLSLaunchStartClassic = 0x00020000,
+	kLSLaunchInClassic = 0x00040000,
+	kLSLaunchNewInstance = 0x00080000,
+	kLSLaunchAndHide = 0x00100000,
+	kLSLaunchAndHideOthers = 0x00200000,
+	kLSLaunchHasUntrustedContents = 0x00400000
+}
+
+struct LSLaunchFSRefSpec
+{
+	FSRef* appRef;
+	uint numDocs;
+	FSRef* itemRefs;
+	AEDesc* passThruParams;
+	uint launchFlags;
+	void* asyncRefCon;
+}
+
+
+struct LSLaunchURLSpec
+{
+	CFURLRef appURL;
+	CFArrayRef itemURLs;
+	AEDesc* passThruParams;
+	uint launchFlags;
+	void* asyncRefCon;
+}
+
+
+struct LSApplicationParameters
+{
+	int version_;
+	uint flags;
+	FSRef* application;
+	void* asyncLaunchRefCon;
+	CFDictionaryRef environment;
+	CFArrayRef argv;
+	AppleEvent* initialEvent;
+}
+
+extern (C)
+{
+	int LSOpenFSRef (FSRef* inRef, FSRef* outLaunchedRef);
+	int LSOpenCFURLRef (CFURLRef inURL, CFURLRef* outLaunchedURL);
+	int LSOpenFromRefSpec (LSLaunchFSRefSpec* inLaunchSpec, FSRef* outLaunchedRef);
+	int LSOpenFromURLSpec (LSLaunchURLSpec* inLaunchSpec, CFURLRef* outLaunchedURL);
+	int LSOpenApplication (LSApplicationParameters* appParams, ProcessSerialNumber* outPSN);
+	int LSOpenItemsWithRole (FSRef* inItems, int inItemCount, uint inRole, AEKeyDesc* inAEParam, LSApplicationParameters* inAppParams, ProcessSerialNumber* outPSNs, int inMaxPSNCount);
+	int LSOpenURLsWithRole (CFArrayRef inURLs, uint inRole, AEKeyDesc* inAEParam, LSApplicationParameters* inAppParams, ProcessSerialNumber* outPSNs, int inMaxPSNCount);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/LSQuarantine.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,30 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.LSQuarantine;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kLSQuarantineAgentNameKey;
+		const CFStringRef kLSQuarantineAgentBundleIdentifierKey;
+		const CFStringRef kLSQuarantineTimeStampKey;
+		const CFStringRef kLSQuarantineTypeKey;
+		const CFStringRef kLSQuarantineTypeWebDownload;
+		const CFStringRef kLSQuarantineTypeOtherDownload;
+		const CFStringRef kLSQuarantineTypeEmailAttachment;
+		const CFStringRef kLSQuarantineTypeInstantMessageAttachment;
+		const CFStringRef kLSQuarantineTypeCalendarEventAttachment;
+		const CFStringRef kLSQuarantineTypeOtherAttachment;
+		const CFStringRef kLSQuarantineOriginURLKey;
+		const CFStringRef kLSQuarantineDataURLKey;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/LSSharedFileList.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,76 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.LSSharedFileList;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.launchservices.IconsCore;
+import dstep.security.Security;
+
+struct OpaqueLSSharedFileListRef;
+struct OpaqueLSSharedFileListItemRef;
+
+alias OpaqueLSSharedFileListRef* LSSharedFileListRef;
+alias OpaqueLSSharedFileListItemRef* LSSharedFileListItemRef;
+
+extern (C)
+{
+	alias void function (LSSharedFileListRef, void*) LSSharedFileListChangedProcPtr;
+}
+
+extern (C)
+{
+	extern
+	{
+		CFStringRef kLSSharedFileListFavoriteVolumes;
+		CFStringRef kLSSharedFileListFavoriteItems;
+		CFStringRef kLSSharedFileListRecentApplicationItems;
+		CFStringRef kLSSharedFileListRecentDocumentItems;
+		CFStringRef kLSSharedFileListRecentServerItems;
+		CFStringRef kLSSharedFileListSessionLoginItems;
+		CFStringRef kLSSharedFileListGlobalLoginItems;
+		CFStringRef kLSSharedFileListRecentItemsMaxAmount;
+		CFStringRef kLSSharedFileListVolumesComputerVisible;
+		CFStringRef kLSSharedFileListVolumesIDiskVisible;
+		CFStringRef kLSSharedFileListVolumesNetworkVisible;
+		LSSharedFileListItemRef kLSSharedFileListItemBeforeFirst;
+		LSSharedFileListItemRef kLSSharedFileListItemLast;
+		CFStringRef kLSSharedFileListItemHidden;
+	}
+}
+
+enum
+{
+	kLSSharedFileListNoUserInteraction = 1 << 0,
+	kLSSharedFileListDoNotMountVolumes = 1 << 1
+}
+
+extern (C)
+{
+	uint LSSharedFileListGetTypeID ();
+	uint LSSharedFileListItemGetTypeID ();
+	LSSharedFileListRef LSSharedFileListCreate (CFAllocatorRef inAllocator, CFStringRef inListType, CFTypeRef listOptions);
+	int LSSharedFileListSetAuthorization (LSSharedFileListRef inList, AuthorizationRef inAuthorization);
+	void LSSharedFileListAddObserver (LSSharedFileListRef inList, CFRunLoopRef inRunloop, CFStringRef inRunloopMode, LSSharedFileListChangedProcPtr callback, void* context);
+	void LSSharedFileListRemoveObserver (LSSharedFileListRef inList, CFRunLoopRef inRunloop, CFStringRef inRunloopMode, LSSharedFileListChangedProcPtr callback, void* context);
+	uint LSSharedFileListGetSeedValue (LSSharedFileListRef inList);
+	CFTypeRef LSSharedFileListCopyProperty (LSSharedFileListRef inList, CFStringRef inPropertyName);
+	int LSSharedFileListSetProperty (LSSharedFileListRef inList, CFStringRef inPropertyName, CFTypeRef inPropertyData);
+	CFArrayRef LSSharedFileListCopySnapshot (LSSharedFileListRef inList, UInt32* outSnapshotSeed);
+	LSSharedFileListItemRef LSSharedFileListInsertItemURL (LSSharedFileListRef inList, LSSharedFileListItemRef insertAfterThisItem, CFStringRef inDisplayName, IconRef inIconRef, CFURLRef inURL, CFDictionaryRef inPropertiesToSet, CFArrayRef inPropertiesToClear);
+	LSSharedFileListItemRef LSSharedFileListInsertItemFSRef (LSSharedFileListRef inList, LSSharedFileListItemRef insertAfterThisItem, CFStringRef inDisplayName, IconRef inIconRef, FSRef* inFSRef, CFDictionaryRef inPropertiesToSet, CFArrayRef inPropertiesToClear);
+	int LSSharedFileListItemMove (LSSharedFileListRef inList, LSSharedFileListItemRef inItem, LSSharedFileListItemRef inMoveAfterItem);
+	int LSSharedFileListItemRemove (LSSharedFileListRef inList, LSSharedFileListItemRef inItem);
+	int LSSharedFileListRemoveAllItems (LSSharedFileListRef inList);
+	uint LSSharedFileListItemGetID (LSSharedFileListItemRef inItem);
+	IconRef LSSharedFileListItemCopyIconRef (LSSharedFileListItemRef inItem);
+	CFStringRef LSSharedFileListItemCopyDisplayName (LSSharedFileListItemRef inItem);
+	int LSSharedFileListItemResolve (LSSharedFileListItemRef inItem, uint inFlags, CFURLRef* outURL, FSRef* outRef);
+	CFTypeRef LSSharedFileListItemCopyProperty (LSSharedFileListItemRef inItem, CFStringRef inPropertyName);
+	int LSSharedFileListItemSetProperty (LSSharedFileListItemRef inItem, CFStringRef inPropertyName, CFTypeRef inPropertyData);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/LaunchServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,18 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.LaunchServices;
+
+public:
+
+import dstep.coreservices.launchservices.IconsCore;
+import dstep.coreservices.launchservices.LSInfo;
+import dstep.coreservices.launchservices.LSOpen;
+import dstep.coreservices.launchservices.LSQuarantine;
+import dstep.coreservices.launchservices.LSSharedFileList;
+import dstep.coreservices.launchservices.UTCoreTypes;
+import dstep.coreservices.launchservices.UTType;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/UTCoreTypes.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,86 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.UTCoreTypes;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kUTTypeItem;
+		const CFStringRef kUTTypeContent;
+		const CFStringRef kUTTypeCompositeContent;
+		const CFStringRef kUTTypeApplication;
+		const CFStringRef kUTTypeMessage;
+		const CFStringRef kUTTypeContact;
+		const CFStringRef kUTTypeArchive;
+		const CFStringRef kUTTypeDiskImage;
+		const CFStringRef kUTTypeData;
+		const CFStringRef kUTTypeDirectory;
+		const CFStringRef kUTTypeResolvable;
+		const CFStringRef kUTTypeSymLink;
+		const CFStringRef kUTTypeMountPoint;
+		const CFStringRef kUTTypeAliasFile;
+		const CFStringRef kUTTypeAliasRecord;
+		const CFStringRef kUTTypeURL;
+		const CFStringRef kUTTypeFileURL;
+		const CFStringRef kUTTypeText;
+		const CFStringRef kUTTypePlainText;
+		const CFStringRef kUTTypeUTF8PlainText;
+		const CFStringRef kUTTypeUTF16ExternalPlainText;
+		const CFStringRef kUTTypeUTF16PlainText;
+		const CFStringRef kUTTypeRTF;
+		const CFStringRef kUTTypeHTML;
+		const CFStringRef kUTTypeXML;
+		const CFStringRef kUTTypeSourceCode;
+		const CFStringRef kUTTypeCSource;
+		const CFStringRef kUTTypeObjectiveCSource;
+		const CFStringRef kUTTypeCPlusPlusSource;
+		const CFStringRef kUTTypeObjectiveCPlusPlusSource;
+		const CFStringRef kUTTypeCHeader;
+		const CFStringRef kUTTypeCPlusPlusHeader;
+		const CFStringRef kUTTypeJavaSource;
+		const CFStringRef kUTTypePDF;
+		const CFStringRef kUTTypeRTFD;
+		const CFStringRef kUTTypeFlatRTFD;
+		const CFStringRef kUTTypeTXNTextAndMultimediaData;
+		const CFStringRef kUTTypeWebArchive;
+		const CFStringRef kUTTypeImage;
+		const CFStringRef kUTTypeJPEG;
+		const CFStringRef kUTTypeJPEG2000;
+		const CFStringRef kUTTypeTIFF;
+		const CFStringRef kUTTypePICT;
+		const CFStringRef kUTTypeGIF;
+		const CFStringRef kUTTypePNG;
+		const CFStringRef kUTTypeQuickTimeImage;
+		const CFStringRef kUTTypeAppleICNS;
+		const CFStringRef kUTTypeBMP;
+		const CFStringRef kUTTypeICO;
+		const CFStringRef kUTTypeAudiovisualContent;
+		const CFStringRef kUTTypeMovie;
+		const CFStringRef kUTTypeVideo;
+		const CFStringRef kUTTypeAudio;
+		const CFStringRef kUTTypeQuickTimeMovie;
+		const CFStringRef kUTTypeMPEG;
+		const CFStringRef kUTTypeMPEG4;
+		const CFStringRef kUTTypeMP3;
+		const CFStringRef kUTTypeMPEG4Audio;
+		const CFStringRef kUTTypeAppleProtectedMPEG4Audio;
+		const CFStringRef kUTTypeFolder;
+		const CFStringRef kUTTypeVolume;
+		const CFStringRef kUTTypePackage;
+		const CFStringRef kUTTypeBundle;
+		const CFStringRef kUTTypeFramework;
+		const CFStringRef kUTTypeApplicationBundle;
+		const CFStringRef kUTTypeApplicationFile;
+		const CFStringRef kUTTypeVCard;
+		const CFStringRef kUTTypeInkText;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/launchservices/UTType.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,45 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.launchservices.UTType;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.corefoundation.CoreFoundation;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kUTExportedTypeDeclarationsKey;
+		const CFStringRef kUTImportedTypeDeclarationsKey;
+		const CFStringRef kUTTypeIdentifierKey;
+		const CFStringRef kUTTypeTagSpecificationKey;
+		const CFStringRef kUTTypeConformsToKey;
+		const CFStringRef kUTTypeDescriptionKey;
+		const CFStringRef kUTTypeIconFileKey;
+		const CFStringRef kUTTypeReferenceURLKey;
+		const CFStringRef kUTTypeVersionKey;
+		const CFStringRef kUTTagClassFilenameExtension;
+		const CFStringRef kUTTagClassMIMEType;
+		const CFStringRef kUTTagClassNSPboardType;
+		const CFStringRef kUTTagClassOSType;
+	}
+}
+
+extern (C)
+{
+	CFStringRef UTTypeCreatePreferredIdentifierForTag (CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI);
+	CFArrayRef UTTypeCreateAllIdentifiersForTag (CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI);
+	CFStringRef UTTypeCopyPreferredTagWithClass (CFStringRef inUTI, CFStringRef inTagClass);
+	ubyte UTTypeEqual (CFStringRef inUTI1, CFStringRef inUTI2);
+	ubyte UTTypeConformsTo (CFStringRef inUTI, CFStringRef inConformsToUTI);
+	CFStringRef UTTypeCopyDescription (CFStringRef inUTI);
+	CFDictionaryRef UTTypeCopyDeclaration (CFStringRef inUTI);
+	CFURLRef UTTypeCopyDeclaringBundleURL (CFStringRef inUTI);
+	CFStringRef UTCreateStringForOSType (uint inOSType);
+	uint UTGetOSTypeFromString (CFStringRef inString);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/AppleDiskPartitions.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,146 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.AppleDiskPartitions;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kPatchDriverSignature = getOSType!("ptDR");
+		const __kATADriverSignature = getOSType!("wiki");
+		const __kSCSICDDriverSignature = getOSType!("CDvr");
+		const __kATAPIDriverSignature = getOSType!("ATPI");
+		const __kDriveSetupHFSSignature = getOSType!("DSU1");
+	}
+}
+
+enum
+{
+	sbSIGWord = 0x4552,
+	sbMac = 1
+}
+
+enum
+{
+	pMapSIG = 0x504D,
+	pdSigWord = 0x5453,
+	oldPMSigWord = pdSigWord,
+	newPMSigWord = pMapSIG
+}
+
+enum
+{
+	kDriverTypeMacSCSI = 0x0001,
+	kDriverTypeMacATA = 0x0701,
+	kDriverTypeMacSCSIChained = 0xFFFF,
+	kDriverTypeMacATAChained = 0xF8FF
+}
+
+static if (D_LP64)
+{
+	enum : long
+	{
+		kPartitionAUXIsValid = 0x00000001,
+		kPartitionAUXIsAllocated = 0x00000002,
+		kPartitionAUXIsInUse = 0x00000004,
+		kPartitionAUXIsBootValid = 0x00000008,
+		kPartitionAUXIsReadable = 0x00000010,
+		kPartitionAUXIsWriteable = 0x00000020,
+		kPartitionAUXIsBootCodePositionIndependent = 0x00000040,
+		kPartitionIsWriteable = 0x00000020,
+		kPartitionIsMountedAtStartup = 0x40000000,
+		kPartitionIsStartup = 0x80000000,
+		kPartitionIsChainCompatible = 0x00000100,
+		kPartitionIsRealDeviceDriver = 0x00000200,
+		kPartitionCanChainToNext = 0x00000400
+	}
+}
+
+else
+{
+	enum
+	{
+		kPartitionAUXIsValid = 0x00000001,
+		kPartitionAUXIsAllocated = 0x00000002,
+		kPartitionAUXIsInUse = 0x00000004,
+		kPartitionAUXIsBootValid = 0x00000008,
+		kPartitionAUXIsReadable = 0x00000010,
+		kPartitionAUXIsWriteable = 0x00000020,
+		kPartitionAUXIsBootCodePositionIndependent = 0x00000040,
+		kPartitionIsWriteable = 0x00000020,
+		kPartitionIsMountedAtStartup = 0x40000000,
+		kPartitionIsStartup = 0x80000000,
+		kPartitionIsChainCompatible = 0x00000100,
+		kPartitionIsRealDeviceDriver = 0x00000200,
+		kPartitionCanChainToNext = 0x00000400
+	}
+}
+
+enum
+{
+	kPatchDriverSignature = getOSType!("ptDR"),
+	kSCSIDriverSignature = 0x00010600,
+	kATADriverSignature = getOSType!("wiki"),
+	kSCSICDDriverSignature = getOSType!("CDvr"),
+	kATAPIDriverSignature = getOSType!("ATPI"),
+	kDriveSetupHFSSignature = getOSType!("DSU1")
+}
+
+struct Block0
+{
+	ushort sbSig;
+	ushort sbBlkSize;
+	uint sbBlkCount;
+	ushort sbDevType;
+	ushort sbDevId;
+	uint sbData;
+	ushort sbDrvrCount;
+	uint ddBlock;
+	ushort ddSize;
+	ushort ddType;
+	UInt16* ddPad;
+}
+
+
+struct DDMap
+{
+	uint ddBlock;
+	ushort ddSize;
+	ushort ddType;
+}
+
+
+struct Partition
+{
+	ushort pmSig;
+	ushort pmSigPad;
+	uint pmMapBlkCnt;
+	uint pmPyPartStart;
+	uint pmPartBlkCnt;
+	char* pmPartName;
+	char* pmParType;
+	uint pmLgDataStart;
+	uint pmDataCnt;
+	uint pmPartStatus;
+	uint pmLgBootStart;
+	uint pmBootSize;
+	uint pmBootAddr;
+	uint pmBootAddr2;
+	uint pmBootEntry;
+	uint pmBootEntry2;
+	uint pmBootCksum;
+	char* pmProcessor;
+	UInt16* pmPad;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/CSIdentity.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,116 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.CSIdentity;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.osservices.CSIdentityAuthority;
+import dstep.security.Authorization;
+import dstep.security.SecBase;
+//import dstep.sys.types;
+
+struct __CSIdentity;
+struct __CSIdentityQuery;
+
+alias __CSIdentity* CSIdentityRef;
+alias __CSIdentityQuery* CSIdentityQueryRef;
+alias int CSIdentityClass;
+alias uint CSIdentityFlags;
+
+extern (C)
+{
+	alias void function (CSIdentityRef, int, CFErrorRef, void*) CSIdentityStatusUpdatedCallback;
+}
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kCSIdentityErrorDomain;
+		const CFStringRef kCSIdentityGeneratePosixName;
+	}
+}
+
+enum
+{
+	kCSIdentityUnknownAuthorityErr = -1,
+	kCSIdentityAuthorityNotAccessibleErr = -2,
+	kCSIdentityPermissionErr = -3,
+	kCSIdentityDeletedErr = -4,
+	kCSIdentityInvalidFullNameErr = -5,
+	kCSIdentityDuplicateFullNameErr = -6,
+	kCSIdentityInvalidPosixNameErr = -7,
+	kCSIdentityDuplicatePosixNameErr = -8
+}
+
+enum
+{
+	kCSIdentityClassUser = 1,
+	kCSIdentityClassGroup = 2
+}
+
+enum
+{
+	kCSIdentityFlagNone = 0,
+	kCSIdentityFlagHidden = 1
+}
+
+enum
+{
+	kCSIdentityCommitCompleted = 1
+}
+
+struct CSIdentityClientContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retain;
+	CFAllocatorReleaseCallBack release;
+	CFAllocatorCopyDescriptionCallBack copyDescription;
+	CSIdentityStatusUpdatedCallback statusUpdated;
+}
+
+extern (C)
+{
+	uint CSIdentityGetTypeID ();
+	CSIdentityRef CSIdentityCreate (CFAllocatorRef allocator, int identityClass, CFStringRef fullName, CFStringRef posixName, uint flags, CSIdentityAuthorityRef authority);
+	CSIdentityRef CSIdentityCreateCopy (CFAllocatorRef allocator, CSIdentityRef identity);
+	int CSIdentityGetClass (CSIdentityRef identity);
+	CSIdentityAuthorityRef CSIdentityGetAuthority (CSIdentityRef identity);
+	CFUUIDRef CSIdentityGetUUID (CSIdentityRef identity);
+	CFStringRef CSIdentityGetFullName (CSIdentityRef identity);
+	uint CSIdentityGetPosixID (CSIdentityRef identity);
+	CFStringRef CSIdentityGetPosixName (CSIdentityRef identity);
+	CFStringRef CSIdentityGetEmailAddress (CSIdentityRef identity);
+	CFURLRef CSIdentityGetImageURL (CSIdentityRef identity);
+	CFDataRef CSIdentityGetImageData (CSIdentityRef identity);
+	CFStringRef CSIdentityGetImageDataType (CSIdentityRef identity);
+	CFArrayRef CSIdentityGetAliases (CSIdentityRef identity);
+	ubyte CSIdentityIsMemberOfGroup (CSIdentityRef identity, CSIdentityRef group);
+	ubyte CSIdentityIsHidden (CSIdentityRef identity);
+	CFDataRef CSIdentityCreatePersistentReference (CFAllocatorRef allocator, CSIdentityRef identity);
+	ubyte CSIdentityIsEnabled (CSIdentityRef user);
+	ubyte CSIdentityAuthenticateUsingPassword (CSIdentityRef user, CFStringRef password);
+	SecCertificateRef CSIdentityGetCertificate (CSIdentityRef user);
+	CSIdentityQueryRef CSIdentityCreateGroupMembershipQuery (CFAllocatorRef allocator, CSIdentityRef group);
+	void CSIdentitySetFullName (CSIdentityRef identity, CFStringRef fullName);
+	void CSIdentitySetEmailAddress (CSIdentityRef identity, CFStringRef emailAddress);
+	void CSIdentitySetImageURL (CSIdentityRef identity, CFURLRef url);
+	void CSIdentitySetImageData (CSIdentityRef identity, CFDataRef imageData, CFStringRef imageDataType);
+	void CSIdentityAddAlias (CSIdentityRef identity, CFStringRef alias_);
+	void CSIdentityRemoveAlias (CSIdentityRef identity, CFStringRef alias_);
+	void CSIdentityAddMember (CSIdentityRef group, CSIdentityRef member);
+	void CSIdentityRemoveMember (CSIdentityRef group, CSIdentityRef member);
+	void CSIdentitySetIsEnabled (CSIdentityRef user, ubyte isEnabled);
+	void CSIdentitySetPassword (CSIdentityRef user, CFStringRef password);
+	void CSIdentitySetCertificate (CSIdentityRef user, SecCertificateRef certificate);
+	void CSIdentityDelete (CSIdentityRef identity);
+	ubyte CSIdentityCommit (CSIdentityRef identity, AuthorizationRef authorization, CFErrorRef* error);
+	ubyte CSIdentityCommitAsynchronously (CSIdentityRef identity, CSIdentityClientContext* clientContext, CFRunLoopRef runLoop, CFStringRef runLoopMode, AuthorizationRef authorization);
+	ubyte CSIdentityIsCommitting (CSIdentityRef identity);
+	void CSIdentityRemoveClient (CSIdentityRef identity);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/CSIdentityAuthority.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,23 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.CSIdentityAuthority;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+
+struct __CSIdentityAuthority;
+
+alias __CSIdentityAuthority* CSIdentityAuthorityRef;
+
+extern (C)
+{
+	uint CSIdentityAuthorityGetTypeID ();
+	CSIdentityAuthorityRef CSGetDefaultIdentityAuthority ();
+	CSIdentityAuthorityRef CSGetLocalIdentityAuthority ();
+	CSIdentityAuthorityRef CSGetManagedIdentityAuthority ();
+	CFStringRef CSIdentityAuthorityCopyLocalizedName (CSIdentityAuthorityRef authority);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/CSIdentityQuery.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,72 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.CSIdentityQuery;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFError;
+import dstep.corefoundation.CFRunLoop;
+import dstep.corefoundation.CFUUID;
+import dstep.coreservices.osservices.CSIdentity;
+import dstep.coreservices.osservices.CSIdentityAuthority;
+
+alias uint CSIdentityQueryFlags;
+alias int CSIdentityQueryStringComparisonMethod;
+alias int CSIdentityQueryEvent;
+
+extern (C)
+{
+	alias void function (CSIdentityQueryRef, int, CFArrayRef, CFErrorRef, void*) CSIdentityQueryReceiveEventCallback;
+}
+
+enum
+{
+	kCSIdentityQueryGenerateUpdateEvents = 0x0001,
+	kCSIdentityQueryIncludeHiddenIdentities = 0x0002
+}
+
+enum
+{
+	kCSIdentityQueryStringEquals = 1,
+	kCSIdentityQueryStringBeginsWith = 2
+}
+
+enum
+{
+	kCSIdentityQueryEventSearchPhaseFinished = 1,
+	kCSIdentityQueryEventResultsAdded = 2,
+	kCSIdentityQueryEventResultsChanged = 3,
+	kCSIdentityQueryEventResultsRemoved = 4,
+	kCSIdentityQueryEventErrorOccurred = 5
+}
+
+struct CSIdentityQueryClientContext
+{
+	int version_;
+	void* info;
+	CFAllocatorRetainCallBack retainInfo;
+	CFAllocatorReleaseCallBack releaseInfo;
+	CFAllocatorCopyDescriptionCallBack copyInfoDescription;
+	CSIdentityQueryReceiveEventCallback receiveEvent;
+}
+
+extern (C)
+{
+	uint CSIdentityQueryGetTypeID ();
+	CSIdentityQueryRef CSIdentityQueryCreate (CFAllocatorRef allocator, int identityClass, CSIdentityAuthorityRef authority);
+	CSIdentityQueryRef CSIdentityQueryCreateForName (CFAllocatorRef allocator, CFStringRef name, int comparisonMethod, int identityClass, CSIdentityAuthorityRef authority);
+	CSIdentityQueryRef CSIdentityQueryCreateForUUID (CFAllocatorRef allocator, CFUUIDRef uuid, CSIdentityAuthorityRef authority);
+	CSIdentityQueryRef CSIdentityQueryCreateForPosixID (CFAllocatorRef allocator, uint posixID, int identityClass, CSIdentityAuthorityRef authority);
+	CSIdentityQueryRef CSIdentityQueryCreateForPersistentReference (CFAllocatorRef allocator, CFDataRef referenceData);
+	CSIdentityQueryRef CSIdentityQueryCreateForCurrentUser (CFAllocatorRef allocator);
+	CFArrayRef CSIdentityQueryCopyResults (CSIdentityQueryRef query);
+	ubyte CSIdentityQueryExecute (CSIdentityQueryRef query, uint flags, CFErrorRef* error);
+	ubyte CSIdentityQueryExecuteAsynchronously (CSIdentityQueryRef query, uint flags, CSIdentityQueryClientContext* clientContext, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void CSIdentityQueryStop (CSIdentityQueryRef query);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/IconStorage.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,137 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.IconStorage;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.objc.bridge.TypeEncoding;
+
+alias IconFamilyResource* IconFamilyPtr;
+alias IconFamilyPtr* IconFamilyHandle;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kIconServices16PixelDataARGB = getOSType!("ic04");
+		const __kIconServices32PixelDataARGB = getOSType!("ic05");
+		const __kIconServices48PixelDataARGB = getOSType!("ic06");
+		const __kIconServices128PixelDataARGB = getOSType!("ic07");
+		const __kIconServices256PixelDataARGB = getOSType!("ic08");
+		const __kIconServices512PixelDataARGB = getOSType!("ic09");
+		const __kThumbnail32BitData = getOSType!("it32");
+		const __kThumbnail8BitMask = getOSType!("t8mk");
+		const __kHuge1BitMask = getOSType!("ich#");
+		const __kHuge4BitData = getOSType!("ich4");
+		const __kHuge8BitData = getOSType!("ich8");
+		const __kHuge32BitData = getOSType!("ih32");
+		const __kHuge8BitMask = getOSType!("h8mk");
+		const __kLarge1BitMask = getOSType!("ICN#");
+		const __kLarge4BitData = getOSType!("icl4");
+		const __kLarge8BitData = getOSType!("icl8");
+		const __kLarge32BitData = getOSType!("il32");
+		const __kLarge8BitMask = getOSType!("l8mk");
+		const __kSmall1BitMask = getOSType!("ics#");
+		const __kSmall4BitData = getOSType!("ics4");
+		const __kSmall8BitData = getOSType!("ics8");
+		const __kSmall32BitData = getOSType!("is32");
+		const __kSmall8BitMask = getOSType!("s8mk");
+		const __kMini1BitMask = getOSType!("icm#");
+		const __kMini4BitData = getOSType!("icm4");
+		const __kMini8BitData = getOSType!("icm8");
+		const __kIconFamilyType = getOSType!("icns");
+		const __kTileIconVariant = getOSType!("tile");
+		const __kRolloverIconVariant = getOSType!("over");
+		const __kDropIconVariant = getOSType!("drop");
+		const __kOpenIconVariant = getOSType!("open");
+		const __kOpenDropIconVariant = getOSType!("odrp");
+	}
+}
+
+enum
+{
+	kIconServices16PixelDataARGB = getOSType!("ic04"),
+	kIconServices32PixelDataARGB = getOSType!("ic05"),
+	kIconServices48PixelDataARGB = getOSType!("ic06"),
+	kIconServices128PixelDataARGB = getOSType!("ic07")
+}
+
+enum
+{
+	kIconServices256PixelDataARGB = getOSType!("ic08"),
+	kIconServices512PixelDataARGB = getOSType!("ic09"),
+	kThumbnail32BitData = getOSType!("it32"),
+	kThumbnail8BitMask = getOSType!("t8mk")
+}
+
+enum
+{
+	kHuge1BitMask = getOSType!("ich#"),
+	kHuge4BitData = getOSType!("ich4"),
+	kHuge8BitData = getOSType!("ich8"),
+	kHuge32BitData = getOSType!("ih32"),
+	kHuge8BitMask = getOSType!("h8mk")
+}
+
+enum
+{
+	kLarge1BitMask = getOSType!("ICN#"),
+	kLarge4BitData = getOSType!("icl4"),
+	kLarge8BitData = getOSType!("icl8"),
+	kLarge32BitData = getOSType!("il32"),
+	kLarge8BitMask = getOSType!("l8mk"),
+	kSmall1BitMask = getOSType!("ics#"),
+	kSmall4BitData = getOSType!("ics4"),
+	kSmall8BitData = getOSType!("ics8"),
+	kSmall32BitData = getOSType!("is32"),
+	kSmall8BitMask = getOSType!("s8mk"),
+	kMini1BitMask = getOSType!("icm#"),
+	kMini4BitData = getOSType!("icm4"),
+	kMini8BitData = getOSType!("icm8")
+}
+
+enum
+{
+	large1BitMask = kLarge1BitMask,
+	large4BitData = kLarge4BitData,
+	large8BitData = kLarge8BitData,
+	small1BitMask = kSmall1BitMask,
+	small4BitData = kSmall4BitData,
+	small8BitData = kSmall8BitData,
+	mini1BitMask = kMini1BitMask,
+	mini4BitData = kMini4BitData,
+	mini8BitData = kMini8BitData
+}
+
+enum
+{
+	kIconFamilyType = getOSType!("icns")
+}
+
+enum
+{
+	kTileIconVariant = getOSType!("tile"),
+	kRolloverIconVariant = getOSType!("over"),
+	kDropIconVariant = getOSType!("drop"),
+	kOpenIconVariant = getOSType!("open"),
+	kOpenDropIconVariant = getOSType!("odrp")
+}
+
+struct IconFamilyElement
+{
+	uint elementType;
+	int elementSize;
+	char* elementData;
+}
+
+struct IconFamilyResource
+{
+	uint resourceType;
+	int resourceSize;
+	IconFamilyElement* elements;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/KeychainCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,374 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.KeychainCore;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.Aliases;
+import dstep.coreservices.carboncore.CodeFragments;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.objc.bridge.TypeEncoding;
+
+struct OpaqueSecKeychainRef;
+struct OpaqueSecKeychainItemRef;
+struct OpaqueSecKeychainSearchRef;
+
+alias OpaqueSecKeychainRef* SecKeychainRef;
+alias OpaqueSecKeychainItemRef* SecKeychainItemRef;
+alias OpaqueSecKeychainSearchRef* SecKeychainSearchRef;
+alias uint SecKeychainAttrType;
+alias uint SecKeychainStatus;
+alias SecKeychainAttribute* SecKeychainAttributePtr;
+alias SecKeychainRef KCRef;
+alias SecKeychainItemRef KCItemRef;
+alias SecKeychainSearchRef KCSearchRef;
+alias SecKeychainAttribute KCAttribute;
+alias SecKeychainAttributeList KCAttributeList;
+alias uint KCAttrType;
+alias uint KCStatus;
+alias ushort KCEvent;
+alias ushort KCEventMask;
+alias uint KCItemClass;
+alias uint KCItemAttr;
+alias uint KCAuthType;
+alias uint KCProtocolType;
+alias uint KCCertAddOptions;
+alias ushort KCVerifyStopOn;
+alias uint KCCertSearchOptions;
+alias KCCallbackProcPtr KCCallbackUPP;
+alias ubyte[16] AFPServerSignature;
+
+extern (C)
+{
+	alias int function (ushort, KCCallbackInfo*, void*) KCCallbackProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kCertificateKCItemClass = getOSType!("cert");
+		const __kAppleSharePasswordKCItemClass = getOSType!("ashp");
+		const __kInternetPasswordKCItemClass = getOSType!("inet");
+		const __kGenericPasswordKCItemClass = getOSType!("genp");
+		const __kClassKCItemAttr = getOSType!("clas");
+		const __kCreationDateKCItemAttr = getOSType!("cdat");
+		const __kModDateKCItemAttr = getOSType!("mdat");
+		const __kDescriptionKCItemAttr = getOSType!("desc");
+		const __kCommentKCItemAttr = getOSType!("icmt");
+		const __kCreatorKCItemAttr = getOSType!("crtr");
+		const __kTypeKCItemAttr = getOSType!("type");
+		const __kScriptCodeKCItemAttr = getOSType!("scrp");
+		const __kLabelKCItemAttr = getOSType!("labl");
+		const __kInvisibleKCItemAttr = getOSType!("invi");
+		const __kNegativeKCItemAttr = getOSType!("nega");
+		const __kCustomIconKCItemAttr = getOSType!("cusi");
+		const __kAccountKCItemAttr = getOSType!("acct");
+		const __kServiceKCItemAttr = getOSType!("svce");
+		const __kGenericKCItemAttr = getOSType!("gena");
+		const __kSecurityDomainKCItemAttr = getOSType!("sdmn");
+		const __kServerKCItemAttr = getOSType!("srvr");
+		const __kAuthTypeKCItemAttr = getOSType!("atyp");
+		const __kPortKCItemAttr = getOSType!("port");
+		const __kPathKCItemAttr = getOSType!("path");
+		const __kVolumeKCItemAttr = getOSType!("vlme");
+		const __kAddressKCItemAttr = getOSType!("addr");
+		const __kSignatureKCItemAttr = getOSType!("ssig");
+		const __kProtocolKCItemAttr = getOSType!("ptcl");
+		const __kSubjectKCItemAttr = getOSType!("subj");
+		const __kCommonNameKCItemAttr = getOSType!("cn  ");
+		const __kIssuerKCItemAttr = getOSType!("issu");
+		const __kSerialNumberKCItemAttr = getOSType!("snbr");
+		const __kEMailKCItemAttr = getOSType!("mail");
+		const __kPublicKeyHashKCItemAttr = getOSType!("hpky");
+		const __kIssuerURLKCItemAttr = getOSType!("iurl");
+		const __kEncryptKCItemAttr = getOSType!("encr");
+		const __kDecryptKCItemAttr = getOSType!("decr");
+		const __kSignKCItemAttr = getOSType!("sign");
+		const __kVerifyKCItemAttr = getOSType!("veri");
+		const __kWrapKCItemAttr = getOSType!("wrap");
+		const __kUnwrapKCItemAttr = getOSType!("unwr");
+		const __kStartDateKCItemAttr = getOSType!("sdat");
+		const __kEndDateKCItemAttr = getOSType!("edat");
+		const __kKCAuthTypeNTLM = getOSType!("ntlm");
+		const __kKCAuthTypeMSN = getOSType!("msna");
+		const __kKCAuthTypeDPA = getOSType!("dpaa");
+		const __kKCAuthTypeRPA = getOSType!("rpaa");
+		const __kKCAuthTypeHTTPDigest = getOSType!("httd");
+		const __kKCAuthTypeDefault = getOSType!("dflt");
+		const __kKCProtocolTypeFTP = getOSType!("ftp ");
+		const __kKCProtocolTypeFTPAccount = getOSType!("ftpa");
+		const __kKCProtocolTypeHTTP = getOSType!("http");
+		const __kKCProtocolTypeIRC = getOSType!("irc ");
+		const __kKCProtocolTypeNNTP = getOSType!("nntp");
+		const __kKCProtocolTypePOP3 = getOSType!("pop3");
+		const __kKCProtocolTypeSMTP = getOSType!("smtp");
+		const __kKCProtocolTypeSOCKS = getOSType!("sox ");
+		const __kKCProtocolTypeIMAP = getOSType!("imap");
+		const __kKCProtocolTypeLDAP = getOSType!("ldap");
+		const __kKCProtocolTypeAppleTalk = getOSType!("atlk");
+		const __kKCProtocolTypeAFP = getOSType!("afp ");
+		const __kKCProtocolTypeTelnet = getOSType!("teln");
+	}
+}
+
+enum
+{
+	kIdleKCEvent = 0,
+	kLockKCEvent = 1,
+	kUnlockKCEvent = 2,
+	kAddKCEvent = 3,
+	kDeleteKCEvent = 4,
+	kUpdateKCEvent = 5,
+	kPasswordChangedKCEvent = 6,
+	kSystemKCEvent = 8,
+	kDefaultChangedKCEvent = 9,
+	kDataAccessKCEvent = 10,
+	kKeychainListChangedKCEvent = 11
+}
+
+enum
+{
+	kIdleKCEventMask = 1 << kIdleKCEvent,
+	kLockKCEventMask = 1 << kLockKCEvent,
+	kUnlockKCEventMask = 1 << kUnlockKCEvent,
+	kAddKCEventMask = 1 << kAddKCEvent,
+	kDeleteKCEventMask = 1 << kDeleteKCEvent,
+	kUpdateKCEventMask = 1 << kUpdateKCEvent,
+	kPasswordChangedKCEventMask = 1 << kPasswordChangedKCEvent,
+	kSystemEventKCEventMask = 1 << kSystemKCEvent,
+	kDefaultChangedKCEventMask = 1 << kDefaultChangedKCEvent,
+	kDataAccessKCEventMask = 1 << kDataAccessKCEvent,
+	kEveryKCEventMask = 0xFFFF
+}
+
+enum
+{
+	kUnlockStateKCStatus = 1,
+	kRdPermKCStatus = 2,
+	kWrPermKCStatus = 4
+}
+
+enum
+{
+	kCertificateKCItemClass = getOSType!("cert"),
+	kAppleSharePasswordKCItemClass = getOSType!("ashp"),
+	kInternetPasswordKCItemClass = getOSType!("inet"),
+	kGenericPasswordKCItemClass = getOSType!("genp")
+}
+
+enum
+{
+	kClassKCItemAttr = getOSType!("clas"),
+	kCreationDateKCItemAttr = getOSType!("cdat"),
+	kModDateKCItemAttr = getOSType!("mdat"),
+	kDescriptionKCItemAttr = getOSType!("desc"),
+	kCommentKCItemAttr = getOSType!("icmt"),
+	kCreatorKCItemAttr = getOSType!("crtr"),
+	kTypeKCItemAttr = getOSType!("type"),
+	kScriptCodeKCItemAttr = getOSType!("scrp"),
+	kLabelKCItemAttr = getOSType!("labl"),
+	kInvisibleKCItemAttr = getOSType!("invi"),
+	kNegativeKCItemAttr = getOSType!("nega"),
+	kCustomIconKCItemAttr = getOSType!("cusi"),
+	kAccountKCItemAttr = getOSType!("acct"),
+	kServiceKCItemAttr = getOSType!("svce"),
+	kGenericKCItemAttr = getOSType!("gena"),
+	kSecurityDomainKCItemAttr = getOSType!("sdmn"),
+	kServerKCItemAttr = getOSType!("srvr"),
+	kAuthTypeKCItemAttr = getOSType!("atyp"),
+	kPortKCItemAttr = getOSType!("port"),
+	kPathKCItemAttr = getOSType!("path"),
+	kVolumeKCItemAttr = getOSType!("vlme"),
+	kAddressKCItemAttr = getOSType!("addr"),
+	kSignatureKCItemAttr = getOSType!("ssig"),
+	kProtocolKCItemAttr = getOSType!("ptcl"),
+	kSubjectKCItemAttr = getOSType!("subj"),
+	kCommonNameKCItemAttr = getOSType!("cn  "),
+	kIssuerKCItemAttr = getOSType!("issu"),
+	kSerialNumberKCItemAttr = getOSType!("snbr"),
+	kEMailKCItemAttr = getOSType!("mail"),
+	kPublicKeyHashKCItemAttr = getOSType!("hpky"),
+	kIssuerURLKCItemAttr = getOSType!("iurl"),
+	kEncryptKCItemAttr = getOSType!("encr"),
+	kDecryptKCItemAttr = getOSType!("decr"),
+	kSignKCItemAttr = getOSType!("sign"),
+	kVerifyKCItemAttr = getOSType!("veri"),
+	kWrapKCItemAttr = getOSType!("wrap"),
+	kUnwrapKCItemAttr = getOSType!("unwr"),
+	kStartDateKCItemAttr = getOSType!("sdat"),
+	kEndDateKCItemAttr = getOSType!("edat")
+}
+
+enum
+{
+	kKCAuthTypeNTLM = getOSType!("ntlm"),
+	kKCAuthTypeMSN = getOSType!("msna"),
+	kKCAuthTypeDPA = getOSType!("dpaa"),
+	kKCAuthTypeRPA = getOSType!("rpaa"),
+	kKCAuthTypeHTTPDigest = getOSType!("httd"),
+	kKCAuthTypeDefault = getOSType!("dflt")
+}
+
+enum
+{
+	kKCProtocolTypeFTP = getOSType!("ftp "),
+	kKCProtocolTypeFTPAccount = getOSType!("ftpa"),
+	kKCProtocolTypeHTTP = getOSType!("http"),
+	kKCProtocolTypeIRC = getOSType!("irc "),
+	kKCProtocolTypeNNTP = getOSType!("nntp"),
+	kKCProtocolTypePOP3 = getOSType!("pop3"),
+	kKCProtocolTypeSMTP = getOSType!("smtp"),
+	kKCProtocolTypeSOCKS = getOSType!("sox "),
+	kKCProtocolTypeIMAP = getOSType!("imap"),
+	kKCProtocolTypeLDAP = getOSType!("ldap"),
+	kKCProtocolTypeAppleTalk = getOSType!("atlk"),
+	kKCProtocolTypeAFP = getOSType!("afp "),
+	kKCProtocolTypeTelnet = getOSType!("teln")
+}
+
+enum
+{
+	kSecOptionReserved = 0x000000FF,
+	kCertUsageShift = 8,
+	kCertUsageSigningAdd = 1 << (kCertUsageShift + 0),
+	kCertUsageSigningAskAndAdd = 1 << (kCertUsageShift + 1),
+	kCertUsageVerifyAdd = 1 << (kCertUsageShift + 2),
+	kCertUsageVerifyAskAndAdd = 1 << (kCertUsageShift + 3),
+	kCertUsageEncryptAdd = 1 << (kCertUsageShift + 4),
+	kCertUsageEncryptAskAndAdd = 1 << (kCertUsageShift + 5),
+	kCertUsageDecryptAdd = 1 << (kCertUsageShift + 6),
+	kCertUsageDecryptAskAndAdd = 1 << (kCertUsageShift + 7),
+	kCertUsageKeyExchAdd = 1 << (kCertUsageShift + 8),
+	kCertUsageKeyExchAskAndAdd = 1 << (kCertUsageShift + 9),
+	kCertUsageRootAdd = 1 << (kCertUsageShift + 10),
+	kCertUsageRootAskAndAdd = 1 << (kCertUsageShift + 11),
+	kCertUsageSSLAdd = 1 << (kCertUsageShift + 12),
+	kCertUsageSSLAskAndAdd = 1 << (kCertUsageShift + 13),
+	kCertUsageAllAdd = 0x7FFFFF00
+}
+
+enum
+{
+	kPolicyKCStopOn = 0,
+	kNoneKCStopOn = 1,
+	kFirstPassKCStopOn = 2,
+	kFirstFailKCStopOn = 3
+}
+
+enum
+{
+	kCertSearchShift = 0,
+	kCertSearchSigningIgnored = 0,
+	kCertSearchSigningAllowed = 1 << (kCertSearchShift + 0),
+	kCertSearchSigningDisallowed = 1 << (kCertSearchShift + 1),
+	kCertSearchSigningMask = ((kCertSearchSigningAllowed) | (kCertSearchSigningDisallowed)),
+	kCertSearchVerifyIgnored = 0,
+	kCertSearchVerifyAllowed = 1 << (kCertSearchShift + 2),
+	kCertSearchVerifyDisallowed = 1 << (kCertSearchShift + 3),
+	kCertSearchVerifyMask = ((kCertSearchVerifyAllowed) | (kCertSearchVerifyDisallowed)),
+	kCertSearchEncryptIgnored = 0,
+	kCertSearchEncryptAllowed = 1 << (kCertSearchShift + 4),
+	kCertSearchEncryptDisallowed = 1 << (kCertSearchShift + 5),
+	kCertSearchEncryptMask = ((kCertSearchEncryptAllowed) | (kCertSearchEncryptDisallowed)),
+	kCertSearchDecryptIgnored = 0,
+	kCertSearchDecryptAllowed = 1 << (kCertSearchShift + 6),
+	kCertSearchDecryptDisallowed = 1 << (kCertSearchShift + 7),
+	kCertSearchDecryptMask = ((kCertSearchDecryptAllowed) | (kCertSearchDecryptDisallowed)),
+	kCertSearchWrapIgnored = 0,
+	kCertSearchWrapAllowed = 1 << (kCertSearchShift + 8),
+	kCertSearchWrapDisallowed = 1 << (kCertSearchShift + 9),
+	kCertSearchWrapMask = ((kCertSearchWrapAllowed) | (kCertSearchWrapDisallowed)),
+	kCertSearchUnwrapIgnored = 0,
+	kCertSearchUnwrapAllowed = 1 << (kCertSearchShift + 10),
+	kCertSearchUnwrapDisallowed = 1 << (kCertSearchShift + 11),
+	kCertSearchUnwrapMask = ((kCertSearchUnwrapAllowed) | (kCertSearchUnwrapDisallowed)),
+	kCertSearchPrivKeyRequired = 1 << (kCertSearchShift + 12),
+	kCertSearchAny = 0
+}
+
+enum
+{
+	kAnyPort = 0
+}
+
+enum
+{
+	kAnyProtocol = 0,
+	kAnyAuthType = 0
+}
+
+struct SecKeychainAttribute
+{
+	uint tag;
+	uint length;
+	void* data;
+}
+
+
+struct SecKeychainAttributeList
+{
+	uint count;
+	SecKeychainAttribute* attr;
+}
+
+
+struct KCCallbackInfo
+{
+	uint version_;
+	KCItemRef item;
+	SInt32* processID;
+	SInt32* event;
+	KCRef keychain;
+}
+
+extern (C)
+{
+	int KCGetKeychainManagerVersion (UInt32* returnVers);
+	int KCSetInteractionAllowed (ubyte state);
+	ubyte KCIsInteractionAllowed ();
+	int KCMakeKCRefFromFSRef (FSRef* keychainFSRef, KCRef* keychain);
+	int KCMakeKCRefFromAlias (AliasHandle keychainAlias, KCRef* keychain);
+	int KCMakeAliasFromKCRef (KCRef keychain, AliasHandle* keychainAlias);
+	int KCReleaseKeychain (KCRef* keychain);
+	int KCGetDefaultKeychain (KCRef* keychain);
+	int KCSetDefaultKeychain (KCRef keychain);
+	int KCGetStatus (KCRef keychain, UInt32* keychainStatus);
+	int KCGetKeychain (KCItemRef item, KCRef* keychain);
+	int KCGetKeychainName (KCRef keychain, char* keychainName);
+	ushort KCCountKeychains ();
+	int KCGetIndKeychain (ushort index, KCRef* keychain);
+	KCCallbackUPP NewKCCallbackUPP (KCCallbackProcPtr userRoutine);
+	void DisposeKCCallbackUPP (KCCallbackUPP userUPP);
+	int InvokeKCCallbackUPP (ushort keychainEvent, KCCallbackInfo* info, void* userContext, KCCallbackUPP userUPP);
+	int KCFindAppleSharePassword (AFPServerSignature* serverSignature, char* serverAddress, char* serverName, char* volumeName, char* accountName, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int KCFindInternetPassword (char* serverName, char* securityDomain, char* accountName, ushort port, uint protocol, uint authType, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int KCFindInternetPasswordWithPath (char* serverName, char* securityDomain, char* accountName, char* path, ushort port, uint protocol, uint authType, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int KCFindGenericPassword (char* serviceName, char* accountName, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int KCAddCallback (KCCallbackUPP callbackProc, ushort eventMask, void* userContext);
+	int KCRemoveCallback (KCCallbackUPP callbackProc);
+	int KCNewItem (uint itemClass, uint itemCreator, uint length, void* data, KCItemRef* item);
+	int KCSetAttribute (KCItemRef item, KCAttribute* attr);
+	int KCGetAttribute (KCItemRef item, KCAttribute* attr, UInt32* actualLength);
+	int KCSetData (KCItemRef item, uint length, void* data);
+	int KCUpdateItem (KCItemRef item);
+	int KCReleaseItem (KCItemRef* item);
+	int KCCopyItem (KCItemRef item, KCRef destKeychain, KCItemRef* copy);
+	int KCFindFirstItem (KCRef keychain, KCAttributeList* attrList, KCSearchRef* search, KCItemRef* item);
+	int KCFindNextItem (KCSearchRef search, KCItemRef* item);
+	int KCReleaseSearch (KCSearchRef* search);
+	int KCDeleteItem (KCItemRef item);
+	int KCGetData (KCItemRef item, uint maxLength, void* data, UInt32* actualLength);
+	int KCLock (KCRef keychain);
+	int kcgetkeychainname (KCRef keychain, char* keychainName);
+	int kcfindapplesharepassword (AFPServerSignature* serverSignature, char* serverAddress, char* serverName, char* volumeName, char* accountName, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int kcfindinternetpassword (char* serverName, char* securityDomain, char* accountName, ushort port, uint protocol, uint authType, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int kcfindinternetpasswordwithpath (char* serverName, char* securityDomain, char* accountName, char* path, ushort port, uint protocol, uint authType, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+	int kcfindgenericpassword (char* serviceName, char* accountName, uint maxLength, void* passwordData, UInt32* actualLength, KCItemRef* item);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/NSLCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,162 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.NSLCore;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CarbonCore;
+
+alias NSLError* NSLErrorPtr;
+alias ushort NSLSearchState;
+alias uint NSLEventCode;
+alias uint NSLClientRef;
+alias uint NSLRequestRef;
+alias uint NSLOneBasedIndex;
+alias char* NSLPath;
+alias char* NSLServiceType;
+alias Handle NSLServicesList;
+alias char* NSLNeighborhood;
+alias NSLClientAsyncInfo* NSLClientAsyncInfoPtr;
+alias NSLPluginAsyncInfo* NSLPluginAsyncInfoPtr;
+alias NSLMgrNotifyProcPtr NSLMgrNotifyUPP;
+alias NSLClientNotifyProcPtr NSLClientNotifyUPP;
+alias NSLTypedData* NSLTypedDataPtr;
+alias NSLServicesListHeader* NSLServicesListHeaderPtr;
+alias NSLPluginData* NSLPluginDataPtr;
+
+extern (C)
+{
+	alias void function (NSLClientAsyncInfo*) NSLClientNotifyProcPtr;
+	alias void function (NSLPluginAsyncInfo*) NSLMgrNotifyProcPtr;
+}
+
+enum
+{
+	kNSLMinSystemVersion = 0x0900,
+	kNSLMinOTVersion = 0x0130
+}
+
+enum
+{
+	kNSLDefaultListSize = 256
+}
+
+enum
+{
+	kNSLURLDelimiter = ','
+}
+
+enum
+{
+	kNSLNoContext = 0
+}
+
+enum
+{
+	kNSLDuplicateSearchInProgress = 100,
+	kNSLUserCanceled = userCanceledErr,
+	kNSLInvalidEnumeratorRef = 0
+}
+
+enum
+{
+	kNSLSearchStateBufferFull = 1,
+	kNSLSearchStateOnGoing = 2,
+	kNSLSearchStateComplete = 3,
+	kNSLSearchStateStalled = 4,
+	kNSLWaitingForContinue = 5
+}
+
+enum
+{
+	kNSLServicesLookupDataEvent = 6,
+	kNSLNeighborhoodLookupDataEvent = 7,
+	kNSLNewDataEvent = 8,
+	kNSLContinueLookupEvent = 9
+}
+
+struct NSLError
+{
+	int theErr;
+	uint theContext;
+}
+
+
+struct NSLClientAsyncInfo
+{
+	void* clientContextPtr;
+	void* mgrContextPtr;
+	char* resultBuffer;
+	int bufferLen;
+	int maxBufferSize;
+	uint startTime;
+	uint intStartTime;
+	uint maxSearchTime;
+	uint alertInterval;
+	uint totalItems;
+	uint alertThreshold;
+	ushort searchState;
+	NSLError searchResult;
+	uint searchDataType;
+}
+
+
+struct NSLPluginAsyncInfo
+{
+	void* mgrContextPtr;
+	void* pluginContextPtr;
+	void* pluginPtr;
+	char* resultBuffer;
+	int bufferLen;
+	int maxBufferSize;
+	uint maxSearchTime;
+	uint reserved1;
+	uint reserved2;
+	uint reserved3;
+	uint clientRef;
+	uint requestRef;
+	ushort searchState;
+	int searchResult;
+}
+
+
+struct NSLTypedData
+{
+	uint dataType;
+	uint lengthOfData;
+}
+
+
+struct NSLServicesListHeader
+{
+	uint numServices;
+	uint logicalLen;
+}
+
+
+struct NSLPluginData
+{
+	int reserved1;
+	int reserved2;
+	int reserved3;
+	ubyte supportsRegistration;
+	ubyte isPurgeable;
+	ushort totalLen;
+	ushort dataTypeOffset;
+	ushort serviceListOffset;
+	ushort protocolListOffset;
+	ushort commentStringOffset;
+}
+
+extern (C)
+{
+	NSLMgrNotifyUPP NewNSLMgrNotifyUPP (NSLMgrNotifyProcPtr userRoutine);
+	NSLClientNotifyUPP NewNSLClientNotifyUPP (NSLClientNotifyProcPtr userRoutine);
+	void DisposeNSLMgrNotifyUPP (NSLMgrNotifyUPP userUPP);
+	void DisposeNSLClientNotifyUPP (NSLClientNotifyUPP userUPP);
+	void InvokeNSLMgrNotifyUPP (NSLPluginAsyncInfo* thePluginAsyncInfo, NSLMgrNotifyUPP userUPP);
+	void InvokeNSLClientNotifyUPP (NSLClientAsyncInfo* theClientAsyncInfo, NSLClientNotifyUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/OSServices.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,29 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.OSServices;
+
+public:
+
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.osservices.AppleDiskPartitions;
+import dstep.coreservices.osservices.CSIdentity;
+import dstep.coreservices.osservices.CSIdentityAuthority;
+import dstep.coreservices.osservices.CSIdentityQuery;
+import dstep.coreservices.osservices.IconStorage;
+import dstep.coreservices.osservices.NSLCore;
+import dstep.coreservices.osservices.OpenTransport;
+import dstep.coreservices.osservices.OpenTransportProtocol;
+import dstep.coreservices.osservices.OpenTransportProviders;
+import dstep.coreservices.osservices.Power;
+import dstep.coreservices.osservices.SCSI;
+import dstep.coreservices.osservices.SecurityCore;
+import dstep.coreservices.osservices.SystemSound;
+import dstep.coreservices.osservices.WSMethodInvocation;
+import dstep.coreservices.osservices.WSProtocolHandler;
+import dstep.coreservices.osservices.WSTypes;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/OT.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,15 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.OT;
+
+public:
+
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.coreservices.osservices.OpenTransport;
+import dstep.coreservices.osservices.OpenTransportProtocol;
+import dstep.coreservices.osservices.OpenTransportProviders;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/OpenTransport.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,813 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.OpenTransport;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Version;
+import dstep.objc.bridge.TypeEncoding;
+//import dstep.stddef;
+
+struct OTConfiguration;
+struct OpaqueOTClientContextPtr;
+
+struct TOptionHeader
+{
+	uint len;
+	uint level;
+	uint name;
+	uint status;
+}
+
+alias ubyte OTUInt8Param;
+alias ushort OTUInt16Param;
+alias short OTSInt16Param;
+alias byte OTSInt8Param;
+alias ubyte OTBooleanParam;
+alias ubyte uchar_p;
+alias ushort ushort_p;
+alias short short_p;
+alias byte char_p;
+alias ubyte boolean_p;
+alias uint OTByteCount;
+alias uint OTItemCount;
+alias int OTInt32;
+alias uint OTUInt32;
+alias int int_t;
+alias uint uint_t;
+alias uint OTTimeout;
+alias int OTSequence;
+alias int OTNameID;
+alias int OTReason;
+alias uint OTQLen;
+alias char* OTClientName;
+alias int OTCommand;
+alias void* OTClient;
+alias uint OTOpenFlags;
+alias ushort OTUnixErr;
+alias ushort OTXTIErr;
+alias int OTResult;
+alias ushort OTAddressType;
+alias uint OTStructType;
+alias uint OTFieldsType;
+alias uint OTFlags;
+alias uint OTBand;
+alias void* ProviderRef;
+alias void* EndpointRef;
+alias void* MapperRef;
+alias uint OTEventCode;
+alias OTNotifyProcPtr OTNotifyUPP;
+alias uint OTXTILevel;
+alias uint OTXTIName;
+alias uint OTXTIStates;
+alias OTConfiguration* OTConfigurationRef;
+alias uint OTServiceType;
+alias int OTDataSize;
+alias uint OTPortRef;
+alias OTPortRef* OTPortRefPtr;
+alias ubyte OTBusType;
+alias ushort OTDeviceType;
+alias ushort OTSlotNumber;
+alias OpaqueOTClientContextPtr* OTClientContextPtr;
+alias uint OTInitializationFlags;
+alias OTProcessProcPtr OTProcessUPP;
+alias int OTDeferredTaskRef;
+alias int OTSystemTaskRef;
+alias UnsignedWide OTTimeStamp;
+alias OTListSearchProcPtr OTListSearchUPP;
+alias ubyte OTLock;
+
+extern (C)
+{
+	alias ubyte function (void*, OTLink*) OTListSearchProcPtr;
+	alias void function (void*) OTProcessProcPtr;
+	alias void function (void*, uint, int, void*) OTNotifyProcPtr;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kOTCFMClass = getOSType!("otan");
+	}
+}
+
+enum
+{
+	kOTCFMClass = getOSType!("otan")
+}
+
+enum
+{
+	kO_ASYNC = 0x01,
+	kO_NDELAY = 0x04,
+	kO_NONBLOCK = 0x04
+}
+
+enum
+{
+	TSUCCESS = 0,
+	TBADADDR = 1,
+	TBADOPT = 2,
+	TACCES = 3,
+	TBADF = 4,
+	TNOADDR = 5,
+	TOUTSTATE = 6,
+	TBADSEQ = 7,
+	TSYSERR = 8,
+	TLOOK = 9,
+	TBADDATA = 10,
+	TBUFOVFLW = 11,
+	TFLOW = 12,
+	TNODATA = 13,
+	TNODIS = 14,
+	TNOUDERR = 15,
+	TBADFLAG = 16,
+	TNOREL = 17,
+	TNOTSUPPORT = 18,
+	TSTATECHNG = 19,
+	TNOSTRUCTYPE = 20,
+	TBADNAME = 21,
+	TBADQLEN = 22,
+	TADDRBUSY = 23,
+	TINDOUT = 24,
+	TPROVMISMATCH = 25,
+	TRESQLEN = 26,
+	TRESADDR = 27,
+	TQFULL = 28,
+	TPROTO = 29,
+	TBADSYNC = 30,
+	TCANCELED = 31,
+	TLASTXTIERROR = 31
+}
+
+enum
+{
+	kOTGenericName = 0
+}
+
+enum
+{
+	T_BIND = 1,
+	T_OPTMGMT = 2,
+	T_CALL = 3,
+	T_DIS = 4,
+	T_UNITDATA = 5,
+	T_UDERROR = 6,
+	T_INFO = 7,
+	T_REPLYDATA = 8,
+	T_REQUESTDATA = 9,
+	T_UNITREQUEST = 10,
+	T_UNITREPLY = 11
+}
+
+enum
+{
+	T_ADDR = 0x01,
+	T_OPT = 0x02,
+	T_UDATA = 0x04,
+	T_ALL = 0xFFFF
+}
+
+enum
+{
+	T_MORE = 0x0001,
+	T_EXPEDITED = 0x0002,
+	T_ACKNOWLEDGED = 0x0004,
+	T_PARTIALDATA = 0x0008,
+	T_NORECEIPT = 0x0010,
+	T_TIMEDOUT = 0x0020
+}
+
+enum
+{
+	T_NEGOTIATE = 0x0004,
+	T_CHECK = 0x0008,
+	T_DEFAULT = 0x0010,
+	T_CURRENT = 0x0080
+}
+
+enum
+{
+	T_SUCCESS = 0x0020,
+	T_FAILURE = 0x0040,
+	T_PARTSUCCESS = 0x0100,
+	T_READONLY = 0x0200,
+	T_NOTSUPPORT = 0x0400
+}
+
+enum
+{
+	T_LISTEN = 0x0001,
+	T_CONNECT = 0x0002,
+	T_DATA = 0x0004,
+	T_EXDATA = 0x0008,
+	T_DISCONNECT = 0x0010,
+	T_ERROR = 0x0020,
+	T_UDERR = 0x0040,
+	T_ORDREL = 0x0080,
+	T_GODATA = 0x0100,
+	T_GOEXDATA = 0x0200,
+	T_REQUEST = 0x0400,
+	T_REPLY = 0x0800,
+	T_PASSCON = 0x1000,
+	T_RESET = 0x2000,
+	kPRIVATEEVENT = 0x10000000,
+	kCOMPLETEEVENT = 0x20000000,
+	T_BINDCOMPLETE = 0x20000001,
+	T_UNBINDCOMPLETE = 0x20000002,
+	T_ACCEPTCOMPLETE = 0x20000003,
+	T_REPLYCOMPLETE = 0x20000004,
+	T_DISCONNECTCOMPLETE = 0x20000005,
+	T_OPTMGMTCOMPLETE = 0x20000006,
+	T_OPENCOMPLETE = 0x20000007,
+	T_GETPROTADDRCOMPLETE = 0x20000008,
+	T_RESOLVEADDRCOMPLETE = 0x20000009,
+	T_GETINFOCOMPLETE = 0x2000000A,
+	T_SYNCCOMPLETE = 0x2000000B,
+	T_MEMORYRELEASED = 0x2000000C,
+	T_REGNAMECOMPLETE = 0x2000000D,
+	T_DELNAMECOMPLETE = 0x2000000E,
+	T_LKUPNAMECOMPLETE = 0x2000000F,
+	T_LKUPNAMERESULT = 0x20000010,
+	kOTSyncIdleEvent = 0x20000011,
+	kSTREAMEVENT = 0x21000000,
+	kOTReservedEvent1 = 0x21000001,
+	kGetmsgEvent = 0x21000002,
+	kStreamReadEvent = 0x21000003,
+	kStreamWriteEvent = 0x21000004,
+	kStreamIoctlEvent = 0x21000005,
+	kOTReservedEvent2 = 0x21000006,
+	kStreamOpenEvent = 0x21000007,
+	kPollEvent = 0x21000008,
+	kOTReservedEvent3 = 0x21000009,
+	kOTReservedEvent4 = 0x2100000A,
+	kOTReservedEvent5 = 0x2100000B,
+	kOTReservedEvent6 = 0x2100000C,
+	kOTReservedEvent7 = 0x2100000D,
+	kOTReservedEvent8 = 0x2100000E,
+	kSIGNALEVENT = 0x22000000,
+	kPROTOCOLEVENT = 0x23000000,
+	kOTProviderIsDisconnected = 0x23000001,
+	kOTProviderIsReconnected = 0x23000002,
+	kOTProviderWillClose = 0x24000001,
+	kOTProviderIsClosed = 0x24000002,
+	kOTPortDisabled = 0x25000001,
+	kOTPortEnabled = 0x25000002,
+	kOTPortOffline = 0x25000003,
+	kOTPortOnline = 0x25000004,
+	kOTClosePortRequest = 0x25000005,
+	kOTYieldPortRequest = 0x25000005,
+	kOTNewPortRegistered = 0x25000006,
+	kOTPortNetworkChange = 0x25000007,
+	kOTConfigurationChanged = 0x26000001,
+	kOTSystemSleep = 0x26000002,
+	kOTSystemShutdown = 0x26000003,
+	kOTSystemAwaken = 0x26000004,
+	kOTSystemIdle = 0x26000005,
+	kOTSystemSleepPrep = 0x26000006,
+	kOTSystemShutdownPrep = 0x26000007,
+	kOTSystemAwakenPrep = 0x26000008,
+	kOTStackIsLoading = 0x27000001,
+	kOTStackWasLoaded = 0x27000002,
+	kOTStackIsUnloading = 0x27000003
+}
+
+enum
+{
+	kOTDisablePortEvent = 0x21000001,
+	kStreamCloseEvent = 0x21000006,
+	kBackgroundStreamEvent = 0x21000009,
+	kIoctlRecvFdEvent = 0x2100000A,
+	kOTTryShutdownEvent = 0x2100000B,
+	kOTScheduleTerminationEvent = 0x2100000C,
+	kOTEnablePortEvent = 0x2100000D,
+	kOTNewPortRegisteredEvent = 0x2100000E,
+	kOTPortOfflineEvent = 0x2100000F,
+	kOTPortOnlineEvent = 0x21000010,
+	kOTPortNetworkChangeEvent = 0x21000011
+}
+
+enum
+{
+	kSIGHUP = 1,
+	kSIGURG = 16,
+	kSIGPOLL = 30
+}
+
+enum
+{
+	XTI_GENERIC = 0xFFFF
+}
+
+enum
+{
+	XTI_DEBUG = 0x0001,
+	XTI_LINGER = 0x0080,
+	XTI_RCVBUF = 0x1002,
+	XTI_RCVLOWAT = 0x1004,
+	XTI_SNDBUF = 0x1001,
+	XTI_SNDLOWAT = 0x1003,
+	XTI_PROTOTYPE = 0x1005,
+	OPT_CHECKSUM = 0x0600,
+	OPT_RETRYCNT = 0x0601,
+	OPT_INTERVAL = 0x0602,
+	OPT_ENABLEEOM = 0x0603,
+	OPT_SELFSEND = 0x0604,
+	OPT_SERVERSTATUS = 0x0605,
+	OPT_ALERTENABLE = 0x0606,
+	OPT_KEEPALIVE = 0x0008
+}
+
+enum
+{
+	MIOC_STREAMIO = 'A',
+	MIOC_TMOD = 'a',
+	MIOC_STRLOG = 'b',
+	MIOC_ND = 'c',
+	MIOC_ECHO = 'd',
+	MIOC_TLI = 'e',
+	MIOC_RESERVEDf = 'f',
+	MIOC_SAD = 'g',
+	MIOC_ARP = 'h',
+	MIOC_HAVOC = 'H',
+	MIOC_RESERVEDi = 'i',
+	MIOC_SIOC = 'j',
+	MIOC_TCP = 'k',
+	MIOC_DLPI = 'l',
+	MIOC_SOCKETS = 'm',
+	MIOC_IPX = 'o',
+	MIOC_OT = 'O',
+	MIOC_ATALK = 'T',
+	MIOC_SRL = 'U',
+	MIOC_RESERVEDp = 'p',
+	MIOC_RESERVEDr = 'r',
+	MIOC_RESERVEDs = 's',
+	MIOC_CFIG = 'z'
+}
+
+enum
+{
+	I_OTGetMiscellaneousEvents = ((MIOC_OT << 8) | 1),
+	I_OTSetFramingType = ((MIOC_OT << 8) | 2),
+	kOTGetFramingValue = cast(uint)0xFFFFFFFF,
+	I_OTSetRawMode = ((MIOC_OT << 8) | 3),
+	kOTSetRecvMode = 0x01,
+	kOTSendErrorPacket = 0x02,
+	I_OTConnect = ((MIOC_OT << 8) | 4),
+	I_OTDisconnect = ((MIOC_OT << 8) | 5),
+	I_OTScript = ((MIOC_OT << 8) | 6)
+}
+
+enum
+{
+	T_UNINIT = 0,
+	T_UNBND = 1,
+	T_IDLE = 2,
+	T_OUTCON = 3,
+	T_INCON = 4,
+	T_DATAXFER = 5,
+	T_OUTREL = 6,
+	T_INREL = 7
+}
+
+static if (D_LP64)
+{
+	enum : ulong
+	{
+		T_YES = 1,
+		T_NO = 0,
+		T_UNUSED = -1,
+		kT_NULL = 0,
+		T_ABSREQ = 0x8000
+	}
+}
+
+else
+{
+	enum : uint
+	{
+		T_YES = 1,
+		T_NO = 0,
+		T_UNUSED = -1,
+		kT_NULL = 0,
+		T_ABSREQ = 0x8000
+	}
+}
+
+enum
+{
+	kT_UNSPEC = cast(uint)0xFFFFFFFD,
+	T_ALLOPT = 0
+}
+
+enum
+{
+	kOTOptionHeaderSize = TOptionHeader.sizeof,
+	kOTBooleanOptionDataSize = uint.sizeof,
+	kOTBooleanOptionSize = kOTOptionHeaderSize + kOTBooleanOptionDataSize,
+	kOTOneByteOptionSize = kOTOptionHeaderSize + 1,
+	kOTTwoByteOptionSize = kOTOptionHeaderSize + 2,
+	kOTFourByteOptionSize = kOTOptionHeaderSize + uint.sizeof
+}
+
+enum
+{
+	T_COTS = 1,
+	T_COTS_ORD = 2,
+	T_CLTS = 3,
+	T_TRANS = 5,
+	T_TRANS_ORD = 6,
+	T_TRANS_CLTS = 7
+}
+
+enum
+{
+	T_SENDZERO = 0x0001,
+	T_XPG4_1 = 0x0002,
+	T_CAN_SUPPORT_MDATA = 0x10000000,
+	T_CAN_RESOLVE_ADDR = 0x40000000,
+	T_CAN_SUPPLY_MIB = 0x20000000
+}
+
+enum
+{
+	T_INFINITE = -1,
+	T_INVALID = -2
+}
+
+enum
+{
+	kOTInvalidPortRef = 0
+}
+
+enum
+{
+	kOTUnknownBusPort = 0,
+	kOTMotherboardBus = 1,
+	kOTNuBus = 2,
+	kOTPCIBus = 3,
+	kOTGeoPort = 4,
+	kOTPCCardBus = 5,
+	kOTFireWireBus = 6,
+	kOTLastBusIndex = 15
+}
+
+enum
+{
+	kOTNoDeviceType = 0,
+	kOTADEVDevice = 1,
+	kOTMDEVDevice = 2,
+	kOTLocalTalkDevice = 3,
+	kOTIRTalkDevice = 4,
+	kOTTokenRingDevice = 5,
+	kOTISDNDevice = 6,
+	kOTATMDevice = 7,
+	kOTSMDSDevice = 8,
+	kOTSerialDevice = 9,
+	kOTEthernetDevice = 10,
+	kOTSLIPDevice = 11,
+	kOTPPPDevice = 12,
+	kOTModemDevice = 13,
+	kOTFastEthernetDevice = 14,
+	kOTFDDIDevice = 15,
+	kOTIrDADevice = 16,
+	kOTATMSNAPDevice = 17,
+	kOTFibreChannelDevice = 18,
+	kOTFireWireDevice = 19,
+	kOTPseudoDevice = 1023,
+	kOTLastDeviceIndex = 1022
+}
+
+enum
+{
+	kOTLastSlotNumber = 255,
+	kOTLastOtherNumber = 255
+}
+
+enum
+{
+	kMaxModuleNameLength = 31,
+	kMaxModuleNameSize = kMaxModuleNameLength + 1,
+	kMaxProviderNameLength = kMaxModuleNameLength + 4,
+	kMaxProviderNameSize = kMaxProviderNameLength + 1,
+	kMaxSlotIDLength = 7,
+	kMaxSlotIDSize = kMaxSlotIDLength + 1,
+	kMaxResourceInfoLength = 31,
+	kMaxResourceInfoSize = 32,
+	kMaxPortNameLength = kMaxModuleNameLength + 4,
+	kMaxPortNameSize = kMaxPortNameLength + 1
+}
+
+enum
+{
+	kOTPortIsActive = 0x00000001,
+	kOTPortIsDisabled = 0x00000002,
+	kOTPortIsUnavailable = 0x00000004,
+	kOTPortIsOffline = 0x00000008
+}
+
+enum
+{
+	kOTPortIsDLPI = 0x00000001,
+	kOTPortIsTPI = 0x00000002,
+	kOTPortCanYield = 0x00000004,
+	kOTPortCanArbitrate = 0x00000008,
+	kOTPortIsTransitory = 0x00000010,
+	kOTPortAutoConnects = 0x00000020,
+	kOTPortIsSystemRegistered = 0x00004000,
+	kOTPortIsPrivate = 0x00008000,
+	kOTPortIsAlias = cast(uint)0x80000000
+}
+
+enum : uint
+{
+	kNetbufDataIsOTData = 0xFFFFFFFE
+}
+
+enum : uint
+{
+	kOTNetbufDataIsOTBufferStar = 0xFFFFFFFD
+}
+
+enum : uint
+{
+	kOTNetbufIsRawMode = 0xFFFFFFFF
+}
+
+enum
+{
+	kInitOTForApplicationMask = 1,
+	kInitOTForExtensionMask = 2
+}
+
+struct OTAddress
+{
+	ushort fAddressType;
+	char* fAddress;
+}
+
+
+struct OTScriptInfo
+{
+	uint fScriptType;
+	void* fTheScript;
+	uint fScriptLength;
+}
+
+struct TOption
+{
+	uint len;
+	uint level;
+	uint name;
+	uint status;
+	UInt32* value;
+}
+
+
+struct t_kpalive
+{
+	int kp_onoff;
+	int kp_timeout;
+}
+
+
+struct t_linger
+{
+	int l_onoff;
+	int l_linger;
+}
+
+
+struct TEndpointInfo
+{
+	int addr;
+	int options;
+	int tsdu;
+	int etsdu;
+	int connect;
+	int discon;
+	uint servtype;
+	uint flags;
+}
+
+
+struct OTPortRecord
+{
+	uint fRef;
+	uint fPortFlags;
+	uint fInfoFlags;
+	uint fCapabilities;
+	uint fNumChildPorts;
+	OTPortRef* fChildPorts;
+	char* fPortName;
+	char* fModuleName;
+	char* fSlotID;
+	char* fResourceInfo;
+	char* fReserved;
+}
+
+
+struct TNetbuf
+{
+	uint maxlen;
+	uint len;
+	char* buf;
+}
+
+
+struct strbuf
+{
+	int maxlen;
+	int len;
+	char* buf;
+}
+
+
+struct OTData
+{
+	void* fNext;
+	void* fData;
+	uint fLen;
+}
+
+
+struct OTBuffer
+{
+	void* fLink;
+	void* fLink2;
+	OTBuffer* fNext;
+	char* fData;
+	uint fLen;
+	void* fSave;
+	ubyte fBand;
+	ubyte fType;
+	ubyte fPad1;
+	ubyte fFlags;
+}
+
+
+struct OTBufferInfo
+{
+	OTBuffer* fBuffer;
+	uint fOffset;
+	ubyte fPad;
+}
+
+
+struct TBind
+{
+	TNetbuf addr;
+	uint qlen;
+}
+
+
+struct TDiscon
+{
+	TNetbuf udata;
+	int reason;
+	int sequence;
+}
+
+
+struct TCall
+{
+	TNetbuf addr;
+	TNetbuf opt;
+	TNetbuf udata;
+	int sequence;
+}
+
+
+struct TUnitData
+{
+	TNetbuf addr;
+	TNetbuf opt;
+	TNetbuf udata;
+}
+
+
+struct TUDErr
+{
+	TNetbuf addr;
+	TNetbuf opt;
+	int error;
+}
+
+
+struct TOptMgmt
+{
+	TNetbuf opt;
+	uint flags;
+}
+
+
+struct TRequest
+{
+	TNetbuf data;
+	TNetbuf opt;
+	int sequence;
+}
+
+
+struct TReply
+{
+	TNetbuf data;
+	TNetbuf opt;
+	int sequence;
+}
+
+
+struct TUnitRequest
+{
+	TNetbuf addr;
+	TNetbuf opt;
+	TNetbuf udata;
+	int sequence;
+}
+
+
+struct TUnitReply
+{
+	TNetbuf opt;
+	TNetbuf udata;
+	int sequence;
+}
+
+
+struct TRegisterRequest
+{
+	TNetbuf name;
+	TNetbuf addr;
+	uint flags;
+}
+
+
+struct TRegisterReply
+{
+	TNetbuf addr;
+	int nameid;
+}
+
+
+struct TLookupRequest
+{
+	TNetbuf name;
+	TNetbuf addr;
+	uint maxcnt;
+	uint timeout;
+	uint flags;
+}
+
+
+struct TLookupReply
+{
+	TNetbuf names;
+	uint rspcount;
+}
+
+
+struct TLookupBuffer
+{
+	ushort fAddressLength;
+	ushort fNameLength;
+	char* fAddressBuffer;
+}
+
+
+struct OTLink
+{
+	OTLink* fNext;
+}
+
+
+struct OTLIFO
+{
+	OTLink* fHead;
+}
+
+
+struct OTList
+{
+	OTLink* fHead;
+}
+
+extern (C)
+{
+	OTNotifyUPP NewOTNotifyUPP (OTNotifyProcPtr userRoutine);
+	void DisposeOTNotifyUPP (OTNotifyUPP userUPP);
+	void InvokeOTNotifyUPP (void* contextPtr, uint code, int result, void* cookie, OTNotifyUPP userUPP);
+	OTProcessUPP NewOTProcessUPP (OTProcessProcPtr userRoutine);
+	void DisposeOTProcessUPP (OTProcessUPP userUPP);
+	void InvokeOTProcessUPP (void* arg, OTProcessUPP userUPP);
+	OTListSearchUPP NewOTListSearchUPP (OTListSearchProcPtr userRoutine);
+	void DisposeOTListSearchUPP (OTListSearchUPP userUPP);
+	ubyte InvokeOTListSearchUPP (void* ref_, OTLink* linkToCheck, OTListSearchUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/OpenTransportProtocol.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,296 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.OpenTransportProtocol;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.CodeFragments;
+import dstep.coreservices.carboncore.ConditionalMacros;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.osservices.OpenTransport;
+//import dstep.stddef;
+
+alias int OTTimerTask;
+
+extern (C)
+{
+	alias ubyte function (void*, OTLink*) OTHashSearchProcPtr;
+	alias ubyte function (OTLink*) OTGateProcPtr;
+	alias uint function (OTLink*) OTHashProcPtr;
+}
+
+enum
+{
+	I_NREAD = ((MIOC_STREAMIO << 8) | 1),
+	I_PUSH = ((MIOC_STREAMIO << 8) | 2),
+	I_POP = ((MIOC_STREAMIO << 8) | 3),
+	I_LOOK = ((MIOC_STREAMIO << 8) | 4),
+	I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
+	I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
+	I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
+	I_STR = ((MIOC_STREAMIO << 8) | 8),
+	I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
+	I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
+	I_FIND = ((MIOC_STREAMIO << 8) | 11),
+	I_LINK = ((MIOC_STREAMIO << 8) | 12),
+	I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
+	I_PEEK = ((MIOC_STREAMIO << 8) | 15),
+	I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
+	I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
+	I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
+	I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
+	I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
+	I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
+	I_LIST = ((MIOC_STREAMIO << 8) | 22),
+	I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
+	I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
+	I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
+	I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
+	I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
+	I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
+	I_PLINK = ((MIOC_STREAMIO << 8) | 29),
+	I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
+	I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
+	I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
+	I_POLL = ((MIOC_STREAMIO << 8) | 42),
+	I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
+	I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
+	I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
+	I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
+	I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
+	I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
+	I_PIPE = ((MIOC_STREAMIO << 8) | 49),
+	I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
+	I_FIFO = ((MIOC_STREAMIO << 8) | 51)
+}
+
+enum
+{
+	RS_HIPRI = 0x01
+}
+
+enum
+{
+	MSG_HIPRI = 0x01,
+	MSG_BAND = 0x02,
+	MSG_ANY = 0x04
+}
+
+enum
+{
+	MORECTL = 0x01,
+	MOREDATA = 0x02
+}
+
+enum
+{
+	FMNAMESZ = 31
+}
+
+enum : uint
+{
+	INFTIM = 0xFFFFFFFF
+}
+
+enum
+{
+	FLUSHR = 0x01,
+	FLUSHW = 0x02,
+	FLUSHRW = (FLUSHW | FLUSHR)
+}
+
+enum
+{
+	FLUSHBAND = 0x40
+}
+
+enum
+{
+	ANYMARK = 0x01,
+	LASTMARK = 0x02
+}
+
+enum
+{
+	S_INPUT = 0x01,
+	S_HIPRI = 0x02,
+	S_OUTPUT = 0x04,
+	S_MSG = 0x08,
+	S_RDNORM = 0x10,
+	S_RDBAND = 0x20,
+	S_WRNORM = 0x40,
+	S_WRBAND = 0x80,
+	S_ERROR = 0x0100,
+	S_HANGUP = 0x0200,
+	S_BANDURG = 0x0400
+}
+
+enum
+{
+	RNORM = 0x01,
+	RMSGD = 0x02,
+	RMSGN = 0x04,
+	RFILL = 0x08
+}
+
+enum
+{
+	RPROTNORM = 0x10,
+	RPROTDIS = 0x20,
+	RPROTDAT = 0x40
+}
+
+enum
+{
+	SNDZERO = 0x01
+}
+
+enum
+{
+	MUXID_ALL = -1
+}
+
+enum
+{
+	SL_FATAL = 0x01,
+	SL_NOTIFY = 0x02,
+	SL_ERROR = 0x04,
+	SL_TRACE = 0x08,
+	SL_CONSOLE = 0x00,
+	SL_WARN = 0x20,
+	SL_NOTE = 0x40
+}
+
+enum
+{
+	I_TRCLOG = ((MIOC_STRLOG << 8) | 1),
+	I_ERRLOG = ((MIOC_STRLOG << 8) | 2)
+}
+
+enum
+{
+	LOGMSGSZ = 128
+}
+
+struct bandinfo
+{
+	ubyte bi_pri;
+	byte pad1;
+	int bi_flag;
+}
+
+
+struct strfdinsert
+{
+	strbuf ctlbuf;
+	strbuf databuf;
+	int flags;
+	int fildes;
+	int offset;
+}
+
+
+struct str_mlist
+{
+	char* l_name;
+}
+
+
+struct str_list
+{
+	int sl_nmods;
+	str_mlist* sl_modlist;
+}
+
+
+struct strpeek
+{
+	strbuf ctlbuf;
+	strbuf databuf;
+	int flags;
+}
+
+
+struct strpmsg
+{
+	strbuf ctlbuf;
+	strbuf databuf;
+	int band;
+	int flags;
+}
+
+
+struct strrecvfd
+{
+	int fd;
+	ushort uid;
+	ushort gid;
+	char* fill;
+}
+
+
+struct strioctl
+{
+	int ic_cmd;
+	int ic_timout;
+	int ic_len;
+	char* ic_dp;
+}
+
+
+struct log_ctl
+{
+	short mid;
+	short sid;
+	byte level;
+	byte pad1;
+	short flags;
+	int ltime;
+	int ttime;
+	int seq_no;
+}
+
+
+struct trace_ids
+{
+	short ti_mid;
+	short ti_sid;
+	byte ti_level;
+}
+
+
+struct OTPortCloseStruct
+{
+	uint fPortRef;
+	ProviderRef fTheProvider;
+	int fDenyReason;
+}
+
+
+struct OTClientList
+{
+	uint fNumClients;
+	char* fBuffer;
+}
+
+
+struct OTHashList
+{
+	OTHashProcPtr fHashProc;
+	uint fHashTableSize;
+	OTLink** fHashBuckets;
+}
+
+
+struct OTGate
+{
+	OTLIFO fLIFO;
+	OTList fList;
+	OTGateProcPtr fProc;
+	int fNumQueued;
+	int fInside;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/OpenTransportProviders.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,975 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.OpenTransportProviders;
+
+//import dstep.AvailabilityMacros;
+import dstep.objc.bridge.TypeEncoding;
+import dstep.coreservices.osservices.OpenTransport;
+
+alias ushort InetPort;
+alias uint InetHost;
+alias void* InetSvcRef;
+alias void* ATSvcRef;
+alias uint OTPacketType;
+alias uint EAddrType;
+alias uint ParityOptionValues;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __ATK_DDP = getOSType!("DDP ");
+		const __ATK_AARP = getOSType!("AARP");
+		const __ATK_ATP = getOSType!("ATP ");
+		const __ATK_ADSP = getOSType!("ADSP");
+		const __ATK_ASP = getOSType!("ASP ");
+		const __ATK_PAP = getOSType!("PAP ");
+		const __ATK_NBP = getOSType!("NBP ");
+		const __ATK_ZIP = getOSType!("ZIP ");
+		const __LNK_ENET = getOSType!("ENET");
+		const __LNK_TOKN = getOSType!("TOKN");
+		const __LNK_FDDI = getOSType!("FDDI");
+		const __LNK_TPI = getOSType!("LTPI");
+		const __COM_SERIAL = getOSType!("SERL");
+		const __COM_ISDN = getOSType!("ISDN");
+		const __MIOC_ISDN = getOSType!("U");
+		const __COM_PPP = getOSType!("PPPC");
+	}
+}
+
+enum
+{
+	AF_DNS = 42
+}
+
+enum
+{
+	kOTAnyInetAddress = 0
+}
+
+enum
+{
+	INET_IP = 0x00,
+	INET_TCP = 0x06,
+	INET_UDP = 0x11
+}
+
+enum
+{
+	TCP_NODELAY = 0x01,
+	TCP_MAXSEG = 0x02,
+	TCP_NOTIFY_THRESHOLD = 0x10,
+	TCP_ABORT_THRESHOLD = 0x11,
+	TCP_CONN_NOTIFY_THRESHOLD = 0x12,
+	TCP_CONN_ABORT_THRESHOLD = 0x13,
+	TCP_OOBINLINE = 0x14,
+	TCP_URGENT_PTR_TYPE = 0x15,
+	TCP_KEEPALIVE = 0x0008
+}
+
+enum
+{
+	T_GARBAGE = 2
+}
+
+enum
+{
+	UDP_CHECKSUM = 0x0600,
+	UDP_RX_ICMP = 0x02
+}
+
+enum
+{
+	kIP_OPTIONS = 0x01,
+	kIP_TOS = 0x02,
+	kIP_TTL = 0x03,
+	kIP_REUSEADDR = 0x04,
+	kIP_DONTROUTE = 0x10,
+	kIP_BROADCAST = 0x20,
+	kIP_REUSEPORT = 0x0200,
+	kIP_HDRINCL = 0x1002,
+	kIP_RCVOPTS = 0x1005,
+	kIP_RCVDSTADDR = 0x1007,
+	kIP_MULTICAST_IF = 0x1010,
+	kIP_MULTICAST_TTL = 0x1011,
+	kIP_MULTICAST_LOOP = 0x1012,
+	kIP_ADD_MEMBERSHIP = 0x1013,
+	kIP_DROP_MEMBERSHIP = 0x1014,
+	kIP_BROADCAST_IFNAME = 0x1015,
+	kIP_RCVIFADDR = 0x1016
+}
+
+enum
+{
+	DVMRP_INIT = 100,
+	DVMRP_DONE = 101,
+	DVMRP_ADD_VIF = 102,
+	DVMRP_DEL_VIF = 103,
+	DVMRP_ADD_LGRP = 104,
+	DVMRP_DEL_LGRP = 105,
+	DVMRP_ADD_MRT = 106,
+	DVMRP_DEL_MRT = 107
+}
+
+enum
+{
+	T_ROUTINE = 0,
+	T_PRIORITY = 1,
+	T_IMMEDIATE = 2,
+	T_FLASH = 3,
+	T_OVERRIDEFLASH = 4,
+	T_CRITIC_ECP = 5,
+	T_INETCONTROL = 6,
+	T_NETCONTROL = 7
+}
+
+enum
+{
+	T_NOTOS = 0x00,
+	T_LDELAY = (1 << 4),
+	T_HITHRPT = (1 << 3),
+	T_HIREL = (1 << 2)
+}
+
+enum
+{
+	T_DNRSTRINGTOADDRCOMPLETE = kPRIVATEEVENT + 1,
+	T_DNRADDRTONAMECOMPLETE = kPRIVATEEVENT + 2,
+	T_DNRSYSINFOCOMPLETE = kPRIVATEEVENT + 3,
+	T_DNRMAILEXCHANGECOMPLETE = kPRIVATEEVENT + 4,
+	T_DNRQUERYCOMPLETE = kPRIVATEEVENT + 5
+}
+
+enum
+{
+	kMaxHostAddrs = 10,
+	kMaxSysStringLen = 32,
+	kMaxHostNameLen = 255
+}
+
+enum
+{
+	kDefaultInetInterface = -1
+}
+
+enum
+{
+	kInetInterfaceInfoVersion = 3
+}
+
+enum
+{
+	kAllDHCPOptions = -1,
+	kDHCPLongOption = 126,
+	kDHCPLongOptionReq = 127
+}
+
+enum
+{
+	ATK_DDP = getOSType!("DDP "),
+	ATK_AARP = getOSType!("AARP"),
+	ATK_ATP = getOSType!("ATP "),
+	ATK_ADSP = getOSType!("ADSP"),
+	ATK_ASP = getOSType!("ASP "),
+	ATK_PAP = getOSType!("PAP "),
+	ATK_NBP = getOSType!("NBP "),
+	ATK_ZIP = getOSType!("ZIP ")
+}
+
+enum
+{
+	DDP_OPT_HOPCOUNT = 0x2100
+}
+
+enum
+{
+	DDP_OPT_CHECKSUM = 0x0600,
+	DDP_OPT_SRCADDR = 0x2101,
+	ATP_OPT_REPLYCNT = 0x2110,
+	ATP_OPT_DATALEN = 0x2111,
+	ATP_OPT_RELTIMER = 0x2112,
+	ATP_OPT_TRANID = 0x2113,
+	PAP_OPT_OPENRETRY = 0x2120
+}
+
+enum
+{
+	kAppleTalkEvent = kPROTOCOLEVENT | 0x00010000,
+	T_GETMYZONECOMPLETE = kAppleTalkEvent + 1,
+	T_GETLOCALZONESCOMPLETE = kAppleTalkEvent + 2,
+	T_GETZONELISTCOMPLETE = kAppleTalkEvent + 3,
+	T_GETATALKINFOCOMPLETE = kAppleTalkEvent + 4,
+	T_ATALKROUTERDOWNEVENT = kAppleTalkEvent + 51,
+	T_ATALKROUTERUPEVENT = kAppleTalkEvent + 52,
+	T_ATALKZONENAMECHANGEDEVENT = kAppleTalkEvent + 53,
+	T_ATALKCONNECTIVITYCHANGEDEVENT = kAppleTalkEvent + 54,
+	T_ATALKINTERNETAVAILABLEEVENT = kAppleTalkEvent + 55,
+	T_ATALKCABLERANGECHANGEDEVENT = kAppleTalkEvent + 56
+}
+
+enum
+{
+	T_ATALKBADROUTEREVENT = kAppleTalkEvent + 70,
+	T_ALLNODESTAKENEVENT = kAppleTalkEvent + 71,
+	T_FIXEDNODETAKENEVENT = kAppleTalkEvent + 72,
+	T_MPPCOMPATCFIGEVENT = kAppleTalkEvent + 73,
+	T_FIXEDNODEBADEVENT = kAppleTalkEvent + 74
+}
+
+enum
+{
+	kAllATalkRoutersDown = 0,
+	kLocalATalkRoutersDown = -1L,
+	kARARouterDisconnected = -2L
+}
+
+enum
+{
+	kARARouterOnline = -1L,
+	kATalkRouterOnline = 0,
+	kLocalATalkRouterOnline = -2L
+}
+
+enum
+{
+	ATALK_IOC_FULLSELFSEND = ((MIOC_ATALK << 8) | 47),
+	ADSP_IOC_FORWARDRESET = ((MIOC_ATALK << 8) | 60)
+}
+
+enum
+{
+	kECHO_TSDU = 585
+}
+
+enum
+{
+	kNBPMaxNameLength = 32,
+	kNBPMaxTypeLength = 32,
+	kNBPMaxZoneLength = 32,
+	kNBPSlushLength = 9,
+	kNBPMaxEntityLength = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + 3),
+	kNBPEntityBufferSize = (kNBPMaxNameLength + kNBPMaxTypeLength + kNBPMaxZoneLength + kNBPSlushLength),
+	kNBPWildCard = 0x3D,
+	kNBPImbeddedWildCard = 0xC5,
+	kNBPDefaultZone = 0x2A
+}
+
+enum
+{
+	kZIPMaxZoneLength = kNBPMaxZoneLength
+}
+
+enum
+{
+	kDDPAddressLength = 8,
+	kNBPAddressLength = kNBPEntityBufferSize,
+	kAppleTalkAddressLength = kDDPAddressLength + kNBPEntityBufferSize
+}
+
+enum
+{
+	AF_ATALK_FAMILY = 0x0100,
+	AF_ATALK_DDP = 0x0100,
+	AF_ATALK_DDPNBP = AF_ATALK_FAMILY + 1,
+	AF_ATALK_NBP = AF_ATALK_FAMILY + 2,
+	AF_ATALK_MNODE = AF_ATALK_FAMILY + 3
+}
+
+enum
+{
+	kATalkInfoIsExtended = 0x0001,
+	kATalkInfoHasRouter = 0x0002,
+	kATalkInfoOneZone = 0x0004
+}
+
+enum
+{
+	kOTFramingEthernet = 0x01,
+	kOTFramingEthernetIPX = 0x02,
+	kOTFraming8023 = 0x04,
+	kOTFraming8022 = 0x08
+}
+
+enum
+{
+	kOTRawRcvOn = 0,
+	kOTRawRcvOff = 1,
+	kOTRawRcvOnWithTimeStamp = 2
+}
+
+enum
+{
+	DL_PROMISC_OFF = 0
+}
+
+enum
+{
+	kT8022ModuleID = 7100,
+	kEnetModuleID = 7101,
+	kTokenRingModuleID = 7102,
+	kFDDIModuleID = 7103
+}
+
+enum
+{
+	AF_8022 = 8200
+}
+
+enum
+{
+	LNK_ENET = getOSType!("ENET"),
+	LNK_TOKN = getOSType!("TOKN"),
+	LNK_FDDI = getOSType!("FDDI"),
+	LNK_TPI = getOSType!("LTPI")
+}
+
+enum
+{
+	OPT_ADDMCAST = 0x1000,
+	OPT_DELMCAST = 0x1001,
+	OPT_RCVPACKETTYPE = 0x1002,
+	OPT_RCVDESTADDR = 0x1003,
+	OPT_SETRAWMODE = 0x1004,
+	OPT_SETPROMISCUOUS = 0x1005
+}
+
+enum
+{
+	kETypeStandard = 0,
+	kETypeMulticast = 1,
+	kETypeBroadcast = 2,
+	kETRawPacketBit = cast(uint)0x80000000,
+	kETTimeStampBit = 0x40000000
+}
+
+enum
+{
+	kMulticastLength = 6,
+	k48BitAddrLength = 6,
+	k8022DLSAPLength = 2,
+	k8022SNAPLength = 5,
+	kEnetAddressLength = k48BitAddrLength + k8022DLSAPLength,
+	kSNAPSAP = 0x00AA,
+	kIPXSAP = 0x00FF,
+	kMax8022SAP = 0x00FE,
+	k8022GlobalSAP = 0x00FF,
+	kMinDIXSAP = 1501,
+	kMaxDIXSAP = 0xFFFF
+}
+
+enum
+{
+	k8022BasicAddressLength = OTAddressType.sizeof + k48BitAddrLength + short.sizeof,
+	k8022SNAPAddressLength = OTAddressType.sizeof + k48BitAddrLength + short.sizeof + k8022SNAPLength
+}
+
+enum
+{
+	kEnetPacketHeaderLength = (2 * k48BitAddrLength) + k8022DLSAPLength,
+	kEnetTSDU = 1514,
+	kTokenRingTSDU = 4458,
+	kFDDITSDU = 4458,
+	k8022SAPLength = 1,
+	k8022BasicHeaderLength = 3,
+	k8022SNAPHeaderLength = k8022SNAPLength + k8022BasicHeaderLength
+}
+
+enum
+{
+	keaStandardAddress = 0,
+	keaMulticast = 1,
+	keaBroadcast = 2,
+	keaBadAddress = 3,
+	keaRawPacketBit = cast(uint)0x80000000,
+	keaTimeStampBit = 0x40000000
+}
+
+enum
+{
+	kT8022HeaderLength = 3,
+	kT8022SNAPHeaderLength = 3 + k8022SNAPLength,
+	kT8022FullPacketHeaderLength = kEnetPacketHeaderLength + kT8022SNAPHeaderLength
+}
+
+enum
+{
+	COM_SERIAL = getOSType!("SERL")
+}
+
+enum
+{
+	kSerialABModuleID = 7200
+}
+
+enum
+{
+	kOTSerialFramingAsync = 0x01,
+	kOTSerialFramingHDLC = 0x02,
+	kOTSerialFramingSDLC = 0x04,
+	kOTSerialFramingAsyncPackets = 0x08,
+	kOTSerialFramingPPP = 0x10
+}
+
+enum
+{
+	I_SetSerialDTR = ((MIOC_SRL << 8) | 0),
+	kOTSerialSetDTROff = 0,
+	kOTSerialSetDTROn = 1,
+	I_SetSerialBreak = ((MIOC_SRL << 8) | 1),
+	kOTSerialSetBreakOn = cast(uint)0xFFFFFFFF,
+	kOTSerialSetBreakOff = 0,
+	I_SetSerialXOffState = ((MIOC_SRL << 8) | 2),
+	kOTSerialForceXOffTrue = 1,
+	kOTSerialForceXOffFalse = 0,
+	I_SetSerialXOn = ((MIOC_SRL << 8) | 3),
+	kOTSerialSendXOnAlways = 1,
+	kOTSerialSendXOnIfXOffTrue = 0,
+	I_SetSerialXOff = ((MIOC_SRL << 8) | 4),
+	kOTSerialSendXOffAlways = 1,
+	kOTSerialSendXOffIfXOnTrue = 0
+}
+
+enum
+{
+	SERIAL_OPT_BAUDRATE = 0x0100,
+	SERIAL_OPT_DATABITS = 0x0101,
+	SERIAL_OPT_STOPBITS = 0x0102,
+	SERIAL_OPT_PARITY = 0x0103,
+	SERIAL_OPT_STATUS = 0x0104,
+	SERIAL_OPT_HANDSHAKE = 0x0105,
+	SERIAL_OPT_RCVTIMEOUT = 0x0106,
+	SERIAL_OPT_ERRORCHARACTER = 0x0107,
+	SERIAL_OPT_EXTCLOCK = 0x0108,
+	SERIAL_OPT_BURSTMODE = 0x0109,
+	SERIAL_OPT_DUMMY = 0x010A
+}
+
+enum
+{
+	kOTSerialNoParity = 0,
+	kOTSerialOddParity = 1,
+	kOTSerialEvenParity = 2
+}
+
+enum
+{
+	kOTSerialSwOverRunErr = 0x01,
+	kOTSerialBreakOn = 0x08,
+	kOTSerialParityErr = 0x10,
+	kOTSerialOverrunErr = 0x20,
+	kOTSerialFramingErr = 0x40,
+	kOTSerialXOffSent = 0x00010000,
+	kOTSerialDTRNegated = 0x00020000,
+	kOTSerialCTLHold = 0x00040000,
+	kOTSerialXOffHold = 0x00080000,
+	kOTSerialOutputBreakOn = 0x01000000
+}
+
+enum
+{
+	kOTSerialXOnOffInputHandshake = 1,
+	kOTSerialXOnOffOutputHandshake = 2,
+	kOTSerialCTSInputHandshake = 4,
+	kOTSerialDTROutputHandshake = 8
+}
+
+enum
+{
+	kOTSerialDefaultBaudRate = 19200,
+	kOTSerialDefaultDataBits = 8,
+	kOTSerialDefaultStopBits = 10,
+	kOTSerialDefaultParity = kOTSerialNoParity,
+	kOTSerialDefaultHandshake = 0,
+	kOTSerialDefaultOnChar = ('Q' & 0xFFFFFFBF),
+	kOTSerialDefaultOffChar = ('S' & 0xFFFFFFBF),
+	kOTSerialDefaultSndBufSize = 1024,
+	kOTSerialDefaultRcvBufSize = 1024,
+	kOTSerialDefaultSndLoWat = 96,
+	kOTSerialDefaultRcvLoWat = 1,
+	kOTSerialDefaultRcvTimeout = 10
+}
+
+enum
+{
+	COM_ISDN = getOSType!("ISDN")
+}
+
+enum
+{
+	kISDNModuleID = 7300
+}
+
+enum
+{
+	kOTISDNFramingTransparentSupported = 0x0010,
+	kOTISDNFramingHDLCSupported = 0x0020,
+	kOTISDNFramingV110Supported = 0x0040,
+	kOTISDNFramingV14ESupported = 0x0080
+}
+
+enum
+{
+	kOTISDNUnallocatedNumber = 1,
+	kOTISDNNoRouteToSpecifiedTransitNetwork = 2,
+	kOTISDNNoRouteToDestination = 3,
+	kOTISDNChannelUnacceptable = 6,
+	kOTISDNNormal = 16,
+	kOTISDNUserBusy = 17,
+	kOTISDNNoUserResponding = 18,
+	kOTISDNNoAnswerFromUser = 19,
+	kOTISDNCallRejected = 21,
+	kOTISDNNumberChanged = 22,
+	kOTISDNNonSelectedUserClearing = 26,
+	kOTISDNDestinationOutOfOrder = 27,
+	kOTISDNInvalidNumberFormat = 28,
+	kOTISDNFacilityRejected = 29,
+	kOTISDNNormalUnspecified = 31,
+	kOTISDNNoCircuitChannelAvailable = 34,
+	kOTISDNNetworkOutOfOrder = 41,
+	kOTISDNSwitchingEquipmentCongestion = 42,
+	kOTISDNAccessInformationDiscarded = 43,
+	kOTISDNRequestedCircuitChannelNotAvailable = 44,
+	kOTISDNResourceUnavailableUnspecified = 45,
+	kOTISDNQualityOfServiceUnvailable = 49,
+	kOTISDNRequestedFacilityNotSubscribed = 50,
+	kOTISDNBearerCapabilityNotAuthorized = 57,
+	kOTISDNBearerCapabilityNotPresentlyAvailable = 58,
+	kOTISDNCallRestricted = 59,
+	kOTISDNServiceOrOptionNotAvilableUnspecified = 63,
+	kOTISDNBearerCapabilityNotImplemented = 65,
+	kOTISDNRequestedFacilityNotImplemented = 69,
+	kOTISDNOnlyRestrictedDigitalBearer = 70,
+	kOTISDNServiceOrOptionNotImplementedUnspecified = 79,
+	kOTISDNCallIdentityNotUsed = 83,
+	kOTISDNCallIdentityInUse = 84,
+	kOTISDNNoCallSuspended = 85,
+	kOTISDNCallIdentityCleared = 86,
+	kOTISDNIncompatibleDestination = 88,
+	kOTISDNInvalidTransitNetworkSelection = 91,
+	kOTISDNInvalidMessageUnspecified = 95,
+	kOTISDNMandatoryInformationElementIsMissing = 96,
+	kOTISDNMessageTypeNonExistentOrNotImplemented = 97,
+	kOTISDNInterworkingUnspecified = 127
+}
+
+enum
+{
+	kAF_ISDN = 0x2000
+}
+
+enum
+{
+	kOTISDNMaxPhoneSize = 32,
+	kOTISDNMaxSubSize = 4
+}
+
+enum
+{
+	MIOC_ISDN = 'U'
+}
+
+enum
+{
+	I_OTISDNAlerting = ((MIOC_ISDN << 8) | 100),
+	I_OTISDNSuspend = ((MIOC_ISDN << 8) | 101),
+	I_OTISDNSuspendAcknowledge = ((MIOC_ISDN << 8) | 102),
+	I_OTISDNSuspendReject = ((MIOC_ISDN << 8) | 103),
+	I_OTISDNResume = ((MIOC_ISDN << 8) | 104),
+	I_OTISDNResumeAcknowledge = ((MIOC_ISDN << 8) | 105),
+	I_OTISDNResumeReject = ((MIOC_ISDN << 8) | 106),
+	I_OTISDNFaciltity = ((MIOC_ISDN << 8) | 107)
+}
+
+enum
+{
+	kOTISDNMaxUserDataSize = 32
+}
+
+enum
+{
+	ISDN_OPT_COMMTYPE = 0x0200,
+	ISDN_OPT_FRAMINGTYPE = 0x0201,
+	ISDN_OPT_56KADAPTATION = 0x0202
+}
+
+enum
+{
+	kOTISDNTelephoneALaw = 1,
+	kOTISDNTelephoneMuLaw = 26,
+	kOTISDNDigital64k = 13,
+	kOTISDNDigital56k = 37,
+	kOTISDNVideo64k = 41,
+	kOTISDNVideo56k = 42
+}
+
+enum
+{
+	kOTISDNFramingTransparent = 0x0010,
+	kOTISDNFramingHDLC = 0x0020,
+	kOTISDNFramingV110 = 0x0040,
+	kOTISDNFramingV14E = 0x0080
+}
+
+enum
+{
+	kOTISDNNot56KAdaptation = 0,
+	kOTISDN56KAdaptation = 1
+}
+
+enum
+{
+	kOTISDNDefaultCommType = kOTISDNDigital64k,
+	kOTISDNDefaultFramingType = kOTISDNFramingHDLC,
+	kOTISDNDefault56KAdaptation = kOTISDNNot56KAdaptation
+}
+
+enum
+{
+	COM_PPP = getOSType!("PPPC")
+}
+
+enum
+{
+	kPPPMaxIDLength = 255,
+	kPPPMaxPasswordLength = 255,
+	kPPPMaxDTEAddressLength = 127,
+	kPPPMaxCallInfoLength = 255
+}
+
+enum
+{
+	kPPPStateInitial = 1,
+	kPPPStateClosed = 2,
+	kPPPStateClosing = 3,
+	kPPPStateOpening = 4,
+	kPPPStateOpened = 5
+}
+
+enum
+{
+	kPPPConnectionStatusIdle = 1,
+	kPPPConnectionStatusConnecting = 2,
+	kPPPConnectionStatusConnected = 3,
+	kPPPConnectionStatusDisconnecting = 4
+}
+
+enum
+{
+	kPPPMinMRU = 0,
+	kPPPMaxMRU = 4500
+}
+
+enum
+{
+	kIPCPTCPHdrCompressionDisabled = 0,
+	kIPCPTCPHdrCompressionEnabled = 1
+}
+
+enum
+{
+	kPPPCompressionDisabled = 0x00000000,
+	kPPPProtoCompression = 0x00000001,
+	kPPPAddrCompression = 0x00000002
+}
+
+enum
+{
+	kPPPNoOutAuthentication = 0,
+	kPPPCHAPOrPAPOutAuthentication = 1
+}
+
+enum
+{
+	kCCReminderTimerDisabled = 0,
+	kCCIPIdleTimerDisabled = 0
+}
+
+enum
+{
+	kPPPScriptTypeModem = 1,
+	kPPPScriptTypeConnect = 2,
+	kPPPMaxScriptSize = 32000
+}
+
+enum
+{
+	kE164Address = 1,
+	kPhoneAddress = 1,
+	kCompoundPhoneAddress = 2,
+	kX121Address = 3
+}
+
+enum
+{
+	kPPPConnectionStatusDialogsFlag = 0x00000001,
+	kPPPConnectionRemindersFlag = 0x00000002,
+	kPPPConnectionFlashingIconFlag = 0x00000004,
+	kPPPOutPasswordDialogsFlag = 0x00000008,
+	kPPPAllAlertsDisabledFlag = 0x00000000,
+	kPPPAllAlertsEnabledFlag = 0x0000000F
+}
+
+enum
+{
+	kPPPAsyncMapCharsNone = 0x00000000,
+	kPPPAsyncMapCharsXOnXOff = 0x000A0000,
+	kPPPAsyncMapCharsAll = cast(uint)0xFFFFFFFF
+}
+
+enum
+{
+	IPCP_OPT_GETREMOTEPROTOADDR = 0x00007000,
+	IPCP_OPT_GETLOCALPROTOADDR = 0x00007001,
+	IPCP_OPT_TCPHDRCOMPRESSION = 0x00007002,
+	LCP_OPT_PPPCOMPRESSION = 0x00007003,
+	LCP_OPT_MRU = 0x00007004,
+	LCP_OPT_RCACCMAP = 0x00007005,
+	LCP_OPT_TXACCMAP = 0x00007006,
+	SEC_OPT_OUTAUTHENTICATION = 0x00007007,
+	SEC_OPT_ID = 0x00007008,
+	SEC_OPT_PASSWORD = 0x00007009,
+	CC_OPT_REMINDERTIMER = 0x00007010,
+	CC_OPT_IPIDLETIMER = 0x00007011,
+	CC_OPT_DTEADDRESSTYPE = 0x00007012,
+	CC_OPT_DTEADDRESS = 0x00007013,
+	CC_OPT_CALLINFO = 0x00007014,
+	CC_OPT_GETMISCINFO = 0x00007015,
+	PPP_OPT_GETCURRENTSTATE = 0x00007016,
+	LCP_OPT_ECHO = 0x00007017,
+	CC_OPT_SERIALPORTNAME = 0x00007200
+}
+
+enum
+{
+	kPPPEvent = kPROTOCOLEVENT | 0x000F0000,
+	kPPPConnectCompleteEvent = kPPPEvent + 1,
+	kPPPSetScriptCompleteEvent = kPPPEvent + 2,
+	kPPPDisconnectCompleteEvent = kPPPEvent + 3,
+	kPPPDisconnectEvent = kPPPEvent + 4,
+	kPPPIPCPUpEvent = kPPPEvent + 5,
+	kPPPIPCPDownEvent = kPPPEvent + 6,
+	kPPPLCPUpEvent = kPPPEvent + 7,
+	kPPPLCPDownEvent = kPPPEvent + 8,
+	kPPPLowerLayerUpEvent = kPPPEvent + 9,
+	kPPPLowerLayerDownEvent = kPPPEvent + 10,
+	kPPPAuthenticationStartedEvent = kPPPEvent + 11,
+	kPPPAuthenticationFinishedEvent = kPPPEvent + 12,
+	kPPPDCEInitStartedEvent = kPPPEvent + 13,
+	kPPPDCEInitFinishedEvent = kPPPEvent + 14,
+	kPPPDCECallStartedEvent = kPPPEvent + 15,
+	kPPPDCECallFinishedEvent = kPPPEvent + 16
+}
+
+enum
+{
+	kRAProductClientOnly = 2,
+	kRAProductOnePortServer = 3,
+	kRAProductManyPortServer = 4
+}
+
+struct TIPAddMulticast
+{
+	uint multicastGroupAddress;
+	uint interfaceAddress;
+}
+
+
+struct InetAddress
+{
+	ushort fAddressType;
+	ushort fPort;
+	uint fHost;
+	char* fUnused;
+}
+
+
+struct InetHostInfo
+{
+	byte[256] name;
+	InetHost* addrs;
+}
+
+
+struct InetSysInfo
+{
+	char* cpuType;
+	char* osType;
+}
+
+
+struct InetMailExchange
+{
+	ushort preference;
+	byte[256] exchange;
+}
+
+
+struct DNSQueryInfo
+{
+	ushort qType;
+	ushort qClass;
+	uint ttl;
+	byte[256] name;
+	ushort responseType;
+	ushort resourceLen;
+	char* resourceData;
+}
+
+
+struct DNSAddress
+{
+	ushort fAddressType;
+	byte[256] fName;
+}
+
+
+struct InetInterfaceInfo
+{
+	uint fAddress;
+	uint fNetmask;
+	uint fBroadcastAddr;
+	uint fDefaultGatewayAddr;
+	uint fDNSAddr;
+	ushort fVersion;
+	ushort fHWAddrLen;
+	char* fHWAddr;
+	uint fIfMTU;
+	ubyte[2]* fReservedPtrs;
+	byte[256] fDomainName;
+	uint fIPSecondaryCount;
+	ubyte[252] fReserved;
+}
+
+
+struct InetDHCPOption
+{
+	ubyte fOptionTag;
+	ubyte fOptionLen;
+	ubyte fOptionValue;
+}
+
+
+struct NBPEntity
+{
+	char* fEntity;
+}
+
+
+struct DDPAddress
+{
+	ushort fAddressType;
+	ushort fNetwork;
+	ubyte fNodeID;
+	ubyte fSocket;
+	ubyte fDDPType;
+	ubyte fPad;
+}
+
+
+struct NBPAddress
+{
+	ushort fAddressType;
+	char* fNBPNameBuffer;
+}
+
+
+struct DDPNBPAddress
+{
+	ushort fAddressType;
+	ushort fNetwork;
+	ubyte fNodeID;
+	ubyte fSocket;
+	ubyte fDDPType;
+	ubyte fPad;
+	char* fNBPNameBuffer;
+}
+
+
+struct AppleTalkInfo
+{
+	DDPAddress fOurAddress;
+	DDPAddress fRouterAddress;
+	ushort[2] fCableRange;
+	ushort fFlags;
+}
+
+
+struct T8022Address
+{
+	ushort fAddrFamily;
+	char* fHWAddr;
+	ushort fSAP;
+	char* fSNAP;
+}
+
+
+struct EnetPacketHeader
+{
+	char* fDestAddr;
+	char* fSourceAddr;
+	ushort fProto;
+}
+
+
+struct T8022Header
+{
+	ubyte fDSAP;
+	ubyte fSSAP;
+	ubyte fCtrl;
+}
+
+
+struct T8022SNAPHeader
+{
+	ubyte fDSAP;
+	ubyte fSSAP;
+	ubyte fCtrl;
+	char* fSNAP;
+}
+
+
+struct T8022FullPacketHeader
+{
+	EnetPacketHeader fEnetPart;
+	T8022SNAPHeader f8022Part;
+}
+
+
+struct OTISDNAddress
+{
+	ushort fAddressType;
+	ushort fPhoneLength;
+	char* fPhoneNumber;
+}
+
+
+struct PPPMRULimits
+{
+	uint mruSize;
+	uint upperMRULimit;
+	uint lowerMRULimit;
+}
+
+
+struct CCMiscInfo
+{
+	uint connectionStatus;
+	uint connectionTimeElapsed;
+	uint connectionTimeRemaining;
+	uint bytesTransmitted;
+	uint bytesReceived;
+	uint reserved;
+}
+
+
+struct LCPEcho
+{
+	uint retryCount;
+	uint retryPeriod;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/Power.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,157 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.Power;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacErrors;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.carboncore.Multiprocessing;
+import dstep.internal.Types;
+import dstep.internal.Version;
+
+alias SleepQRec* SleepQRecPtr;
+alias SleepQProcPtr SleepQUPP;
+alias uint RegEntryID;
+alias PowerHandlerProcPtr PowerHandlerUPP;
+alias HDSpindownProcPtr HDSpindownUPP;
+alias PMgrStateChangeProcPtr PMgrStateChangeUPP;
+
+enum
+{
+	kSleepRequest = 1,
+	kSleepDemand = 2,
+	kSleepWakeUp = 3,
+	kSleepRevoke = 4,
+	kSleepUnlock = 4,
+	kSleepDeny = 5,
+	kSleepNow = 6,
+	kDozeDemand = 7,
+	kDozeWakeUp = 8,
+	kDozeRequest = 9,
+	kEnterStandby = 10,
+	kEnterRun = 11,
+	kSuspendRequest = 12,
+	kSuspendDemand = 13,
+	kSuspendRevoke = 14,
+	kSuspendWakeUp = 15,
+	kGetPowerLevel = 16,
+	kSetPowerLevel = 17,
+	kDeviceInitiatedWake = 18,
+	kWakeToDoze = 19,
+	kDozeToFullWakeUp = 20,
+	kGetPowerInfo = 21,
+	kGetWakeOnNetInfo = 22,
+	kSuspendWakeToDoze = 23,
+	kEnterIdle = 24,
+	kStillIdle = 25,
+	kExitIdle = 26
+}
+
+enum
+{
+	noCalls = 1,
+	noRequest = 2,
+	slpQType = 16,
+	sleepQType = 16
+}
+
+enum
+{
+	OverallAct = 0,
+	UsrActivity = 1,
+	NetActivity = 2,
+	HDActivity = 3,
+	IdleActivity = 4
+}
+
+struct SleepQRec
+{
+	SleepQRecPtr sleepQLink;
+	short sleepQType;
+	SleepQUPP sleepQProc;
+	short sleepQFlags;
+}
+
+static if (!D_LP64)
+{
+	struct HDQueueElement
+	{
+		HDQueueElement* hdQLink;
+		short hdQType;
+		short hdFlags;
+		HDSpindownUPP hdProc;
+		c_long hdUser;
+	}
+	
+	struct PMgrQueueElement
+	{
+		PMgrQueueElement* pmQLink;
+		short pmQType;
+		short pmFlags;
+		c_long pmNotifyBits;
+		PMgrStateChangeUPP pmProc;
+		c_long pmUser;
+	}
+	
+	struct BatteryTimeRec
+	{
+		c_ulong expectedBatteryTime;
+		c_ulong minimumBatteryTime;
+		c_ulong maximumBatteryTime;
+		c_ulong timeUntilCharged;
+	}
+	
+	struct WakeupTime
+	{
+		c_ulong wakeTime;
+		bool wakeEnabled;
+		byte filler;
+	}
+	
+	struct StartupTime
+	{
+		c_ulong startTime;
+		bool startEnabled;
+		byte filler;
+	}
+	
+	/++
+	
+	
+	
+	+/
+}
+
+extern (C)
+{
+	alias int function (int, SleepQRecPtr) SleepQProcPtr;
+	alias void function (HDQueueElement*) HDSpindownProcPtr;
+	alias int function (uint, void*, uint, RegEntryID*) PowerHandlerProcPtr;
+	alias void function (PMgrQueueElement*, int) PMgrStateChangeProcPtr;
+}
+
+extern (C)
+{
+	SleepQUPP NewSleepQUPP (SleepQProcPtr userRoutine);
+	void DisposeSleepQUPP (SleepQUPP userUPP);
+	int InvokeSleepQUPP (int message, SleepQRecPtr qRecPtr, SleepQUPP userUPP);
+	int GetCPUSpeed ();
+	void SleepQInstall (SleepQRecPtr qRecPtr);
+	void SleepQRemove (SleepQRecPtr qRecPtr);
+	short MaximumProcessorSpeed ();
+	short MinimumProcessorSpeed ();
+	short CurrentProcessorSpeed ();
+	short BatteryCount ();
+	short UpdateSystemActivity (ubyte activity);
+	HDSpindownUPP NewHDSpindownUPP (HDSpindownProcPtr userRoutine);
+	PMgrStateChangeUPP NewPMgrStateChangeUPP (PMgrStateChangeProcPtr userRoutine);
+	void DisposeHDSpindownUPP (HDSpindownUPP userUPP);
+	void DisposePMgrStateChangeUPP (PMgrStateChangeUPP userUPP);
+	void InvokeHDSpindownUPP (HDQueueElement* theElement, HDSpindownUPP userUPP);
+	void InvokePMgrStateChangeUPP (PMgrQueueElement* theElement, int stateBits, PMgrStateChangeUPP userUPP);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/SCSI.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,35 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.SCSI;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MacTypes;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.internal.Types;
+import dstep.internal.Version;
+
+static if (!D_LP64)
+{
+	enum
+	{
+		scInc = 1,
+		scNoInc = 2,
+		scAdd = 3,
+		scMove = 4,
+		scLoop = 5,
+		scNop = 6,
+		scStop = 7,
+		scComp = 8
+	}
+	
+	struct SCSIInstr
+	{
+		ushort scOpcode;
+		c_long scParam1;
+		c_long scParam2;
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/SecurityCore.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,11 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.SecurityCore;
+
+import dstep.coreservices.carboncore.CarbonCore;
+import dstep.coreservices.osservices.KeychainCore;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/SystemSound.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,42 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.SystemSound;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFRunLoop;
+import dstep.coreservices.carboncore.Files;
+import dstep.coreservices.carboncore.MacTypes;
+
+alias uint SystemSoundActionID;
+alias SystemSoundCompletionProcPtr SystemSoundCompletionUPP;
+
+extern (C)
+{
+	alias int function (uint, void*) SystemSoundCompletionProcPtr;
+}
+
+enum
+{
+	kSystemSoundNoError = 0,
+	kSystemSoundUnspecifiedError = -1500,
+	kSystemSoundClientTimedOutError = -1501
+}
+
+extern (C)
+{
+	SystemSoundCompletionUPP NewSystemSoundCompletionUPP (SystemSoundCompletionProcPtr userRoutine);
+	void DisposeSystemSoundCompletionUPP (SystemSoundCompletionUPP userUPP);
+	int InvokeSystemSoundCompletionUPP (uint actionID, void* userData, SystemSoundCompletionUPP userUPP);
+	void AlertSoundPlay ();
+	void AlertSoundPlayCustomSound (uint inAction);
+	void SystemSoundPlay (uint inAction);
+	int SystemSoundGetActionID (FSRef* userFile, SystemSoundActionID* outAction);
+	int SystemSoundRemoveActionID (uint inAction);
+	int SystemSoundSetCompletionRoutine (uint inAction, CFRunLoopRef inRunLoop, CFStringRef inRunLoopMode, SystemSoundCompletionUPP inCompletionRoutine, void* inUserData);
+	void SystemSoundRemoveCompletionRoutine (uint inAction);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/WSMethodInvocation.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,77 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.WSMethodInvocation;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.osservices.WSTypes;
+
+struct OpaqueWSMethodInvocationRef;
+
+alias OpaqueWSMethodInvocationRef* WSMethodInvocationRef;
+
+extern (C)
+{
+	alias CFTypeRef function (WSMethodInvocationRef, CFXMLTreeRef, CFXMLTreeRef, void*) WSMethodInvocationDeserializationProcPtr;
+	alias void function (WSMethodInvocationRef, void*, CFDictionaryRef) WSMethodInvocationCallBackProcPtr;
+	alias CFStringRef function (WSMethodInvocationRef, CFTypeRef, void*) WSMethodInvocationSerializationProcPtr;
+}
+
+extern (C)
+{
+	extern
+	{
+		CFStringRef kWSMethodInvocationResult;
+		CFStringRef kWSFaultString;
+		CFStringRef kWSFaultCode;
+		CFStringRef kWSFaultExtra;
+		CFStringRef kWSNetworkStreamFaultString;
+		CFStringRef kWSStreamErrorMessage;
+		CFStringRef kWSStreamErrorDomain;
+		CFStringRef kWSStreamErrorError;
+		CFStringRef kWSHTTPMessage;
+		CFStringRef kWSHTTPResponseMessage;
+		CFStringRef kWSHTTPVersion;
+		CFStringRef kWSHTTPExtraHeaders;
+		CFStringRef kWSHTTPProxy;
+		CFStringRef kWSHTTPFollowsRedirects;
+		CFStringRef kWSDebugOutgoingHeaders;
+		CFStringRef kWSDebugOutgoingBody;
+		CFStringRef kWSDebugIncomingHeaders;
+		CFStringRef kWSDebugIncomingBody;
+		CFStringRef kWSSOAPMethodNamespaceURI;
+		CFStringRef kWSSOAPBodyEncodingStyle;
+		CFStringRef kWSSOAPStyleDoc;
+		CFStringRef kWSSOAPStyleRPC;
+		CFStringRef kWSSOAPMessageHeaders;
+		CFStringRef kWSRecordParameterOrder;
+		CFStringRef kWSRecordNamespaceURI;
+		CFStringRef kWSRecordType;
+		CFStringRef kWSMethodInvocationResultParameterName;
+		CFStringRef kWSMethodInvocationTimeoutValue;
+	}
+}
+
+extern (C)
+{
+	uint WSMethodInvocationGetTypeID ();
+	WSMethodInvocationRef WSMethodInvocationCreate (CFURLRef url, CFStringRef methodName, CFStringRef protocol);
+	WSMethodInvocationRef WSMethodInvocationCreateFromSerialization (CFDataRef contract);
+	CFDataRef WSMethodInvocationCopySerialization (WSMethodInvocationRef invocation);
+	void WSMethodInvocationSetParameters (WSMethodInvocationRef invocation, CFDictionaryRef parameters, CFArrayRef parameterOrder);
+	CFDictionaryRef WSMethodInvocationCopyParameters (WSMethodInvocationRef invocation, CFArrayRef* parameterOrder);
+	void WSMethodInvocationSetProperty (WSMethodInvocationRef invocation, CFStringRef propertyName, CFTypeRef propertyValue);
+	CFTypeRef WSMethodInvocationCopyProperty (WSMethodInvocationRef invocation, CFStringRef propertyName);
+	CFDictionaryRef WSMethodInvocationInvoke (WSMethodInvocationRef invocation);
+	void WSMethodInvocationSetCallBack (WSMethodInvocationRef invocation, WSMethodInvocationCallBackProcPtr clientCB, WSClientContext* context);
+	void WSMethodInvocationScheduleWithRunLoop (WSMethodInvocationRef invocation, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void WSMethodInvocationUnscheduleFromRunLoop (WSMethodInvocationRef invocation, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	ubyte WSMethodResultIsFault (CFDictionaryRef methodResult);
+	void WSMethodInvocationAddSerializationOverride (WSMethodInvocationRef invocation, uint objType, WSMethodInvocationSerializationProcPtr serializationProc, WSClientContext* context);
+	void WSMethodInvocationAddDeserializationOverride (WSMethodInvocationRef invocation, CFStringRef typeNamespace, CFStringRef typeName, WSMethodInvocationDeserializationProcPtr deserializationProc, WSClientContext* context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/WSProtocolHandler.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,37 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.WSProtocolHandler;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.coreservices.osservices.WSTypes;
+
+struct OpaqueWSProtocolHandlerRef;
+
+alias OpaqueWSProtocolHandlerRef* WSProtocolHandlerRef;
+
+extern (C)
+{
+	alias CFTypeRef function (WSProtocolHandlerRef, CFXMLTreeRef, CFXMLTreeRef, void*) WSProtocolHandlerDeserializationProcPtr;
+	alias CFStringRef function (WSProtocolHandlerRef, CFTypeRef, void*) WSProtocolHandlerSerializationProcPtr;
+}
+
+extern (C)
+{
+	uint WSProtocolHandlerGetTypeID ();
+	WSProtocolHandlerRef WSProtocolHandlerCreate (CFAllocatorRef allocator, CFStringRef protocol);
+	CFDictionaryRef WSProtocolHandlerCopyRequestDictionary (WSProtocolHandlerRef ref_, CFDataRef data);
+	CFDictionaryRef WSProtocolHandlerCopyReplyDictionary (WSProtocolHandlerRef ref_, CFStringRef methodName, CFDataRef data);
+	CFDataRef WSProtocolHandlerCopyReplyDocument (WSProtocolHandlerRef ref_, CFDictionaryRef methodContext, CFTypeRef resultValue);
+	CFDataRef WSProtocolHandlerCopyFaultDocument (WSProtocolHandlerRef ref_, CFDictionaryRef methodContext, CFDictionaryRef faultDict);
+	CFDataRef WSProtocolHandlerCopyRequestDocument (WSProtocolHandlerRef ref_, CFStringRef methodName, CFDictionaryRef methodParams, CFArrayRef methodParamOrder, CFDictionaryRef methodExtras);
+	CFTypeRef WSProtocolHandlerCopyProperty (WSProtocolHandlerRef ref_, CFStringRef propertyName);
+	void WSProtocolHandlerSetProperty (WSProtocolHandlerRef ref_, CFStringRef propertyName, CFTypeRef propertyValue);
+	void WSProtocolHandlerSetSerializationOverride (WSProtocolHandlerRef protocol, uint objType, WSProtocolHandlerSerializationProcPtr serializationProc, WSClientContext* context);
+	void WSProtocolHandlerSetDeserializationOverride (WSProtocolHandlerRef protocol, CFStringRef typeNamespace, CFStringRef typeName, WSProtocolHandlerDeserializationProcPtr deserializationProc, WSClientContext* context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/osservices/WSTypes.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,67 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.osservices.WSTypes;
+
+//import dstep.AvailabilityMacros;
+import dstep.coreservices.carboncore.MixedMode;
+import dstep.corefoundation.CoreFoundation;
+
+alias int WSTypeID;
+
+extern (C)
+{
+	alias CFStringRef function (void*) WSClientContextCopyDescriptionCallBackProcPtr;
+	alias void function (void*) WSClientContextReleaseCallBackProcPtr;
+	alias void * function (void*) WSClientContextRetainCallBackProcPtr;
+}
+
+extern (C)
+{
+	extern
+	{
+		CFStringRef kWSXMLRPCProtocol;
+		CFStringRef kWSSOAP1999Protocol;
+		CFStringRef kWSSOAP2001Protocol;
+	}
+}
+
+enum
+{
+	errWSInternalError = -65793L,
+	errWSTransportError = -65794L,
+	errWSParseError = -65795L,
+	errWSTimeoutError = -65796L
+}
+
+enum /*WSTypeID*/ 
+{
+	eWSUnknownType = 0,
+	eWSNullType = 1,
+	eWSBooleanType = 2,
+	eWSIntegerType = 3,
+	eWSDoubleType = 4,
+	eWSStringType = 5,
+	eWSDateType = 6,
+	eWSDataType = 7,
+	eWSArrayType = 8,
+	eWSDictionaryType = 9
+}
+
+struct WSClientContext
+{
+	int version_;
+	void* info;
+	WSClientContextRetainCallBackProcPtr retain;
+	WSClientContextReleaseCallBackProcPtr release;
+	WSClientContextCopyDescriptionCallBackProcPtr copyDescription;
+}
+
+extern (C)
+{
+	int WSGetWSTypeIDFromCFType (CFTypeRef ref_);
+	uint WSGetCFTypeIDFromWSTypeID (int typeID);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SKAnalysis.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,27 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SKAnalysis;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kSKLanguageTypes;
+		const CFStringRef kSKMinTermLength;
+		const CFStringRef kSKSubstitutions;
+		const CFStringRef kSKStopWords;
+		const CFStringRef kSKProximityIndexing;
+		const CFStringRef kSKMaximumTerms;
+		const CFStringRef kSKTermChars;
+		const CFStringRef kSKStartTermChars;
+		const CFStringRef kSKEndTermChars;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SKDocument.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,24 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SKDocument;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFURL;
+
+alias CFTypeRef SKDocumentRef;
+
+extern (C)
+{
+	uint SKDocumentGetTypeID ();
+	SKDocumentRef SKDocumentCreateWithURL (CFURLRef inURL);
+	CFURLRef SKDocumentCopyURL (SKDocumentRef inDocument);
+	SKDocumentRef SKDocumentCreate (CFStringRef inScheme, SKDocumentRef inParent, CFStringRef inName);
+	CFStringRef SKDocumentGetSchemeName (SKDocumentRef inDocument);
+	CFStringRef SKDocumentGetName (SKDocumentRef inDocument);
+	SKDocumentRef SKDocumentGetParent (SKDocumentRef inDocument);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SKIndex.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,81 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SKIndex;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFData;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFURL;
+import dstep.coreservices.searchkit.SKDocument;
+
+struct __SKIndex;
+struct __SKIndexDocumentIterator;
+
+alias __SKIndex* SKIndexRef;
+alias __SKIndexDocumentIterator* SKIndexDocumentIteratorRef;
+alias int SKIndexType;
+alias int SKDocumentIndexState;
+alias int SKDocumentID;
+
+enum /*SKIndexType*/ 
+{
+	kSKIndexUnknown = 0,
+	kSKIndexInverted = 1,
+	kSKIndexVector = 2,
+	kSKIndexInvertedVector = 3
+}
+
+enum /*SKDocumentIndexState*/ 
+{
+	kSKDocumentStateNotIndexed = 0,
+	kSKDocumentStateIndexed = 1,
+	kSKDocumentStateAddPending = 2,
+	kSKDocumentStateDeletePending = 3
+}
+
+extern (C)
+{
+	uint SKIndexGetTypeID ();
+	uint SKIndexDocumentIteratorGetTypeID ();
+	SKIndexRef SKIndexCreateWithURL (CFURLRef inURL, CFStringRef inIndexName, int inIndexType, CFDictionaryRef inAnalysisProperties);
+	SKIndexRef SKIndexOpenWithURL (CFURLRef inURL, CFStringRef inIndexName, ubyte inWriteAccess);
+	SKIndexRef SKIndexCreateWithMutableData (CFMutableDataRef inData, CFStringRef inIndexName, int inIndexType, CFDictionaryRef inAnalysisProperties);
+	SKIndexRef SKIndexOpenWithData (CFDataRef inData, CFStringRef inIndexName);
+	SKIndexRef SKIndexOpenWithMutableData (CFMutableDataRef inData, CFStringRef inIndexName);
+	ubyte SKIndexFlush (SKIndexRef inIndex);
+	void SKIndexSetMaximumBytesBeforeFlush (SKIndexRef inIndex, int inBytesForUpdate);
+	int SKIndexGetMaximumBytesBeforeFlush (SKIndexRef inIndex);
+	ubyte SKIndexCompact (SKIndexRef inIndex);
+	int SKIndexGetIndexType (SKIndexRef inIndex);
+	CFDictionaryRef SKIndexGetAnalysisProperties (SKIndexRef inIndex);
+	int SKIndexGetDocumentCount (SKIndexRef inIndex);
+	void SKIndexClose (SKIndexRef inIndex);
+	ubyte SKIndexAddDocumentWithText (SKIndexRef inIndex, SKDocumentRef inDocument, CFStringRef inDocumentText, ubyte inCanReplace);
+	ubyte SKIndexAddDocument (SKIndexRef inIndex, SKDocumentRef inDocument, CFStringRef inMIMETypeHint, ubyte inCanReplace);
+	ubyte SKIndexRemoveDocument (SKIndexRef inIndex, SKDocumentRef inDocument);
+	CFDictionaryRef SKIndexCopyDocumentProperties (SKIndexRef inIndex, SKDocumentRef inDocument);
+	void SKIndexSetDocumentProperties (SKIndexRef inIndex, SKDocumentRef inDocument, CFDictionaryRef inProperties);
+	int SKIndexGetDocumentState (SKIndexRef inIndex, SKDocumentRef inDocument);
+	int SKIndexGetDocumentID (SKIndexRef inIndex, SKDocumentRef inDocument);
+	SKDocumentRef SKIndexCopyDocumentForDocumentID (SKIndexRef inIndex, int inDocumentID);
+	ubyte SKIndexRenameDocument (SKIndexRef inIndex, SKDocumentRef inDocument, CFStringRef inNewName);
+	ubyte SKIndexMoveDocument (SKIndexRef inIndex, SKDocumentRef inDocument, SKDocumentRef inNewParent);
+	SKIndexDocumentIteratorRef SKIndexDocumentIteratorCreate (SKIndexRef inIndex, SKDocumentRef inParentDocument);
+	SKDocumentRef SKIndexDocumentIteratorCopyNext (SKIndexDocumentIteratorRef inIterator);
+	int SKIndexGetMaximumDocumentID (SKIndexRef inIndex);
+	int SKIndexGetDocumentTermCount (SKIndexRef inIndex, int inDocumentID);
+	CFArrayRef SKIndexCopyTermIDArrayForDocumentID (SKIndexRef inIndex, int inDocumentID);
+	int SKIndexGetDocumentTermFrequency (SKIndexRef inIndex, int inDocumentID, int inTermID);
+	int SKIndexGetMaximumTermID (SKIndexRef inIndex);
+	int SKIndexGetTermDocumentCount (SKIndexRef inIndex, int inTermID);
+	CFArrayRef SKIndexCopyDocumentIDArrayForTermID (SKIndexRef inIndex, int inTermID);
+	CFStringRef SKIndexCopyTermStringForTermID (SKIndexRef inIndex, int inTermID);
+	int SKIndexGetTermIDForTermString (SKIndexRef inIndex, CFStringRef inTermString);
+	void SKLoadDefaultExtractorPlugIns ();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SKSearch.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,67 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SKSearch;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFURL;
+import dstep.coreservices.searchkit.SKDocument;
+import dstep.coreservices.searchkit.SKIndex;
+
+struct __SKSearchGroup;
+struct __SKSearchResults;
+struct __SKSearch;
+
+alias __SKSearchGroup* SKSearchGroupRef;
+alias __SKSearchResults* SKSearchResultsRef;
+alias int SKSearchType;
+alias __SKSearch* SKSearchRef;
+alias uint SKSearchOptions;
+
+extern (C)
+{
+	alias ubyte function (SKIndexRef, SKDocumentRef, void*) SKSearchResultsFilterCallBack;
+}
+
+enum /*SKSearchType*/ 
+{
+	kSKSearchRanked = 0,
+	kSKSearchBooleanRanked = 1,
+	kSKSearchRequiredRanked = 2,
+	kSKSearchPrefixRanked = 3
+}
+
+enum
+{
+	kSKSearchOptionDefault = 0,
+	kSKSearchOptionNoRelevanceScores = 1L << 0,
+	kSKSearchOptionSpaceMeansOR = 1L << 1,
+	kSKSearchOptionFindSimilar = 1L << 2
+}
+
+extern (C)
+{
+	uint SKSearchGroupGetTypeID ();
+	uint SKSearchResultsGetTypeID ();
+	SKSearchGroupRef SKSearchGroupCreate (CFArrayRef inArrayOfInIndexes);
+	CFArrayRef SKSearchGroupCopyIndexes (SKSearchGroupRef inSearchGroup);
+	SKSearchResultsRef SKSearchResultsCreateWithQuery (SKSearchGroupRef inSearchGroup, CFStringRef inQuery, int inSearchType, int inMaxFoundDocuments, void* inContext, SKSearchResultsFilterCallBack inFilterCallBack);
+	SKSearchResultsRef SKSearchResultsCreateWithDocuments (SKSearchGroupRef inSearchGroup, CFArrayRef inExampleDocuments, int inMaxFoundDocuments, void* inContext, SKSearchResultsFilterCallBack inFilterCallBack);
+	int SKSearchResultsGetCount (SKSearchResultsRef inSearchResults);
+	int SKSearchResultsGetInfoInRange (SKSearchResultsRef inSearchResults, CFRange inRange, SKDocumentRef* outDocumentsArray, SKIndexRef* outIndexesArray, float* outScoresArray);
+	CFArrayRef SKSearchResultsCopyMatchingTerms (SKSearchResultsRef inSearchResults, int inItem);
+	uint SKSearchGetTypeID ();
+	SKSearchRef SKSearchCreate (SKIndexRef inIndex, CFStringRef inQuery, uint inSearchOptions);
+	void SKSearchCancel (SKSearchRef inSearch);
+	ubyte SKSearchFindMatches (SKSearchRef inSearch, int inMaximumCount, SKDocumentID* outDocumentIDsArray, float* outScoresArray, double maximumTime, CFIndex* outFoundCount);
+	void SKIndexCopyInfoForDocumentIDs (SKIndexRef inIndex, int inCount, SKDocumentID* inDocumentIDsArray, CFStringRef* outNamesArray, SKDocumentID* outParentIDsArray);
+	void SKIndexCopyDocumentRefsForDocumentIDs (SKIndexRef inIndex, int inCount, SKDocumentID* inDocumentIDsArray, SKDocumentRef* outDocumentRefsArray);
+	void SKIndexCopyDocumentURLsForDocumentIDs (SKIndexRef inIndex, int inCount, SKDocumentID* inDocumentIDsArray, CFURLRef* outDocumentURLsArray);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SKSummary.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,29 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SKSummary;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFString;
+
+struct __SKSummary;
+
+alias __SKSummary* SKSummaryRef;
+
+extern (C)
+{
+	uint SKSummaryGetTypeID ();
+	SKSummaryRef SKSummaryCreateWithString (CFStringRef inString);
+	int SKSummaryGetSentenceCount (SKSummaryRef summary);
+	int SKSummaryGetParagraphCount (SKSummaryRef summary);
+	CFStringRef SKSummaryCopySentenceAtIndex (SKSummaryRef summary, int i);
+	CFStringRef SKSummaryCopyParagraphAtIndex (SKSummaryRef summary, int i);
+	CFStringRef SKSummaryCopySentenceSummaryString (SKSummaryRef summary, int numSentences);
+	CFStringRef SKSummaryCopyParagraphSummaryString (SKSummaryRef summary, int numParagraphs);
+	int SKSummaryGetSentenceSummaryInfo (SKSummaryRef summary, int numSentencesInSummary, CFIndex* outRankOrderOfSentences, CFIndex* outSentenceIndexOfSentences, CFIndex* outParagraphIndexOfSentences);
+	int SKSummaryGetParagraphSummaryInfo (SKSummaryRef summary, int numParagraphsInSummary, CFIndex* outRankOrderOfParagraphs, CFIndex* outParagraphIndexOfParagraphs);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/coreservices/searchkit/SearchKit.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,17 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.coreservices.searchkit.SearchKit;
+
+public:
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.searchkit.SKAnalysis;
+import dstep.coreservices.searchkit.SKDocument;
+import dstep.coreservices.searchkit.SKIndex;
+import dstep.coreservices.searchkit.SKSearch;
+import dstep.coreservices.searchkit.SKSummary;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/diskarbitration/DADisk.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,67 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.diskarbitration.DADisk;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.diskarbitration.DASession;
+//import dstep.iokit.IOKitLib;
+
+struct __DADisk;
+
+alias __DADisk* DADiskRef;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kDADiskDescriptionVolumeKindKey;
+		const CFStringRef kDADiskDescriptionVolumeMountableKey;
+		const CFStringRef kDADiskDescriptionVolumeNameKey;
+		const CFStringRef kDADiskDescriptionVolumeNetworkKey;
+		const CFStringRef kDADiskDescriptionVolumePathKey;
+		const CFStringRef kDADiskDescriptionVolumeUUIDKey;
+		const CFStringRef kDADiskDescriptionMediaBlockSizeKey;
+		const CFStringRef kDADiskDescriptionMediaBSDMajorKey;
+		const CFStringRef kDADiskDescriptionMediaBSDMinorKey;
+		const CFStringRef kDADiskDescriptionMediaBSDNameKey;
+		const CFStringRef kDADiskDescriptionMediaBSDUnitKey;
+		const CFStringRef kDADiskDescriptionMediaContentKey;
+		const CFStringRef kDADiskDescriptionMediaEjectableKey;
+		const CFStringRef kDADiskDescriptionMediaIconKey;
+		const CFStringRef kDADiskDescriptionMediaKindKey;
+		const CFStringRef kDADiskDescriptionMediaLeafKey;
+		const CFStringRef kDADiskDescriptionMediaNameKey;
+		const CFStringRef kDADiskDescriptionMediaPathKey;
+		const CFStringRef kDADiskDescriptionMediaRemovableKey;
+		const CFStringRef kDADiskDescriptionMediaSizeKey;
+		const CFStringRef kDADiskDescriptionMediaTypeKey;
+		const CFStringRef kDADiskDescriptionMediaUUIDKey;
+		const CFStringRef kDADiskDescriptionMediaWholeKey;
+		const CFStringRef kDADiskDescriptionMediaWritableKey;
+		const CFStringRef kDADiskDescriptionDeviceGUIDKey;
+		const CFStringRef kDADiskDescriptionDeviceInternalKey;
+		const CFStringRef kDADiskDescriptionDeviceModelKey;
+		const CFStringRef kDADiskDescriptionDevicePathKey;
+		const CFStringRef kDADiskDescriptionDeviceProtocolKey;
+		const CFStringRef kDADiskDescriptionDeviceRevisionKey;
+		const CFStringRef kDADiskDescriptionDeviceUnitKey;
+		const CFStringRef kDADiskDescriptionDeviceVendorKey;
+		const CFStringRef kDADiskDescriptionBusNameKey;
+		const CFStringRef kDADiskDescriptionBusPathKey;
+	}
+}
+
+extern (C)
+{
+	uint DADiskGetTypeID ();
+	DADiskRef DADiskCreateFromBSDName (CFAllocatorRef allocator, DASessionRef session, char* name);
+	DADiskRef DADiskCreateFromIOMedia (CFAllocatorRef allocator, DASessionRef session, uint media);
+	char* DADiskGetBSDName (DADiskRef disk);
+	uint DADiskCopyIOMedia (DADiskRef disk);
+	CFDictionaryRef DADiskCopyDescription (DADiskRef disk);
+	DADiskRef DADiskCopyWholeDisk (DADiskRef disk);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/diskarbitration/DADissenter.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,39 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.diskarbitration.DADissenter;
+
+import dstep.corefoundation.CoreFoundation;
+//import dstep.mach.error;
+
+struct __DADissenter;
+
+alias int DAReturn;
+alias __DADissenter* DADissenterRef;
+
+enum
+{
+	kDAReturnSuccess = 0,
+	kDAReturnError = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x01,
+	kDAReturnBusy = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x02,
+	kDAReturnBadArgument = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x03,
+	kDAReturnExclusiveAccess = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x04,
+	kDAReturnNoResources = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x05,
+	kDAReturnNotFound = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x06,
+	kDAReturnNotMounted = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x07,
+	kDAReturnNotPermitted = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x08,
+	kDAReturnNotPrivileged = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x09,
+	kDAReturnNotReady = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0A,
+	kDAReturnNotWritable = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0B,
+	kDAReturnUnsupported = (((0x3e)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0C
+}
+
+extern (C)
+{
+	DADissenterRef DADissenterCreate (CFAllocatorRef allocator, int status, CFStringRef string);
+	int DADissenterGetStatus (DADissenterRef dissenter);
+	CFStringRef DADissenterGetStatusString (DADissenterRef dissenter);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/diskarbitration/DASession.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,27 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.diskarbitration.DASession;
+
+import dstep.corefoundation.CoreFoundation;
+
+struct __DASession;
+struct __DAApprovalSession;
+
+alias __DASession* DASessionRef;
+alias __DAApprovalSession* DAApprovalSessionRef;
+
+extern (C)
+{
+	uint DASessionGetTypeID ();
+	DASessionRef DASessionCreate (CFAllocatorRef allocator);
+	void DASessionScheduleWithRunLoop (DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void DASessionUnscheduleFromRunLoop (DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	uint DAApprovalSessionGetTypeID ();
+	DAApprovalSessionRef DAApprovalSessionCreate (CFAllocatorRef allocator);
+	void DAApprovalSessionScheduleWithRunLoop (DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+	void DAApprovalSessionUnscheduleFromRunLoop (DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/diskarbitration/DiskArbitration.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,111 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 21, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.diskarbitration.DiskArbitration;
+
+public:
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.diskarbitration.DADisk;
+import dstep.diskarbitration.DADissenter;
+import dstep.diskarbitration.DASession;
+
+alias uint DADiskMountOptions;
+alias uint DADiskRenameOptions;
+alias uint DADiskUnmountOptions;
+alias uint DADiskEjectOptions;
+alias uint DADiskClaimOptions;
+alias uint DADiskOptions;
+
+extern (C)
+{
+	alias void function (DADiskRef, DADissenterRef, void*) DADiskRenameCallback;
+	alias DADissenterRef function (DADiskRef, void*) DADiskMountApprovalCallback;
+	alias void function (DADiskRef, CFArrayRef, void*) DADiskDescriptionChangedCallback;
+	alias void function (DADiskRef, void*) DADiskAppearedCallback;
+	alias DADissenterRef function (DADiskRef, void*) DADiskEjectApprovalCallback;
+	alias void function (DADiskRef, void*) DADiskDisappearedCallback;
+	alias void function (DADiskRef, DADissenterRef, void*) DADiskUnmountCallback;
+	alias void function (DADiskRef, DADissenterRef, void*) DADiskMountCallback;
+	alias void function (DADiskRef, DADissenterRef, void*) DADiskClaimCallback;
+	alias DADissenterRef function (DADiskRef, void*) DADiskUnmountApprovalCallback;
+	alias void function (DADiskRef, void*) DADiskPeekCallback;
+	alias DADissenterRef function (DADiskRef, void*) DADiskClaimReleaseCallback;
+	alias void function (DADiskRef, DADissenterRef, void*) DADiskEjectCallback;
+}
+
+extern (C)
+{
+	extern
+	{
+		CFDictionaryRef kDADiskDescriptionMatchMediaUnformatted;
+		CFDictionaryRef kDADiskDescriptionMatchMediaWhole;
+		CFDictionaryRef kDADiskDescriptionMatchVolumeMountable;
+		CFDictionaryRef kDADiskDescriptionMatchVolumeUnrecognized;
+		CFArrayRef kDADiskDescriptionWatchVolumeName;
+		CFArrayRef kDADiskDescriptionWatchVolumePath;
+	}
+}
+
+enum
+{
+	kDADiskMountOptionDefault = 0x00000000,
+	kDADiskMountOptionWhole = 0x00000001
+}
+
+enum
+{
+	kDADiskRenameOptionDefault = 0x00000000
+}
+
+enum
+{
+	kDADiskUnmountOptionDefault = 0x00000000,
+	kDADiskUnmountOptionForce = 0x00080000,
+	kDADiskUnmountOptionWhole = 0x00000001
+}
+
+enum
+{
+	kDADiskEjectOptionDefault = 0x00000000
+}
+
+enum
+{
+	kDADiskClaimOptionDefault = 0x00000000
+}
+
+enum
+{
+	kDADiskOptionDefault = 0x00000000,
+	kDADiskOptionEjectUponLogout = 0x00000001,
+	kDADiskOptionMountAutomatic = 0x00000010,
+	kDADiskOptionMountAutomaticNoDefer = 0x00000020,
+	kDADiskOptionPrivate = 0x00000100
+}
+
+extern (C)
+{
+	void DARegisterDiskAppearedCallback (DASessionRef session, CFDictionaryRef match, DADiskAppearedCallback callback, void* context);
+	void DARegisterDiskDescriptionChangedCallback (DASessionRef session, CFDictionaryRef match, CFArrayRef watch, DADiskDescriptionChangedCallback callback, void* context);
+	void DARegisterDiskDisappearedCallback (DASessionRef session, CFDictionaryRef match, DADiskDisappearedCallback callback, void* context);
+	void DADiskMount (DADiskRef disk, CFURLRef path, uint options, DADiskMountCallback callback, void* context);
+	void DADiskMountWithArguments (DADiskRef disk, CFURLRef path, uint options, DADiskMountCallback callback, void* context, CFStringRef* arguments);
+	void DARegisterDiskMountApprovalCallback (DAApprovalSessionRef session, CFDictionaryRef match, DADiskMountApprovalCallback callback, void* context);
+	void DADiskRename (DADiskRef disk, CFStringRef name, uint options, DADiskRenameCallback callback, void* context);
+	void DADiskUnmount (DADiskRef disk, uint options, DADiskUnmountCallback callback, void* context);
+	void DARegisterDiskUnmountApprovalCallback (DAApprovalSessionRef session, CFDictionaryRef match, DADiskUnmountApprovalCallback callback, void* context);
+	void DADiskEject (DADiskRef disk, uint options, DADiskEjectCallback callback, void* context);
+	void DARegisterDiskEjectApprovalCallback (DAApprovalSessionRef session, CFDictionaryRef match, DADiskEjectApprovalCallback callback, void* context);
+	void DADiskClaim (DADiskRef disk, uint options, DADiskClaimReleaseCallback release, void* releaseContext, DADiskClaimCallback callback, void* callbackContext);
+	ubyte DADiskIsClaimed (DADiskRef disk);
+	void DADiskUnclaim (DADiskRef disk);
+	void DARegisterDiskPeekCallback (DASessionRef session, CFDictionaryRef match, int order, DADiskPeekCallback callback, void* context);
+	uint DADiskGetOptions (DADiskRef disk);
+	int DADiskSetOptions (DADiskRef disk, uint options, ubyte value);
+	void DAUnregisterCallback (DASessionRef session, void* callback, void* context);
+	void DAUnregisterApprovalCallback (DAApprovalSessionRef session, void* callback, void* context);
+}
\ No newline at end of file
--- a/dstep/internal/Version.d	Thu Jul 09 23:25:18 2009 +0200
+++ b/dstep/internal/Version.d	Sat Aug 01 15:03:28 2009 +0200
@@ -6,136 +6,4 @@
  */
 module dstep.internal.Version;
 
-public import mambo.util.Version;
-
-/*static if ((void*).sizeof > int.sizeof)
-	version = D_LP64;
-
-version (GNU)
-	version (darwin)
-		version = OSX;
-
-version (DigitalMars)
-	version (OSX)
-		version = darwin;
-
-//Compiler Vendors
-version (DigitalMars) const bool DigitalMars = true;
-else const bool DigitalMars = false;
-
-version (GNU) const bool GNU = true;
-else const bool GNU = false;
-
-version (LDC) const bool LDC = true;
-else const bool LDC = false;
-
-version (LLVM) const bool LLVM = true;
-else const bool LLVM = false;
-
-
-
-//Processors 
-version (PPC) const bool PPC = true;
-else const bool PPC = false;
-
-version (PPC64) const bool PPC64 = true;
-else const bool PPC64 = false;
-
-version (SPARC) const bool SPARC = true;
-else const bool SPARC = false;
-
-version (SPARC64) const bool SPARC64 = true;
-else const bool SPARC64 = false;
-
-version (X86) const bool X86 = true;
-else const bool X86 = false;
-
-version (X86_64) const bool X86_64 = true;
-else const bool X86_64 = false;
-
-
-
-//Operating Systems
-version (aix) const bool aix = true;
-else const bool aix = false;
-
-version (cygwin) const bool cygwin = true;
-else const bool cygwin = false;
-
-version (darwin) const bool darwin = true;
-else const bool darwin = false;
-
-version (OSX) const bool OSX = true;
-else const bool OSX = false;
-
-version (freebsd) const bool freebsd = true;
-else const bool freebsd = false;
-
-version (linux) const bool linux = true;
-else const bool linux = false;
-
-version (solaris) const bool solaris = true;
-else const bool solaris = false;
-
-version (Unix) const bool Unix = true;
-else const bool Unix = false;
-
-version (Win32) const bool Win32 = true;
-else const bool Win32 = false;
-
-version (Win64) const bool Win64 = true;
-else const bool Win64 = false;
-
-version (Windows) const bool Windows = true;
-else const bool Windows = false;
-
-
-
-//Rest
-version (BigEndian) const bool BigEndian = true;
-else const bool BigEndian = false;
-
-version (LittleEndian) const bool LittleEndian = true;
-else const bool LittleEndian = false;
-
-version (D_Coverage) const bool D_Coverage = true;
-else const bool D_Coverage = false;
-
-version (D_Ddoc) const bool D_Ddoc = true;
-else const bool D_Ddoc = false;
-
-version (D_InlineAsm_X86) const bool D_InlineAsm_X86 = true;
-else const bool D_InlineAsm_X86 = false;
-
-version (D_InlineAsm_X86_64) const bool D_InlineAsm_X86_64 = true;
-else const bool D_InlineAsm_X86_64 = false;
-
-version (D_LP64) const bool D_LP64 = true;
-else const bool D_LP64 = false;
-
-version (D_PIC) const bool D_PIC = true;
-else const bool D_PIC = false;
-
-version (GNU_BitsPerPointer32) const bool GNU_BitsPerPointer32 = true;
-else const bool GNU_BitsPerPointer32 = false;
-
-version (GNU_BitsPerPointer64) const bool GNU_BitsPerPointer64 = true;
-else const bool GNU_BitsPerPointer64 = false;
-
-version (all) const bool all = true;
-else const bool D_InlineAsm_X86_64 = false;
-
-version (none) const bool D_InlineAsm_X86_64 = true;
-else const bool none = false;
-
-version (Tango)
-{
-	const bool Tango = true;
-	const bool Phobos = false;
-}
-
-else
-{
-	const bool Tango = false;
-	const bool Phobos = true; 
-}*/
\ No newline at end of file
+public import mambo.util.Version;
\ No newline at end of file
--- a/dstep/objc/bridge/Bridge.d	Thu Jul 09 23:25:18 2009 +0200
+++ b/dstep/objc/bridge/Bridge.d	Sat Aug 01 15:03:28 2009 +0200
@@ -6,8 +6,6 @@
  */
 module dstep.objc.bridge.Bridge;
 
-import mambo.io;
-
 version (Tango)
 {
 	import tango.core.Memory;
@@ -89,12 +87,12 @@
 		super(object);
 	}
 	
-	static typeof(this) alloc ()
+	/*static typeof(this) alloc ()
 	{
 		return invokeObjcSelfClass!(typeof(this), "alloc");
-	}
+	}*/
 	
-	typeof(this) init ()
+	/*typeof(this) init ()
 	{
 		id ret = invokeObjcSelf!(id, "init");
 		
@@ -111,7 +109,7 @@
 		object.dObject = this;
 		
 		return object;
-	}
+	}*/
 	
 	mixin ObjcSubclassInitializer!("D_" ~ name, name);
 }
--- a/dstep/objc/bridge/TypeEncoding.d	Thu Jul 09 23:25:18 2009 +0200
+++ b/dstep/objc/bridge/TypeEncoding.d	Sat Aug 01 15:03:28 2009 +0200
@@ -154,3 +154,10 @@
 	return result;
 }
 
+/**
+ * Converts the given string representing of a OSType into an integer.
+ */
+template getOSType (string osType)
+{
+	const getOSType = (cast(int)osType[0]) << 24 | (cast(int)osType[1]) << 16 | (cast(int)osType[2]) << 8 | (cast(int)osType[3]);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/AuthSession.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,50 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.AuthSession;
+
+import dstep.security.Authorization;
+
+alias uint SecuritySessionId;
+alias uint SessionAttributeBits;
+alias uint SessionCreationFlags;
+
+enum
+{
+	noSecuritySession = 0,
+	callerSecuritySession = (cast(SecuritySessionId)-1)
+}
+
+enum
+{
+	sessionIsRoot = 0x0001,
+	sessionHasGraphicAccess = 0x0010,
+	sessionHasTTY = 0x0020,
+	sessionIsRemote = 0x1000,
+	sessionWasInitialized = 0x8000
+}
+
+enum
+{
+	sessionKeepCurrentBootstrap = 0x8000
+}
+
+enum
+{
+	errSessionSuccess = 0,
+	errSessionInvalidId = -60500,
+	errSessionInvalidAttributes = -60501,
+	errSessionAuthorizationDenied = -60502,
+	errSessionValueNotSet = -60503,
+	errSessionInternal = errAuthorizationInternal,
+	errSessionInvalidFlags = errAuthorizationInvalidFlags
+}
+
+extern (C)
+{
+	int SessionGetInfo (uint session, SecuritySessionId* sessionId, SessionAttributeBits* attributes);
+	int SessionCreate (uint flags, uint attributes);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/Authorization.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,97 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.Authorization;
+
+version (Tango)
+	import tango.stdc.stdio;
+
+else
+	import std.c.stdio;
+
+import dstep.coreservices.carboncore.MacTypes;
+
+struct AuthorizationOpaqueRef;
+
+alias uint AuthorizationFlags;
+alias AuthorizationOpaqueRef* AuthorizationRef;
+alias char* AuthorizationString;
+alias AuthorizationItemSet AuthorizationRights;
+alias AuthorizationItemSet AuthorizationEnvironment;
+
+enum
+{
+	errAuthorizationSuccess = 0,
+	errAuthorizationInvalidSet = -60001,
+	errAuthorizationInvalidRef = -60002,
+	errAuthorizationInvalidTag = -60003,
+	errAuthorizationInvalidPointer = -60004,
+	errAuthorizationDenied = -60005,
+	errAuthorizationCanceled = -60006,
+	errAuthorizationInteractionNotAllowed = -60007,
+	errAuthorizationInternal = -60008,
+	errAuthorizationExternalizeNotAllowed = -60009,
+	errAuthorizationInternalizeNotAllowed = -60010,
+	errAuthorizationInvalidFlags = -60011,
+	errAuthorizationToolExecuteFailure = -60031,
+	errAuthorizationToolEnvironmentError = -60032,
+	errAuthorizationBadAddress = -60033
+}
+
+enum
+{
+	kAuthorizationFlagDefaults = 0,
+	kAuthorizationFlagInteractionAllowed = (1 << 0),
+	kAuthorizationFlagExtendRights = (1 << 1),
+	kAuthorizationFlagPartialRights = (1 << 2),
+	kAuthorizationFlagDestroyRights = (1 << 3),
+	kAuthorizationFlagPreAuthorize = (1 << 4),
+	kAuthorizationFlagNoData = (1 << 20)
+}
+
+enum
+{
+	kAuthorizationFlagCanNotPreAuthorize = (1 << 0)
+}
+
+enum
+{
+	kAuthorizationExternalFormLength = 32
+}
+
+struct AuthorizationItem
+{
+	char* name;
+	uint valueLength;
+	void* value;
+	uint flags;
+}
+
+
+struct AuthorizationItemSet
+{
+	uint count;
+	AuthorizationItem* items;
+}
+
+
+struct AuthorizationExternalForm
+{
+	char* bytes;
+}
+
+extern (C)
+{
+	int AuthorizationCreate (AuthorizationRights* rights, AuthorizationEnvironment* environment, uint flags, AuthorizationRef* authorization);
+	int AuthorizationFree (AuthorizationRef authorization, uint flags);
+	int AuthorizationCopyRights (AuthorizationRef authorization, AuthorizationRights* rights, AuthorizationEnvironment* environment, uint flags, AuthorizationRights** authorizedRights);
+	int AuthorizationCopyInfo (AuthorizationRef authorization, char* tag, AuthorizationItemSet** info);
+	int AuthorizationMakeExternalForm (AuthorizationRef authorization, AuthorizationExternalForm* extForm);
+	int AuthorizationCreateFromExternalForm (AuthorizationExternalForm* extForm, AuthorizationRef* authorization);
+	int AuthorizationFreeItemSet (AuthorizationItemSet* set);
+	int AuthorizationExecuteWithPrivileges (AuthorizationRef authorization, char* pathToTool, uint options, char** arguments, FILE** communicationsPipe);
+	int AuthorizationCopyPrivilegedReference (AuthorizationRef* authorization, uint flags);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/AuthorizationDB.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,17 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.AuthorizationDB;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.Authorization;
+
+extern (C)
+{
+	int AuthorizationRightGet (char* rightName, CFDictionaryRef* rightDefinition);
+	int AuthorizationRightSet (AuthorizationRef authRef, char* rightName, CFTypeRef rightDefinition, CFStringRef descriptionKey, CFBundleRef bundle, CFStringRef localeTableName);
+	int AuthorizationRightRemove (AuthorizationRef authRef, char* rightName);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/AuthorizationPlugin.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,80 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.AuthorizationPlugin;
+
+import dstep.security.Authorization;
+
+struct __OpaqueAuthorizationEngine;
+
+alias uint AuthorizationContextFlags;
+alias char* AuthorizationMechanismId;
+alias char* AuthorizationPluginId;
+alias void* AuthorizationPluginRef;
+alias void* AuthorizationMechanismRef;
+alias __OpaqueAuthorizationEngine* AuthorizationEngineRef;
+alias void* AuthorizationSessionId;
+alias uint AuthorizationResult;
+
+enum
+{
+	kAuthorizationContextFlagExtractable = (1 << 0),
+	kAuthorizationContextFlagVolatile = (1 << 1),
+	kAuthorizationContextFlagSticky = (1 << 2)
+}
+
+enum
+{
+	kAuthorizationResultAllow,
+	kAuthorizationResultDeny,
+	kAuthorizationResultUndefined,
+	kAuthorizationResultUserCanceled
+}
+
+enum
+{
+	kAuthorizationPluginInterfaceVersion = 0
+}
+
+enum
+{
+	kAuthorizationCallbacksVersion = 0
+}
+
+struct AuthorizationValue
+{
+	uint length;
+	void* data;
+}
+
+
+struct AuthorizationValueVector
+{
+	uint count;
+	AuthorizationValue* values;
+}
+
+
+struct AuthorizationCallbacks
+{
+	uint version_;
+	char* inKey;
+	AuthorizationContextFlags* outContextFlags;
+	uint inContextFlags;
+}
+
+
+struct AuthorizationPluginInterface
+{
+	uint version_;
+	AuthorizationEngineRef inEngine;
+	AuthorizationMechanismId mechanismId;
+}
+
+extern (C)
+{
+	int AuthorizationPluginCreate (AuthorizationCallbacks* callbacks, AuthorizationPluginRef* outPlugin, AuthorizationPluginInterface** outPluginInterface);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/AuthorizationTags.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,7 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.AuthorizationTags;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/CMSDecoder.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,45 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.CMSDecoder;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.Security;
+//import dstep.stdint;
+
+struct _CMSDecoder;
+
+alias _CMSDecoder* CMSDecoderRef;
+alias uint CMSSignerStatus;
+
+enum
+{
+	kCMSSignerUnsigned = 0,
+	kCMSSignerValid,
+	kCMSSignerNeedsDetachedContent,
+	kCMSSignerInvalidSignature,
+	kCMSSignerInvalidCert,
+	kCMSSignerInvalidIndex
+}
+
+extern (C)
+{
+	uint CMSDecoderGetTypeID ();
+	int CMSDecoderCreate (CMSDecoderRef* cmsDecoderOut);
+	int CMSDecoderUpdateMessage (CMSDecoderRef cmsDecoder, void* msgBytes, uint msgBytesLen);
+	int CMSDecoderFinalizeMessage (CMSDecoderRef cmsDecoder);
+	int CMSDecoderSetDetachedContent (CMSDecoderRef cmsDecoder, CFDataRef detachedContent);
+	int CMSDecoderCopyDetachedContent (CMSDecoderRef cmsDecoder, CFDataRef* detachedContentOut);
+	int CMSDecoderSetSearchKeychain (CMSDecoderRef cmsDecoder, CFTypeRef keychainOrArray);
+	int CMSDecoderGetNumSigners (CMSDecoderRef cmsDecoder, size_t* numSignersOut);
+	int CMSDecoderCopySignerStatus (CMSDecoderRef cmsDecoder, uint signerIndex, CFTypeRef policyOrArray, ubyte evaluateSecTrust, CMSSignerStatus* signerStatusOut, SecTrustRef* secTrustOut, OSStatus* certVerifyResultCodeOut);
+	int CMSDecoderCopySignerEmailAddress (CMSDecoderRef cmsDecoder, uint signerIndex, CFStringRef* signerEmailAddressOut);
+	int CMSDecoderCopySignerCert (CMSDecoderRef cmsDecoder, uint signerIndex, SecCertificateRef* signerCertOut);
+	int CMSDecoderIsContentEncrypted (CMSDecoderRef cmsDecoder, char* isEncryptedOut);
+	int CMSDecoderCopyEncapsulatedContentType (CMSDecoderRef cmsDecoder, CFDataRef* eContentTypeOut);
+	int CMSDecoderCopyAllCerts (CMSDecoderRef cmsDecoder, CFArrayRef* certsOut);
+	int CMSDecoderCopyContent (CMSDecoderRef cmsDecoder, CFDataRef* contentOut);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/CMSEncoder.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,56 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.CMSEncoder;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.Security;
+//import dstep.stdint;
+
+struct _CMSEncoder;
+
+alias _CMSEncoder* CMSEncoderRef;
+alias uint CMSSignedAttributes;
+alias uint CMSCertificateChainMode;
+
+enum
+{
+	kCMSAttrNone = 0x0000,
+	kCMSAttrSmimeCapabilities = 0x0001,
+	kCMSAttrSmimeEncryptionKeyPrefs = 0x0002,
+	kCMSAttrSmimeMSEncryptionKeyPrefs = 0x0004,
+	kCMSAttrSigningTime = 0x0008
+}
+
+enum
+{
+	kCMSCertificateNone = 0,
+	kCMSCertificateSignerOnly,
+	kCMSCertificateChain,
+	kCMSCertificateChainWithRoot
+}
+
+extern (C)
+{
+	uint CMSEncoderGetTypeID ();
+	int CMSEncoderCreate (CMSEncoderRef* cmsEncoderOut);
+	int CMSEncoderAddSigners (CMSEncoderRef cmsEncoder, CFTypeRef signerOrArray);
+	int CMSEncoderCopySigners (CMSEncoderRef cmsEncoder, CFArrayRef* signersOut);
+	int CMSEncoderAddRecipients (CMSEncoderRef cmsEncoder, CFTypeRef recipientOrArray);
+	int CMSEncoderCopyRecipients (CMSEncoderRef cmsEncoder, CFArrayRef* recipientsOut);
+	int CMSEncoderSetHasDetachedContent (CMSEncoderRef cmsEncoder, ubyte detachedContent);
+	int CMSEncoderGetHasDetachedContent (CMSEncoderRef cmsEncoder, char* detachedContentOut);
+	int CMSEncoderSetEncapsulatedContentType (CMSEncoderRef cmsEncoder, CSSM_OID* eContentType);
+	int CMSEncoderCopyEncapsulatedContentType (CMSEncoderRef cmsEncoder, CFDataRef* eContentTypeOut);
+	int CMSEncoderAddSupportingCerts (CMSEncoderRef cmsEncoder, CFTypeRef certOrArray);
+	int CMSEncoderCopySupportingCerts (CMSEncoderRef cmsEncoder, CFArrayRef* certsOut);
+	int CMSEncoderAddSignedAttributes (CMSEncoderRef cmsEncoder, uint signedAttributes);
+	int CMSEncoderSetCertificateChainMode (CMSEncoderRef cmsEncoder, uint chainMode);
+	int CMSEncoderGetCertificateChainMode (CMSEncoderRef cmsEncoder, CMSCertificateChainMode* chainModeOut);
+	int CMSEncoderUpdateContent (CMSEncoderRef cmsEncoder, void* content, uint contentLen);
+	int CMSEncoderCopyEncodedContent (CMSEncoderRef cmsEncoder, CFDataRef* encodedContentOut);
+	int CMSEncode (CFTypeRef signers, CFTypeRef recipients, CSSM_OID* eContentType, ubyte detachedContent, uint signedAttributes, void* content, uint contentLen, CFDataRef* encodedContentOut);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/CipherSuite.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,63 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.CipherSuite;
+
+import dstep.corefoundation.CFBase;
+
+alias uint SSLCipherSuite;
+
+enum
+{
+	SSL_NULL_WITH_NULL_NULL = 0x0000,
+	SSL_RSA_WITH_NULL_MD5 = 0x0001,
+	SSL_RSA_WITH_NULL_SHA = 0x0002,
+	SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003,
+	SSL_RSA_WITH_RC4_128_MD5 = 0x0004,
+	SSL_RSA_WITH_RC4_128_SHA = 0x0005,
+	SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006,
+	SSL_RSA_WITH_IDEA_CBC_SHA = 0x0007,
+	SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008,
+	SSL_RSA_WITH_DES_CBC_SHA = 0x0009,
+	SSL_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
+	SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B,
+	SSL_DH_DSS_WITH_DES_CBC_SHA = 0x000C,
+	SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D,
+	SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E,
+	SSL_DH_RSA_WITH_DES_CBC_SHA = 0x000F,
+	SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010,
+	SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011,
+	SSL_DHE_DSS_WITH_DES_CBC_SHA = 0x0012,
+	SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013,
+	SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014,
+	SSL_DHE_RSA_WITH_DES_CBC_SHA = 0x0015,
+	SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
+	SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017,
+	SSL_DH_anon_WITH_RC4_128_MD5 = 0x0018,
+	SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019,
+	SSL_DH_anon_WITH_DES_CBC_SHA = 0x001A,
+	SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
+	SSL_FORTEZZA_DMS_WITH_NULL_SHA = 0x001C,
+	SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA = 0x001D,
+	TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
+	TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030,
+	TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031,
+	TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032,
+	TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
+	TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034,
+	TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
+	TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036,
+	TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037,
+	TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038,
+	TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
+	TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A,
+	SSL_RSA_WITH_RC2_CBC_MD5 = 0xFF80,
+	SSL_RSA_WITH_IDEA_CBC_MD5 = 0xFF81,
+	SSL_RSA_WITH_DES_CBC_MD5 = 0xFF82,
+	SSL_RSA_WITH_3DES_EDE_CBC_MD5 = 0xFF83,
+	SSL_NO_SUCH_CIPHERSUITE = 0xFFFF
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecACL.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,23 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecACL;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.SecBase;
+import dstep.security.cssmapple;
+import dstep.security.cssmtype;
+
+extern (C)
+{
+	uint SecACLGetTypeID ();
+	int SecACLCreateFromSimpleContents (SecAccessRef access, CFArrayRef applicationList, CFStringRef description, CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR* promptSelector, SecACLRef* newAcl);
+	int SecACLRemove (SecACLRef aclRef);
+	int SecACLCopySimpleContents (SecACLRef acl, CFArrayRef* applicationList, CFStringRef* description, CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR* promptSelector);
+	int SecACLSetSimpleContents (SecACLRef acl, CFArrayRef applicationList, CFStringRef description, CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR* promptSelector);
+	int SecACLGetAuthorizations (SecACLRef acl, CSSM_ACL_AUTHORIZATION_TAG* tags, uint* tagCount);
+	int SecACLSetAuthorizations (SecACLRef acl, CSSM_ACL_AUTHORIZATION_TAG* tags, uint tagCount);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecAccess.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,22 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecAccess;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+extern (C)
+{
+	uint SecAccessGetTypeID ();
+	int SecAccessCreate (CFStringRef descriptor, CFArrayRef trustedlist, SecAccessRef* accessRef);
+	int SecAccessCreateFromOwnerAndACL (CSSM_ACL_OWNER_PROTOTYPE* owner, uint aclCount, CSSM_ACL_ENTRY_INFO* acls, SecAccessRef* accessRef);
+	int SecAccessGetOwnerAndACL (SecAccessRef accessRef, CSSM_ACL_OWNER_PROTOTYPE_PTR* owner, uint* aclCount, CSSM_ACL_ENTRY_INFO_PTR* acls);
+	int SecAccessCopyACLList (SecAccessRef accessRef, CFArrayRef* aclList);
+	int SecAccessCopySelectedACLList (SecAccessRef accessRef, int action, CFArrayRef* aclList);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecAsn1Coder.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,29 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecAsn1Coder;
+
+import dstep.security.SecAsn1Types;
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+//import dstep.sys.types;
+
+struct SecAsn1Coder;
+
+alias SecAsn1Coder* SecAsn1CoderRef;
+
+extern (C)
+{
+	int SecAsn1CoderCreate (SecAsn1CoderRef* coder);
+	int SecAsn1CoderRelease (SecAsn1CoderRef coder);
+	int SecAsn1Decode (SecAsn1CoderRef coder, void* src, uint len, SecAsn1Template* templates, void* dest);
+	int SecAsn1DecodeData (SecAsn1CoderRef coder, CSSM_DATA* src, SecAsn1Template* templ, void* dest);
+	int SecAsn1EncodeItem (SecAsn1CoderRef coder, void* src, SecAsn1Template* templates, CSSM_DATA* dest);
+	void* SecAsn1Malloc (SecAsn1CoderRef coder, uint len);
+	int SecAsn1AllocItem (SecAsn1CoderRef coder, CSSM_DATA* item, uint len);
+	int SecAsn1AllocCopy (SecAsn1CoderRef coder, void* src, uint len, CSSM_DATA* dest);
+	int SecAsn1AllocCopyItem (SecAsn1CoderRef coder, CSSM_DATA* src, CSSM_DATA* dest);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecAsn1Templates.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,91 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecAsn1Templates;
+
+import dstep.security.SecAsn1Types;
+
+extern (C)
+{
+	extern
+	{
+		const SecAsn1Template* kSecAsn1AnyTemplate;
+		const SecAsn1Template* kSecAsn1BitStringTemplate;
+		const SecAsn1Template* kSecAsn1BMPStringTemplate;
+		const SecAsn1Template* kSecAsn1BooleanTemplate;
+		const SecAsn1Template* kSecAsn1EnumeratedTemplate;
+		const SecAsn1Template* kSecAsn1GeneralizedTimeTemplate;
+		const SecAsn1Template* kSecAsn1IA5StringTemplate;
+		const SecAsn1Template* kSecAsn1IntegerTemplate;
+		const SecAsn1Template* kSecAsn1UnsignedIntegerTemplate;
+		const SecAsn1Template* kSecAsn1NullTemplate;
+		const SecAsn1Template* kSecAsn1ObjectIDTemplate;
+		const SecAsn1Template* kSecAsn1OctetStringTemplate;
+		const SecAsn1Template* kSecAsn1PrintableStringTemplate;
+		const SecAsn1Template* kSecAsn1T61StringTemplate;
+		const SecAsn1Template* kSecAsn1UniversalStringTemplate;
+		const SecAsn1Template* kSecAsn1UTCTimeTemplate;
+		const SecAsn1Template* kSecAsn1UTF8StringTemplate;
+		const SecAsn1Template* kSecAsn1VisibleStringTemplate;
+		const SecAsn1Template* kSecAsn1TeletexStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToAnyTemplate;
+		const SecAsn1Template* kSecAsn1PointerToBitStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToBMPStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToBooleanTemplate;
+		const SecAsn1Template* kSecAsn1PointerToEnumeratedTemplate;
+		const SecAsn1Template* kSecAsn1PointerToGeneralizedTimeTemplate;
+		const SecAsn1Template* kSecAsn1PointerToIA5StringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToIntegerTemplate;
+		const SecAsn1Template* kSecAsn1PointerToNullTemplate;
+		const SecAsn1Template* kSecAsn1PointerToObjectIDTemplate;
+		const SecAsn1Template* kSecAsn1PointerToOctetStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToPrintableStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToT61StringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToUniversalStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToUTCTimeTemplate;
+		const SecAsn1Template* kSecAsn1PointerToUTF8StringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToVisibleStringTemplate;
+		const SecAsn1Template* kSecAsn1PointerToTeletexStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfAnyTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfBitStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfBMPStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfBooleanTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfEnumeratedTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfGeneralizedTimeTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfIA5StringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfIntegerTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfNullTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfObjectIDTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfOctetStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfPrintableStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfT61StringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfUniversalStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfUTCTimeTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfUTF8StringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfVisibleStringTemplate;
+		const SecAsn1Template* kSecAsn1SequenceOfTeletexStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfAnyTemplate;
+		const SecAsn1Template* kSecAsn1SetOfBitStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfBMPStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfBooleanTemplate;
+		const SecAsn1Template* kSecAsn1SetOfEnumeratedTemplate;
+		const SecAsn1Template* kSecAsn1SetOfGeneralizedTimeTemplate;
+		const SecAsn1Template* kSecAsn1SetOfIA5StringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfIntegerTemplate;
+		const SecAsn1Template* kSecAsn1SetOfNullTemplate;
+		const SecAsn1Template* kSecAsn1SetOfObjectIDTemplate;
+		const SecAsn1Template* kSecAsn1SetOfOctetStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfPrintableStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfT61StringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfUniversalStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfUTCTimeTemplate;
+		const SecAsn1Template* kSecAsn1SetOfUTF8StringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfVisibleStringTemplate;
+		const SecAsn1Template* kSecAsn1SetOfTeletexStringTemplate;
+		const SecAsn1Template* kSecAsn1SkipTemplate;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecAsn1Types.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,28 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecAsn1Types;
+
+import dstep.corefoundation.CFBase;
+import dstep.security.cssmtype;
+//import dstep.stdint;
+//import dstep.sys.types;
+
+alias extern (C) SecAsn1Template* function (void*, ubyte, char*, void*) SecAsn1TemplateChooserPtr;
+
+extern (C)
+{
+	SecAsn1Template* SecAsn1TemplateChooser (void*, ubyte, char*, void*);
+}
+
+struct SecAsn1Template
+{
+	uint kind;
+	uint offset;
+	void* sub;
+	uint size;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecBase.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,111 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecBase;
+
+import dstep.corefoundation.CFBase;
+
+struct OpaqueSecKeychainRef;
+struct OpaqueSecKeychainItemRef;
+struct OpaqueSecKeychainSearchRef;
+struct OpaqueSecTrustedApplicationRef;
+struct OpaqueSecPolicyRef;
+struct OpaqueSecCertificateRef;
+struct OpaqueSecAccessRef;
+struct OpaqueSecIdentityRef;
+struct OpaqueSecKeyRef;
+struct OpaqueSecTrustRef;
+struct OpaqueSecPasswordRef;
+
+alias OpaqueSecKeychainRef* SecKeychainRef;
+alias OpaqueSecKeychainItemRef* SecKeychainItemRef;
+alias OpaqueSecKeychainSearchRef* SecKeychainSearchRef;
+alias uint SecKeychainAttrType;
+alias SecKeychainAttribute* SecKeychainAttributePtr;
+alias uint SecKeychainStatus;
+alias OpaqueSecTrustedApplicationRef* SecTrustedApplicationRef;
+alias OpaqueSecPolicyRef* SecPolicyRef;
+alias OpaqueSecCertificateRef* SecCertificateRef;
+alias OpaqueSecAccessRef* SecAccessRef;
+alias OpaqueSecIdentityRef* SecIdentityRef;
+alias OpaqueSecKeyRef* SecKeyRef;
+alias OpaqueSecTrustRef* SecACLRef;
+alias OpaqueSecPasswordRef* SecPasswordRef;
+
+enum
+{
+	errSecNotAvailable = -25291,
+	errSecReadOnly = -25292,
+	errSecAuthFailed = -25293,
+	errSecNoSuchKeychain = -25294,
+	errSecInvalidKeychain = -25295,
+	errSecDuplicateKeychain = -25296,
+	errSecDuplicateCallback = -25297,
+	errSecInvalidCallback = -25298,
+	errSecDuplicateItem = -25299,
+	errSecItemNotFound = -25300,
+	errSecBufferTooSmall = -25301,
+	errSecDataTooLarge = -25302,
+	errSecNoSuchAttr = -25303,
+	errSecInvalidItemRef = -25304,
+	errSecInvalidSearchRef = -25305,
+	errSecNoSuchClass = -25306,
+	errSecNoDefaultKeychain = -25307,
+	errSecInteractionNotAllowed = -25308,
+	errSecReadOnlyAttr = -25309,
+	errSecWrongSecVersion = -25310,
+	errSecKeySizeNotAllowed = -25311,
+	errSecNoStorageModule = -25312,
+	errSecNoCertificateModule = -25313,
+	errSecNoPolicyModule = -25314,
+	errSecInteractionRequired = -25315,
+	errSecDataNotAvailable = -25316,
+	errSecDataNotModifiable = -25317,
+	errSecCreateChainFailed = -25318,
+	errSecInvalidPrefsDomain = -25319,
+	errSecACLNotSimple = -25240,
+	errSecPolicyNotFound = -25241,
+	errSecInvalidTrustSetting = -25242,
+	errSecNoAccessForItem = -25243,
+	errSecInvalidOwnerEdit = -25244,
+	errSecTrustNotAvailable = -25245,
+	errSecUnsupportedFormat = -25256,
+	errSecUnknownFormat = -25257,
+	errSecKeyIsSensitive = -25258,
+	errSecMultiplePrivKeys = -25259,
+	errSecPassphraseRequired = -25260,
+	errSecInvalidPasswordRef = -25261,
+	errSecInvalidTrustSettings = -25262,
+	errSecNoTrustSettings = -25263,
+	errSecPkcs12VerifyFailure = -25264
+}
+
+struct SecKeychainAttribute
+{
+	uint tag;
+	uint length;
+	void* data;
+}
+
+
+struct SecKeychainAttributeList
+{
+	uint count;
+	SecKeychainAttribute* attr;
+}
+
+
+struct SecKeychainAttributeInfo
+{
+	uint count;
+	uint* tag;
+	uint* format;
+}
+
+extern (C)
+{
+	CFStringRef SecCopyErrorMessageString (int status, void* reserved);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecCertificate.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,60 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecCertificate;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDate;
+import dstep.objc.bridge.TypeEncoding;
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+import dstep.security.x509defs;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSecSubjectItemAttr = getOSType!("subj");
+		const __kSecIssuerItemAttr = getOSType!("issu");
+		const __kSecSerialNumberItemAttr = getOSType!("snbr");
+		const __kSecPublicKeyHashItemAttr = getOSType!("hpky");
+		const __kSecSubjectKeyIdentifierItemAttr = getOSType!("skid");
+		const __kSecCertTypeItemAttr = getOSType!("ctyp");
+		const __kSecCertEncodingItemAttr = getOSType!("cenc");
+	}
+}
+
+enum
+{
+	kSecSubjectItemAttr = getOSType!("subj"),
+	kSecIssuerItemAttr = getOSType!("issu"),
+	kSecSerialNumberItemAttr = getOSType!("snbr"),
+	kSecPublicKeyHashItemAttr = getOSType!("hpky"),
+	kSecSubjectKeyIdentifierItemAttr = getOSType!("skid"),
+	kSecCertTypeItemAttr = getOSType!("ctyp"),
+	kSecCertEncodingItemAttr = getOSType!("cenc")
+}
+
+extern (C)
+{
+	uint SecCertificateGetTypeID ();
+	int SecCertificateCreateFromData (CSSM_DATA* data, uint type, uint encoding, SecCertificateRef* certificate);
+	int SecCertificateAddToKeychain (SecCertificateRef certificate, SecKeychainRef keychain);
+	int SecCertificateGetData (SecCertificateRef certificate, CSSM_DATA_PTR data);
+	int SecCertificateGetType (SecCertificateRef certificate, CSSM_CERT_TYPE* certificateType);
+	int SecCertificateGetSubject (SecCertificateRef certificate, CSSM_X509_NAME** subject);
+	int SecCertificateGetIssuer (SecCertificateRef certificate, CSSM_X509_NAME** issuer);
+	int SecCertificateGetCLHandle (SecCertificateRef certificate, CSSM_CL_HANDLE* clHandle);
+	int SecCertificateGetAlgorithmID (SecCertificateRef certificate, CSSM_X509_ALGORITHM_IDENTIFIER** algid);
+	int SecCertificateCopyPublicKey (SecCertificateRef certificate, SecKeyRef* key);
+	int SecCertificateCopyCommonName (SecCertificateRef certificate, CFStringRef* commonName);
+	int SecCertificateCopyEmailAddresses (SecCertificateRef certificate, CFArrayRef* emailAddresses);
+	int SecCertificateCopyPreference (CFStringRef name, uint keyUsage, SecCertificateRef* certificate);
+	int SecCertificateSetPreference (SecCertificateRef certificate, CFStringRef name, uint keyUsage, CFDateRef date);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecIdentity.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,34 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecIdentity;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+extern (C)
+{
+	extern
+	{
+		const CFStringRef kSecIdentityDomainDefault;
+		const CFStringRef kSecIdentityDomainKerberosKDC;
+	}
+}
+
+extern (C)
+{
+	uint SecIdentityGetTypeID ();
+	int SecIdentityCreateWithCertificate (CFTypeRef keychainOrArray, SecCertificateRef certificateRef, SecIdentityRef* identityRef);
+	int SecIdentityCopyCertificate (SecIdentityRef identityRef, SecCertificateRef* certificateRef);
+	int SecIdentityCopyPrivateKey (SecIdentityRef identityRef, SecKeyRef* privateKeyRef);
+	int SecIdentityCopyPreference (CFStringRef name, uint keyUsage, CFArrayRef validIssuers, SecIdentityRef* identity);
+	int SecIdentitySetPreference (SecIdentityRef identity, CFStringRef name, uint keyUsage);
+	int SecIdentityCopySystemIdentity (CFStringRef domain, SecIdentityRef* idRef, CFStringRef* actualDomain);
+	int SecIdentitySetSystemIdentity (CFStringRef domain, SecIdentityRef idRef);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecIdentitySearch.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,26 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecIdentitySearch;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.corefoundation.CFDictionary;
+import dstep.corefoundation.CFString;
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+struct OpaqueSecIdentitySearchRef;
+
+alias OpaqueSecIdentitySearchRef* SecIdentitySearchRef;
+
+extern (C)
+{
+	uint SecIdentitySearchGetTypeID ();
+	int SecIdentitySearchCreate (CFTypeRef keychainOrArray, uint keyUsage, SecIdentitySearchRef* searchRef);
+	int SecIdentitySearchCopyNext (SecIdentitySearchRef searchRef, SecIdentityRef* identity);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecImportExport.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,78 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecImportExport;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.SecAccess;
+import dstep.security.SecBase;
+import dstep.security.SecKeychain;
+import dstep.security.cssmtype;
+//import dstep.stdint;
+
+alias uint SecExternalFormat;
+alias uint SecExternalItemType;
+alias uint SecItemImportExportFlags;
+alias uint SecKeyImportExportFlags;
+
+enum
+{
+	kSecFormatUnknown = 0,
+	kSecFormatOpenSSL,
+	kSecFormatSSH,
+	kSecFormatBSAFE,
+	kSecFormatRawKey,
+	kSecFormatWrappedPKCS8,
+	kSecFormatWrappedOpenSSL,
+	kSecFormatWrappedSSH,
+	kSecFormatWrappedLSH,
+	kSecFormatX509Cert,
+	kSecFormatPEMSequence,
+	kSecFormatPKCS7,
+	kSecFormatPKCS12,
+	kSecFormatNetscapeCertSequence,
+	kSecFormatSSHv2
+}
+
+enum
+{
+	kSecItemTypeUnknown,
+	kSecItemTypePrivateKey,
+	kSecItemTypePublicKey,
+	kSecItemTypeSessionKey,
+	kSecItemTypeCertificate,
+	kSecItemTypeAggregate
+}
+
+enum
+{
+	kSecItemPemArmour = 0x00000001
+}
+
+enum
+{
+	kSecKeyImportOnlyOne = 0x00000001,
+	kSecKeySecurePassphrase = 0x00000002,
+	kSecKeyNoAccessControl = 0x00000004
+}
+
+struct SecKeyImportExportParameters
+{
+	uint version_;
+	uint flags;
+	CFTypeRef passphrase;
+	CFStringRef alertTitle;
+	CFStringRef alertPrompt;
+	SecAccessRef accessRef;
+	uint keyUsage;
+	uint keyAttributes;
+}
+
+extern (C)
+{
+	int SecKeychainItemExport (CFTypeRef keychainItemOrArray, uint outputFormat, uint flags, SecKeyImportExportParameters* keyParams, CFDataRef* exportedData);
+	int SecKeychainItemImport (CFDataRef importedData, CFStringRef fileNameOrExtension, SecExternalFormat* inputFormat, SecExternalItemType* itemType, uint flags, SecKeyImportExportParameters* keyParams, SecKeychainRef importKeychain, CFArrayRef* outItems);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecKey.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,60 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecKey;
+
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+alias uint SecCredentialType;
+
+enum
+{
+	kSecKeyKeyClass = 0,
+	kSecKeyPrintName = 1,
+	kSecKeyAlias = 2,
+	kSecKeyPermanent = 3,
+	kSecKeyPrivate = 4,
+	kSecKeyModifiable = 5,
+	kSecKeyLabel = 6,
+	kSecKeyApplicationTag = 7,
+	kSecKeyKeyCreator = 8,
+	kSecKeyKeyType = 9,
+	kSecKeyKeySizeInBits = 10,
+	kSecKeyEffectiveKeySize = 11,
+	kSecKeyStartDate = 12,
+	kSecKeyEndDate = 13,
+	kSecKeySensitive = 14,
+	kSecKeyAlwaysSensitive = 15,
+	kSecKeyExtractable = 16,
+	kSecKeyNeverExtractable = 17,
+	kSecKeyEncrypt = 18,
+	kSecKeyDecrypt = 19,
+	kSecKeyDerive = 20,
+	kSecKeySign = 21,
+	kSecKeyVerify = 22,
+	kSecKeySignRecover = 23,
+	kSecKeyVerifyRecover = 24,
+	kSecKeyWrap = 25,
+	kSecKeyUnwrap = 26
+}
+
+enum
+{
+	kSecCredentialTypeDefault = 0,
+	kSecCredentialTypeWithUI,
+	kSecCredentialTypeNoUI
+}
+
+extern (C)
+{
+	uint SecKeyGetTypeID ();
+	int SecKeyCreatePair (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint publicKeyUsage, uint publicKeyAttr, uint privateKeyUsage, uint privateKeyAttr, SecAccessRef initialAccess, SecKeyRef* publicKey, SecKeyRef* privateKey);
+	int SecKeyGenerate (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint keyUsage, uint keyAttr, SecAccessRef initialAccess, SecKeyRef* keyRef);
+	int SecKeyGetCSSMKey (SecKeyRef key, CSSM_KEY** cssmKey);
+	int SecKeyGetCSPHandle (SecKeyRef keyRef, CSSM_CSP_HANDLE* cspHandle);
+	int SecKeyGetCredentials (SecKeyRef keyRef, int operation, uint credentialType, CSSM_ACCESS_CREDENTIALS** outCredentials);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecKeychain.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,228 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecKeychain;
+
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.objc.bridge.TypeEncoding;
+import dstep.security.SecBase;
+import dstep.security.cssmapple;
+import dstep.security.cssmtype;
+
+alias uint SecAuthenticationType;
+alias uint SecProtocolType;
+alias uint SecKeychainEvent;
+alias uint SecKeychainEventMask;
+
+extern (C)
+{
+	alias int function (uint, SecKeychainCallbackInfo*, void*) SecKeychainCallback;
+}
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSecProtocolTypeFTP = getOSType!("ftp ");
+		const __kSecProtocolTypeFTPAccount = getOSType!("ftpa");
+		const __kSecProtocolTypeHTTP = getOSType!("http");
+		const __kSecProtocolTypeIRC = getOSType!("irc ");
+		const __kSecProtocolTypeNNTP = getOSType!("nntp");
+		const __kSecProtocolTypePOP3 = getOSType!("pop3");
+		const __kSecProtocolTypeSMTP = getOSType!("smtp");
+		const __kSecProtocolTypeSOCKS = getOSType!("sox ");
+		const __kSecProtocolTypeIMAP = getOSType!("imap");
+		const __kSecProtocolTypeLDAP = getOSType!("ldap");
+		const __kSecProtocolTypeAppleTalk = getOSType!("atlk");
+		const __kSecProtocolTypeAFP = getOSType!("afp ");
+		const __kSecProtocolTypeTelnet = getOSType!("teln");
+		const __kSecProtocolTypeSSH = getOSType!("ssh ");
+		const __kSecProtocolTypeFTPS = getOSType!("ftps");
+		const __kSecProtocolTypeHTTPS = getOSType!("htps");
+		const __kSecProtocolTypeHTTPProxy = getOSType!("htpx");
+		const __kSecProtocolTypeHTTPSProxy = getOSType!("htsx");
+		const __kSecProtocolTypeFTPProxy = getOSType!("ftpx");
+		const __kSecProtocolTypeCIFS = getOSType!("cifs");
+		const __kSecProtocolTypeSMB = getOSType!("smb ");
+		const __kSecProtocolTypeRTSP = getOSType!("rtsp");
+		const __kSecProtocolTypeRTSPProxy = getOSType!("rtsx");
+		const __kSecProtocolTypeDAAP = getOSType!("daap");
+		const __kSecProtocolTypeEPPC = getOSType!("eppc");
+		const __kSecProtocolTypeIPP = getOSType!("ipp ");
+		const __kSecProtocolTypeNNTPS = getOSType!("ntps");
+		const __kSecProtocolTypeLDAPS = getOSType!("ldps");
+		const __kSecProtocolTypeTelnetS = getOSType!("tels");
+		const __kSecProtocolTypeIMAPS = getOSType!("imps");
+		const __kSecProtocolTypeIRCS = getOSType!("ircs");
+		const __kSecProtocolTypePOP3S = getOSType!("pops");
+		const __kSecProtocolTypeCVSpserver = getOSType!("cvsp");
+		const __kSecProtocolTypeSVN = getOSType!("svn ");
+		const __kSecAuthenticationTypeNTLM = ((getOSType!("ntlm") >> 24) | ((getOSType!("ntlm") >> 8) & 0xff00) | ((getOSType!("ntlm") << 8) & 0xff0000) | (getOSType!("ntlm") & 0xff) << 24);
+		const __kSecAuthenticationTypeMSN = ((getOSType!("msna") >> 24) | ((getOSType!("msna") >> 8) & 0xff00) | ((getOSType!("msna") << 8) & 0xff0000) | (getOSType!("msna") & 0xff) << 24);
+		const __kSecAuthenticationTypeDPA = ((getOSType!("dpaa") >> 24) | ((getOSType!("dpaa") >> 8) & 0xff00) | ((getOSType!("dpaa") << 8) & 0xff0000) | (getOSType!("dpaa") & 0xff) << 24);
+		const __kSecAuthenticationTypeRPA = ((getOSType!("rpaa") >> 24) | ((getOSType!("rpaa") >> 8) & 0xff00) | ((getOSType!("rpaa") << 8) & 0xff0000) | (getOSType!("rpaa") & 0xff) << 24);
+		const __kSecAuthenticationTypeHTTPBasic = ((getOSType!("http") >> 24) | ((getOSType!("http") >> 8) & 0xff00) | ((getOSType!("http") << 8) & 0xff0000) | (getOSType!("http") & 0xff) << 24);
+		const __kSecAuthenticationTypeHTTPDigest = ((getOSType!("httd") >> 24) | ((getOSType!("httd") >> 8) & 0xff00) | ((getOSType!("httd") << 8) & 0xff0000) | (getOSType!("httd") & 0xff) << 24);
+		const __kSecAuthenticationTypeHTMLForm = ((getOSType!("form") >> 24) | ((getOSType!("form") >> 8) & 0xff00) | ((getOSType!("form") << 8) & 0xff0000) | (getOSType!("form") & 0xff) << 24);
+		const __kSecAuthenticationTypeDefault = ((getOSType!("dflt") >> 24) | ((getOSType!("dflt") >> 8) & 0xff00) | ((getOSType!("dflt") << 8) & 0xff0000) | (getOSType!("dflt") & 0xff) << 24);
+		const __kSecAuthenticationTypeAny = ((0 >> 24) | ((0 >> 8) & 0xff00) | ((0 << 8) & 0xff0000) | (0 & 0xff) << 24);
+	}
+}
+
+enum
+{
+	kSecUnlockStateStatus = 1,
+	kSecReadPermStatus = 2,
+	kSecWritePermStatus = 4
+}
+
+enum
+{
+	kSecAuthenticationTypeNTLM = ((getOSType!("ntlm") >> 24) | ((getOSType!("ntlm") >> 8) & 0xff00) | ((getOSType!("ntlm") << 8) & 0xff0000) | (getOSType!("ntlm") & 0xff) << 24),
+	kSecAuthenticationTypeMSN = ((getOSType!("msna") >> 24) | ((getOSType!("msna") >> 8) & 0xff00) | ((getOSType!("msna") << 8) & 0xff0000) | (getOSType!("msna") & 0xff) << 24),
+	kSecAuthenticationTypeDPA = ((getOSType!("dpaa") >> 24) | ((getOSType!("dpaa") >> 8) & 0xff00) | ((getOSType!("dpaa") << 8) & 0xff0000) | (getOSType!("dpaa") & 0xff) << 24),
+	kSecAuthenticationTypeRPA = ((getOSType!("rpaa") >> 24) | ((getOSType!("rpaa") >> 8) & 0xff00) | ((getOSType!("rpaa") << 8) & 0xff0000) | (getOSType!("rpaa") & 0xff) << 24),
+	kSecAuthenticationTypeHTTPBasic = ((getOSType!("http") >> 24) | ((getOSType!("http") >> 8) & 0xff00) | ((getOSType!("http") << 8) & 0xff0000) | (getOSType!("http") & 0xff) << 24),
+	kSecAuthenticationTypeHTTPDigest = ((getOSType!("httd") >> 24) | ((getOSType!("httd") >> 8) & 0xff00) | ((getOSType!("httd") << 8) & 0xff0000) | (getOSType!("httd") & 0xff) << 24),
+	kSecAuthenticationTypeHTMLForm = ((getOSType!("form") >> 24) | ((getOSType!("form") >> 8) & 0xff00) | ((getOSType!("form") << 8) & 0xff0000) | (getOSType!("form") & 0xff) << 24),
+	kSecAuthenticationTypeDefault = ((getOSType!("dflt") >> 24) | ((getOSType!("dflt") >> 8) & 0xff00) | ((getOSType!("dflt") << 8) & 0xff0000) | (getOSType!("dflt") & 0xff) << 24),
+	kSecAuthenticationTypeAny = ((0 >> 24) | ((0 >> 8) & 0xff00) | ((0 << 8) & 0xff0000) | (0 & 0xff) << 24)
+}
+
+enum
+{
+	kSecProtocolTypeFTP = getOSType!("ftp "),
+	kSecProtocolTypeFTPAccount = getOSType!("ftpa"),
+	kSecProtocolTypeHTTP = getOSType!("http"),
+	kSecProtocolTypeIRC = getOSType!("irc "),
+	kSecProtocolTypeNNTP = getOSType!("nntp"),
+	kSecProtocolTypePOP3 = getOSType!("pop3"),
+	kSecProtocolTypeSMTP = getOSType!("smtp"),
+	kSecProtocolTypeSOCKS = getOSType!("sox "),
+	kSecProtocolTypeIMAP = getOSType!("imap"),
+	kSecProtocolTypeLDAP = getOSType!("ldap"),
+	kSecProtocolTypeAppleTalk = getOSType!("atlk"),
+	kSecProtocolTypeAFP = getOSType!("afp "),
+	kSecProtocolTypeTelnet = getOSType!("teln"),
+	kSecProtocolTypeSSH = getOSType!("ssh "),
+	kSecProtocolTypeFTPS = getOSType!("ftps"),
+	kSecProtocolTypeHTTPS = getOSType!("htps"),
+	kSecProtocolTypeHTTPProxy = getOSType!("htpx"),
+	kSecProtocolTypeHTTPSProxy = getOSType!("htsx"),
+	kSecProtocolTypeFTPProxy = getOSType!("ftpx"),
+	kSecProtocolTypeCIFS = getOSType!("cifs"),
+	kSecProtocolTypeSMB = getOSType!("smb "),
+	kSecProtocolTypeRTSP = getOSType!("rtsp"),
+	kSecProtocolTypeRTSPProxy = getOSType!("rtsx"),
+	kSecProtocolTypeDAAP = getOSType!("daap"),
+	kSecProtocolTypeEPPC = getOSType!("eppc"),
+	kSecProtocolTypeIPP = getOSType!("ipp "),
+	kSecProtocolTypeNNTPS = getOSType!("ntps"),
+	kSecProtocolTypeLDAPS = getOSType!("ldps"),
+	kSecProtocolTypeTelnetS = getOSType!("tels"),
+	kSecProtocolTypeIMAPS = getOSType!("imps"),
+	kSecProtocolTypeIRCS = getOSType!("ircs"),
+	kSecProtocolTypePOP3S = getOSType!("pops"),
+	kSecProtocolTypeCVSpserver = getOSType!("cvsp"),
+	kSecProtocolTypeSVN = getOSType!("svn "),
+	kSecProtocolTypeAny = 0
+}
+
+enum
+{
+	kSecLockEvent = 1,
+	kSecUnlockEvent = 2,
+	kSecAddEvent = 3,
+	kSecDeleteEvent = 4,
+	kSecUpdateEvent = 5,
+	kSecPasswordChangedEvent = 6,
+	kSecDefaultChangedEvent = 9,
+	kSecDataAccessEvent = 10,
+	kSecKeychainListChangedEvent = 11,
+	kSecTrustSettingsChangedEvent = 12
+}
+
+enum
+{
+	kSecLockEventMask = 1 << kSecLockEvent,
+	kSecUnlockEventMask = 1 << kSecUnlockEvent,
+	kSecAddEventMask = 1 << kSecAddEvent,
+	kSecDeleteEventMask = 1 << kSecDeleteEvent,
+	kSecUpdateEventMask = 1 << kSecUpdateEvent,
+	kSecPasswordChangedEventMask = 1 << kSecPasswordChangedEvent,
+	kSecDefaultChangedEventMask = 1 << kSecDefaultChangedEvent,
+	kSecDataAccessEventMask = 1 << kSecDataAccessEvent,
+	kSecKeychainListChangedMask = 1 << kSecKeychainListChangedEvent,
+	kSecTrustSettingsChangedEventMask = 1 << kSecTrustSettingsChangedEvent,
+	kSecEveryEventMask = 0xffffffff
+}
+
+enum SecPreferencesDomain
+{
+	kSecPreferencesDomainUser,
+	kSecPreferencesDomainSystem,
+	kSecPreferencesDomainCommon,
+	kSecPreferencesDomainDynamic
+}
+
+struct SecKeychainSettings
+{
+	uint version_;
+	ubyte lockOnSleep;
+	ubyte useLockInterval;
+	uint lockInterval;
+}
+
+
+struct SecKeychainCallbackInfo
+{
+	uint version_;
+	SecKeychainItemRef item;
+	SecKeychainRef keychain;
+	int pid;
+}
+
+extern (C)
+{
+	uint SecKeychainGetTypeID ();
+	int SecKeychainGetVersion (uint* returnVers);
+	int SecKeychainOpen (char* pathName, SecKeychainRef* keychain);
+	int SecKeychainCreate (char* pathName, uint passwordLength, void* password, ubyte promptUser, SecAccessRef initialAccess, SecKeychainRef* keychain);
+	int SecKeychainDelete (SecKeychainRef keychainOrArray);
+	int SecKeychainSetSettings (SecKeychainRef keychain, SecKeychainSettings* newSettings);
+	int SecKeychainCopySettings (SecKeychainRef keychain, SecKeychainSettings* outSettings);
+	int SecKeychainUnlock (SecKeychainRef keychain, uint passwordLength, void* password, ubyte usePassword);
+	int SecKeychainLock (SecKeychainRef keychain);
+	int SecKeychainLockAll ();
+	int SecKeychainCopyDefault (SecKeychainRef* keychain);
+	int SecKeychainSetDefault (SecKeychainRef keychain);
+	int SecKeychainCopySearchList (CFArrayRef* searchList);
+	int SecKeychainSetSearchList (CFArrayRef searchList);
+	int SecKeychainCopyDomainDefault (int domain, SecKeychainRef* keychain);
+	int SecKeychainSetDomainDefault (int domain, SecKeychainRef keychain);
+	int SecKeychainCopyDomainSearchList (int domain, CFArrayRef* searchList);
+	int SecKeychainSetDomainSearchList (int domain, CFArrayRef searchList);
+	int SecKeychainSetPreferenceDomain (int domain);
+	int SecKeychainGetPreferenceDomain (SecPreferencesDomain* domain);
+	int SecKeychainGetStatus (SecKeychainRef keychain, SecKeychainStatus* keychainStatus);
+	int SecKeychainGetPath (SecKeychainRef keychain, uint* ioPathLength, char* pathName);
+	int SecKeychainAttributeInfoForItemID (SecKeychainRef keychain, uint itemID, SecKeychainAttributeInfo** info);
+	int SecKeychainFreeAttributeInfo (SecKeychainAttributeInfo* info);
+	int SecKeychainAddCallback (SecKeychainCallback callbackFunction, uint eventMask, void* userContext);
+	int SecKeychainRemoveCallback (SecKeychainCallback callbackFunction);
+	int SecKeychainAddInternetPassword (SecKeychainRef keychain, uint serverNameLength, char* serverName, uint securityDomainLength, char* securityDomain, uint accountNameLength, char* accountName, uint pathLength, char* path, ushort port, uint protocol, uint authenticationType, uint passwordLength, void* passwordData, SecKeychainItemRef* itemRef);
+	int SecKeychainFindInternetPassword (CFTypeRef keychainOrArray, uint serverNameLength, char* serverName, uint securityDomainLength, char* securityDomain, uint accountNameLength, char* accountName, uint pathLength, char* path, ushort port, uint protocol, uint authenticationType, uint* passwordLength, void** passwordData, SecKeychainItemRef* itemRef);
+	int SecKeychainAddGenericPassword (SecKeychainRef keychain, uint serviceNameLength, char* serviceName, uint accountNameLength, char* accountName, uint passwordLength, void* passwordData, SecKeychainItemRef* itemRef);
+	int SecKeychainFindGenericPassword (CFTypeRef keychainOrArray, uint serviceNameLength, char* serviceName, uint accountNameLength, char* accountName, uint* passwordLength, void** passwordData, SecKeychainItemRef* itemRef);
+	int SecKeychainSetUserInteractionAllowed (ubyte state);
+	int SecKeychainGetUserInteractionAllowed (char* state);
+	int SecKeychainGetCSPHandle (SecKeychainRef keychain, CSSM_CSP_HANDLE* cspHandle);
+	int SecKeychainGetDLDBHandle (SecKeychainRef keychain, CSSM_DL_DB_HANDLE* dldbHandle);
+	int SecKeychainCopyAccess (SecKeychainRef keychain, SecAccessRef* access);
+	int SecKeychainSetAccess (SecKeychainRef keychain, SecAccessRef access);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecKeychainItem.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,116 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecKeychainItem;
+
+import dstep.objc.bridge.TypeEncoding;
+import dstep.security.SecBase;
+import dstep.security.cssmapple;
+import dstep.security.cssmtype;
+
+alias uint SecItemClass;
+alias uint SecItemAttr;
+
+// This is needed otherwise the enums will fail compiling with gdc
+version (GNU)
+{
+	private
+	{
+		const __kSecInternetPasswordItemClass = getOSType!("inet");
+		const __kSecGenericPasswordItemClass = getOSType!("genp");
+		const __kSecAppleSharePasswordItemClass = getOSType!("ashp");
+		const __kSecCreationDateItemAttr = getOSType!("cdat");
+		const __kSecModDateItemAttr = getOSType!("mdat");
+		const __kSecDescriptionItemAttr = getOSType!("desc");
+		const __kSecCommentItemAttr = getOSType!("icmt");
+		const __kSecCreatorItemAttr = getOSType!("crtr");
+		const __kSecTypeItemAttr = getOSType!("type");
+		const __kSecScriptCodeItemAttr = getOSType!("scrp");
+		const __kSecLabelItemAttr = getOSType!("labl");
+		const __kSecInvisibleItemAttr = getOSType!("invi");
+		const __kSecNegativeItemAttr = getOSType!("nega");
+		const __kSecCustomIconItemAttr = getOSType!("cusi");
+		const __kSecAccountItemAttr = getOSType!("acct");
+		const __kSecServiceItemAttr = getOSType!("svce");
+		const __kSecGenericItemAttr = getOSType!("gena");
+		const __kSecSecurityDomainItemAttr = getOSType!("sdmn");
+		const __kSecServerItemAttr = getOSType!("srvr");
+		const __kSecAuthenticationTypeItemAttr = getOSType!("atyp");
+		const __kSecPortItemAttr = getOSType!("port");
+		const __kSecPathItemAttr = getOSType!("path");
+		const __kSecVolumeItemAttr = getOSType!("vlme");
+		const __kSecAddressItemAttr = getOSType!("addr");
+		const __kSecSignatureItemAttr = getOSType!("ssig");
+		const __kSecProtocolItemAttr = getOSType!("ptcl");
+		const __kSecCertificateType = getOSType!("ctyp");
+		const __kSecCertificateEncoding = getOSType!("cenc");
+		const __kSecCrlType = getOSType!("crtp");
+		const __kSecCrlEncoding = getOSType!("crnc");
+		const __kSecAlias = getOSType!("alis");
+	}
+}
+
+enum
+{
+	kSecInternetPasswordItemClass = getOSType!("inet"),
+	kSecGenericPasswordItemClass = getOSType!("genp"),
+	kSecAppleSharePasswordItemClass = getOSType!("ashp"),
+	kSecCertificateItemClass = CSSM_DL_DB_RECORD_X509_CERTIFICATE,
+	kSecPublicKeyItemClass = CSSM_DL_DB_RECORD_PUBLIC_KEY,
+	kSecPrivateKeyItemClass = CSSM_DL_DB_RECORD_PRIVATE_KEY,
+	kSecSymmetricKeyItemClass = CSSM_DL_DB_RECORD_SYMMETRIC_KEY
+}
+
+enum
+{
+	kSecCreationDateItemAttr = getOSType!("cdat"),
+	kSecModDateItemAttr = getOSType!("mdat"),
+	kSecDescriptionItemAttr = getOSType!("desc"),
+	kSecCommentItemAttr = getOSType!("icmt"),
+	kSecCreatorItemAttr = getOSType!("crtr"),
+	kSecTypeItemAttr = getOSType!("type"),
+	kSecScriptCodeItemAttr = getOSType!("scrp"),
+	kSecLabelItemAttr = getOSType!("labl"),
+	kSecInvisibleItemAttr = getOSType!("invi"),
+	kSecNegativeItemAttr = getOSType!("nega"),
+	kSecCustomIconItemAttr = getOSType!("cusi"),
+	kSecAccountItemAttr = getOSType!("acct"),
+	kSecServiceItemAttr = getOSType!("svce"),
+	kSecGenericItemAttr = getOSType!("gena"),
+	kSecSecurityDomainItemAttr = getOSType!("sdmn"),
+	kSecServerItemAttr = getOSType!("srvr"),
+	kSecAuthenticationTypeItemAttr = getOSType!("atyp"),
+	kSecPortItemAttr = getOSType!("port"),
+	kSecPathItemAttr = getOSType!("path"),
+	kSecVolumeItemAttr = getOSType!("vlme"),
+	kSecAddressItemAttr = getOSType!("addr"),
+	kSecSignatureItemAttr = getOSType!("ssig"),
+	kSecProtocolItemAttr = getOSType!("ptcl"),
+	kSecCertificateType = getOSType!("ctyp"),
+	kSecCertificateEncoding = getOSType!("cenc"),
+	kSecCrlType = getOSType!("crtp"),
+	kSecCrlEncoding = getOSType!("crnc"),
+	kSecAlias = getOSType!("alis")
+}
+
+extern (C)
+{
+	uint SecKeychainItemGetTypeID ();
+	int SecKeychainItemModifyAttributesAndData (SecKeychainItemRef itemRef, SecKeychainAttributeList* attrList, uint length, void* data);
+	int SecKeychainItemCreateFromContent (uint itemClass, SecKeychainAttributeList* attrList, uint length, void* data, SecKeychainRef keychainRef, SecAccessRef initialAccess, SecKeychainItemRef* itemRef);
+	int SecKeychainItemModifyContent (SecKeychainItemRef itemRef, SecKeychainAttributeList* attrList, uint length, void* data);
+	int SecKeychainItemCopyContent (SecKeychainItemRef itemRef, SecItemClass* itemClass, SecKeychainAttributeList* attrList, uint* length, void** outData);
+	int SecKeychainItemFreeContent (SecKeychainAttributeList* attrList, void* data);
+	int SecKeychainItemCopyAttributesAndData (SecKeychainItemRef itemRef, SecKeychainAttributeInfo* info, SecItemClass* itemClass, SecKeychainAttributeList** attrList, uint* length, void** outData);
+	int SecKeychainItemFreeAttributesAndData (SecKeychainAttributeList* attrList, void* data);
+	int SecKeychainItemDelete (SecKeychainItemRef itemRef);
+	int SecKeychainItemCopyKeychain (SecKeychainItemRef itemRef, SecKeychainRef* keychainRef);
+	int SecKeychainItemCreateCopy (SecKeychainItemRef itemRef, SecKeychainRef destKeychainRef, SecAccessRef initialAccess, SecKeychainItemRef* itemCopy);
+	int SecKeychainItemGetDLDBHandle (SecKeychainItemRef keyItemRef, CSSM_DL_DB_HANDLE* dldbHandle);
+	int SecKeychainItemGetUniqueRecordID (SecKeychainItemRef itemRef, CSSM_DB_UNIQUE_RECORD** uniqueRecordID);
+	int SecKeychainItemCopyAccess (SecKeychainItemRef itemRef, SecAccessRef* access);
+	int SecKeychainItemSetAccess (SecKeychainItemRef itemRef, SecAccessRef access);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecKeychainSearch.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,18 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecKeychainSearch;
+
+import dstep.corefoundation.CFBase;
+import dstep.security.SecBase;
+import dstep.security.SecKeychainItem;
+
+extern (C)
+{
+	uint SecKeychainSearchGetTypeID ();
+	int SecKeychainSearchCreateFromAttributes (CFTypeRef keychainOrArray, uint itemClass, SecKeychainAttributeList* attrList, SecKeychainSearchRef* searchRef);
+	int SecKeychainSearchCopyNext (SecKeychainSearchRef searchRef, SecKeychainItemRef* itemRef);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecPolicy.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,19 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecPolicy;
+
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+extern (C)
+{
+	uint SecPolicyGetTypeID ();
+	int SecPolicyGetOID (SecPolicyRef policyRef, CSSM_OID* oid);
+	int SecPolicyGetValue (SecPolicyRef policyRef, CSSM_DATA* value);
+	int SecPolicySetValue (SecPolicyRef policyRef, CSSM_DATA* value);
+	int SecPolicyGetTPHandle (SecPolicyRef policyRef, CSSM_TP_HANDLE* tpHandle);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecPolicySearch.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,21 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecPolicySearch;
+
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+struct OpaquePolicySearchRef;
+
+alias OpaquePolicySearchRef* SecPolicySearchRef;
+
+extern (C)
+{
+	uint SecPolicySearchGetTypeID ();
+	int SecPolicySearchCreate (uint certType, CSSM_OID* policyOID, CSSM_DATA* value, SecPolicySearchRef* searchRef);
+	int SecPolicySearchCopyNext (SecPolicySearchRef searchRef, SecPolicyRef* policyRef);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecTrust.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,51 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecTrust;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CoreFoundation;
+import dstep.coreservices.carboncore.MacTypes : OSStatus;
+import dstep.security.SecBase;
+import dstep.security.cssmapple;
+import dstep.security.cssmtype;
+
+alias int SecTrustUserSetting;
+alias OpaqueSecTrustRef* SecTrustRef;
+
+enum SecTrustResultType
+{
+	kSecTrustResultInvalid,
+	kSecTrustResultProceed,
+	kSecTrustResultConfirm,
+	kSecTrustResultDeny,
+	kSecTrustResultUnspecified,
+	kSecTrustResultRecoverableTrustFailure,
+	kSecTrustResultFatalTrustFailure,
+	kSecTrustResultOtherError
+}
+
+extern (C)
+{
+	uint SecTrustGetTypeID ();
+	int SecTrustCreateWithCertificates (CFArrayRef certificates, CFTypeRef policies, SecTrustRef* trustRef);
+	int SecTrustSetPolicies (SecTrustRef trust, CFTypeRef policies);
+	int SecTrustSetParameters (SecTrustRef trustRef, uint action, CFDataRef actionData);
+	int SecTrustSetAnchorCertificates (SecTrustRef trust, CFArrayRef anchorCertificates);
+	int SecTrustSetKeychains (SecTrustRef trust, CFTypeRef keychainOrArray);
+	int SecTrustSetVerifyDate (SecTrustRef trust, CFDateRef verifyDate);
+	int SecTrustEvaluate (SecTrustRef trust, SecTrustResultType* result);
+	int SecTrustGetResult (SecTrustRef trustRef, SecTrustResultType* result, CFArrayRef* certChain, CSSM_TP_APPLE_EVIDENCE_INFO** statusChain);
+	int SecTrustGetCssmResult (SecTrustRef trust, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR* result);
+	int SecTrustGetCssmResultCode (SecTrustRef trust, OSStatus* resultCode);
+	int SecTrustGetTPHandle (SecTrustRef trust, CSSM_TP_HANDLE* handle);
+	int SecTrustCopyPolicies (SecTrustRef trust, CFArrayRef* policies);
+	int SecTrustCopyCustomAnchorCertificates (SecTrustRef trust, CFArrayRef* anchors);
+	int SecTrustCopyAnchorCertificates (CFArrayRef* anchors);
+	int SecTrustGetCSSMAnchorCertificates (CSSM_DATA** cssmAnchors, uint* cssmAnchorCount);
+	int SecTrustGetUserTrust (SecCertificateRef certificate, SecPolicyRef policy, SecTrustUserSetting* trustSetting);
+	int SecTrustSetUserTrust (SecCertificateRef certificate, SecPolicyRef policy, int trustSetting);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecTrustSettings.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,56 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecTrustSettings;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.SecBase;
+import dstep.security.SecCertificate;
+import dstep.security.SecKeychain;
+import dstep.security.SecPolicy;
+import dstep.security.cssmtype;
+
+alias uint SecTrustSettingsKeyUsage;
+alias uint SecTrustSettingsResult;
+alias uint SecTrustSettingsDomain;
+
+enum
+{
+	kSecTrustSettingsKeyUseSignature = 0x00000001,
+	kSecTrustSettingsKeyUseEnDecryptData = 0x00000002,
+	kSecTrustSettingsKeyUseEnDecryptKey = 0x00000004,
+	kSecTrustSettingsKeyUseSignCert = 0x00000008,
+	kSecTrustSettingsKeyUseSignRevocation = 0x00000010,
+	kSecTrustSettingsKeyUseKeyExchange = 0x00000020,
+	kSecTrustSettingsKeyUseAny = 0xffffffff
+}
+
+enum
+{
+	kSecTrustSettingsResultInvalid = 0,
+	kSecTrustSettingsResultTrustRoot,
+	kSecTrustSettingsResultTrustAsRoot,
+	kSecTrustSettingsResultDeny,
+	kSecTrustSettingsResultUnspecified
+}
+
+enum
+{
+	kSecTrustSettingsDomainUser = 0,
+	kSecTrustSettingsDomainAdmin,
+	kSecTrustSettingsDomainSystem
+}
+
+extern (C)
+{
+	int SecTrustSettingsCopyTrustSettings (SecCertificateRef certRef, uint domain, CFArrayRef* trustSettings);
+	int SecTrustSettingsSetTrustSettings (SecCertificateRef certRef, uint domain, CFTypeRef trustSettingsDictOrArray);
+	int SecTrustSettingsRemoveTrustSettings (SecCertificateRef certRef, uint domain);
+	int SecTrustSettingsCopyCertificates (uint domain, CFArrayRef* certArray);
+	int SecTrustSettingsCopyModificationDate (SecCertificateRef certRef, uint domain, CFDateRef* modificationDate);
+	int SecTrustSettingsCreateExternalRepresentation (uint domain, CFDataRef* trustSettings);
+	int SecTrustSettingsImportExternalRepresentation (uint domain, CFDataRef trustSettings);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecTrustedApplication.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,18 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecTrustedApplication;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.SecBase;
+
+extern (C)
+{
+	uint SecTrustedApplicationGetTypeID ();
+	int SecTrustedApplicationCreateFromPath (char* path, SecTrustedApplicationRef* app);
+	int SecTrustedApplicationCopyData (SecTrustedApplicationRef appRef, CFDataRef* data);
+	int SecTrustedApplicationSetData (SecTrustedApplicationRef appRef, CFDataRef data);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecureDownload.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,47 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecureDownload;
+
+import dstep.corefoundation.CoreFoundation;
+import dstep.security.SecBase;
+import dstep.security.SecTrust;
+
+struct OpaqueSecureDownload;
+
+alias OpaqueSecureDownload* SecureDownloadRef;
+
+extern (C)
+{
+	alias int function (SecTrustRef, int, void*) SecureDownloadTrustEvaluateCallback;
+	alias int function (SecTrustRef, void*) SecureDownloadTrustSetupCallback;
+}
+
+enum
+{
+	errSecureDownloadInvalidTicket = -20052,
+	errSecureDownloadInvalidDownload = -20053
+}
+
+enum _SecureDownloadTrustCallbackResult
+{
+	kSecureDownloadDoNotEvaluateSigner = 0,
+	kSecureDownloadEvaluateSigner = 1,
+	kSecureDownloadFailEvaluation = 2
+}
+
+extern (C)
+{
+	int SecureDownloadCreateWithTicket (CFDataRef ticket, SecureDownloadTrustSetupCallback setup, void* setupContext, SecureDownloadTrustEvaluateCallback evaluate, void* evaluateContext, SecureDownloadRef* downloadRef);
+	int SecureDownloadCopyURLs (SecureDownloadRef downloadRef, CFArrayRef* urls);
+	int SecureDownloadCopyName (SecureDownloadRef downloadRef, CFStringRef* name);
+	int SecureDownloadCopyCreationDate (SecureDownloadRef downloadRef, CFDateRef* date);
+	int SecureDownloadGetDownloadSize (SecureDownloadRef downloadRef, long* downloadSize);
+	int SecureDownloadUpdateWithData (SecureDownloadRef downloadRef, CFDataRef data);
+	int SecureDownloadFinished (SecureDownloadRef downloadRef);
+	int SecureDownloadRelease (SecureDownloadRef downloadRef);
+	int SecureDownloadCopyTicketLocation (CFURLRef url, CFURLRef* ticketLocation);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecureTransport.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,168 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecureTransport;
+
+//import dstep.AvailabilityMacros;
+import dstep.corefoundation.CFArray;
+import dstep.corefoundation.CFBase;
+import dstep.coreservices.carboncore.MacTypes : OSStatus;
+import dstep.security.CipherSuite;
+//import dstep.sys.types;
+
+struct SSLContext;
+
+alias SSLContext* SSLContextRef;
+alias void* SSLConnectionRef;
+
+extern (C)
+{
+	alias OSStatus function (SSLConnectionRef connection, /*const*/ void *data,size_t* dataLength) SSLWriteFunc;
+	alias OSStatus function (SSLConnectionRef connection, void* data, size_t dataLength) SSLReadFunc;
+}
+
+enum SSLProtocol
+{
+	kSSLProtocolUnknown,
+	kSSLProtocol2,
+	kSSLProtocol3,
+	kSSLProtocol3Only,
+	kTLSProtocol1,
+	kTLSProtocol1Only,
+	kSSLProtocolAll
+}
+
+enum SSLSessionState
+{
+	kSSLIdle,
+	kSSLHandshake,
+	kSSLConnected,
+	kSSLClosed,
+	kSSLAborted
+}
+
+enum SSLClientCertificateState
+{
+	kSSLClientCertNone,
+	kSSLClientCertRequested,
+	kSSLClientCertSent,
+	kSSLClientCertRejected
+}
+
+enum
+{
+	errSSLProtocol = -9800,
+	errSSLNegotiation = -9801,
+	errSSLFatalAlert = -9802,
+	errSSLWouldBlock = -9803,
+	errSSLSessionNotFound = -9804,
+	errSSLClosedGraceful = -9805,
+	errSSLClosedAbort = -9806,
+	errSSLXCertChainInvalid = -9807,
+	errSSLBadCert = -9808,
+	errSSLCrypto = -9809,
+	errSSLInternal = -9810,
+	errSSLModuleAttach = -9811,
+	errSSLUnknownRootCert = -9812,
+	errSSLNoRootCert = -9813,
+	errSSLCertExpired = -9814,
+	errSSLCertNotYetValid = -9815,
+	errSSLClosedNoNotify = -9816,
+	errSSLBufferOverflow = -9817,
+	errSSLBadCipherSuite = -9818,
+	errSSLPeerUnexpectedMsg = -9819,
+	errSSLPeerBadRecordMac = -9820,
+	errSSLPeerDecryptionFail = -9821,
+	errSSLPeerRecordOverflow = -9822,
+	errSSLPeerDecompressFail = -9823,
+	errSSLPeerHandshakeFail = -9824,
+	errSSLPeerBadCert = -9825,
+	errSSLPeerUnsupportedCert = -9826,
+	errSSLPeerCertRevoked = -9827,
+	errSSLPeerCertExpired = -9828,
+	errSSLPeerCertUnknown = -9829,
+	errSSLIllegalParam = -9830,
+	errSSLPeerUnknownCA = -9831,
+	errSSLPeerAccessDenied = -9832,
+	errSSLPeerDecodeError = -9833,
+	errSSLPeerDecryptError = -9834,
+	errSSLPeerExportRestriction = -9835,
+	errSSLPeerProtocolVersion = -9836,
+	errSSLPeerInsufficientSecurity = -9837,
+	errSSLPeerInternalError = -9838,
+	errSSLPeerUserCancelled = -9839,
+	errSSLPeerNoRenegotiation = -9840,
+	errSSLHostNameMismatch = -9843,
+	errSSLConnectionRefused = -9844,
+	errSSLDecryptionFail = -9845,
+	errSSLBadRecordMac = -9846,
+	errSSLRecordOverflow = -9847,
+	errSSLBadConfiguration = -9848,
+	errSSLLast = -9849
+}
+
+enum
+{
+	kNeverAuthenticate,
+	kAlwaysAuthenticate,
+	kTryAuthenticate
+}
+
+extern (C)
+{
+	int SSLNewContext (ubyte isServer, SSLContextRef* contextPtr);
+	int SSLDisposeContext (SSLContextRef context);
+	int SSLGetSessionState (SSLContextRef context, SSLSessionState* state);
+	int SSLSetIOFuncs (SSLContextRef context, SSLReadFunc read, SSLWriteFunc write);
+	int SSLSetProtocolVersionEnabled (SSLContextRef context, int protocol, ubyte enable);
+	int SSLGetProtocolVersionEnabled (SSLContextRef context, int protocol, char* enable);
+	int SSLSetProtocolVersion (SSLContextRef context, int version_);
+	int SSLGetProtocolVersion (SSLContextRef context, SSLProtocol* protocol);
+	int SSLSetCertificate (SSLContextRef context, CFArrayRef certRefs);
+	int SSLSetConnection (SSLContextRef context, SSLConnectionRef connection);
+	int SSLGetConnection (SSLContextRef context, SSLConnectionRef* connection);
+	int SSLSetPeerDomainName (SSLContextRef context, char* peerName, uint peerNameLen);
+	int SSLGetPeerDomainNameLength (SSLContextRef context, size_t* peerNameLen);
+	int SSLGetPeerDomainName (SSLContextRef context, char* peerName, size_t* peerNameLen);
+	int SSLGetNegotiatedProtocolVersion (SSLContextRef context, SSLProtocol* protocol);
+	int SSLGetNumberSupportedCiphers (SSLContextRef context, size_t* numCiphers);
+	int SSLGetSupportedCiphers (SSLContextRef context, SSLCipherSuite* ciphers, size_t* numCiphers);
+	int SSLSetEnabledCiphers (SSLContextRef context, SSLCipherSuite* ciphers, uint numCiphers);
+	int SSLGetNumberEnabledCiphers (SSLContextRef context, size_t* numCiphers);
+	int SSLGetEnabledCiphers (SSLContextRef context, SSLCipherSuite* ciphers, size_t* numCiphers);
+	int SSLSetEnableCertVerify (SSLContextRef context, ubyte enableVerify);
+	int SSLGetEnableCertVerify (SSLContextRef context, char* enableVerify);
+	int SSLSetAllowsExpiredCerts (SSLContextRef context, ubyte allowsExpired);
+	int SSLGetAllowsExpiredCerts (SSLContextRef context, char* allowsExpired);
+	int SSLSetAllowsExpiredRoots (SSLContextRef context, ubyte allowsExpired);
+	int SSLGetAllowsExpiredRoots (SSLContextRef context, char* allowsExpired);
+	int SSLSetAllowsAnyRoot (SSLContextRef context, ubyte anyRoot);
+	int SSLGetAllowsAnyRoot (SSLContextRef context, char* anyRoot);
+	int SSLSetTrustedRoots (SSLContextRef context, CFArrayRef trustedRoots, ubyte replaceExisting);
+	int SSLGetTrustedRoots (SSLContextRef context, CFArrayRef* trustedRoots);
+	int SSLCopyTrustedRoots (SSLContextRef context, CFArrayRef* trustedRoots);
+	int SSLGetPeerCertificates (SSLContextRef context, CFArrayRef* certs);
+	int SSLCopyPeerCertificates (SSLContextRef context, CFArrayRef* certs);
+	int SSLSetPeerID (SSLContextRef context, void* peerID, uint peerIDLen);
+	int SSLGetPeerID (SSLContextRef context, void** peerID, size_t* peerIDLen);
+	int SSLGetNegotiatedCipher (SSLContextRef context, SSLCipherSuite* cipherSuite);
+	int SSLSetEncryptionCertificate (SSLContextRef context, CFArrayRef certRefs);
+	int SSLSetClientSideAuthenticate (SSLContextRef context, int auth);
+	int SSLAddDistinguishedName (SSLContextRef context, void* derDN, uint derDNLen);
+	int SSLSetCertificateAuthorities (SSLContextRef context, CFTypeRef certificateOrArray, ubyte replaceExisting);
+	int SSLCopyCertificateAuthorities (SSLContextRef context, CFArrayRef* certificates);
+	int SSLCopyDistinguishedNames (SSLContextRef context, CFArrayRef* names);
+	int SSLGetClientCertificateState (SSLContextRef context, SSLClientCertificateState* clientState);
+	int SSLSetDiffieHellmanParams (SSLContextRef context, void* dhParams, uint dhParamsLen);
+	int SSLGetDiffieHellmanParams (SSLContextRef context, void** dhParams, size_t* dhParamsLen);
+	int SSLSetRsaBlinding (SSLContextRef context, ubyte blinding);
+	int SSLGetRsaBlinding (SSLContextRef context, char* blinding);
+	int SSLHandshake (SSLContextRef context);
+	int SSLWrite (SSLContextRef context, void* data, uint dataLength, size_t* processed);
+	int SSLRead (SSLContextRef context, void* data, uint dataLength, size_t* processed);
+	int SSLGetBufferedReadSize (SSLContextRef context, size_t* bufSize);
+	int SSLClose (SSLContextRef context);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/Security.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,57 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.Security;
+
+public:
+
+import dstep.security.Authorization;
+import dstep.security.AuthorizationDB;
+import dstep.security.AuthorizationTags;
+import dstep.security.CipherSuite;
+import dstep.security.SecACL;
+import dstep.security.SecAccess;
+import dstep.security.SecBase;
+import dstep.security.SecCertificate;
+import dstep.security.SecIdentity;
+import dstep.security.SecIdentitySearch;
+import dstep.security.SecImportExport;
+import dstep.security.SecKey;
+import dstep.security.SecKeychain;
+import dstep.security.SecKeychainItem;
+import dstep.security.SecKeychainSearch;
+import dstep.security.SecPolicy;
+import dstep.security.SecPolicySearch;
+import dstep.security.SecTrust;
+import dstep.security.SecTrustSettings;
+import dstep.security.SecTrustedApplication;
+import dstep.security.SecureTransport;
+import dstep.security.certextensions;
+import dstep.security.cssm;
+import dstep.security.cssmaci;
+import dstep.security.cssmapi;
+import dstep.security.cssmapple;
+import dstep.security.cssmcli;
+import dstep.security.cssmconfig;
+import dstep.security.cssmcspi;
+import dstep.security.cssmdli;
+import dstep.security.cssmerr;
+import dstep.security.cssmkrapi;
+import dstep.security.cssmkrspi;
+import dstep.security.cssmspi;
+import dstep.security.cssmtpi;
+import dstep.security.cssmtype;
+import dstep.security.emmspi;
+import dstep.security.emmtype;
+import dstep.security.mds;
+import dstep.security.mds_schema;
+import dstep.security.oidsalg;
+import dstep.security.oidsattr;
+import dstep.security.oidsbase;
+import dstep.security.oidscert;
+import dstep.security.oidscrl;
+import dstep.security.x509defs;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/certextensions.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,235 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.certextensions;
+
+import dstep.security.cssmtype;
+import dstep.security.x509defs;
+
+alias CSSM_DATA CE_SubjectKeyID;
+alias ushort CE_KeyUsage;
+alias uint CE_CrlReason;
+alias ushort CE_NetscapeCertType;
+alias ubyte CE_CrlDistReasonFlags;
+alias CE_GeneralNames CE_NameRegistrationAuthorities;
+alias uint CE_CrlNumber;
+alias uint CE_DeltaCrl;
+
+enum
+{
+	GNT_OtherName = 0,
+	GNT_RFC822Name,
+	GNT_DNSName,
+	GNT_X400Address,
+	GNT_DirectoryName,
+	GNT_EdiPartyName,
+	GNT_URI,
+	GNT_IPAddress,
+	GNT_RegisteredID
+}
+
+enum CE_CrlDistributionPointNameType
+{
+	CE_CDNT_FullName,
+	CE_CDNT_NameRelativeToCrlIssuer
+}
+
+enum CE_DataType
+{
+	DT_AuthorityKeyID,
+	DT_SubjectKeyID,
+	DT_KeyUsage,
+	DT_SubjectAltName,
+	DT_IssuerAltName,
+	DT_ExtendedKeyUsage,
+	DT_BasicConstraints,
+	DT_CertPolicies,
+	DT_NetscapeCertType,
+	DT_CrlNumber,
+	DT_DeltaCrl,
+	DT_CrlReason,
+	DT_CrlDistributionPoints,
+	DT_IssuingDistributionPoint,
+	DT_AuthorityInfoAccess,
+	DT_Other,
+	DT_QC_Statements
+}
+
+struct CE_OtherName
+{
+	CSSM_OID typeId;
+	CSSM_DATA value;
+}
+
+
+struct CE_GeneralName
+{
+	int nameType;
+	int berEncoded;
+	CSSM_DATA name;
+}
+
+
+struct CE_GeneralNames
+{
+	uint numNames;
+	CE_GeneralName* generalName;
+}
+
+
+struct CE_AuthorityKeyID
+{
+	int keyIdentifierPresent;
+	CSSM_DATA keyIdentifier;
+	int generalNamesPresent;
+	CE_GeneralNames* generalNames;
+	int serialNumberPresent;
+	CSSM_DATA serialNumber;
+}
+
+
+struct CE_ExtendedKeyUsage
+{
+	uint numPurposes;
+	CSSM_OID_PTR purposes;
+}
+
+
+struct CE_BasicConstraints
+{
+	int cA;
+	int pathLenConstraintPresent;
+	uint pathLenConstraint;
+}
+
+
+struct CE_PolicyQualifierInfo
+{
+	CSSM_OID policyQualifierId;
+	CSSM_DATA qualifier;
+}
+
+
+struct CE_PolicyInformation
+{
+	CSSM_OID certPolicyId;
+	uint numPolicyQualifiers;
+	CE_PolicyQualifierInfo* policyQualifiers;
+}
+
+
+struct CE_CertPolicies
+{
+	uint numPolicies;
+	CE_PolicyInformation* policies;
+}
+
+
+struct CE_DistributionPointName
+{
+	CE_CrlDistributionPointNameType nameType;
+	
+	union
+	{
+		CE_GeneralNames* fullName;
+		CSSM_X509_RDN_PTR rd;
+	}
+}
+
+
+struct CE_CRLDistributionPoint
+{
+	int distPointName;
+	ubyte reasonsPresent;
+	CE_CrlDistReasonFlags reasons;
+	CE_GeneralNames* crlIssuer;
+}
+
+
+struct CE_CRLDistPointsSyntax
+{
+	uint numDistPoints;
+	CE_CRLDistributionPoint* distPoints;
+}
+
+
+struct CE_AccessDescription
+{
+	CSSM_OID accessMethod;
+	CE_GeneralName accessLocation;
+}
+
+
+struct CE_AuthorityInfoAccess
+{
+	uint numAccessDescriptions;
+	CE_AccessDescription* accessDescriptions;
+}
+
+
+struct CE_SemanticsInformation
+{
+	CSSM_OID* semanticsIdentifier;
+	CE_NameRegistrationAuthorities* nameRegistrationAuthorities;
+}
+
+
+struct CE_QC_Statement
+{
+	CSSM_OID statementId;
+	CE_SemanticsInformation* semanticsInfo;
+	CSSM_DATA* otherInfo;
+}
+
+
+struct CE_QC_Statements
+{
+	uint numQCStatements;
+	CE_QC_Statement* qcStatements;
+}
+
+
+struct CE_IssuingDistributionPoint
+{
+	int distPointName;
+	int onlyUserCertsPresent;
+	int onlyUserCerts;
+	int onlyCACertsPresent;
+	int onlyCACerts;
+	ubyte onlySomeReasonsPresent;
+	int onlySomeReasons;
+	int indirectCrlPresent;
+	CSSM_BOOL indirectCrl;
+}
+
+
+struct CE_DataAndType
+{
+	CE_DataType type;
+	int extension;
+	CSSM_BOOL critical;
+}
+
+union CE_Data
+{
+	CE_AuthorityKeyID authorityKeyID;
+	CE_SubjectKeyID subjectKeyID;
+	CE_KeyUsage keyUsage;
+	CE_GeneralNames subjectAltName;
+	CE_GeneralNames issuerAltName;
+	CE_ExtendedKeyUsage extendedKeyUsage;
+	CE_BasicConstraints basicConstraints;
+	CE_CertPolicies certPolicies;
+	CE_NetscapeCertType netscapeCertType;
+	CE_CrlNumber crlNumber;
+	CE_DeltaCrl deltaCrl;
+	CE_CrlReason crlReason;
+	CE_CRLDistPointsSyntax crlDistPoints;
+	CE_IssuingDistributionPoint issuingDistPoint;
+	CE_AuthorityInfoAccess authorityInfoAccess;
+	CE_QC_Statements qualifiedCertStatements;
+	CSSM_DATA rawData;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssm.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,16 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssm;
+
+public:
+
+import dstep.security.cssmapi;
+import dstep.security.cssmapple;
+import dstep.security.cssmerr;
+import dstep.security.cssmtype;
+import dstep.security.emmtype;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmaci.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,31 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmaci;
+
+import dstep.security.cssmtype;
+
+struct CSSM_SPI_AC_FUNCS
+{
+	extern (C) int function (CSSM_AC_HANDLE ACHandle,
+							 CSSM_TUPLEGROUP* BaseAuthorizations,
+							 CSSM_TUPLEGROUP* Credentials,
+							 uint NumberOfRequestors,
+							 CSSM_LIST* Requestors,
+							 CSSM_LIST* RequestedAuthorizationPeriod,
+							 CSSM_LIST* RequestedAuthorization,
+							 CSSM_TUPLEGROUP* AuthorizationResult) AuthCompute;
+	
+	extern (C) int function (CSSM_AC_HANDLE ACHandle,
+							 int TPHandle,
+							 ulong CCHandle,
+							 CSSM_DL_DB_LIST* DBList,
+							 uint PassThroughId,
+							 void* InputParams,
+							 void** OutputParams) PassThrough;
+}
+
+alias CSSM_SPI_AC_FUNCS* CSSM_SPI_AC_FUNCS_PTR;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmapi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,195 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmapi;
+
+import dstep.security.cssmconfig;
+import dstep.security.cssmtype;
+
+extern (C)
+{
+	int CSSM_Init (CSSM_VERSION* Version, uint Scope, CSSM_GUID* CallerGuid, uint KeyHierarchy, CSSM_PVC_MODE* PvcPolicy, void* Reserved);
+	int CSSM_Terminate ();
+	int CSSM_ModuleLoad (CSSM_GUID* ModuleGuid, uint KeyHierarchy, CSSM_API_ModuleEventHandler AppNotifyCallback, void* AppNotifyCallbackCtx);
+	int CSSM_ModuleUnload (CSSM_GUID* ModuleGuid, CSSM_API_ModuleEventHandler AppNotifyCallback, void* AppNotifyCallbackCtx);
+	int CSSM_Introduce (CSSM_GUID* ModuleID, uint KeyHierarchy);
+	int CSSM_Unintroduce (CSSM_GUID* ModuleID);
+	int CSSM_ModuleAttach (CSSM_GUID* ModuleGuid, CSSM_VERSION* Version, CSSM_API_MEMORY_FUNCS* MemoryFuncs, uint SubserviceID, uint SubServiceType, uint AttachFlags, uint KeyHierarchy, CSSM_FUNC_NAME_ADDR* FunctionTable, uint NumFunctionTable, void* Reserved, CSSM_MODULE_HANDLE_PTR NewModuleHandle);
+	int CSSM_ModuleDetach (int ModuleHandle);
+	int CSSM_SetPrivilege (ulong Privilege);
+	int CSSM_GetPrivilege (CSSM_PRIVILEGE* Privilege);
+	int CSSM_GetModuleGUIDFromHandle (int ModuleHandle, CSSM_GUID_PTR ModuleGUID);
+	int CSSM_GetSubserviceUIDFromHandle (int ModuleHandle, CSSM_SUBSERVICE_UID_PTR SubserviceUID);
+	int CSSM_ListAttachedModuleManagers (uint* NumberOfModuleManagers, CSSM_GUID_PTR ModuleManagerGuids);
+	int CSSM_GetAPIMemoryFunctions (int AddInHandle, CSSM_API_MEMORY_FUNCS_PTR AppMemoryFuncs);
+	int CSSM_CSP_CreateSignatureContext (int CSPHandle, uint AlgorithmID, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateSymmetricContext (int CSPHandle, uint AlgorithmID, uint Mode, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, CSSM_DATA* InitVector, uint Padding, void* Reserved, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateDigestContext (int CSPHandle, uint AlgorithmID, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateMacContext (int CSPHandle, uint AlgorithmID, CSSM_KEY* Key, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateRandomGenContext (int CSPHandle, uint AlgorithmID, CSSM_CRYPTO_DATA* Seed, uint Length, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateAsymmetricContext (int CSPHandle, uint AlgorithmID, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, uint Padding, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateDeriveKeyContext (int CSPHandle, uint AlgorithmID, uint DeriveKeyType, uint DeriveKeyLengthInBits, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* BaseKey, uint IterationCount, CSSM_DATA* Salt, CSSM_CRYPTO_DATA* Seed, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreateKeyGenContext (int CSPHandle, uint AlgorithmID, uint KeySizeInBits, CSSM_CRYPTO_DATA* Seed, CSSM_DATA* Salt, CSSM_DATE* StartDate, CSSM_DATE* EndDate, CSSM_DATA* Params, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_CSP_CreatePassThroughContext (int CSPHandle, CSSM_KEY* Key, CSSM_CC_HANDLE* NewContextHandle);
+	int CSSM_GetContext (ulong CCHandle, CSSM_CONTEXT_PTR* Context);
+	int CSSM_FreeContext (CSSM_CONTEXT_PTR Context);
+	int CSSM_SetContext (ulong CCHandle, CSSM_CONTEXT* Context);
+	int CSSM_DeleteContext (ulong CCHandle);
+	int CSSM_GetContextAttribute (CSSM_CONTEXT* Context, uint AttributeType, CSSM_CONTEXT_ATTRIBUTE_PTR* ContextAttribute);
+	int CSSM_UpdateContextAttributes (ulong CCHandle, uint NumberOfAttributes, CSSM_CONTEXT_ATTRIBUTE* ContextAttributes);
+	int CSSM_DeleteContextAttributes (ulong CCHandle, uint NumberOfAttributes, CSSM_CONTEXT_ATTRIBUTE* ContextAttributes);
+	int CSSM_CSP_Login (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_DATA* LoginName, void* Reserved);
+	int CSSM_CSP_Logout (int CSPHandle);
+	int CSSM_CSP_GetLoginAcl (int CSPHandle, CSSM_STRING* SelectionTag, uint* NumberOfAclInfos, CSSM_ACL_ENTRY_INFO_PTR* AclInfos);
+	int CSSM_CSP_ChangeLoginAcl (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_ACL_EDIT* AclEdit);
+	int CSSM_GetKeyAcl (int CSPHandle, CSSM_KEY* Key, CSSM_STRING* SelectionTag, uint* NumberOfAclInfos, CSSM_ACL_ENTRY_INFO_PTR* AclInfos);
+	int CSSM_ChangeKeyAcl (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_ACL_EDIT* AclEdit, CSSM_KEY* Key);
+	int CSSM_GetKeyOwner (int CSPHandle, CSSM_KEY* Key, CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
+	int CSSM_ChangeKeyOwner (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, CSSM_ACL_OWNER_PROTOTYPE* NewOwner);
+	int CSSM_CSP_GetLoginOwner (int CSPHandle, CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
+	int CSSM_CSP_ChangeLoginOwner (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_ACL_OWNER_PROTOTYPE* NewOwner);
+	int CSSM_SignData (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount, uint DigestAlgorithm, CSSM_DATA_PTR Signature);
+	int CSSM_SignDataInit (ulong CCHandle);
+	int CSSM_SignDataUpdate (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount);
+	int CSSM_SignDataFinal (ulong CCHandle, CSSM_DATA_PTR Signature);
+	int CSSM_VerifyData (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount, uint DigestAlgorithm, CSSM_DATA* Signature);
+	int CSSM_VerifyDataInit (ulong CCHandle);
+	int CSSM_VerifyDataUpdate (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount);
+	int CSSM_VerifyDataFinal (ulong CCHandle, CSSM_DATA* Signature);
+	int CSSM_DigestData (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount, CSSM_DATA_PTR Digest);
+	int CSSM_DigestDataInit (ulong CCHandle);
+	int CSSM_DigestDataUpdate (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount);
+	int CSSM_DigestDataClone (ulong CCHandle, CSSM_CC_HANDLE* ClonednewCCHandle);
+	int CSSM_DigestDataFinal (ulong CCHandle, CSSM_DATA_PTR Digest);
+	int CSSM_GenerateMac (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount, CSSM_DATA_PTR Mac);
+	int CSSM_GenerateMacInit (ulong CCHandle);
+	int CSSM_GenerateMacUpdate (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount);
+	int CSSM_GenerateMacFinal (ulong CCHandle, CSSM_DATA_PTR Mac);
+	int CSSM_VerifyMac (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount, CSSM_DATA* Mac);
+	int CSSM_VerifyMacInit (ulong CCHandle);
+	int CSSM_VerifyMacUpdate (ulong CCHandle, CSSM_DATA* DataBufs, uint DataBufCount);
+	int CSSM_VerifyMacFinal (ulong CCHandle, CSSM_DATA* Mac);
+	int CSSM_QuerySize (ulong CCHandle, int Encrypt, uint QuerySizeCount, CSSM_QUERY_SIZE_DATA_PTR DataBlockSizes);
+	int CSSM_EncryptData (ulong CCHandle, CSSM_DATA* ClearBufs, uint ClearBufCount, CSSM_DATA_PTR CipherBufs, uint CipherBufCount, CSSM_SIZE* bytesEncrypted, CSSM_DATA_PTR RemData);
+	int CSSM_EncryptDataP (ulong CCHandle, CSSM_DATA* ClearBufs, uint ClearBufCount, CSSM_DATA_PTR CipherBufs, uint CipherBufCount, CSSM_SIZE* bytesEncrypted, CSSM_DATA_PTR RemData, ulong Privilege);
+	int CSSM_EncryptDataInit (ulong CCHandle);
+	int CSSM_EncryptDataInitP (ulong CCHandle, ulong Privilege);
+	int CSSM_EncryptDataUpdate (ulong CCHandle, CSSM_DATA* ClearBufs, uint ClearBufCount, CSSM_DATA_PTR CipherBufs, uint CipherBufCount, CSSM_SIZE* bytesEncrypted);
+	int CSSM_EncryptDataFinal (ulong CCHandle, CSSM_DATA_PTR RemData);
+	int CSSM_DecryptData (ulong CCHandle, CSSM_DATA* CipherBufs, uint CipherBufCount, CSSM_DATA_PTR ClearBufs, uint ClearBufCount, CSSM_SIZE* bytesDecrypted, CSSM_DATA_PTR RemData);
+	int CSSM_DecryptDataP (ulong CCHandle, CSSM_DATA* CipherBufs, uint CipherBufCount, CSSM_DATA_PTR ClearBufs, uint ClearBufCount, CSSM_SIZE* bytesDecrypted, CSSM_DATA_PTR RemData, ulong Privilege);
+	int CSSM_DecryptDataInit (ulong CCHandle);
+	int CSSM_DecryptDataInitP (ulong CCHandle, ulong Privilege);
+	int CSSM_DecryptDataUpdate (ulong CCHandle, CSSM_DATA* CipherBufs, uint CipherBufCount, CSSM_DATA_PTR ClearBufs, uint ClearBufCount, CSSM_SIZE* bytesDecrypted);
+	int CSSM_DecryptDataFinal (ulong CCHandle, CSSM_DATA_PTR RemData);
+	int CSSM_QueryKeySizeInBits (int CSPHandle, ulong CCHandle, CSSM_KEY* Key, CSSM_KEY_SIZE_PTR KeySize);
+	int CSSM_GenerateKey (ulong CCHandle, uint KeyUsage, uint KeyAttr, CSSM_DATA* KeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR Key);
+	int CSSM_GenerateKeyP (ulong CCHandle, uint KeyUsage, uint KeyAttr, CSSM_DATA* KeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR Key, ulong Privilege);
+	int CSSM_GenerateKeyPair (ulong CCHandle, uint PublicKeyUsage, uint PublicKeyAttr, CSSM_DATA* PublicKeyLabel, CSSM_KEY_PTR PublicKey, uint PrivateKeyUsage, uint PrivateKeyAttr, CSSM_DATA* PrivateKeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR PrivateKey);
+	int CSSM_GenerateKeyPairP (ulong CCHandle, uint PublicKeyUsage, uint PublicKeyAttr, CSSM_DATA* PublicKeyLabel, CSSM_KEY_PTR PublicKey, uint PrivateKeyUsage, uint PrivateKeyAttr, CSSM_DATA* PrivateKeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR PrivateKey, ulong Privilege);
+	int CSSM_GenerateRandom (ulong CCHandle, CSSM_DATA_PTR RandomNumber);
+	int CSSM_CSP_ObtainPrivateKeyFromPublicKey (int CSPHandle, CSSM_KEY* PublicKey, CSSM_KEY_PTR PrivateKey);
+	int CSSM_WrapKey (ulong CCHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, CSSM_DATA* DescriptiveData, CSSM_WRAP_KEY_PTR WrappedKey);
+	int CSSM_UnwrapKey (ulong CCHandle, CSSM_KEY* PublicKey, CSSM_WRAP_KEY* WrappedKey, uint KeyUsage, uint KeyAttr, CSSM_DATA* KeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR UnwrappedKey, CSSM_DATA_PTR DescriptiveData);
+	int CSSM_WrapKeyP (ulong CCHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY* Key, CSSM_DATA* DescriptiveData, CSSM_WRAP_KEY_PTR WrappedKey, ulong Privilege);
+	int CSSM_UnwrapKeyP (ulong CCHandle, CSSM_KEY* PublicKey, CSSM_WRAP_KEY* WrappedKey, uint KeyUsage, uint KeyAttr, CSSM_DATA* KeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR UnwrappedKey, CSSM_DATA_PTR DescriptiveData, ulong Privilege);
+	int CSSM_DeriveKey (ulong CCHandle, CSSM_DATA_PTR Param, uint KeyUsage, uint KeyAttr, CSSM_DATA* KeyLabel, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, CSSM_KEY_PTR DerivedKey);
+	int CSSM_FreeKey (int CSPHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_KEY_PTR KeyPtr, int Delete);
+	int CSSM_GenerateAlgorithmParams (ulong CCHandle, uint ParamBits, CSSM_DATA_PTR Param);
+	int CSSM_CSP_GetOperationalStatistics (int CSPHandle, CSSM_CSP_OPERATIONAL_STATISTICS* Statistics);
+	int CSSM_GetTimeValue (int CSPHandle, uint TimeAlgorithm, CSSM_DATA* TimeData);
+	int CSSM_RetrieveUniqueId (int CSPHandle, CSSM_DATA_PTR UniqueID);
+	int CSSM_RetrieveCounter (int CSPHandle, CSSM_DATA_PTR Counter);
+	int CSSM_VerifyDevice (int CSPHandle, CSSM_DATA* DeviceCert);
+	int CSSM_CSP_PassThrough (ulong CCHandle, uint PassThroughId, void* InData, void** OutData);
+	int CSSM_TP_SubmitCredRequest (int TPHandle, CSSM_TP_AUTHORITY_ID* PreferredAuthority, uint RequestType, CSSM_TP_REQUEST_SET* RequestInput, CSSM_TP_CALLERAUTH_CONTEXT* CallerAuthContext, sint32* EstimatedTime, CSSM_DATA_PTR ReferenceIdentifier);
+	int CSSM_TP_RetrieveCredResult (int TPHandle, CSSM_DATA* ReferenceIdentifier, CSSM_TP_CALLERAUTH_CONTEXT* CallerAuthCredentials, sint32* EstimatedTime, CSSM_BOOL* ConfirmationRequired, CSSM_TP_RESULT_SET_PTR* RetrieveOutput);
+	int CSSM_TP_ConfirmCredResult (int TPHandle, CSSM_DATA* ReferenceIdentifier, CSSM_TP_CALLERAUTH_CONTEXT* CallerAuthCredentials, CSSM_TP_CONFIRM_RESPONSE* Responses, CSSM_TP_AUTHORITY_ID* PreferredAuthority);
+	int CSSM_TP_ReceiveConfirmation (int TPHandle, CSSM_DATA* ReferenceIdentifier, CSSM_TP_CONFIRM_RESPONSE_PTR* Responses, int* ElapsedTime);
+	int CSSM_TP_CertReclaimKey (int TPHandle, CSSM_CERTGROUP* CertGroup, uint CertIndex, ulong KeyCacheHandle, int CSPHandle, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry);
+	int CSSM_TP_CertReclaimAbort (int TPHandle, ulong KeyCacheHandle);
+	int CSSM_TP_FormRequest (int TPHandle, CSSM_TP_AUTHORITY_ID* PreferredAuthority, uint FormType, CSSM_DATA_PTR BlankForm);
+	int CSSM_TP_FormSubmit (int TPHandle, uint FormType, CSSM_DATA* Form, CSSM_TP_AUTHORITY_ID* ClearanceAuthority, CSSM_TP_AUTHORITY_ID* RepresentedAuthority, CSSM_ACCESS_CREDENTIALS_PTR Credentials);
+	int CSSM_TP_CertGroupVerify (int TPHandle, int CLHandle, int CSPHandle, CSSM_CERTGROUP* CertGroupToBeVerified, CSSM_TP_VERIFY_CONTEXT* VerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult);
+	int CSSM_TP_CertCreateTemplate (int TPHandle, int CLHandle, uint NumberOfFields, CSSM_FIELD* CertFields, CSSM_DATA_PTR CertTemplate);
+	int CSSM_TP_CertGetAllTemplateFields (int TPHandle, int CLHandle, CSSM_DATA* CertTemplate, uint* NumberOfFields, CSSM_FIELD_PTR* CertFields);
+	int CSSM_TP_CertSign (int TPHandle, int CLHandle, ulong CCHandle, CSSM_DATA* CertTemplateToBeSigned, CSSM_CERTGROUP* SignerCertGroup, CSSM_TP_VERIFY_CONTEXT* SignerVerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, CSSM_DATA_PTR SignedCert);
+	int CSSM_TP_CrlVerify (int TPHandle, int CLHandle, int CSPHandle, CSSM_ENCODED_CRL* CrlToBeVerified, CSSM_CERTGROUP* SignerCertGroup, CSSM_TP_VERIFY_CONTEXT* VerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult);
+	int CSSM_TP_CrlCreateTemplate (int TPHandle, int CLHandle, uint NumberOfFields, CSSM_FIELD* CrlFields, CSSM_DATA_PTR NewCrlTemplate);
+	int CSSM_TP_CertRevoke (int TPHandle, int CLHandle, int CSPHandle, CSSM_DATA* OldCrlTemplate, CSSM_CERTGROUP* CertGroupToBeRevoked, CSSM_CERTGROUP* RevokerCertGroup, CSSM_TP_VERIFY_CONTEXT* RevokerVerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, uint Reason, CSSM_DATA_PTR NewCrlTemplate);
+	int CSSM_TP_CertRemoveFromCrlTemplate (int TPHandle, int CLHandle, int CSPHandle, CSSM_DATA* OldCrlTemplate, CSSM_CERTGROUP* CertGroupToBeRemoved, CSSM_CERTGROUP* RevokerCertGroup, CSSM_TP_VERIFY_CONTEXT* RevokerVerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, CSSM_DATA_PTR NewCrlTemplate);
+	int CSSM_TP_CrlSign (int TPHandle, int CLHandle, ulong CCHandle, CSSM_ENCODED_CRL* CrlToBeSigned, CSSM_CERTGROUP* SignerCertGroup, CSSM_TP_VERIFY_CONTEXT* SignerVerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, CSSM_DATA_PTR SignedCrl);
+	int CSSM_TP_ApplyCrlToDb (int TPHandle, int CLHandle, int CSPHandle, CSSM_ENCODED_CRL* CrlToBeApplied, CSSM_CERTGROUP* SignerCertGroup, CSSM_TP_VERIFY_CONTEXT* ApplyCrlVerifyContext, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult);
+	int CSSM_TP_CertGroupConstruct (int TPHandle, int CLHandle, int CSPHandle, CSSM_DL_DB_LIST* DBList, void* ConstructParams, CSSM_CERTGROUP* CertGroupFrag, CSSM_CERTGROUP_PTR* CertGroup);
+	int CSSM_TP_CertGroupPrune (int TPHandle, int CLHandle, CSSM_DL_DB_LIST* DBList, CSSM_CERTGROUP* OrderedCertGroup, CSSM_CERTGROUP_PTR* PrunedCertGroup);
+	int CSSM_TP_CertGroupToTupleGroup (int TPHandle, int CLHandle, CSSM_CERTGROUP* CertGroup, CSSM_TUPLEGROUP_PTR* TupleGroup);
+	int CSSM_TP_TupleGroupToCertGroup (int TPHandle, int CLHandle, CSSM_TUPLEGROUP* TupleGroup, CSSM_CERTGROUP_PTR* CertTemplates);
+	int CSSM_TP_PassThrough (int TPHandle, int CLHandle, ulong CCHandle, CSSM_DL_DB_LIST* DBList, uint PassThroughId, void* InputParams, void** OutputParams);
+	int CSSM_AC_AuthCompute (int ACHandle, CSSM_TUPLEGROUP* BaseAuthorizations, CSSM_TUPLEGROUP* Credentials, uint NumberOfRequestors, CSSM_LIST* Requestors, CSSM_LIST* RequestedAuthorizationPeriod, CSSM_LIST* RequestedAuthorization, CSSM_TUPLEGROUP_PTR AuthorizationResult);
+	int CSSM_AC_PassThrough (int ACHandle, int TPHandle, int CLHandle, ulong CCHandle, CSSM_DL_DB_LIST* DBList, uint PassThroughId, void* InputParams, void** OutputParams);
+	int CSSM_CL_CertCreateTemplate (int CLHandle, uint NumberOfFields, CSSM_FIELD* CertFields, CSSM_DATA_PTR CertTemplate);
+	int CSSM_CL_CertGetAllTemplateFields (int CLHandle, CSSM_DATA* CertTemplate, uint* NumberOfFields, CSSM_FIELD_PTR* CertFields);
+	int CSSM_CL_CertSign (int CLHandle, ulong CCHandle, CSSM_DATA* CertTemplate, CSSM_FIELD* SignScope, uint ScopeSize, CSSM_DATA_PTR SignedCert);
+	int CSSM_CL_CertVerify (int CLHandle, ulong CCHandle, CSSM_DATA* CertToBeVerified, CSSM_DATA* SignerCert, CSSM_FIELD* VerifyScope, uint ScopeSize);
+	int CSSM_CL_CertVerifyWithKey (int CLHandle, ulong CCHandle, CSSM_DATA* CertToBeVerified);
+	int CSSM_CL_CertGetFirstFieldValue (int CLHandle, CSSM_DATA* Cert, CSSM_OID* CertField, CSSM_HANDLE_PTR ResultsHandle, uint* NumberOfMatchedFields, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CertGetNextFieldValue (int CLHandle, int ResultsHandle, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CertAbortQuery (int CLHandle, int ResultsHandle);
+	int CSSM_CL_CertGetKeyInfo (int CLHandle, CSSM_DATA* Cert, CSSM_KEY_PTR* Key);
+	int CSSM_CL_CertGetAllFields (int CLHandle, CSSM_DATA* Cert, uint* NumberOfFields, CSSM_FIELD_PTR* CertFields);
+	int CSSM_CL_FreeFields (int CLHandle, uint NumberOfFields, CSSM_FIELD_PTR* Fields);
+	int CSSM_CL_FreeFieldValue (int CLHandle, CSSM_OID* CertOrCrlOid, CSSM_DATA_PTR Value);
+	int CSSM_CL_CertCache (int CLHandle, CSSM_DATA* Cert, CSSM_HANDLE_PTR CertHandle);
+	int CSSM_CL_CertGetFirstCachedFieldValue (int CLHandle, int CertHandle, CSSM_OID* CertField, CSSM_HANDLE_PTR ResultsHandle, uint* NumberOfMatchedFields, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CertGetNextCachedFieldValue (int CLHandle, int ResultsHandle, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CertAbortCache (int CLHandle, int CertHandle);
+	int CSSM_CL_CertGroupToSignedBundle (int CLHandle, ulong CCHandle, CSSM_CERTGROUP* CertGroupToBundle, CSSM_CERT_BUNDLE_HEADER* BundleInfo, CSSM_DATA_PTR SignedBundle);
+	int CSSM_CL_CertGroupFromVerifiedBundle (int CLHandle, ulong CCHandle, CSSM_CERT_BUNDLE* CertBundle, CSSM_DATA* SignerCert, CSSM_CERTGROUP_PTR* CertGroup);
+	int CSSM_CL_CertDescribeFormat (int CLHandle, uint* NumberOfFields, CSSM_OID_PTR* OidList);
+	int CSSM_CL_CrlCreateTemplate (int CLHandle, uint NumberOfFields, CSSM_FIELD* CrlTemplate, CSSM_DATA_PTR NewCrl);
+	int CSSM_CL_CrlSetFields (int CLHandle, uint NumberOfFields, CSSM_FIELD* CrlTemplate, CSSM_DATA* OldCrl, CSSM_DATA_PTR ModifiedCrl);
+	int CSSM_CL_CrlAddCert (int CLHandle, ulong CCHandle, CSSM_DATA* Cert, uint NumberOfFields, CSSM_FIELD* CrlEntryFields, CSSM_DATA* OldCrl, CSSM_DATA_PTR NewCrl);
+	int CSSM_CL_CrlRemoveCert (int CLHandle, CSSM_DATA* Cert, CSSM_DATA* OldCrl, CSSM_DATA_PTR NewCrl);
+	int CSSM_CL_CrlSign (int CLHandle, ulong CCHandle, CSSM_DATA* UnsignedCrl, CSSM_FIELD* SignScope, uint ScopeSize, CSSM_DATA_PTR SignedCrl);
+	int CSSM_CL_CrlVerify (int CLHandle, ulong CCHandle, CSSM_DATA* CrlToBeVerified, CSSM_DATA* SignerCert, CSSM_FIELD* VerifyScope, uint ScopeSize);
+	int CSSM_CL_CrlVerifyWithKey (int CLHandle, ulong CCHandle, CSSM_DATA* CrlToBeVerified);
+	int CSSM_CL_IsCertInCrl (int CLHandle, CSSM_DATA* Cert, CSSM_DATA* Crl, CSSM_BOOL* CertFound);
+	int CSSM_CL_CrlGetFirstFieldValue (int CLHandle, CSSM_DATA* Crl, CSSM_OID* CrlField, CSSM_HANDLE_PTR ResultsHandle, uint* NumberOfMatchedFields, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CrlGetNextFieldValue (int CLHandle, int ResultsHandle, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CrlAbortQuery (int CLHandle, int ResultsHandle);
+	int CSSM_CL_CrlGetAllFields (int CLHandle, CSSM_DATA* Crl, uint* NumberOfCrlFields, CSSM_FIELD_PTR* CrlFields);
+	int CSSM_CL_CrlCache (int CLHandle, CSSM_DATA* Crl, CSSM_HANDLE_PTR CrlHandle);
+	int CSSM_CL_IsCertInCachedCrl (int CLHandle, CSSM_DATA* Cert, int CrlHandle, CSSM_BOOL* CertFound, CSSM_DATA_PTR CrlRecordIndex);
+	int CSSM_CL_CrlGetFirstCachedFieldValue (int CLHandle, int CrlHandle, CSSM_DATA* CrlRecordIndex, CSSM_OID* CrlField, CSSM_HANDLE_PTR ResultsHandle, uint* NumberOfMatchedFields, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CrlGetNextCachedFieldValue (int CLHandle, int ResultsHandle, CSSM_DATA_PTR* Value);
+	int CSSM_CL_CrlGetAllCachedRecordFields (int CLHandle, int CrlHandle, CSSM_DATA* CrlRecordIndex, uint* NumberOfFields, CSSM_FIELD_PTR* CrlFields);
+	int CSSM_CL_CrlAbortCache (int CLHandle, int CrlHandle);
+	int CSSM_CL_CrlDescribeFormat (int CLHandle, uint* NumberOfFields, CSSM_OID_PTR* OidList);
+	int CSSM_CL_PassThrough (int CLHandle, ulong CCHandle, uint PassThroughId, void* InputParams, void** OutputParams);
+	int CSSM_DL_DbOpen (int DLHandle, char* DbName, CSSM_NET_ADDRESS* DbLocation, uint AccessRequest, CSSM_ACCESS_CREDENTIALS* AccessCred, void* OpenParameters, CSSM_DB_HANDLE* DbHandle);
+	int CSSM_DL_DbClose (CSSM_DL_DB_HANDLE DLDBHandle);
+	int CSSM_DL_DbCreate (int DLHandle, char* DbName, CSSM_NET_ADDRESS* DbLocation, CSSM_DBINFO* DBInfo, uint AccessRequest, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, void* OpenParameters, CSSM_DB_HANDLE* DbHandle);
+	int CSSM_DL_DbDelete (int DLHandle, char* DbName, CSSM_NET_ADDRESS* DbLocation, CSSM_ACCESS_CREDENTIALS* AccessCred);
+	int CSSM_DL_CreateRelation (CSSM_DL_DB_HANDLE DLDBHandle, uint RelationID, char* RelationName, uint NumberOfAttributes, CSSM_DB_SCHEMA_ATTRIBUTE_INFO* pAttributeInfo, uint NumberOfIndexes, CSSM_DB_SCHEMA_INDEX_INFO* pIndexInfo);
+	int CSSM_DL_DestroyRelation (CSSM_DL_DB_HANDLE DLDBHandle, uint RelationID);
+	int CSSM_DL_Authenticate (CSSM_DL_DB_HANDLE DLDBHandle, uint AccessRequest, CSSM_ACCESS_CREDENTIALS* AccessCred);
+	int CSSM_DL_GetDbAcl (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_STRING* SelectionTag, uint* NumberOfAclInfos, CSSM_ACL_ENTRY_INFO_PTR* AclInfos);
+	int CSSM_DL_ChangeDbAcl (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_ACL_EDIT* AclEdit);
+	int CSSM_DL_GetDbOwner (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
+	int CSSM_DL_ChangeDbOwner (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_ACCESS_CREDENTIALS* AccessCred, CSSM_ACL_OWNER_PROTOTYPE* NewOwner);
+	int CSSM_DL_GetDbNames (int DLHandle, CSSM_NAME_LIST_PTR* NameList);
+	int CSSM_DL_GetDbNameFromHandle (CSSM_DL_DB_HANDLE DLDBHandle, char** DbName);
+	int CSSM_DL_FreeNameList (int DLHandle, CSSM_NAME_LIST_PTR NameList);
+	int CSSM_DL_DataInsert (CSSM_DL_DB_HANDLE DLDBHandle, uint RecordType, CSSM_DB_RECORD_ATTRIBUTE_DATA* Attributes, CSSM_DATA* Data, CSSM_DB_UNIQUE_RECORD_PTR* UniqueId);
+	int CSSM_DL_DataDelete (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_DB_UNIQUE_RECORD* UniqueRecordIdentifier);
+	int CSSM_DL_DataModify (CSSM_DL_DB_HANDLE DLDBHandle, uint RecordType, CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier, CSSM_DB_RECORD_ATTRIBUTE_DATA* AttributesToBeModified, CSSM_DATA* DataToBeModified, uint ModifyMode);
+	int CSSM_DL_DataGetFirst (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_QUERY* Query, CSSM_HANDLE_PTR ResultsHandle, CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, CSSM_DATA_PTR Data, CSSM_DB_UNIQUE_RECORD_PTR* UniqueId);
+	int CSSM_DL_DataGetNext (CSSM_DL_DB_HANDLE DLDBHandle, int ResultsHandle, CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, CSSM_DATA_PTR Data, CSSM_DB_UNIQUE_RECORD_PTR* UniqueId);
+	int CSSM_DL_DataAbortQuery (CSSM_DL_DB_HANDLE DLDBHandle, int ResultsHandle);
+	int CSSM_DL_DataGetFromUniqueRecordId (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_DB_UNIQUE_RECORD* UniqueRecord, CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, CSSM_DATA_PTR Data);
+	int CSSM_DL_FreeUniqueRecord (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
+	int CSSM_DL_PassThrough (CSSM_DL_DB_HANDLE DLDBHandle, uint PassThroughId, void* InputParams, void** OutputParams);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmapple.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,635 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmapple;
+
+import dstep.security.certextensions;
+import dstep.security.cssmerr;
+import dstep.security.cssmtype;
+import dstep.security.x509defs;
+//import dstep.stdbool;
+//import dstep.sys.types;
+
+alias uint CSSM_ACL_PREAUTH_TRACKING_STATE;
+alias uint CSSM_APPLE_TP_CRL_OPT_FLAGS;
+alias uint CSSM_APPLE_TP_ACTION_FLAGS;
+alias uint CSSM_TP_APPLE_CERT_STATUS;
+
+extern (C)
+{
+	extern
+	{
+		const CSSM_GUID gGuidCssm;
+		const CSSM_GUID gGuidAppleFileDL;
+		const CSSM_GUID gGuidAppleCSP;
+		const CSSM_GUID gGuidAppleCSPDL;
+		const CSSM_GUID gGuidAppleX509CL;
+		const CSSM_GUID gGuidAppleX509TP;
+		const CSSM_GUID gGuidAppleLDAPDL;
+		const CSSM_GUID gGuidAppleDotMacTP;
+		const CSSM_GUID gGuidAppleSdCSPDL;
+		const CSSM_GUID gGuidAppleDotMacDL;
+	}
+}
+
+enum
+{
+	CSSM_WORDID_KEYCHAIN_PROMPT = CSSM_WORDID_VENDOR_START,
+	CSSM_WORDID_KEYCHAIN_LOCK,
+	CSSM_WORDID_KEYCHAIN_CHANGE_LOCK,
+	CSSM_WORDID_PROCESS,
+	CSSM_WORDID__RESERVED_1,
+	CSSM_WORDID_SYMMETRIC_KEY,
+	CSSM_WORDID_SYSTEM,
+	CSSM_WORDID_KEY,
+	CSSM_WORDID_PIN,
+	CSSM_WORDID_PREAUTH,
+	CSSM_WORDID_PREAUTH_SOURCE,
+	CSSM_WORDID_ASYMMETRIC_KEY,
+	CSSM_WORDID__FIRST_UNUSED
+}
+
+enum
+{
+	CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT = CSSM_WORDID_KEYCHAIN_PROMPT,
+	CSSM_ACL_SUBJECT_TYPE_PROCESS = CSSM_WORDID_PROCESS,
+	CSSM_ACL_SUBJECT_TYPE_CODE_SIGNATURE = CSSM_WORDID_SIGNATURE,
+	CSSM_ACL_SUBJECT_TYPE_COMMENT = CSSM_WORDID_COMMENT,
+	CSSM_ACL_SUBJECT_TYPE_SYMMETRIC_KEY = CSSM_WORDID_SYMMETRIC_KEY,
+	CSSM_ACL_SUBJECT_TYPE_PREAUTH = CSSM_WORDID_PREAUTH,
+	CSSM_ACL_SUBJECT_TYPE_PREAUTH_SOURCE = CSSM_WORDID_PREAUTH_SOURCE,
+	CSSM_ACL_SUBJECT_TYPE_ASYMMETRIC_KEY = CSSM_WORDID_ASYMMETRIC_KEY
+}
+
+enum
+{
+	CSSM_SAMPLE_TYPE_KEYCHAIN_PROMPT = CSSM_WORDID_KEYCHAIN_PROMPT,
+	CSSM_SAMPLE_TYPE_KEYCHAIN_LOCK = CSSM_WORDID_KEYCHAIN_LOCK,
+	CSSM_SAMPLE_TYPE_KEYCHAIN_CHANGE_LOCK = CSSM_WORDID_KEYCHAIN_CHANGE_LOCK,
+	CSSM_SAMPLE_TYPE_PROCESS = CSSM_WORDID_PROCESS,
+	CSSM_SAMPLE_TYPE_COMMENT = CSSM_WORDID_COMMENT,
+	CSSM_SAMPLE_TYPE_RETRY_ID = CSSM_WORDID_PROPAGATE,
+	CSSM_SAMPLE_TYPE_SYMMETRIC_KEY = CSSM_WORDID_SYMMETRIC_KEY,
+	CSSM_SAMPLE_TYPE_PREAUTH = CSSM_WORDID_PREAUTH,
+	CSSM_SAMPLE_TYPE_ASYMMETRIC_KEY = CSSM_WORDID_ASYMMETRIC_KEY
+}
+
+enum
+{
+	CSSM_ACL_AUTHORIZATION_CHANGE_ACL = CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START,
+	CSSM_ACL_AUTHORIZATION_CHANGE_OWNER,
+	CSSM_ACL_AUTHORIZATION_PREAUTH_BASE = CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START + 0x1000000,
+	CSSM_ACL_AUTHORIZATION_PREAUTH_END = CSSM_ACL_AUTHORIZATION_PREAUTH_BASE + 0x10000
+}
+
+enum
+{
+	CSSM_ACL_CODE_SIGNATURE_INVALID = 0,
+	CSSM_ACL_CODE_SIGNATURE_OSX = 1
+}
+
+enum
+{
+	CSSM_ACL_MATCH_UID = 0x01,
+	CSSM_ACL_MATCH_GID = 0x02,
+	CSSM_ACL_MATCH_HONOR_ROOT = 0x100,
+	CSSM_ACL_MATCH_BITS = CSSM_ACL_MATCH_UID | CSSM_ACL_MATCH_GID
+}
+
+enum
+{
+	CSSM_ACL_PROCESS_SELECTOR_CURRENT_VERSION = 0x101
+}
+
+enum
+{
+	CSSM_ACL_KEYCHAIN_PROMPT_CURRENT_VERSION = 0x101
+}
+
+enum
+{
+	CSSM_ACL_KEYCHAIN_PROMPT_REQUIRE_PASSPHRASE = 0x0001,
+	CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED = 0x0010,
+	CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED_ACT = 0x0020,
+	CSSM_ACL_KEYCHAIN_PROMPT_INVALID = 0x0040,
+	CSSM_ACL_KEYCHAIN_PROMPT_INVALID_ACT = 0x0080
+}
+
+enum
+{
+	CSSM_ACL_PREAUTH_TRACKING_COUNT_MASK = 0xff,
+	CSSM_ACL_PREAUTH_TRACKING_BLOCKED = 0,
+	CSSM_ACL_PREAUTH_TRACKING_UNKNOWN = 0x40000000,
+	CSSM_ACL_PREAUTH_TRACKING_AUTHORIZED = 0x80000000
+}
+
+enum
+{
+	CSSM_DB_ACCESS_RESET = 0x10000
+}
+
+enum
+{
+	CSSM_ALGID_APPLE_YARROW = CSSM_ALGID_VENDOR_DEFINED,
+	CSSM_ALGID_AES,
+	CSSM_ALGID_FEE,
+	CSSM_ALGID_FEE_MD5,
+	CSSM_ALGID_FEE_SHA1,
+	CSSM_ALGID_FEED,
+	CSSM_ALGID_FEEDEXP,
+	CSSM_ALGID_ASC,
+	CSSM_ALGID_SHA1HMAC_LEGACY,
+	CSSM_ALGID_KEYCHAIN_KEY,
+	CSSM_ALGID_PKCS12_PBE_ENCR,
+	CSSM_ALGID_PKCS12_PBE_MAC,
+	CSSM_ALGID_SECURE_PASSPHRASE,
+	CSSM_ALGID_PBE_OPENSSL_MD5,
+	CSSM_ALGID_SHA256,
+	CSSM_ALGID_SHA384,
+	CSSM_ALGID_SHA512,
+	CSSM_ALGID_ENTROPY_DEFAULT,
+	CSSM_ALGID_SHA224,
+	CSSM_ALGID_SHA224WithRSA,
+	CSSM_ALGID_SHA256WithRSA,
+	CSSM_ALGID_SHA384WithRSA,
+	CSSM_ALGID_SHA512WithRSA,
+	CSSM_ALGID_OPENSSH1,
+	CSSM_ALGID__FIRST_UNUSED
+}
+
+enum
+{
+	CSSM_PADDING_APPLE_SSLv2 = CSSM_PADDING_VENDOR_DEFINED
+}
+
+enum
+{
+	CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED = 0x80000000
+}
+
+enum
+{
+	CSSM_KEYBLOB_RAW_FORMAT_X509 = CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED,
+	CSSM_KEYBLOB_RAW_FORMAT_OPENSSH,
+	CSSM_KEYBLOB_RAW_FORMAT_OPENSSL,
+	CSSM_KEYBLOB_RAW_FORMAT_OPENSSH2
+}
+
+enum
+{
+	CSSM_CUSTOM_COMMON_ERROR_EXTENT = 0x00e0,
+	CSSM_ERRCODE_NO_USER_INTERACTION = 0x00e0,
+	CSSM_ERRCODE_USER_CANCELED = 0x00e1,
+	CSSM_ERRCODE_SERVICE_NOT_AVAILABLE = 0x00e2,
+	CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION = 0x00e3,
+	CSSM_ERRCODE_DEVICE_RESET = 0x00e4,
+	CSSM_ERRCODE_DEVICE_FAILED = 0x00e5
+}
+
+enum
+{
+	CSSMERR_CSSM_NO_USER_INTERACTION = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_AC_NO_USER_INTERACTION = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_CSP_NO_USER_INTERACTION = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_CL_NO_USER_INTERACTION = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_DL_NO_USER_INTERACTION = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_TP_NO_USER_INTERACTION = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION,
+	CSSMERR_CSSM_USER_CANCELED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_AC_USER_CANCELED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_CSP_USER_CANCELED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_CL_USER_CANCELED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_DL_USER_CANCELED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_TP_USER_CANCELED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED,
+	CSSMERR_CSSM_SERVICE_NOT_AVAILABLE = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_AC_SERVICE_NOT_AVAILABLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_CSP_SERVICE_NOT_AVAILABLE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_CL_SERVICE_NOT_AVAILABLE = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_DL_SERVICE_NOT_AVAILABLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_TP_SERVICE_NOT_AVAILABLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE,
+	CSSMERR_CSSM_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_AC_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_CSP_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_CL_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_DL_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_TP_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION,
+	CSSMERR_CSSM_DEVICE_RESET = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_AC_DEVICE_RESET = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_CSP_DEVICE_RESET = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_CL_DEVICE_RESET = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_DL_DEVICE_RESET = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_TP_DEVICE_RESET = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET,
+	CSSMERR_CSSM_DEVICE_FAILED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED,
+	CSSMERR_AC_DEVICE_FAILED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED,
+	CSSMERR_CSP_DEVICE_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED,
+	CSSMERR_CL_DEVICE_FAILED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED,
+	CSSMERR_DL_DEVICE_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED,
+	CSSMERR_TP_DEVICE_FAILED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED
+}
+
+enum
+{
+	CSSMERR_CSP_APPLE_ADD_APPLICATION_ACL_SUBJECT = CSSM_CSP_PRIVATE_ERROR + 0,
+	CSSMERR_CSP_APPLE_PUBLIC_KEY_INCOMPLETE = CSSM_CSP_PRIVATE_ERROR + 1,
+	CSSMERR_CSP_APPLE_SIGNATURE_MISMATCH = CSSM_CSP_PRIVATE_ERROR + 2,
+	CSSMERR_CSP_APPLE_INVALID_KEY_START_DATE = CSSM_CSP_PRIVATE_ERROR + 3,
+	CSSMERR_CSP_APPLE_INVALID_KEY_END_DATE = CSSM_CSP_PRIVATE_ERROR + 4,
+	CSSMERR_CSPDL_APPLE_DL_CONVERSION_ERROR = CSSM_CSP_PRIVATE_ERROR + 5,
+	CSSMERR_CSP_APPLE_SSLv2_ROLLBACK = CSSM_CSP_PRIVATE_ERROR + 6
+}
+
+enum
+{
+	CSSM_DL_DB_RECORD_GENERIC_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0,
+	CSSM_DL_DB_RECORD_INTERNET_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 1,
+	CSSM_DL_DB_RECORD_APPLESHARE_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 2,
+	CSSM_DL_DB_RECORD_X509_CERTIFICATE = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0x1000,
+	CSSM_DL_DB_RECORD_USER_TRUST,
+	CSSM_DL_DB_RECORD_X509_CRL,
+	CSSM_DL_DB_RECORD_UNLOCK_REFERRAL,
+	CSSM_DL_DB_RECORD_EXTENDED_ATTRIBUTE,
+	CSSM_DL_DB_RECORD_METADATA = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0x8000
+}
+
+enum
+{
+	CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT,
+	CSSM_APPLEFILEDL_COMMIT,
+	CSSM_APPLEFILEDL_ROLLBACK
+}
+
+enum
+{
+	CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT = 1,
+	CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE = 2
+}
+
+enum
+{
+	CSSMERR_APPLEDL_INVALID_OPEN_PARAMETERS = CSSM_DL_PRIVATE_ERROR + 0,
+	CSSMERR_APPLEDL_DISK_FULL = CSSM_DL_PRIVATE_ERROR + 1,
+	CSSMERR_APPLEDL_QUOTA_EXCEEDED = CSSM_DL_PRIVATE_ERROR + 2,
+	CSSMERR_APPLEDL_FILE_TOO_BIG = CSSM_DL_PRIVATE_ERROR + 3,
+	CSSMERR_APPLEDL_INVALID_DATABASE_BLOB = CSSM_DL_PRIVATE_ERROR + 4,
+	CSSMERR_APPLEDL_INVALID_KEY_BLOB = CSSM_DL_PRIVATE_ERROR + 5,
+	CSSMERR_APPLEDL_INCOMPATIBLE_DATABASE_BLOB = CSSM_DL_PRIVATE_ERROR + 6,
+	CSSMERR_APPLEDL_INCOMPATIBLE_KEY_BLOB = CSSM_DL_PRIVATE_ERROR + 7
+}
+
+enum
+{
+	CSSMERR_APPLETP_HOSTNAME_MISMATCH = CSSM_TP_PRIVATE_ERROR + 0,
+	CSSMERR_APPLETP_UNKNOWN_CRITICAL_EXTEN = CSSM_TP_PRIVATE_ERROR + 1,
+	CSSMERR_APPLETP_NO_BASIC_CONSTRAINTS = CSSM_TP_PRIVATE_ERROR + 2,
+	CSSMERR_APPLETP_INVALID_CA = CSSM_TP_PRIVATE_ERROR + 3,
+	CSSMERR_APPLETP_INVALID_AUTHORITY_ID = CSSM_TP_PRIVATE_ERROR + 4,
+	CSSMERR_APPLETP_INVALID_SUBJECT_ID = CSSM_TP_PRIVATE_ERROR + 5,
+	CSSMERR_APPLETP_INVALID_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 6,
+	CSSMERR_APPLETP_INVALID_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 7,
+	CSSMERR_APPLETP_INVALID_ID_LINKAGE = CSSM_TP_PRIVATE_ERROR + 8,
+	CSSMERR_APPLETP_PATH_LEN_CONSTRAINT = CSSM_TP_PRIVATE_ERROR + 9,
+	CSSMERR_APPLETP_INVALID_ROOT = CSSM_TP_PRIVATE_ERROR + 10,
+	CSSMERR_APPLETP_CRL_EXPIRED = CSSM_TP_PRIVATE_ERROR + 11,
+	CSSMERR_APPLETP_CRL_NOT_VALID_YET = CSSM_TP_PRIVATE_ERROR + 12,
+	CSSMERR_APPLETP_CRL_NOT_FOUND = CSSM_TP_PRIVATE_ERROR + 13,
+	CSSMERR_APPLETP_CRL_SERVER_DOWN = CSSM_TP_PRIVATE_ERROR + 14,
+	CSSMERR_APPLETP_CRL_BAD_URI = CSSM_TP_PRIVATE_ERROR + 15,
+	CSSMERR_APPLETP_UNKNOWN_CERT_EXTEN = CSSM_TP_PRIVATE_ERROR + 16,
+	CSSMERR_APPLETP_UNKNOWN_CRL_EXTEN = CSSM_TP_PRIVATE_ERROR + 17,
+	CSSMERR_APPLETP_CRL_NOT_TRUSTED = CSSM_TP_PRIVATE_ERROR + 18,
+	CSSMERR_APPLETP_CRL_INVALID_ANCHOR_CERT = CSSM_TP_PRIVATE_ERROR + 19,
+	CSSMERR_APPLETP_CRL_POLICY_FAIL = CSSM_TP_PRIVATE_ERROR + 20,
+	CSSMERR_APPLETP_IDP_FAIL = CSSM_TP_PRIVATE_ERROR + 21,
+	CSSMERR_APPLETP_CERT_NOT_FOUND_FROM_ISSUER = CSSM_TP_PRIVATE_ERROR + 22,
+	CSSMERR_APPLETP_BAD_CERT_FROM_ISSUER = CSSM_TP_PRIVATE_ERROR + 23,
+	CSSMERR_APPLETP_SMIME_EMAIL_ADDRS_NOT_FOUND = CSSM_TP_PRIVATE_ERROR + 24,
+	CSSMERR_APPLETP_SMIME_BAD_EXT_KEY_USE = CSSM_TP_PRIVATE_ERROR + 25,
+	CSSMERR_APPLETP_SMIME_BAD_KEY_USE = CSSM_TP_PRIVATE_ERROR + 26,
+	CSSMERR_APPLETP_SMIME_KEYUSAGE_NOT_CRITICAL = CSSM_TP_PRIVATE_ERROR + 27,
+	CSSMERR_APPLETP_SMIME_NO_EMAIL_ADDRS = CSSM_TP_PRIVATE_ERROR + 28,
+	CSSMERR_APPLETP_SMIME_SUBJ_ALT_NAME_NOT_CRIT = CSSM_TP_PRIVATE_ERROR + 29,
+	CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE = CSSM_TP_PRIVATE_ERROR + 30,
+	CSSMERR_APPLETP_OCSP_BAD_RESPONSE = CSSM_TP_PRIVATE_ERROR + 31,
+	CSSMERR_APPLETP_OCSP_BAD_REQUEST = CSSM_TP_PRIVATE_ERROR + 32,
+	CSSMERR_APPLETP_OCSP_UNAVAILABLE = CSSM_TP_PRIVATE_ERROR + 33,
+	CSSMERR_APPLETP_OCSP_STATUS_UNRECOGNIZED = CSSM_TP_PRIVATE_ERROR + 34,
+	CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK = CSSM_TP_PRIVATE_ERROR + 35,
+	CSSMERR_APPLETP_NETWORK_FAILURE = CSSM_TP_PRIVATE_ERROR + 36,
+	CSSMERR_APPLETP_OCSP_NOT_TRUSTED = CSSM_TP_PRIVATE_ERROR + 37,
+	CSSMERR_APPLETP_OCSP_INVALID_ANCHOR_CERT = CSSM_TP_PRIVATE_ERROR + 38,
+	CSSMERR_APPLETP_OCSP_SIG_ERROR = CSSM_TP_PRIVATE_ERROR + 39,
+	CSSMERR_APPLETP_OCSP_NO_SIGNER = CSSM_TP_PRIVATE_ERROR + 40,
+	CSSMERR_APPLETP_OCSP_RESP_MALFORMED_REQ = CSSM_TP_PRIVATE_ERROR + 41,
+	CSSMERR_APPLETP_OCSP_RESP_INTERNAL_ERR = CSSM_TP_PRIVATE_ERROR + 42,
+	CSSMERR_APPLETP_OCSP_RESP_TRY_LATER = CSSM_TP_PRIVATE_ERROR + 43,
+	CSSMERR_APPLETP_OCSP_RESP_SIG_REQUIRED = CSSM_TP_PRIVATE_ERROR + 44,
+	CSSMERR_APPLETP_OCSP_RESP_UNAUTHORIZED = CSSM_TP_PRIVATE_ERROR + 45,
+	CSSMERR_APPLETP_OCSP_NONCE_MISMATCH = CSSM_TP_PRIVATE_ERROR + 46,
+	CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH = CSSM_TP_PRIVATE_ERROR + 47,
+	CSSMERR_APPLETP_CS_NO_BASIC_CONSTRAINTS = CSSM_TP_PRIVATE_ERROR + 48,
+	CSSMERR_APPLETP_CS_BAD_PATH_LENGTH = CSSM_TP_PRIVATE_ERROR + 49,
+	CSSMERR_APPLETP_CS_NO_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 50,
+	CSSMERR_APPLETP_CODE_SIGN_DEVELOPMENT = CSSM_TP_PRIVATE_ERROR + 51,
+	CSSMERR_APPLETP_RS_BAD_CERT_CHAIN_LENGTH = CSSM_TP_PRIVATE_ERROR + 52,
+	CSSMERR_APPLETP_RS_BAD_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 53,
+	CSSMERR_APPLETP_TRUST_SETTING_DENY = CSSM_TP_PRIVATE_ERROR + 54,
+	CSSMERR_APPLETP_INVALID_EMPTY_SUBJECT = CSSM_TP_PRIVATE_ERROR + 55,
+	CSSMERR_APPLETP_UNKNOWN_QUAL_CERT_STATEMENT = CSSM_TP_PRIVATE_ERROR + 56
+}
+
+enum
+{
+	CSSMERR_APPLE_DOTMAC_REQ_QUEUED = CSSM_TP_PRIVATE_ERROR + 100,
+	CSSMERR_APPLE_DOTMAC_REQ_REDIRECT = CSSM_TP_PRIVATE_ERROR + 101,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_ERR = CSSM_TP_PRIVATE_ERROR + 102,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_PARAM = CSSM_TP_PRIVATE_ERROR + 103,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_AUTH = CSSM_TP_PRIVATE_ERROR + 104,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_UNIMPL = CSSM_TP_PRIVATE_ERROR + 105,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_NOT_AVAIL = CSSM_TP_PRIVATE_ERROR + 106,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_ALREADY_EXIST = CSSM_TP_PRIVATE_ERROR + 107,
+	CSSMERR_APPLE_DOTMAC_REQ_SERVER_SERVICE_ERROR = CSSM_TP_PRIVATE_ERROR + 108,
+	CSSMERR_APPLE_DOTMAC_REQ_IS_PENDING = CSSM_TP_PRIVATE_ERROR + 109,
+	CSSMERR_APPLE_DOTMAC_NO_REQ_PENDING = CSSM_TP_PRIVATE_ERROR + 110,
+	CSSMERR_APPLE_DOTMAC_CSR_VERIFY_FAIL = CSSM_TP_PRIVATE_ERROR + 111,
+	CSSMERR_APPLE_DOTMAC_FAILED_CONSISTENCY_CHECK = CSSM_TP_PRIVATE_ERROR + 112
+}
+
+enum
+{
+	CSSM_APPLEDL_OPEN_PARAMETERS_VERSION = 1
+}
+
+enum cssm_appledl_open_parameters_mask
+
+{
+	kCSSM_APPLEDL_MASK_MODE = (1 << 0)
+}
+
+enum
+{
+	CSSM_APPLECSPDL_DB_LOCK = 0,
+	CSSM_APPLECSPDL_DB_UNLOCK = 1,
+	CSSM_APPLECSPDL_DB_GET_SETTINGS = 2,
+	CSSM_APPLECSPDL_DB_SET_SETTINGS = 3,
+	CSSM_APPLECSPDL_DB_IS_LOCKED = 4,
+	CSSM_APPLECSPDL_DB_CHANGE_PASSWORD = 5,
+	CSSM_APPLECSPDL_DB_GET_HANDLE = 6,
+	CSSM_APPLESCPDL_CSP_GET_KEYHANDLE = 7,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_8 = 8,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_9 = 9,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_10 = 10,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_11 = 11,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_12 = 12,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_13 = 13,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_14 = 14,
+	CSSM_APPLE_PRIVATE_CSPDL_CODE_15 = 15,
+	CSSM_APPLECSP_KEYDIGEST = 0x100
+}
+
+enum
+{
+	CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM = 100,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSH1
+}
+
+enum
+{
+	CSSM_ATTRIBUTE_VENDOR_DEFINED = 0x800000
+}
+
+enum
+{
+	CSSM_ATTRIBUTE_PUBLIC_KEY = (CSSM_ATTRIBUTE_DATA_KEY | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 0)),
+	CSSM_ATTRIBUTE_FEE_PRIME_TYPE = (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 1)),
+	CSSM_ATTRIBUTE_FEE_CURVE_TYPE = (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 2)),
+	CSSM_ATTRIBUTE_ASC_OPTIMIZATION = (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 3)),
+	CSSM_ATTRIBUTE_RSA_BLINDING = (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 4)),
+	CSSM_ATTRIBUTE_PARAM_KEY = (CSSM_ATTRIBUTE_DATA_KEY | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 5)),
+	CSSM_ATTRIBUTE_PROMPT = (CSSM_ATTRIBUTE_DATA_CSSM_DATA | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 6)),
+	CSSM_ATTRIBUTE_ALERT_TITLE = (CSSM_ATTRIBUTE_DATA_CSSM_DATA | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 7)),
+	CSSM_ATTRIBUTE_VERIFY_PASSPHRASE = (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 8))
+}
+
+enum
+{
+	CSSM_FEE_PRIME_TYPE_DEFAULT = 0,
+	CSSM_FEE_PRIME_TYPE_MERSENNE,
+	CSSM_FEE_PRIME_TYPE_FEE,
+	CSSM_FEE_PRIME_TYPE_GENERAL
+}
+
+enum
+{
+	CSSM_FEE_CURVE_TYPE_DEFAULT = 0,
+	CSSM_FEE_CURVE_TYPE_MONTGOMERY,
+	CSSM_FEE_CURVE_TYPE_WEIERSTRASS
+}
+
+enum
+{
+	CSSM_ASC_OPTIMIZE_DEFAULT = 0,
+	CSSM_ASC_OPTIMIZE_SIZE,
+	CSSM_ASC_OPTIMIZE_SECURITY,
+	CSSM_ASC_OPTIMIZE_TIME,
+	CSSM_ASC_OPTIMIZE_TIME_SIZE,
+	CSSM_ASC_OPTIMIZE_ASCII
+}
+
+enum
+{
+	CSSM_KEYATTR_PARTIAL = 0x00010000,
+	CSSM_KEYATTR_PUBLIC_KEY_ENCRYPT = 0x00020000
+}
+
+enum
+{
+	CSSM_TP_ACTION_REQUIRE_CRL_PER_CERT = 0x00000001,
+	CSSM_TP_ACTION_FETCH_CRL_FROM_NET = 0x00000002,
+	CSSM_TP_ACTION_CRL_SUFFICIENT = 0x00000004,
+	CSSM_TP_ACTION_REQUIRE_CRL_IF_PRESENT = 0x00000008
+}
+
+enum
+{
+	CSSM_TP_ACTION_ALLOW_EXPIRED = 0x00000001,
+	CSSM_TP_ACTION_LEAF_IS_CA = 0x00000002,
+	CSSM_TP_ACTION_FETCH_CERT_FROM_NET = 0x00000004,
+	CSSM_TP_ACTION_ALLOW_EXPIRED_ROOT = 0x00000008,
+	CSSM_TP_ACTION_REQUIRE_REV_PER_CERT = 0x00000010,
+	CSSM_TP_ACTION_TRUST_SETTINGS = 0x00000020,
+	CSSM_TP_ACTION_IMPLICIT_ANCHORS = 0x00000040
+}
+
+enum
+{
+	CSSM_CERT_STATUS_EXPIRED = 0x00000001,
+	CSSM_CERT_STATUS_NOT_VALID_YET = 0x00000002,
+	CSSM_CERT_STATUS_IS_IN_INPUT_CERTS = 0x00000004,
+	CSSM_CERT_STATUS_IS_IN_ANCHORS = 0x00000008,
+	CSSM_CERT_STATUS_IS_ROOT = 0x00000010,
+	CSSM_CERT_STATUS_IS_FROM_NET = 0x00000020,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_USER = 0x00000040,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_ADMIN = 0x00000080,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_SYSTEM = 0x00000100,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_TRUST = 0x00000200,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_DENY = 0x00000400,
+	CSSM_CERT_STATUS_TRUST_SETTINGS_IGNORED_ERROR = 0x00000800
+}
+
+enum
+{
+	CSSM_EVIDENCE_FORM_APPLE_HEADER = 0x80000000 + 0,
+	CSSM_EVIDENCE_FORM_APPLE_CERTGROUP = 0x80000000 + 1,
+	CSSM_EVIDENCE_FORM_APPLE_CERT_INFO = 0x80000000 + 2
+}
+
+enum
+{
+	CSSM_APPLEX509CL_OBTAIN_CSR,
+	CSSM_APPLEX509CL_VERIFY_CSR
+}
+
+struct CSSM_ACL_PROCESS_SUBJECT_SELECTOR
+{
+	ushort version_;
+	ushort mask;
+	uint uid;
+	uint gid;
+}
+
+
+struct CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR
+{
+	ushort version_;
+	ushort flags;
+}
+
+
+struct CSSM_APPLEDL_OPEN_PARAMETERS
+{
+	uint length;
+	uint version_;
+	int autoCommit;
+	uint mask;
+	ushort mode;
+}
+
+
+struct CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS
+{
+	uint idleTimeout;
+	ubyte lockOnSleep;
+}
+
+
+struct CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS
+{
+	ubyte isLocked;
+}
+
+
+struct CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS
+{
+	CSSM_ACCESS_CREDENTIALS* accessCredentials;
+}
+
+
+struct CSSM_APPLE_TP_NAME_OID
+{
+	char* string;
+	CSSM_OID* oid;
+}
+
+
+struct CSSM_APPLE_TP_CERT_REQUEST
+{
+	int cspHand;
+	int clHand;
+	uint serialNumber;
+	uint numSubjectNames;
+	CSSM_APPLE_TP_NAME_OID* subjectNames;
+	uint numIssuerNames;
+	CSSM_APPLE_TP_NAME_OID* issuerNames;
+	CSSM_X509_NAME_PTR issuerNameX509;
+	CSSM_KEY* certPublicKey;
+	CSSM_KEY* issuerPrivateKey;
+	uint signatureAlg;
+	CSSM_OID signatureOid;
+	uint notBefore;
+	uint notAfter;
+	uint numExtensions;
+	CE_DataAndType* extensions;
+	char* challengeString;
+}
+
+
+struct CSSM_APPLE_TP_SSL_OPTIONS
+{
+	uint Version;
+	uint ServerNameLen;
+	char* ServerName;
+	uint Flags;
+}
+
+
+struct CSSM_APPLE_TP_CRL_OPTIONS
+{
+	uint Version;
+	uint CrlFlags;
+	CSSM_DL_DB_HANDLE_PTR crlStore;
+}
+
+
+struct CSSM_APPLE_TP_SMIME_OPTIONS
+{
+	uint Version;
+	ushort IntendedUsage;
+	uint SenderEmailLen;
+	char* SenderEmail;
+}
+
+
+struct CSSM_APPLE_TP_ACTION_DATA
+{
+	uint Version;
+	uint ActionFlags;
+}
+
+
+struct CSSM_TP_APPLE_EVIDENCE_INFO
+{
+	uint StatusBits;
+	uint NumStatusCodes;
+	CSSM_RETURN* StatusCodes;
+	uint Index;
+	CSSM_DL_DB_HANDLE DlDbHandle;
+	CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord;
+}
+
+
+struct CSSM_TP_APPLE_EVIDENCE_HEADER
+{
+	uint Version;
+}
+
+
+struct CSSM_APPLE_CL_CSR_REQUEST
+{
+	CSSM_X509_NAME_PTR subjectNameX509;
+	uint signatureAlg;
+	CSSM_OID signatureOid;
+	int cspHand;
+	CSSM_KEY* subjectPublicKey;
+	CSSM_KEY* subjectPrivateKey;
+	char* challengeString;
+}
+
+extern (C)
+{
+	void cssmPerror (char* how, int error);
+	bool cssmOidToAlg (CSSM_OID* oid, CSSM_ALGORITHMS* alg);
+	CSSM_OID* cssmAlgToOid (uint algId);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmcli.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,118 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmcli;
+
+import dstep.security.cssmtype;
+
+struct CSSM_SPI_CL_FUNCS
+{
+	extern (C) int function (CSSM_DL_HANDLE DLHandle,
+					         /*const*/ char* DbName,
+					         /*const*/ CSSM_NET_ADDRESS* DbLocation,
+					         CSSM_DB_ACCESS_TYPE AccessRequest,
+					         /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCred,
+					         /*/*const*/ void* OpenParameters,
+					         CSSM_DB_HANDLE* DbHandle) DbOpen;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle) DbClose;
+	extern (C) int function (CSSM_DL_HANDLE DLHandle,
+					         /*const*/ char* DbName,
+					         /*const*/ CSSM_NET_ADDRESS* DbLocation,
+					         /*const*/ CSSM_DBINFO* DBInfo,
+					         CSSM_DB_ACCESS_TYPE AccessRequest,
+					         /*const*/ CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry,
+					         /*const*/ void* OpenParameters,
+					         CSSM_DB_HANDLE* DbHandle) DbCreate;
+	
+	extern (C) int function (CSSM_DL_HANDLE DLHandle,
+					         /*const*/ char* DbName,
+					         /*const*/ CSSM_NET_ADDRESS* DbLocation,
+					         /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCred) DbDelete;	
+
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         CSSM_DB_RECORDTYPE RelationID,
+					         /*const*/ char* RelationName,
+					         uint NumberOfAttributes,
+					         /*const*/ CSSM_DB_SCHEMA_ATTRIBUTE_INFO* pAttributeInfo,
+					         uint NumberOfIndexes,
+					         /*const*/ CSSM_DB_SCHEMA_INDEX_INFO* pIndexInfo) CreateRelation;		
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+							 CSSM_DB_RECORDTYPE RelationID) DestroyRelation;
+							 
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         CSSM_DB_ACCESS_TYPE AccessRequest,
+					         /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCred) Authenticate;	
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         /*const*/ CSSM_STRING* SelectionTag,
+					         uint* NumberOfAclInfos,
+					         CSSM_ACL_ENTRY_INFO_PTR* AclInfos) GetDbAcl;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCred,
+					         /*const*/ CSSM_ACL_EDIT* AclEdit) ChangeDbAcl;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+							 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner) GetDbOwner;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCred,
+					         /*const*/ CSSM_ACL_OWNER_PROTOTYPE* NewOwner) ChangeDbOwner;
+	
+	extern (C) int function (CSSM_DL_HANDLE DLHandle,
+							 CSSM_NAME_LIST_PTR* NameList) GetDbNames;	
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle, char* *DbName) GetDbNameFromHandle;
+	extern (C) int function (CSSM_DL_HANDLE DLHandle, CSSM_NAME_LIST_PTR NameList) FreeNameList;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         CSSM_DB_RECORDTYPE RecordType,
+					         /*const*/ CSSM_DB_RECORD_ATTRIBUTE_DATA* Attributes,
+					         /*const*/ CSSM_DATA* Data,
+					         CSSM_DB_UNIQUE_RECORD_PTR* UniqueId) DataInsert;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+							 /*const*/ CSSM_DB_UNIQUE_RECORD* UniqueRecordIdentifier) DataDelete;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         CSSM_DB_RECORDTYPE RecordType,
+					         CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
+					         /*const*/ CSSM_DB_RECORD_ATTRIBUTE_DATA* AttributesToBeModified,
+					         /*const*/ CSSM_DATA* DataToBeModified,
+					         CSSM_DB_MODIFY_MODE ModifyMode) DataModify;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         /*const*/ CSSM_QUERY* Query,
+					         CSSM_HANDLE_PTR ResultsHandle,
+					         CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+					         CSSM_DATA_PTR Data,
+					         CSSM_DB_UNIQUE_RECORD_PTR* UniqueId) DataGetFirst;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         CSSM_HANDLE ResultsHandle,
+					         CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+					         CSSM_DATA_PTR Data,
+					         CSSM_DB_UNIQUE_RECORD_PTR* UniqueId) DataGetNext;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle, CSSM_HANDLE ResultsHandle) DataAbortQuery;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         /*const*/ CSSM_DB_UNIQUE_RECORD* UniqueRecord,
+					         CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+					         CSSM_DATA_PTR Data) DataGetFromUniqueRecordId;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+							 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord) FreeUniqueRecord;
+	
+	extern (C) int function (CSSM_DL_DB_HANDLE DLDBHandle,
+					         uint PassThroughId,
+					         /*const*/ void* InputParams,
+					         void** OutputParams) PassThrough;
+}
+
+alias CSSM_SPI_CL_FUNCS* CSSM_SPI_CL_FUNCS_PTR;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmconfig.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,20 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmconfig;
+
+import dstep.coreservices.carboncore.ConditionalMacros;
+
+alias long sint64;
+alias ulong uint64;
+alias int sint32;
+alias short sint16;
+alias byte sint8;
+alias uint uint32;
+alias ushort uint16;
+alias ubyte uint8;
+alias ptrdiff_t CSSM_INTPTR;
+alias size_t CSSM_SIZE;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmcspi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,59 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmcspi;
+
+import dstep.security.cssmconfig;
+import dstep.security.cssmspi;
+import dstep.security.cssmtype;
+
+struct CSSM_SPI_CSP_FUNCS
+{
+	uint Event;
+	ulong CCHandle;
+	CSSM_CONTEXT* Context;
+	int Encrypt;
+	uint QuerySizeCount;
+	CSSM_DATA* DataBufs;
+	uint DataBufCount;
+	uint DigestAlgorithm;
+	CSSM_DATA* ClearBufs;
+	uint ClearBufCount;
+	CSSM_DATA_PTR CipherBufs;
+	uint CipherBufCount;
+	CSSM_SIZE* bytesEncrypted;
+	CSSM_DATA_PTR RemData;
+	CSSM_SIZE* bytesDecrypted;
+	CSSM_KEY* Key;
+	uint KeyUsage;
+	uint KeyAttr;
+	CSSM_DATA* KeyLabel;
+	CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry;
+	uint PublicKeyUsage;
+	uint PublicKeyAttr;
+	CSSM_DATA* PublicKeyLabel;
+	CSSM_KEY_PTR PublicKey;
+	uint PrivateKeyUsage;
+	uint PrivateKeyAttr;
+	CSSM_DATA* PrivateKeyLabel;
+	CSSM_KEY_PTR PrivateKey;
+	uint ParamBits;
+	CSSM_DATA_PTR Param;
+	uint32* NumberOfUpdatedAttibutes;
+	CSSM_ACCESS_CREDENTIALS* AccessCred;
+	CSSM_DATA* DescriptiveData;
+	CSSM_WRAP_KEY_PTR WrappedKey;
+	CSSM_KEY_PTR UnwrappedKey;
+	CSSM_KEY_PTR KeyPtr;
+	uint PassThroughId;
+	void* InData;
+	CSSM_DATA* LoginName;
+	uint TimeAlgorithm;
+	CSSM_STRING* SelectionTag;
+	uint32* NumberOfAclInfos;
+	CSSM_ACL_EDIT* AclEdit;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmdli.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,39 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmdli;
+
+import dstep.security.cssmtype;
+
+struct CSSM_SPI_DL_FUNCS
+{
+	char* DbName;
+	CSSM_NET_ADDRESS* DbLocation;
+	uint AccessRequest;
+	CSSM_ACCESS_CREDENTIALS* AccessCred;
+	void* OpenParameters;
+	CSSM_DBINFO* DBInfo;
+	CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry;
+	uint RelationID;
+	char* RelationName;
+	uint NumberOfAttributes;
+	CSSM_DB_SCHEMA_ATTRIBUTE_INFO* pAttributeInfo;
+	uint NumberOfIndexes;
+	CSSM_STRING* SelectionTag;
+	uint* NumberOfAclInfos;
+	uint RecordType;
+	CSSM_DB_RECORD_ATTRIBUTE_DATA* Attributes;
+	CSSM_DATA* Data;
+	CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier;
+	CSSM_DB_RECORD_ATTRIBUTE_DATA* AttributesToBeModified;
+	CSSM_DATA* DataToBeModified;
+	CSSM_QUERY* Query;
+	CSSM_HANDLE_PTR ResultsHandle;
+	CSSM_DB_UNIQUE_RECORD* UniqueRecord;
+	uint PassThroughId;
+	void* InputParams;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmerr.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,588 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmerr;enum
+{
+	CSSM_BASE_ERROR = -0x7FFF0000
+}
+
+enum
+{
+	CSSM_ERRORCODE_MODULE_EXTENT = 0x00000800,
+	CSSM_ERRORCODE_CUSTOM_OFFSET = 0x00000400,
+	CSSM_ERRORCODE_COMMON_EXTENT = 0x100
+}
+
+enum
+{
+	CSSM_CSSM_BASE_ERROR = CSSM_BASE_ERROR,
+	CSSM_CSSM_PRIVATE_ERROR = CSSM_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_CSP_BASE_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_CSP_PRIVATE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_DL_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_DL_PRIVATE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_CL_BASE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_CL_PRIVATE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_TP_BASE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_TP_PRIVATE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_KR_BASE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_KR_PRIVATE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET,
+	CSSM_AC_BASE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_AC_PRIVATE_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET
+}
+
+enum
+{
+	CSSM_MDS_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT,
+	CSSM_MDS_PRIVATE_ERROR = CSSM_MDS_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET
+}
+
+enum
+{
+	CSSMERR_CSSM_INVALID_ADDIN_HANDLE = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 1,
+	CSSMERR_CSSM_NOT_INITIALIZED = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 2,
+	CSSMERR_CSSM_INVALID_HANDLE_USAGE = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 3,
+	CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 4,
+	CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 5
+}
+
+enum
+{
+	CSSM_ERRCODE_INTERNAL_ERROR = 0x0001,
+	CSSM_ERRCODE_MEMORY_ERROR = 0x0002,
+	CSSM_ERRCODE_MDS_ERROR = 0x0003,
+	CSSM_ERRCODE_INVALID_POINTER = 0x0004,
+	CSSM_ERRCODE_INVALID_INPUT_POINTER = 0x0005,
+	CSSM_ERRCODE_INVALID_OUTPUT_POINTER = 0x0006,
+	CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED = 0x0007,
+	CSSM_ERRCODE_SELF_CHECK_FAILED = 0x0008,
+	CSSM_ERRCODE_OS_ACCESS_DENIED = 0x0009,
+	CSSM_ERRCODE_FUNCTION_FAILED = 0x000A,
+	CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED = 0x000B,
+	CSSM_ERRCODE_INVALID_GUID = 0x000C
+}
+
+enum
+{
+	CSSM_ERRCODE_OPERATION_AUTH_DENIED = 0x0020,
+	CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED = 0x0021,
+	CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED = 0x0022,
+	CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED = 0x0023,
+	CSSM_ERRCODE_OBJECT_ACL_REQUIRED = 0x0024,
+	CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS = 0x0025,
+	CSSM_ERRCODE_INVALID_ACL_BASE_CERTS = 0x0026,
+	CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED = 0x0027,
+	CSSM_ERRCODE_INVALID_SAMPLE_VALUE = 0x0028,
+	CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED = 0x0029,
+	CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE = 0x002A,
+	CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED = 0x002B,
+	CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK = 0x002C,
+	CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED = 0x002D,
+	CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG = 0x002E,
+	CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND = 0x002F,
+	CSSM_ERRCODE_INVALID_ACL_EDIT_MODE = 0x0030,
+	CSSM_ERRCODE_ACL_CHANGE_FAILED = 0x0031,
+	CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY = 0x0032,
+	CSSM_ERRCODE_INVALID_NEW_ACL_OWNER = 0x0033,
+	CSSM_ERRCODE_ACL_DELETE_FAILED = 0x0034,
+	CSSM_ERRCODE_ACL_REPLACE_FAILED = 0x0035,
+	CSSM_ERRCODE_ACL_ADD_FAILED = 0x0036
+}
+
+enum
+{
+	CSSM_ERRCODE_INVALID_CONTEXT_HANDLE = 0x0040,
+	CSSM_ERRCODE_INCOMPATIBLE_VERSION = 0x0041,
+	CSSM_ERRCODE_INVALID_CERTGROUP_POINTER = 0x0042,
+	CSSM_ERRCODE_INVALID_CERT_POINTER = 0x0043,
+	CSSM_ERRCODE_INVALID_CRL_POINTER = 0x0044,
+	CSSM_ERRCODE_INVALID_FIELD_POINTER = 0x0045,
+	CSSM_ERRCODE_INVALID_DATA = 0x0046,
+	CSSM_ERRCODE_CRL_ALREADY_SIGNED = 0x0047,
+	CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS = 0x0048,
+	CSSM_ERRCODE_VERIFICATION_FAILURE = 0x0049,
+	CSSM_ERRCODE_INVALID_DB_HANDLE = 0x004A,
+	CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED = 0x004B,
+	CSSM_ERRCODE_INVALID_DB_LIST = 0x004C,
+	CSSM_ERRCODE_INVALID_DB_LIST_POINTER = 0x004D,
+	CSSM_ERRCODE_UNKNOWN_FORMAT = 0x004E,
+	CSSM_ERRCODE_UNKNOWN_TAG = 0x004F,
+	CSSM_ERRCODE_INVALID_CSP_HANDLE = 0x0050,
+	CSSM_ERRCODE_INVALID_DL_HANDLE = 0x0051,
+	CSSM_ERRCODE_INVALID_CL_HANDLE = 0x0052,
+	CSSM_ERRCODE_INVALID_TP_HANDLE = 0x0053,
+	CSSM_ERRCODE_INVALID_KR_HANDLE = 0x0054,
+	CSSM_ERRCODE_INVALID_AC_HANDLE = 0x0055,
+	CSSM_ERRCODE_INVALID_PASSTHROUGH_ID = 0x0056,
+	CSSM_ERRCODE_INVALID_NETWORK_ADDR = 0x0057,
+	CSSM_ERRCODE_INVALID_CRYPTO_DATA = 0x0058
+}
+
+enum
+{
+	CSSMERR_CSSM_INTERNAL_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_CSSM_MEMORY_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_CSSM_MDS_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_CSSM_INVALID_POINTER = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_CSSM_INVALID_INPUT_POINTER = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_CSSM_INVALID_OUTPUT_POINTER = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_CSSM_SELF_CHECK_FAILED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_CSSM_OS_ACCESS_DENIED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_CSSM_FUNCTION_FAILED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED,
+	CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED,
+	CSSMERR_CSSM_INVALID_GUID = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_GUID
+}
+
+enum
+{
+	CSSMERR_CSSM_INVALID_CONTEXT_HANDLE = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE,
+	CSSMERR_CSSM_INCOMPATIBLE_VERSION = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INCOMPATIBLE_VERSION,
+	CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED
+}
+
+enum
+{
+	CSSM_CSSM_BASE_CSSM_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 0x10,
+	CSSMERR_CSSM_SCOPE_NOT_SUPPORTED = CSSM_CSSM_BASE_CSSM_ERROR + 1,
+	CSSMERR_CSSM_PVC_ALREADY_CONFIGURED = CSSM_CSSM_BASE_CSSM_ERROR + 2,
+	CSSMERR_CSSM_INVALID_PVC = CSSM_CSSM_BASE_CSSM_ERROR + 3,
+	CSSMERR_CSSM_EMM_LOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 4,
+	CSSMERR_CSSM_EMM_UNLOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 5,
+	CSSMERR_CSSM_ADDIN_LOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 6,
+	CSSMERR_CSSM_INVALID_KEY_HIERARCHY = CSSM_CSSM_BASE_CSSM_ERROR + 7,
+	CSSMERR_CSSM_ADDIN_UNLOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 8,
+	CSSMERR_CSSM_LIB_REF_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 9,
+	CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE = CSSM_CSSM_BASE_CSSM_ERROR + 10,
+	CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 11,
+	CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 12,
+	CSSMERR_CSSM_INVALID_SERVICE_MASK = CSSM_CSSM_BASE_CSSM_ERROR + 13,
+	CSSMERR_CSSM_MODULE_NOT_LOADED = CSSM_CSSM_BASE_CSSM_ERROR + 14,
+	CSSMERR_CSSM_INVALID_SUBSERVICEID = CSSM_CSSM_BASE_CSSM_ERROR + 15,
+	CSSMERR_CSSM_BUFFER_TOO_SMALL = CSSM_CSSM_BASE_CSSM_ERROR + 16,
+	CSSMERR_CSSM_INVALID_ATTRIBUTE = CSSM_CSSM_BASE_CSSM_ERROR + 17,
+	CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT = CSSM_CSSM_BASE_CSSM_ERROR + 18,
+	CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL = CSSM_CSSM_BASE_CSSM_ERROR + 19,
+	CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 20,
+	CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 21
+}
+
+enum
+{
+	CSSMERR_CSP_INTERNAL_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_CSP_MEMORY_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_CSP_MDS_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_CSP_INVALID_POINTER = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_CSP_INVALID_INPUT_POINTER = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_CSP_INVALID_OUTPUT_POINTER = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_CSP_SELF_CHECK_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_CSP_OS_ACCESS_DENIED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_CSP_FUNCTION_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED
+}
+
+enum
+{
+	CSSMERR_CSP_OPERATION_AUTH_DENIED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OPERATION_AUTH_DENIED,
+	CSSMERR_CSP_OBJECT_USE_AUTH_DENIED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED,
+	CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED,
+	CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED,
+	CSSMERR_CSP_OBJECT_ACL_REQUIRED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_REQUIRED,
+	CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS,
+	CSSMERR_CSP_INVALID_ACL_BASE_CERTS = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_BASE_CERTS,
+	CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED,
+	CSSMERR_CSP_INVALID_SAMPLE_VALUE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_SAMPLE_VALUE,
+	CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED,
+	CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE,
+	CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED,
+	CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK,
+	CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED,
+	CSSMERR_CSP_INVALID_ACL_ENTRY_TAG = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG,
+	CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND,
+	CSSMERR_CSP_INVALID_ACL_EDIT_MODE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_EDIT_MODE,
+	CSSMERR_CSP_ACL_CHANGE_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_CHANGE_FAILED,
+	CSSMERR_CSP_INVALID_NEW_ACL_ENTRY = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY,
+	CSSMERR_CSP_INVALID_NEW_ACL_OWNER = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_OWNER,
+	CSSMERR_CSP_ACL_DELETE_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_DELETE_FAILED,
+	CSSMERR_CSP_ACL_REPLACE_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_REPLACE_FAILED,
+	CSSMERR_CSP_ACL_ADD_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_ADD_FAILED
+}
+
+enum
+{
+	CSSMERR_CSP_INVALID_CONTEXT_HANDLE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE,
+	CSSMERR_CSP_PRIVILEGE_NOT_GRANTED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED,
+	CSSMERR_CSP_INVALID_DATA = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA,
+	CSSMERR_CSP_INVALID_PASSTHROUGH_ID = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID,
+	CSSMERR_CSP_INVALID_CRYPTO_DATA = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_CRYPTO_DATA
+}
+
+enum
+{
+	CSSM_CSP_BASE_CSP_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
+	CSSMERR_CSP_INPUT_LENGTH_ERROR = CSSM_CSP_BASE_CSP_ERROR + 1,
+	CSSMERR_CSP_OUTPUT_LENGTH_ERROR = CSSM_CSP_BASE_CSP_ERROR + 2,
+	CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED = CSSM_CSP_BASE_CSP_ERROR + 3,
+	CSSMERR_CSP_DEVICE_ERROR = CSSM_CSP_BASE_CSP_ERROR + 4,
+	CSSMERR_CSP_DEVICE_MEMORY_ERROR = CSSM_CSP_BASE_CSP_ERROR + 5,
+	CSSMERR_CSP_ATTACH_HANDLE_BUSY = CSSM_CSP_BASE_CSP_ERROR + 6,
+	CSSMERR_CSP_NOT_LOGGED_IN = CSSM_CSP_BASE_CSP_ERROR + 7,
+	CSSMERR_CSP_INVALID_KEY = CSSM_CSP_BASE_CSP_ERROR + 16,
+	CSSMERR_CSP_INVALID_KEY_REFERENCE = CSSM_CSP_BASE_CSP_ERROR + 17,
+	CSSMERR_CSP_INVALID_KEY_CLASS = CSSM_CSP_BASE_CSP_ERROR + 18,
+	CSSMERR_CSP_ALGID_MISMATCH = CSSM_CSP_BASE_CSP_ERROR + 19,
+	CSSMERR_CSP_KEY_USAGE_INCORRECT = CSSM_CSP_BASE_CSP_ERROR + 20,
+	CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT = CSSM_CSP_BASE_CSP_ERROR + 21,
+	CSSMERR_CSP_KEY_HEADER_INCONSISTENT = CSSM_CSP_BASE_CSP_ERROR + 22,
+	CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 23,
+	CSSMERR_CSP_UNSUPPORTED_KEY_SIZE = CSSM_CSP_BASE_CSP_ERROR + 24,
+	CSSMERR_CSP_INVALID_KEY_POINTER = CSSM_CSP_BASE_CSP_ERROR + 25,
+	CSSMERR_CSP_INVALID_KEYUSAGE_MASK = CSSM_CSP_BASE_CSP_ERROR + 26,
+	CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK = CSSM_CSP_BASE_CSP_ERROR + 27,
+	CSSMERR_CSP_INVALID_KEYATTR_MASK = CSSM_CSP_BASE_CSP_ERROR + 28,
+	CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK = CSSM_CSP_BASE_CSP_ERROR + 29,
+	CSSMERR_CSP_INVALID_KEY_LABEL = CSSM_CSP_BASE_CSP_ERROR + 30,
+	CSSMERR_CSP_UNSUPPORTED_KEY_LABEL = CSSM_CSP_BASE_CSP_ERROR + 31,
+	CSSMERR_CSP_INVALID_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 32,
+	CSSMERR_CSP_INVALID_DATA_COUNT = CSSM_CSP_BASE_CSP_ERROR + 40,
+	CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED = CSSM_CSP_BASE_CSP_ERROR + 41,
+	CSSMERR_CSP_INVALID_INPUT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 42,
+	CSSMERR_CSP_INVALID_OUTPUT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 43,
+	CSSMERR_CSP_INVALID_CONTEXT = CSSM_CSP_BASE_CSP_ERROR + 48,
+	CSSMERR_CSP_INVALID_ALGORITHM = CSSM_CSP_BASE_CSP_ERROR + 49,
+	CSSMERR_CSP_INVALID_ATTR_KEY = CSSM_CSP_BASE_CSP_ERROR + 54,
+	CSSMERR_CSP_MISSING_ATTR_KEY = CSSM_CSP_BASE_CSP_ERROR + 55,
+	CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 56,
+	CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 57,
+	CSSMERR_CSP_INVALID_ATTR_SALT = CSSM_CSP_BASE_CSP_ERROR + 58,
+	CSSMERR_CSP_MISSING_ATTR_SALT = CSSM_CSP_BASE_CSP_ERROR + 59,
+	CSSMERR_CSP_INVALID_ATTR_PADDING = CSSM_CSP_BASE_CSP_ERROR + 60,
+	CSSMERR_CSP_MISSING_ATTR_PADDING = CSSM_CSP_BASE_CSP_ERROR + 61,
+	CSSMERR_CSP_INVALID_ATTR_RANDOM = CSSM_CSP_BASE_CSP_ERROR + 62,
+	CSSMERR_CSP_MISSING_ATTR_RANDOM = CSSM_CSP_BASE_CSP_ERROR + 63,
+	CSSMERR_CSP_INVALID_ATTR_SEED = CSSM_CSP_BASE_CSP_ERROR + 64,
+	CSSMERR_CSP_MISSING_ATTR_SEED = CSSM_CSP_BASE_CSP_ERROR + 65,
+	CSSMERR_CSP_INVALID_ATTR_PASSPHRASE = CSSM_CSP_BASE_CSP_ERROR + 66,
+	CSSMERR_CSP_MISSING_ATTR_PASSPHRASE = CSSM_CSP_BASE_CSP_ERROR + 67,
+	CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH = CSSM_CSP_BASE_CSP_ERROR + 68,
+	CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH = CSSM_CSP_BASE_CSP_ERROR + 69,
+	CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE = CSSM_CSP_BASE_CSP_ERROR + 70,
+	CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE = CSSM_CSP_BASE_CSP_ERROR + 71,
+	CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE = CSSM_CSP_BASE_CSP_ERROR + 100,
+	CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE = CSSM_CSP_BASE_CSP_ERROR + 101,
+	CSSMERR_CSP_INVALID_ATTR_ROUNDS = CSSM_CSP_BASE_CSP_ERROR + 102,
+	CSSMERR_CSP_MISSING_ATTR_ROUNDS = CSSM_CSP_BASE_CSP_ERROR + 103,
+	CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS = CSSM_CSP_BASE_CSP_ERROR + 104,
+	CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS = CSSM_CSP_BASE_CSP_ERROR + 105,
+	CSSMERR_CSP_INVALID_ATTR_LABEL = CSSM_CSP_BASE_CSP_ERROR + 106,
+	CSSMERR_CSP_MISSING_ATTR_LABEL = CSSM_CSP_BASE_CSP_ERROR + 107,
+	CSSMERR_CSP_INVALID_ATTR_KEY_TYPE = CSSM_CSP_BASE_CSP_ERROR + 108,
+	CSSMERR_CSP_MISSING_ATTR_KEY_TYPE = CSSM_CSP_BASE_CSP_ERROR + 109,
+	CSSMERR_CSP_INVALID_ATTR_MODE = CSSM_CSP_BASE_CSP_ERROR + 110,
+	CSSMERR_CSP_MISSING_ATTR_MODE = CSSM_CSP_BASE_CSP_ERROR + 111,
+	CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS = CSSM_CSP_BASE_CSP_ERROR + 112,
+	CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS = CSSM_CSP_BASE_CSP_ERROR + 113,
+	CSSMERR_CSP_INVALID_ATTR_START_DATE = CSSM_CSP_BASE_CSP_ERROR + 114,
+	CSSMERR_CSP_MISSING_ATTR_START_DATE = CSSM_CSP_BASE_CSP_ERROR + 115,
+	CSSMERR_CSP_INVALID_ATTR_END_DATE = CSSM_CSP_BASE_CSP_ERROR + 116,
+	CSSMERR_CSP_MISSING_ATTR_END_DATE = CSSM_CSP_BASE_CSP_ERROR + 117,
+	CSSMERR_CSP_INVALID_ATTR_VERSION = CSSM_CSP_BASE_CSP_ERROR + 118,
+	CSSMERR_CSP_MISSING_ATTR_VERSION = CSSM_CSP_BASE_CSP_ERROR + 119,
+	CSSMERR_CSP_INVALID_ATTR_PRIME = CSSM_CSP_BASE_CSP_ERROR + 120,
+	CSSMERR_CSP_MISSING_ATTR_PRIME = CSSM_CSP_BASE_CSP_ERROR + 121,
+	CSSMERR_CSP_INVALID_ATTR_BASE = CSSM_CSP_BASE_CSP_ERROR + 122,
+	CSSMERR_CSP_MISSING_ATTR_BASE = CSSM_CSP_BASE_CSP_ERROR + 123,
+	CSSMERR_CSP_INVALID_ATTR_SUBPRIME = CSSM_CSP_BASE_CSP_ERROR + 124,
+	CSSMERR_CSP_MISSING_ATTR_SUBPRIME = CSSM_CSP_BASE_CSP_ERROR + 125,
+	CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT = CSSM_CSP_BASE_CSP_ERROR + 126,
+	CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT = CSSM_CSP_BASE_CSP_ERROR + 127,
+	CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE = CSSM_CSP_BASE_CSP_ERROR + 128,
+	CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE = CSSM_CSP_BASE_CSP_ERROR + 129,
+	CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS = CSSM_CSP_BASE_CSP_ERROR + 130,
+	CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS = CSSM_CSP_BASE_CSP_ERROR + 131,
+	CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 132,
+	CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 133,
+	CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 134,
+	CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 135,
+	CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 136,
+	CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 137,
+	CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 138,
+	CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 139,
+	CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS = CSSM_CSP_BASE_CSP_ERROR + 72,
+	CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED = CSSM_CSP_BASE_CSP_ERROR + 73,
+	CSSMERR_CSP_VERIFY_FAILED = CSSM_CSP_BASE_CSP_ERROR + 74,
+	CSSMERR_CSP_INVALID_SIGNATURE = CSSM_CSP_BASE_CSP_ERROR + 75,
+	CSSMERR_CSP_QUERY_SIZE_UNKNOWN = CSSM_CSP_BASE_CSP_ERROR + 76,
+	CSSMERR_CSP_BLOCK_SIZE_MISMATCH = CSSM_CSP_BASE_CSP_ERROR + 77,
+	CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND = CSSM_CSP_BASE_CSP_ERROR + 78,
+	CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT = CSSM_CSP_BASE_CSP_ERROR + 79,
+	CSSMERR_CSP_DEVICE_VERIFY_FAILED = CSSM_CSP_BASE_CSP_ERROR + 80,
+	CSSMERR_CSP_INVALID_LOGIN_NAME = CSSM_CSP_BASE_CSP_ERROR + 81,
+	CSSMERR_CSP_ALREADY_LOGGED_IN = CSSM_CSP_BASE_CSP_ERROR + 82,
+	CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS = CSSM_CSP_BASE_CSP_ERROR + 83,
+	CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS = CSSM_CSP_BASE_CSP_ERROR + 84,
+	CSSMERR_CSP_INVALID_DIGEST_ALGORITHM = CSSM_CSP_BASE_CSP_ERROR + 85,
+	CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED = CSSM_CSP_BASE_CSP_ERROR + 86
+}
+
+enum
+{
+	CSSMERR_TP_INTERNAL_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_TP_MEMORY_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_TP_MDS_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_TP_INVALID_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_TP_INVALID_INPUT_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_TP_INVALID_OUTPUT_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_TP_SELF_CHECK_FAILED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_TP_OS_ACCESS_DENIED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_TP_FUNCTION_FAILED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED,
+	CSSMERR_TP_INVALID_CONTEXT_HANDLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE,
+	CSSMERR_TP_INVALID_DATA = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA,
+	CSSMERR_TP_INVALID_DB_LIST = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST,
+	CSSMERR_TP_INVALID_CERTGROUP_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CERTGROUP_POINTER,
+	CSSMERR_TP_INVALID_CERT_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CERT_POINTER,
+	CSSMERR_TP_INVALID_CRL_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CRL_POINTER,
+	CSSMERR_TP_INVALID_FIELD_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_FIELD_POINTER,
+	CSSMERR_TP_INVALID_NETWORK_ADDR = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_NETWORK_ADDR,
+	CSSMERR_TP_CRL_ALREADY_SIGNED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_CRL_ALREADY_SIGNED,
+	CSSMERR_TP_INVALID_NUMBER_OF_FIELDS = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS,
+	CSSMERR_TP_VERIFICATION_FAILURE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_VERIFICATION_FAILURE,
+	CSSMERR_TP_INVALID_DB_HANDLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE,
+	CSSMERR_TP_UNKNOWN_FORMAT = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_FORMAT,
+	CSSMERR_TP_UNKNOWN_TAG = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_TAG,
+	CSSMERR_TP_INVALID_PASSTHROUGH_ID = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID,
+	CSSMERR_TP_INVALID_CSP_HANDLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CSP_HANDLE,
+	CSSMERR_TP_INVALID_DL_HANDLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE,
+	CSSMERR_TP_INVALID_CL_HANDLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE,
+	CSSMERR_TP_INVALID_DB_LIST_POINTER = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER
+}
+
+enum
+{
+	CSSM_TP_BASE_TP_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
+	CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER = CSSM_TP_BASE_TP_ERROR + 1,
+	CSSMERR_TP_INVALID_IDENTIFIER_POINTER = CSSM_TP_BASE_TP_ERROR + 2,
+	CSSMERR_TP_INVALID_KEYCACHE_HANDLE = CSSM_TP_BASE_TP_ERROR + 3,
+	CSSMERR_TP_INVALID_CERTGROUP = CSSM_TP_BASE_TP_ERROR + 4,
+	CSSMERR_TP_INVALID_CRLGROUP = CSSM_TP_BASE_TP_ERROR + 5,
+	CSSMERR_TP_INVALID_CRLGROUP_POINTER = CSSM_TP_BASE_TP_ERROR + 6,
+	CSSMERR_TP_AUTHENTICATION_FAILED = CSSM_TP_BASE_TP_ERROR + 7,
+	CSSMERR_TP_CERTGROUP_INCOMPLETE = CSSM_TP_BASE_TP_ERROR + 8,
+	CSSMERR_TP_CERTIFICATE_CANT_OPERATE = CSSM_TP_BASE_TP_ERROR + 9,
+	CSSMERR_TP_CERT_EXPIRED = CSSM_TP_BASE_TP_ERROR + 10,
+	CSSMERR_TP_CERT_NOT_VALID_YET = CSSM_TP_BASE_TP_ERROR + 11,
+	CSSMERR_TP_CERT_REVOKED = CSSM_TP_BASE_TP_ERROR + 12,
+	CSSMERR_TP_CERT_SUSPENDED = CSSM_TP_BASE_TP_ERROR + 13,
+	CSSMERR_TP_INSUFFICIENT_CREDENTIALS = CSSM_TP_BASE_TP_ERROR + 14,
+	CSSMERR_TP_INVALID_ACTION = CSSM_TP_BASE_TP_ERROR + 15,
+	CSSMERR_TP_INVALID_ACTION_DATA = CSSM_TP_BASE_TP_ERROR + 16,
+	CSSMERR_TP_INVALID_ANCHOR_CERT = CSSM_TP_BASE_TP_ERROR + 18,
+	CSSMERR_TP_INVALID_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 19,
+	CSSMERR_TP_VERIFY_ACTION_FAILED = CSSM_TP_BASE_TP_ERROR + 20,
+	CSSMERR_TP_INVALID_CERTIFICATE = CSSM_TP_BASE_TP_ERROR + 21,
+	CSSMERR_TP_INVALID_CERT_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 22,
+	CSSMERR_TP_INVALID_CRL_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 23,
+	CSSMERR_TP_INVALID_CRL_ENCODING = CSSM_TP_BASE_TP_ERROR + 24,
+	CSSMERR_TP_INVALID_CRL_TYPE = CSSM_TP_BASE_TP_ERROR + 25,
+	CSSMERR_TP_INVALID_CRL = CSSM_TP_BASE_TP_ERROR + 26,
+	CSSMERR_TP_INVALID_FORM_TYPE = CSSM_TP_BASE_TP_ERROR + 27,
+	CSSMERR_TP_INVALID_ID = CSSM_TP_BASE_TP_ERROR + 28,
+	CSSMERR_TP_INVALID_IDENTIFIER = CSSM_TP_BASE_TP_ERROR + 29,
+	CSSMERR_TP_INVALID_INDEX = CSSM_TP_BASE_TP_ERROR + 30,
+	CSSMERR_TP_INVALID_NAME = CSSM_TP_BASE_TP_ERROR + 31,
+	CSSMERR_TP_INVALID_POLICY_IDENTIFIERS = CSSM_TP_BASE_TP_ERROR + 32,
+	CSSMERR_TP_INVALID_TIMESTRING = CSSM_TP_BASE_TP_ERROR + 33,
+	CSSMERR_TP_INVALID_REASON = CSSM_TP_BASE_TP_ERROR + 34,
+	CSSMERR_TP_INVALID_REQUEST_INPUTS = CSSM_TP_BASE_TP_ERROR + 35,
+	CSSMERR_TP_INVALID_RESPONSE_VECTOR = CSSM_TP_BASE_TP_ERROR + 36,
+	CSSMERR_TP_INVALID_SIGNATURE = CSSM_TP_BASE_TP_ERROR + 37,
+	CSSMERR_TP_INVALID_STOP_ON_POLICY = CSSM_TP_BASE_TP_ERROR + 38,
+	CSSMERR_TP_INVALID_CALLBACK = CSSM_TP_BASE_TP_ERROR + 39,
+	CSSMERR_TP_INVALID_TUPLE = CSSM_TP_BASE_TP_ERROR + 40,
+	CSSMERR_TP_NOT_SIGNER = CSSM_TP_BASE_TP_ERROR + 41,
+	CSSMERR_TP_NOT_TRUSTED = CSSM_TP_BASE_TP_ERROR + 42,
+	CSSMERR_TP_NO_DEFAULT_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 43,
+	CSSMERR_TP_REJECTED_FORM = CSSM_TP_BASE_TP_ERROR + 44,
+	CSSMERR_TP_REQUEST_LOST = CSSM_TP_BASE_TP_ERROR + 45,
+	CSSMERR_TP_REQUEST_REJECTED = CSSM_TP_BASE_TP_ERROR + 46,
+	CSSMERR_TP_UNSUPPORTED_ADDR_TYPE = CSSM_TP_BASE_TP_ERROR + 47,
+	CSSMERR_TP_UNSUPPORTED_SERVICE = CSSM_TP_BASE_TP_ERROR + 48,
+	CSSMERR_TP_INVALID_TUPLEGROUP_POINTER = CSSM_TP_BASE_TP_ERROR + 49,
+	CSSMERR_TP_INVALID_TUPLEGROUP = CSSM_TP_BASE_TP_ERROR + 50
+}
+
+enum
+{
+	CSSMERR_AC_INTERNAL_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_AC_MEMORY_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_AC_MDS_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_AC_INVALID_POINTER = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_AC_INVALID_INPUT_POINTER = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_AC_INVALID_OUTPUT_POINTER = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_AC_SELF_CHECK_FAILED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_AC_OS_ACCESS_DENIED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_AC_FUNCTION_FAILED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED,
+	CSSMERR_AC_INVALID_CONTEXT_HANDLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE,
+	CSSMERR_AC_INVALID_DATA = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA,
+	CSSMERR_AC_INVALID_DB_LIST = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST,
+	CSSMERR_AC_INVALID_PASSTHROUGH_ID = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID,
+	CSSMERR_AC_INVALID_DL_HANDLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE,
+	CSSMERR_AC_INVALID_CL_HANDLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE,
+	CSSMERR_AC_INVALID_TP_HANDLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_TP_HANDLE,
+	CSSMERR_AC_INVALID_DB_HANDLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE,
+	CSSMERR_AC_INVALID_DB_LIST_POINTER = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER
+}
+
+enum
+{
+	CSSM_AC_BASE_AC_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
+	CSSMERR_AC_INVALID_BASE_ACLS = CSSM_AC_BASE_AC_ERROR + 1,
+	CSSMERR_AC_INVALID_TUPLE_CREDENTIALS = CSSM_AC_BASE_AC_ERROR + 2,
+	CSSMERR_AC_INVALID_ENCODING = CSSM_AC_BASE_AC_ERROR + 3,
+	CSSMERR_AC_INVALID_VALIDITY_PERIOD = CSSM_AC_BASE_AC_ERROR + 4,
+	CSSMERR_AC_INVALID_REQUESTOR = CSSM_AC_BASE_AC_ERROR + 5,
+	CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR = CSSM_AC_BASE_AC_ERROR + 6
+}
+
+enum
+{
+	CSSMERR_CL_INTERNAL_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_CL_MEMORY_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_CL_MDS_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_CL_INVALID_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_CL_INVALID_INPUT_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_CL_INVALID_OUTPUT_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_CL_SELF_CHECK_FAILED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_CL_OS_ACCESS_DENIED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_CL_FUNCTION_FAILED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED,
+	CSSMERR_CL_INVALID_CONTEXT_HANDLE = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE,
+	CSSMERR_CL_INVALID_CERTGROUP_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CERTGROUP_POINTER,
+	CSSMERR_CL_INVALID_CERT_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CERT_POINTER,
+	CSSMERR_CL_INVALID_CRL_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CRL_POINTER,
+	CSSMERR_CL_INVALID_FIELD_POINTER = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_FIELD_POINTER,
+	CSSMERR_CL_INVALID_DATA = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA,
+	CSSMERR_CL_CRL_ALREADY_SIGNED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_CRL_ALREADY_SIGNED,
+	CSSMERR_CL_INVALID_NUMBER_OF_FIELDS = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS,
+	CSSMERR_CL_VERIFICATION_FAILURE = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_VERIFICATION_FAILURE,
+	CSSMERR_CL_UNKNOWN_FORMAT = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_FORMAT,
+	CSSMERR_CL_UNKNOWN_TAG = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_TAG,
+	CSSMERR_CL_INVALID_PASSTHROUGH_ID = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID
+}
+
+enum
+{
+	CSSM_CL_BASE_CL_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
+	CSSMERR_CL_INVALID_BUNDLE_POINTER = CSSM_CL_BASE_CL_ERROR + 1,
+	CSSMERR_CL_INVALID_CACHE_HANDLE = CSSM_CL_BASE_CL_ERROR + 2,
+	CSSMERR_CL_INVALID_RESULTS_HANDLE = CSSM_CL_BASE_CL_ERROR + 3,
+	CSSMERR_CL_INVALID_BUNDLE_INFO = CSSM_CL_BASE_CL_ERROR + 4,
+	CSSMERR_CL_INVALID_CRL_INDEX = CSSM_CL_BASE_CL_ERROR + 5,
+	CSSMERR_CL_INVALID_SCOPE = CSSM_CL_BASE_CL_ERROR + 6,
+	CSSMERR_CL_NO_FIELD_VALUES = CSSM_CL_BASE_CL_ERROR + 7,
+	CSSMERR_CL_SCOPE_NOT_SUPPORTED = CSSM_CL_BASE_CL_ERROR + 8
+}
+
+enum
+{
+	CSSMERR_DL_INTERNAL_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR,
+	CSSMERR_DL_MEMORY_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR,
+	CSSMERR_DL_MDS_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR,
+	CSSMERR_DL_INVALID_POINTER = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER,
+	CSSMERR_DL_INVALID_INPUT_POINTER = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER,
+	CSSMERR_DL_INVALID_OUTPUT_POINTER = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER,
+	CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED,
+	CSSMERR_DL_SELF_CHECK_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED,
+	CSSMERR_DL_OS_ACCESS_DENIED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED,
+	CSSMERR_DL_FUNCTION_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED,
+	CSSMERR_DL_INVALID_CSP_HANDLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_CSP_HANDLE,
+	CSSMERR_DL_INVALID_DL_HANDLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE,
+	CSSMERR_DL_INVALID_CL_HANDLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE,
+	CSSMERR_DL_INVALID_DB_LIST_POINTER = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER
+}
+
+enum
+{
+	CSSMERR_DL_OPERATION_AUTH_DENIED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OPERATION_AUTH_DENIED,
+	CSSMERR_DL_OBJECT_USE_AUTH_DENIED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED,
+	CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED,
+	CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED,
+	CSSMERR_DL_OBJECT_ACL_REQUIRED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_REQUIRED,
+	CSSMERR_DL_INVALID_ACCESS_CREDENTIALS = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS,
+	CSSMERR_DL_INVALID_ACL_BASE_CERTS = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_BASE_CERTS,
+	CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED,
+	CSSMERR_DL_INVALID_SAMPLE_VALUE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_SAMPLE_VALUE,
+	CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED,
+	CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE,
+	CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED,
+	CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK,
+	CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED,
+	CSSMERR_DL_INVALID_ACL_ENTRY_TAG = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG,
+	CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND,
+	CSSMERR_DL_INVALID_ACL_EDIT_MODE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_EDIT_MODE,
+	CSSMERR_DL_ACL_CHANGE_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_CHANGE_FAILED,
+	CSSMERR_DL_INVALID_NEW_ACL_ENTRY = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY,
+	CSSMERR_DL_INVALID_NEW_ACL_OWNER = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_OWNER,
+	CSSMERR_DL_ACL_DELETE_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_DELETE_FAILED,
+	CSSMERR_DL_ACL_REPLACE_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_REPLACE_FAILED,
+	CSSMERR_DL_ACL_ADD_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_ADD_FAILED
+}
+
+enum
+{
+	CSSMERR_DL_INVALID_DB_HANDLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE,
+	CSSMERR_DL_INVALID_PASSTHROUGH_ID = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID,
+	CSSMERR_DL_INVALID_NETWORK_ADDR = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NETWORK_ADDR
+}
+
+enum
+{
+	CSSM_DL_BASE_DL_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT,
+	CSSMERR_DL_DATABASE_CORRUPT = CSSM_DL_BASE_DL_ERROR + 1,
+	CSSMERR_DL_INVALID_RECORD_INDEX = CSSM_DL_BASE_DL_ERROR + 8,
+	CSSMERR_DL_INVALID_RECORDTYPE = CSSM_DL_BASE_DL_ERROR + 9,
+	CSSMERR_DL_INVALID_FIELD_NAME = CSSM_DL_BASE_DL_ERROR + 10,
+	CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT = CSSM_DL_BASE_DL_ERROR + 11,
+	CSSMERR_DL_UNSUPPORTED_INDEX_INFO = CSSM_DL_BASE_DL_ERROR + 12,
+	CSSMERR_DL_UNSUPPORTED_LOCALITY = CSSM_DL_BASE_DL_ERROR + 13,
+	CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES = CSSM_DL_BASE_DL_ERROR + 14,
+	CSSMERR_DL_UNSUPPORTED_NUM_INDEXES = CSSM_DL_BASE_DL_ERROR + 15,
+	CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES = CSSM_DL_BASE_DL_ERROR + 16,
+	CSSMERR_DL_UNSUPPORTED_RECORDTYPE = CSSM_DL_BASE_DL_ERROR + 17,
+	CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE = CSSM_DL_BASE_DL_ERROR + 18,
+	CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT = CSSM_DL_BASE_DL_ERROR + 19,
+	CSSMERR_DL_INVALID_PARSING_MODULE = CSSM_DL_BASE_DL_ERROR + 20,
+	CSSMERR_DL_INVALID_DB_NAME = CSSM_DL_BASE_DL_ERROR + 22,
+	CSSMERR_DL_DATASTORE_DOESNOT_EXIST = CSSM_DL_BASE_DL_ERROR + 23,
+	CSSMERR_DL_DATASTORE_ALREADY_EXISTS = CSSM_DL_BASE_DL_ERROR + 24,
+	CSSMERR_DL_DB_LOCKED = CSSM_DL_BASE_DL_ERROR + 25,
+	CSSMERR_DL_DATASTORE_IS_OPEN = CSSM_DL_BASE_DL_ERROR + 26,
+	CSSMERR_DL_RECORD_NOT_FOUND = CSSM_DL_BASE_DL_ERROR + 27,
+	CSSMERR_DL_MISSING_VALUE = CSSM_DL_BASE_DL_ERROR + 28,
+	CSSMERR_DL_UNSUPPORTED_QUERY = CSSM_DL_BASE_DL_ERROR + 29,
+	CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS = CSSM_DL_BASE_DL_ERROR + 30,
+	CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS = CSSM_DL_BASE_DL_ERROR + 31,
+	CSSMERR_DL_UNSUPPORTED_OPERATOR = CSSM_DL_BASE_DL_ERROR + 33,
+	CSSMERR_DL_INVALID_RESULTS_HANDLE = CSSM_DL_BASE_DL_ERROR + 34,
+	CSSMERR_DL_INVALID_DB_LOCATION = CSSM_DL_BASE_DL_ERROR + 35,
+	CSSMERR_DL_INVALID_ACCESS_REQUEST = CSSM_DL_BASE_DL_ERROR + 36,
+	CSSMERR_DL_INVALID_INDEX_INFO = CSSM_DL_BASE_DL_ERROR + 37,
+	CSSMERR_DL_INVALID_SELECTION_TAG = CSSM_DL_BASE_DL_ERROR + 38,
+	CSSMERR_DL_INVALID_NEW_OWNER = CSSM_DL_BASE_DL_ERROR + 39,
+	CSSMERR_DL_INVALID_RECORD_UID = CSSM_DL_BASE_DL_ERROR + 40,
+	CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA = CSSM_DL_BASE_DL_ERROR + 41,
+	CSSMERR_DL_INVALID_MODIFY_MODE = CSSM_DL_BASE_DL_ERROR + 42,
+	CSSMERR_DL_INVALID_OPEN_PARAMETERS = CSSM_DL_BASE_DL_ERROR + 43,
+	CSSMERR_DL_RECORD_MODIFIED = CSSM_DL_BASE_DL_ERROR + 44,
+	CSSMERR_DL_ENDOFDATA = CSSM_DL_BASE_DL_ERROR + 45,
+	CSSMERR_DL_INVALID_QUERY = CSSM_DL_BASE_DL_ERROR + 46,
+	CSSMERR_DL_INVALID_VALUE = CSSM_DL_BASE_DL_ERROR + 47,
+	CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED = CSSM_DL_BASE_DL_ERROR + 48,
+	CSSMERR_DL_STALE_UNIQUE_RECORD = CSSM_DL_BASE_DL_ERROR + 49
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmkrapi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,98 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmkrapi;
+
+import dstep.security.cssmtype;
+
+alias uint CSSM_KRSP_HANDLE;
+alias uint CSSM_KR_POLICY_TYPE;
+alias uint CSSM_KR_POLICY_FLAGS;
+alias CSSM_KR_POLICY_INFO* CSSM_KR_POLICY_INFO_PTR;
+alias CSSM_KR_PROFILE* CSSM_KR_PROFILE_PTR;
+
+struct CSSM_KR_NAME
+{
+	ubyte Type;
+	ubyte Length;
+	char* Name;
+}
+
+
+struct CSSM_KR_PROFILE
+{
+	CSSM_KR_NAME UserName;
+	CSSM_CERTGROUP_PTR UserCertificate;
+	CSSM_CERTGROUP_PTR KRSCertChain;
+	ubyte LE_KRANum;
+	CSSM_CERTGROUP_PTR LE_KRACertChainList;
+	ubyte ENT_KRANum;
+	CSSM_CERTGROUP_PTR ENT_KRACertChainList;
+	ubyte INDIV_KRANum;
+	CSSM_CERTGROUP_PTR INDIV_KRACertChainList;
+	CSSM_DATA_PTR INDIV_AuthenticationInfo;
+	uint KRSPFlags;
+	CSSM_DATA_PTR KRSPExtensions;
+}
+
+
+struct CSSM_KR_WRAPPEDPRODUCT_INFO
+{
+	CSSM_VERSION StandardVersion;
+	byte[68] StandardDescription;
+	CSSM_VERSION ProductVersion;
+	byte[68] ProductDescription;
+	byte[68] ProductVendor;
+	uint ProductFlags;
+}
+
+
+struct CSSM_KRSUBSERVICE
+{
+	uint SubServiceId;
+	char* Description;
+	CSSM_KR_WRAPPEDPRODUCT_INFO WrappedProduct;
+}
+
+
+struct CSSM_KR_POLICY_LIST_ITEM
+{
+	CSSM_KR_POLICY_LIST_ITEM* next;
+	uint AlgorithmId;
+	uint Mode;
+	uint MaxKeyLength;
+	uint MaxRounds;
+	ubyte WorkFactor;
+	uint PolicyFlags;
+	uint AlgClass;
+}
+
+
+struct CSSM_KR_POLICY_INFO
+{
+	int krbNotAllowed;
+	uint numberOfEntries;
+	CSSM_KR_POLICY_LIST_ITEM* policyEntry;
+}
+
+extern (C)
+{
+	int CSSM_KR_SetEnterpriseRecoveryPolicy (CSSM_DATA* RecoveryPolicyFileName, CSSM_ACCESS_CREDENTIALS* OldPassPhrase, CSSM_ACCESS_CREDENTIALS* NewPassPhrase);
+	int CSSM_KR_CreateRecoveryRegistrationContext (uint KRSPHandle, CSSM_CC_HANDLE* NewContext);
+	int CSSM_KR_CreateRecoveryEnablementContext (uint KRSPHandle, CSSM_KR_PROFILE* LocalProfile, CSSM_KR_PROFILE* RemoteProfile, CSSM_CC_HANDLE* NewContext);
+	int CSSM_KR_CreateRecoveryRequestContext (uint KRSPHandle, CSSM_KR_PROFILE* LocalProfile, CSSM_CC_HANDLE* NewContext);
+	int CSSM_KR_GetPolicyInfo (ulong CCHandle, CSSM_KR_POLICY_FLAGS* EncryptionProhibited, uint* WorkFactor);
+	int CSSM_KR_RegistrationRequest (ulong RecoveryRegistrationContext, CSSM_DATA* KRInData, CSSM_ACCESS_CREDENTIALS* AccessCredentials, uint KRFlags, int* EstimatedTime, CSSM_HANDLE_PTR ReferenceHandle);
+	int CSSM_KR_RegistrationRetrieve (uint KRSPHandle, int ReferenceHandle, CSSM_ACCESS_CREDENTIALS* AccessCredentials, int* EstimatedTime, CSSM_KR_PROFILE_PTR KRProfile);
+	int CSSM_KR_GenerateRecoveryFields (ulong KeyRecoveryContext, ulong CCHandle, CSSM_DATA* KRSPOptions, uint KRFlags, CSSM_DATA_PTR KRFields, CSSM_CC_HANDLE* NewCCHandle);
+	int CSSM_KR_ProcessRecoveryFields (ulong KeyRecoveryContext, ulong CryptoContext, CSSM_DATA* KRSPOptions, uint KRFlags, CSSM_DATA* KRFields, CSSM_CC_HANDLE* NewCryptoContext);
+	int CSSM_KR_RecoveryRequest (ulong RecoveryRequestContext, CSSM_DATA* KRInData, CSSM_ACCESS_CREDENTIALS* AccessCredentials, int* EstimatedTime, CSSM_HANDLE_PTR ReferenceHandle);
+	int CSSM_KR_RecoveryRetrieve (uint KRSPHandle, int ReferenceHandle, CSSM_ACCESS_CREDENTIALS* AccessCredentials, int* EstimatedTime, CSSM_HANDLE_PTR CacheHandle, uint* NumberOfRecoveredKeys);
+	int CSSM_KR_GetRecoveredObject (uint KRSPHandle, int CacheHandle, uint IndexInResults, int CSPHandle, CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry, uint Flags, CSSM_KEY_PTR RecoveredKey, CSSM_DATA_PTR OtherInfo);
+	int CSSM_KR_RecoveryRequestAbort (uint KRSPHandle, int CacheHandle);
+	int CSSM_KR_QueryPolicyInfo (uint KRSPHandle, uint AlgorithmID, uint Mode, uint Class, CSSM_KR_POLICY_INFO_PTR* PolicyInfoData);
+	int CSSM_KR_PassThrough (uint KRSPHandle, ulong KeyRecoveryContext, ulong CryptoContext, uint PassThroughId, void* InputParams, void** OutputParams);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmkrspi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,82 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmkrspi;
+
+import dstep.security.cssmtype;
+import dstep.security.cssmkrapi;
+
+struct CSSM_SPI_KR_FUNCS
+{
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_CC_HANDLE KRRegistrationContextHandle,
+						     /*const*/ CSSM_CONTEXT* KRRegistrationContext,
+						     /*const*/ CSSM_DATA* KRInData,
+						     /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCredentials,
+						     CSSM_KR_POLICY_FLAGS KRFlags,
+						     int* EstimatedTime,
+						     CSSM_HANDLE_PTR ReferenceHandle) RegistrationRequest;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_HANDLE ReferenceHandle,
+						     int* EstimatedTime,
+						     CSSM_KR_PROFILE_PTR KRProfile) RegistrationRetrieve;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_CC_HANDLE KREnablementContextHandle,
+						     /*const*/ CSSM_CONTEXT* KREnablementContext,
+						     CSSM_CC_HANDLE CryptoContextHandle,
+						     /*const*/ CSSM_CONTEXT* CryptoContext,
+						     /*const*/ CSSM_DATA* KRSPOptions,
+						     CSSM_KR_POLICY_FLAGS KRFlags,
+						     CSSM_DATA_PTR KRFields) GenerateRecoveryFields;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_CC_HANDLE KREnablementContextHandle,
+						     /*const*/ CSSM_CONTEXT* KREnablementContext,
+						     CSSM_CC_HANDLE CryptoContextHandle,
+						     /*const*/ CSSM_CONTEXT* CryptoContext,
+						     /*const*/ CSSM_DATA* KRSPOptions,
+						     CSSM_KR_POLICY_FLAGS KRFlags,
+						     /*const*/ CSSM_DATA* KRFields) ProcessRecoveryFields;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_CC_HANDLE KRRequestContextHandle,
+						     /*const*/ CSSM_CONTEXT* KRRequestContext,
+						     /*const*/ CSSM_DATA* KRInData,
+						     /*const*/ CSSM_ACCESS_CREDENTIALS* AccessCredentials,
+						     int* EstimatedTime,
+						     CSSM_HANDLE_PTR ReferenceHandle) RecoveryRequest;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_HANDLE ReferenceHandle,
+						     int* EstimatedTime,
+						     CSSM_HANDLE_PTR CacheHandle,
+						     uint* NumberOfRecoveredKeys) RecoveryRetrieve;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_HANDLE CacheHandle,
+						     uint IndexInResults,
+						     CSSM_CSP_HANDLE CSPHandle,
+						     /*const*/ CSSM_RESOURCE_CONTROL_CONTEXT* CredAndAclEntry,
+						     uint Flags,
+						     CSSM_KEY_PTR RecoveredKey,
+						     CSSM_DATA_PTR OtherInfo) GetRecoveredObject;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+							 CSSM_HANDLE ResultsHandle) RecoveryRequestAbort;
+	
+	extern (C) int function (CSSM_KRSP_HANDLE KRSPHandle,
+						     CSSM_CC_HANDLE KeyRecoveryContextHandle,
+						     /*const*/ CSSM_CONTEXT* KeyRecoveryContext,
+						     CSSM_CC_HANDLE CryptoContextHandle,
+						     /*const*/ CSSM_CONTEXT* CryptoContext,
+						     uint PassThroughId,
+						     /*const*/ void* InputParams,
+						     void* *OutputParams) PassThrough;
+}
+
+alias CSSM_SPI_KR_FUNCS* CSSM_SPI_KR_FUNCS_PTR;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmspi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,61 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmspi;
+
+import dstep.security.cssmtype;
+
+alias uint CSSM_CONTEXT_EVENT;
+alias CSSM_MODULE_FUNCS* CSSM_MODULE_FUNCS_PTR;
+alias CSSM_UPCALLS* CSSM_UPCALLS_PTR;
+
+extern (C)
+{
+	alias void * function (int, uint, uint) CSSM_UPCALLS_CALLOC;
+	alias void * function (int, void*, uint) CSSM_UPCALLS_REALLOC;
+	alias void * function (int, uint) CSSM_UPCALLS_MALLOC;
+	alias int function (CSSM_GUID*, void*, uint, uint, uint) CSSM_SPI_ModuleEventHandler;
+	alias void function (int, void*) CSSM_UPCALLS_FREE;
+}
+
+enum
+{
+	CSSM_CONTEXT_EVENT_CREATE = 1,
+	CSSM_CONTEXT_EVENT_DELETE = 2,
+	CSSM_CONTEXT_EVENT_UPDATE = 3
+}
+
+struct CSSM_MODULE_FUNCS
+{
+	uint ServiceType;
+	uint NumberOfServiceFuncs;
+	CSSM_PROC_ADDR* ServiceFuncs;
+}
+
+
+struct CSSM_UPCALLS
+{
+	CSSM_UPCALLS_MALLOC malloc_func;
+	CSSM_UPCALLS_FREE free_func;
+	CSSM_UPCALLS_REALLOC realloc_func;
+	CSSM_UPCALLS_CALLOC calloc_func;
+	CSSM_GUID_PTR Guid;
+	CSSM_VERSION_PTR Version;
+	uint* SubServiceId;
+	CSSM_SERVICE_TYPE* SubServiceType;
+	CSSM_ATTACH_FLAGS* AttachFlags;
+	CSSM_KEY_HIERARCHY* KeyHierarchy;
+	CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs;
+	CSSM_FUNC_NAME_ADDR_PTR FunctionTable;
+}
+
+extern (C)
+{
+	int CSSM_SPI_ModuleLoad (CSSM_GUID* CssmGuid, CSSM_GUID* ModuleGuid, CSSM_SPI_ModuleEventHandler CssmNotifyCallback, void* CssmNotifyCallbackCtx);
+	int CSSM_SPI_ModuleUnload (CSSM_GUID* CssmGuid, CSSM_GUID* ModuleGuid, CSSM_SPI_ModuleEventHandler CssmNotifyCallback, void* CssmNotifyCallbackCtx);
+	int CSSM_SPI_ModuleAttach (CSSM_GUID* ModuleGuid, CSSM_VERSION* Version, uint SubserviceID, uint SubServiceType, uint AttachFlags, int ModuleHandle, uint KeyHierarchy, CSSM_GUID* CssmGuid, CSSM_GUID* ModuleManagerGuid, CSSM_GUID* CallerGuid, CSSM_UPCALLS* Upcalls, CSSM_MODULE_FUNCS_PTR* FuncTbl);
+	int CSSM_SPI_ModuleDetach (int ModuleHandle);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmtpi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,61 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmtpi;
+
+import dstep.security.cssmtype;
+
+struct CSSM_SPI_TP_FUNCS
+{
+	CSSM_TP_AUTHORITY_ID* PreferredAuthority;
+	uint RequestType;
+	CSSM_TP_REQUEST_SET* RequestInput;
+	CSSM_TP_CALLERAUTH_CONTEXT* CallerAuthContext;
+	int* EstimatedTime;
+	CSSM_DATA* ReferenceIdentifier;
+	CSSM_TP_CALLERAUTH_CONTEXT* CallerAuthCredentials;
+	CSSM_BOOL* ConfirmationRequired;
+	CSSM_TP_CONFIRM_RESPONSE* Responses;
+	CSSM_CERTGROUP* CertGroup;
+	uint CertIndex;
+	ulong KeyCacheHandle;
+	int CSPHandle;
+	uint FormType;
+	CSSM_DATA* Form;
+	CSSM_TP_AUTHORITY_ID* ClearanceAuthority;
+	CSSM_TP_AUTHORITY_ID* RepresentedAuthority;
+	int CLHandle;
+	CSSM_CERTGROUP* CertGroupToBeVerified;
+	CSSM_TP_VERIFY_CONTEXT* VerifyContext;
+	uint NumberOfFields;
+	CSSM_FIELD* CertFields;
+	CSSM_DATA* CertTemplate;
+	ulong CCHandle;
+	CSSM_DATA* CertTemplateToBeSigned;
+	CSSM_CERTGROUP* SignerCertGroup;
+	CSSM_TP_VERIFY_CONTEXT* SignerVerifyContext;
+	CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult;
+	CSSM_ENCODED_CRL* CrlToBeVerified;
+	CSSM_FIELD* CrlFields;
+	CSSM_DATA* OldCrlTemplate;
+	CSSM_CERTGROUP* CertGroupToBeRevoked;
+	CSSM_CERTGROUP* RevokerCertGroup;
+	CSSM_TP_VERIFY_CONTEXT* RevokerVerifyContext;
+	CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult;
+	uint Reason;
+	CSSM_CERTGROUP* CertGroupToBeRemoved;
+	CSSM_ENCODED_CRL* CrlToBeSigned;
+	CSSM_ENCODED_CRL* CrlToBeApplied;
+	CSSM_TP_VERIFY_CONTEXT* ApplyCrlVerifyContext;
+	CSSM_DL_DB_LIST* DBList;
+	void* ConstructParams;
+	CSSM_CERTGROUP* CertGroupFrag;
+	CSSM_CERTGROUP* OrderedCertGroup;
+	CSSM_TUPLEGROUP* TupleGroup;
+	uint PassThroughId;
+	void* InputParams;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/cssmtype.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,2104 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.cssmtype;
+
+import dstep.security.cssmconfig;
+
+alias int CSSM_HANDLE;
+alias CSSM_INTPTR* CSSM_HANDLE_PTR;
+alias ulong CSSM_LONG_HANDLE;
+alias uint64* CSSM_LONG_HANDLE_PTR;
+alias int CSSM_MODULE_HANDLE;
+alias CSSM_HANDLE* CSSM_MODULE_HANDLE_PTR;
+alias ulong CSSM_CC_HANDLE;
+alias int CSSM_CSP_HANDLE;
+alias int CSSM_TP_HANDLE;
+alias int CSSM_AC_HANDLE;
+alias int CSSM_CL_HANDLE;
+alias int CSSM_DL_HANDLE;
+alias int CSSM_DB_HANDLE;
+alias int CSSM_BOOL;
+alias int CSSM_RETURN;
+alias uint CSSM_BITMASK;
+alias uint CSSM_KEY_HIERARCHY;
+alias uint CSSM_PVC_MODE;
+alias uint CSSM_PRIVILEGE_SCOPE;
+alias uint CSSM_SERVICE_MASK;
+alias uint CSSM_SERVICE_TYPE;
+alias uint CSSM_MODULE_EVENT;
+alias uint32* CSSM_MODULE_EVENT_PTR;
+alias uint CSSM_ATTACH_FLAGS;
+alias ulong CSSM_PRIVILEGE;
+alias ulong CSSM_USEE_TAG;
+alias uint CSSM_NET_ADDRESS_TYPE;
+alias uint CSSM_NET_PROTOCOL;
+alias int CSSM_WORDID_TYPE;
+alias uint CSSM_LIST_ELEMENT_TYPE;
+alias uint32* CSSM_LIST_ELEMENT_TYPE_PTR;
+alias uint CSSM_LIST_TYPE;
+alias uint32* CSSM_LIST_TYPE_PTR;
+alias CSSM_LIST_ELEMENT* CSSM_LIST_ELEMENT_PTR;
+alias int CSSM_SAMPLE_TYPE;
+alias CSSM_MEMORY_FUNCS CSSM_API_MEMORY_FUNCS;
+alias CSSM_API_MEMORY_FUNCS* CSSM_API_MEMORY_FUNCS_PTR;
+alias uint CSSM_CERT_TYPE;
+alias uint32* CSSM_CERT_TYPE_PTR;
+alias uint CSSM_CERT_ENCODING;
+alias uint32* CSSM_CERT_ENCODING_PTR;
+alias uint CSSM_CERT_PARSE_FORMAT;
+alias uint32* CSSM_CERT_PARSE_FORMAT_PTR;
+alias uint CSSM_CERTGROUP_TYPE;
+alias uint32* CSSM_CERTGROUP_TYPE_PTR;
+alias int CSSM_ACL_SUBJECT_TYPE;
+alias int CSSM_ACL_AUTHORIZATION_TAG;
+alias int CSSM_ACL_HANDLE;
+alias uint CSSM_ACL_EDIT_MODE;
+alias CSSM_PROC_ADDR* CSSM_PROC_ADDR_PTR;
+alias uint CSSM_HEADERVERSION;
+alias uint CSSM_KEYBLOB_TYPE;
+alias uint CSSM_KEYBLOB_FORMAT;
+alias uint CSSM_KEYCLASS;
+alias uint CSSM_KEYATTR_FLAGS;
+alias uint CSSM_KEYUSE;
+alias uint CSSM_ALGORITHMS;
+alias uint CSSM_ENCRYPT_MODE;
+alias CSSM_KEY CSSM_WRAP_KEY;
+alias CSSM_KEY* CSSM_WRAP_KEY_PTR;
+alias uint CSSM_CSPTYPE;
+alias uint CSSM_CONTEXT_TYPE;
+alias uint CSSM_ATTRIBUTE_TYPE;
+alias uint CSSM_PADDING;
+alias uint CSSM_KEY_TYPE;
+alias uint CSSM_SC_FLAGS;
+alias uint CSSM_CSP_READER_FLAGS;
+alias uint CSSM_CSP_FLAGS;
+alias uint CSSM_PKCS_OAEP_MGF;
+alias uint CSSM_PKCS_OAEP_PSOURCE;
+alias uint CSSM_PKCS5_PBKDF2_PRF;
+alias uint CSSM_TP_AUTHORITY_REQUEST_TYPE;
+alias uint32* CSSM_TP_AUTHORITY_REQUEST_TYPE_PTR;
+alias CSSM_DATA CSSM_OID;
+alias CSSM_DATA* CSSM_OID_PTR;
+alias uint CSSM_TP_SERVICES;
+alias uint CSSM_TP_ACTION;
+alias uint CSSM_TP_STOP_ON;
+alias char* CSSM_TIMESTRING;
+alias uint CSSM_CRL_PARSE_FORMAT;
+alias uint32* CSSM_CRL_PARSE_FORMAT_PTR;
+alias uint CSSM_CRL_TYPE;
+alias uint32* CSSM_CRL_TYPE_PTR;
+alias uint CSSM_CRL_ENCODING;
+alias uint32* CSSM_CRL_ENCODING_PTR;
+alias uint CSSM_CRLGROUP_TYPE;
+alias uint32* CSSM_CRLGROUP_TYPE_PTR;
+alias uint CSSM_EVIDENCE_FORM;
+alias uint CSSM_TP_CONFIRM_STATUS;
+alias uint32* CSSM_TP_CONFIRM_STATUS_PTR;
+alias uint CSSM_TP_CERTISSUE_STATUS;
+alias uint CSSM_TP_CERTCHANGE_ACTION;
+alias uint CSSM_TP_CERTCHANGE_REASON;
+alias uint CSSM_TP_CERTCHANGE_STATUS;
+alias uint CSSM_TP_CERTVERIFY_STATUS;
+alias uint CSSM_TP_CERTNOTARIZE_STATUS;
+alias uint CSSM_TP_CERTRECLAIM_STATUS;
+alias uint CSSM_TP_CRLISSUE_STATUS;
+alias uint CSSM_TP_FORM_TYPE;
+alias uint CSSM_CL_TEMPLATE_TYPE;
+alias uint CSSM_CERT_BUNDLE_TYPE;
+alias uint CSSM_CERT_BUNDLE_ENCODING;
+alias uint CSSM_DB_ATTRIBUTE_NAME_FORMAT;
+alias uint32* CSSM_DB_ATTRIBUTE_NAME_FORMAT_PTR;
+alias uint CSSM_DB_ATTRIBUTE_FORMAT;
+alias uint32* CSSM_DB_ATTRIBUTE_FORMAT_PTR;
+alias uint CSSM_DB_RECORDTYPE;
+alias uint CSSM_DB_INDEX_TYPE;
+alias uint CSSM_DB_INDEXED_DATA_LOCATION;
+alias uint CSSM_DB_ACCESS_TYPE;
+alias uint32* CSSM_DB_ACCESS_TYPE_PTR;
+alias uint CSSM_DB_MODIFY_MODE;
+alias uint CSSM_DB_OPERATOR;
+alias uint32* CSSM_DB_OPERATOR_PTR;
+alias uint CSSM_DB_CONJUNCTIVE;
+alias uint32* CSSM_DB_CONJUNCTIVE_PTR;
+alias uint CSSM_QUERY_FLAGS;
+alias uint CSSM_DLTYPE;
+alias uint32* CSSM_DLTYPE_PTR;
+alias void* CSSM_DL_CUSTOM_ATTRIBUTES;
+alias void* CSSM_DL_LDAP_ATTRIBUTES;
+alias void* CSSM_DL_ODBC_ATTRIBUTES;
+alias void* CSSM_DL_FFS_ATTRIBUTES;
+alias uint CSSM_DB_RETRIEVAL_MODES;
+alias CSSM_LIST* CSSM_LIST_PTR;
+alias CSSM_DATA* CSSM_DATA_PTR;
+alias CSSM_SAMPLEGROUP* CSSM_SAMPLEGROUP_PTR;
+alias CSSM_TUPLE* CSSM_TUPLE_PTR;
+alias CSSM_CERTGROUP* CSSM_CERTGROUP_PTR;
+alias CSSM_ENCODED_CERT* CSSM_ENCODED_CERT_PTR;
+alias CSSM_PARSED_CERT* CSSM_PARSED_CERT_PTR;
+alias CSSM_CERT_PAIR* CSSM_CERT_PAIR_PTR;
+alias CSSM_ACCESS_CREDENTIALS* CSSM_ACCESS_CREDENTIALS_PTR;
+alias CSSM_NET_ADDRESS* CSSM_NET_ADDRESS_PTR;
+alias CSSM_CRLGROUP* CSSM_CRLGROUP_PTR;
+alias CSSM_ENCODED_CRL* CSSM_ENCODED_CRL_PTR;
+alias CSSM_PARSED_CRL* CSSM_PARSED_CRL_PTR;
+alias CSSM_CRL_PAIR* CSSM_CRL_PAIR_PTR;
+alias CSSM_FIELD* CSSM_FIELD_PTR;
+alias CSSM_TP_CALLERAUTH_CONTEXT* CSSM_TP_CALLERAUTH_CONTEXT_PTR;
+alias CSSM_EVIDENCE* CSSM_EVIDENCE_PTR;
+alias CSSM_TP_VERIFY_CONTEXT* CSSM_TP_VERIFY_CONTEXT_PTR;
+alias CSSM_DB_ATTRIBUTE_INFO* CSSM_DB_ATTRIBUTE_INFO_PTR;
+alias CSSM_DB_INDEX_INFO* CSSM_DB_INDEX_INFO_PTR;
+alias CSSM_DB_PARSING_MODULE_INFO* CSSM_DB_PARSING_MODULE_INFO_PTR;
+alias CSSM_DB_RECORD_ATTRIBUTE_INFO* CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR;
+alias CSSM_SELECTION_PREDICATE* CSSM_SELECTION_PREDICATE_PTR;
+alias CSSM_GUID* CSSM_GUID_PTR;
+alias CSSM_SUBSERVICE_UID* CSSM_SUBSERVICE_UID_PTR;
+alias CSSM_CONTEXT* CSSM_CONTEXT_PTR;
+alias CSSM_CONTEXT_ATTRIBUTE* CSSM_CONTEXT_ATTRIBUTE_PTR;
+alias CSSM_ACL_ENTRY_INFO* CSSM_ACL_ENTRY_INFO_PTR;
+alias CSSM_ACL_OWNER_PROTOTYPE* CSSM_ACL_OWNER_PROTOTYPE_PTR;
+alias CSSM_QUERY_SIZE_DATA* CSSM_QUERY_SIZE_DATA_PTR;
+alias CSSM_KEY_SIZE* CSSM_KEY_SIZE_PTR;
+alias CSSM_KEY* CSSM_KEY_PTR;
+alias CSSM_TP_CONFIRM_RESPONSE* CSSM_TP_CONFIRM_RESPONSE_PTR;
+alias CSSM_TUPLEGROUP* CSSM_TUPLEGROUP_PTR;
+alias CSSM_TP_RESULT_SET* CSSM_TP_RESULT_SET_PTR;
+alias CSSM_TP_VERIFY_CONTEXT_RESULT* CSSM_TP_VERIFY_CONTEXT_RESULT_PTR;
+alias CSSM_NAME_LIST* CSSM_NAME_LIST_PTR;
+alias CSSM_DB_UNIQUE_RECORD* CSSM_DB_UNIQUE_RECORD_PTR;
+alias CSSM_DB_RECORD_ATTRIBUTE_DATA* CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR;
+alias CSSM_DL_DB_HANDLE* CSSM_DL_DB_HANDLE_PTR;
+alias CSSM_VERSION* CSSM_VERSION_PTR;
+alias CSSM_FUNC_NAME_ADDR* CSSM_FUNC_NAME_ADDR_PTR;
+
+extern (C)
+{
+	alias int function (CSSM_GUID*, void*, uint, uint, uint) CSSM_API_ModuleEventHandler;
+	alias void function (void*, void*) CSSM_FREE;
+	alias int function (CSSM_LIST*, CSSM_LIST_PTR, void*, CSSM_MEMORY_FUNCS*) CSSM_ACL_SUBJECT_CALLBACK;
+	alias int function (int, void*, CSSM_DATA_PTR) CSSM_TP_VERIFICATION_RESULTS_CALLBACK;
+	alias int function (CSSM_LIST*, CSSM_SAMPLEGROUP_PTR, void*, CSSM_MEMORY_FUNCS*) CSSM_CHALLENGE_CALLBACK;
+	alias void function () CSSM_PROC_ADDR;
+	alias void* function (uint, CSSM_SIZE, void*) CSSM_REALLOC;
+	alias uint function (uint, CSSM_SIZE, void*) CSSM_CALLOC;
+	alias uint function (CSSM_SIZE, int) CSSM_MALLOC;
+	alias CSSM_RETURN function (CSSM_DATA_PTR, void*) CSSM_CALLBACK;
+}
+
+enum
+{
+	CSSM_INVALID_HANDLE = 0
+}
+
+enum
+{
+	CSSM_FALSE = 0,
+	CSSM_TRUE = !CSSM_FALSE
+}
+
+enum
+{
+	CSSM_OK = 0
+}
+
+enum
+{
+	CSSM_MODULE_STRING_SIZE = 64
+}
+
+alias char[CSSM_MODULE_STRING_SIZE + 4] CSSM_STRING;
+
+enum
+{
+	CSSM_KEY_HIERARCHY_NONE = 0,
+	CSSM_KEY_HIERARCHY_INTEG = 1,
+	CSSM_KEY_HIERARCHY_EXPORT = 2
+}
+
+enum
+{
+	CSSM_PVC_NONE = 0,
+	CSSM_PVC_APP = 1,
+	CSSM_PVC_SP = 2
+}
+
+enum
+{
+	CSSM_PRIVILEGE_SCOPE_NONE = 0,
+	CSSM_PRIVILEGE_SCOPE_PROCESS = 1,
+	CSSM_PRIVILEGE_SCOPE_THREAD = 2
+}
+
+enum
+{
+	CSSM_SERVICE_CSSM = 0x1,
+	CSSM_SERVICE_CSP = 0x2,
+	CSSM_SERVICE_DL = 0x4,
+	CSSM_SERVICE_CL = 0x8,
+	CSSM_SERVICE_TP = 0x10,
+	CSSM_SERVICE_AC = 0x20,
+	CSSM_SERVICE_KR = 0x40
+}
+
+enum
+{
+	CSSM_NOTIFY_INSERT = 1,
+	CSSM_NOTIFY_REMOVE = 2,
+	CSSM_NOTIFY_FAULT = 3
+}
+
+enum
+{
+	CSSM_ATTACH_READ_ONLY = 0x00000001
+}
+
+enum
+{
+	CSSM_USEE_LAST = 0xFF,
+	CSSM_USEE_NONE = 0,
+	CSSM_USEE_DOMESTIC = 1,
+	CSSM_USEE_FINANCIAL = 2,
+	CSSM_USEE_KRLE = 3,
+	CSSM_USEE_KRENT = 4,
+	CSSM_USEE_SSL = 5,
+	CSSM_USEE_AUTHENTICATION = 6,
+	CSSM_USEE_KEYEXCH = 7,
+	CSSM_USEE_MEDICAL = 8,
+	CSSM_USEE_INSURANCE = 9,
+	CSSM_USEE_WEAK = 10
+}
+
+enum
+{
+	CSSM_ADDR_NONE = 0,
+	CSSM_ADDR_CUSTOM = 1,
+	CSSM_ADDR_URL = 2,
+	CSSM_ADDR_SOCKADDR = 3,
+	CSSM_ADDR_NAME = 4
+}
+
+enum
+{
+	CSSM_NET_PROTO_NONE = 0,
+	CSSM_NET_PROTO_CUSTOM = 1,
+	CSSM_NET_PROTO_UNSPECIFIED = 2,
+	CSSM_NET_PROTO_LDAP = 3,
+	CSSM_NET_PROTO_LDAPS = 4,
+	CSSM_NET_PROTO_LDAPNS = 5,
+	CSSM_NET_PROTO_X500DAP = 6,
+	CSSM_NET_PROTO_FTP = 7,
+	CSSM_NET_PROTO_FTPS = 8,
+	CSSM_NET_PROTO_OCSP = 9,
+	CSSM_NET_PROTO_CMP = 10,
+	CSSM_NET_PROTO_CMPS = 11
+}
+
+enum
+{
+	CSSM_WORDID__UNK_ = -1,
+	CSSM_WORDID__NLU_ = 0,
+	CSSM_WORDID__STAR_ = 1,
+	CSSM_WORDID_A = 2,
+	CSSM_WORDID_ACL = 3,
+	CSSM_WORDID_ALPHA = 4,
+	CSSM_WORDID_B = 5,
+	CSSM_WORDID_BER = 6,
+	CSSM_WORDID_BINARY = 7,
+	CSSM_WORDID_BIOMETRIC = 8,
+	CSSM_WORDID_C = 9,
+	CSSM_WORDID_CANCELED = 10,
+	CSSM_WORDID_CERT = 11,
+	CSSM_WORDID_COMMENT = 12,
+	CSSM_WORDID_CRL = 13,
+	CSSM_WORDID_CUSTOM = 14,
+	CSSM_WORDID_D = 15,
+	CSSM_WORDID_DATE = 16,
+	CSSM_WORDID_DB_DELETE = 17,
+	CSSM_WORDID_DB_EXEC_STORED_QUERY = 18,
+	CSSM_WORDID_DB_INSERT = 19,
+	CSSM_WORDID_DB_MODIFY = 20,
+	CSSM_WORDID_DB_READ = 21,
+	CSSM_WORDID_DBS_CREATE = 22,
+	CSSM_WORDID_DBS_DELETE = 23,
+	CSSM_WORDID_DECRYPT = 24,
+	CSSM_WORDID_DELETE = 25,
+	CSSM_WORDID_DELTA_CRL = 26,
+	CSSM_WORDID_DER = 27,
+	CSSM_WORDID_DERIVE = 28,
+	CSSM_WORDID_DISPLAY = 29,
+	CSSM_WORDID_DO = 30,
+	CSSM_WORDID_DSA = 31,
+	CSSM_WORDID_DSA_SHA1 = 32,
+	CSSM_WORDID_E = 33,
+	CSSM_WORDID_ELGAMAL = 34,
+	CSSM_WORDID_ENCRYPT = 35,
+	CSSM_WORDID_ENTRY = 36,
+	CSSM_WORDID_EXPORT_CLEAR = 37,
+	CSSM_WORDID_EXPORT_WRAPPED = 38,
+	CSSM_WORDID_G = 39,
+	CSSM_WORDID_GE = 40,
+	CSSM_WORDID_GENKEY = 41,
+	CSSM_WORDID_HASH = 42,
+	CSSM_WORDID_HASHED_PASSWORD = 43,
+	CSSM_WORDID_HASHED_SUBJECT = 44,
+	CSSM_WORDID_HAVAL = 45,
+	CSSM_WORDID_IBCHASH = 46,
+	CSSM_WORDID_IMPORT_CLEAR = 47,
+	CSSM_WORDID_IMPORT_WRAPPED = 48,
+	CSSM_WORDID_INTEL = 49,
+	CSSM_WORDID_ISSUER = 50,
+	CSSM_WORDID_ISSUER_INFO = 51,
+	CSSM_WORDID_K_OF_N = 52,
+	CSSM_WORDID_KEA = 53,
+	CSSM_WORDID_KEYHOLDER = 54,
+	CSSM_WORDID_L = 55,
+	CSSM_WORDID_LE = 56,
+	CSSM_WORDID_LOGIN = 57,
+	CSSM_WORDID_LOGIN_NAME = 58,
+	CSSM_WORDID_MAC = 59,
+	CSSM_WORDID_MD2 = 60,
+	CSSM_WORDID_MD2WITHRSA = 61,
+	CSSM_WORDID_MD4 = 62,
+	CSSM_WORDID_MD5 = 63,
+	CSSM_WORDID_MD5WITHRSA = 64,
+	CSSM_WORDID_N = 65,
+	CSSM_WORDID_NAME = 66,
+	CSSM_WORDID_NDR = 67,
+	CSSM_WORDID_NHASH = 68,
+	CSSM_WORDID_NOT_AFTER = 69,
+	CSSM_WORDID_NOT_BEFORE = 70,
+	CSSM_WORDID_NULL = 71,
+	CSSM_WORDID_NUMERIC = 72,
+	CSSM_WORDID_OBJECT_HASH = 73,
+	CSSM_WORDID_ONE_TIME = 74,
+	CSSM_WORDID_ONLINE = 75,
+	CSSM_WORDID_OWNER = 76,
+	CSSM_WORDID_P = 77,
+	CSSM_WORDID_PAM_NAME = 78,
+	CSSM_WORDID_PASSWORD = 79,
+	CSSM_WORDID_PGP = 80,
+	CSSM_WORDID_PREFIX = 81,
+	CSSM_WORDID_PRIVATE_KEY = 82,
+	CSSM_WORDID_PROMPTED_BIOMETRIC = 83,
+	CSSM_WORDID_PROMPTED_PASSWORD = 84,
+	CSSM_WORDID_PROPAGATE = 85,
+	CSSM_WORDID_PROTECTED_BIOMETRIC = 86,
+	CSSM_WORDID_PROTECTED_PASSWORD = 87,
+	CSSM_WORDID_PROTECTED_PIN = 88,
+	CSSM_WORDID_PUBLIC_KEY = 89,
+	CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90,
+	CSSM_WORDID_Q = 91,
+	CSSM_WORDID_RANGE = 92,
+	CSSM_WORDID_REVAL = 93,
+	CSSM_WORDID_RIPEMAC = 94,
+	CSSM_WORDID_RIPEMD = 95,
+	CSSM_WORDID_RIPEMD160 = 96,
+	CSSM_WORDID_RSA = 97,
+	CSSM_WORDID_RSA_ISO9796 = 98,
+	CSSM_WORDID_RSA_PKCS = 99,
+	CSSM_WORDID_RSA_PKCS_MD5 = 100,
+	CSSM_WORDID_RSA_PKCS_SHA1 = 101,
+	CSSM_WORDID_RSA_PKCS1 = 102,
+	CSSM_WORDID_RSA_PKCS1_MD5 = 103,
+	CSSM_WORDID_RSA_PKCS1_SHA1 = 104,
+	CSSM_WORDID_RSA_PKCS1_SIG = 105,
+	CSSM_WORDID_RSA_RAW = 106,
+	CSSM_WORDID_SDSIV1 = 107,
+	CSSM_WORDID_SEQUENCE = 108,
+	CSSM_WORDID_SET = 109,
+	CSSM_WORDID_SEXPR = 110,
+	CSSM_WORDID_SHA1 = 111,
+	CSSM_WORDID_SHA1WITHDSA = 112,
+	CSSM_WORDID_SHA1WITHECDSA = 113,
+	CSSM_WORDID_SHA1WITHRSA = 114,
+	CSSM_WORDID_SIGN = 115,
+	CSSM_WORDID_SIGNATURE = 116,
+	CSSM_WORDID_SIGNED_NONCE = 117,
+	CSSM_WORDID_SIGNED_SECRET = 118,
+	CSSM_WORDID_SPKI = 119,
+	CSSM_WORDID_SUBJECT = 120,
+	CSSM_WORDID_SUBJECT_INFO = 121,
+	CSSM_WORDID_TAG = 122,
+	CSSM_WORDID_THRESHOLD = 123,
+	CSSM_WORDID_TIME = 124,
+	CSSM_WORDID_URI = 125,
+	CSSM_WORDID_VERSION = 126,
+	CSSM_WORDID_X509_ATTRIBUTE = 127,
+	CSSM_WORDID_X509V1 = 128,
+	CSSM_WORDID_X509V2 = 129,
+	CSSM_WORDID_X509V3 = 130,
+	CSSM_WORDID_X9_ATTRIBUTE = 131,
+	CSSM_WORDID_VENDOR_START = 0x00010000,
+	CSSM_WORDID_VENDOR_END = 0x7FFF0000
+}
+
+enum
+{
+	CSSM_LIST_ELEMENT_DATUM = 0x00,
+	CSSM_LIST_ELEMENT_SUBLIST = 0x01,
+	CSSM_LIST_ELEMENT_WORDID = 0x02
+}
+
+enum
+{
+	CSSM_LIST_TYPE_UNKNOWN = 0,
+	CSSM_LIST_TYPE_CUSTOM = 1,
+	CSSM_LIST_TYPE_SEXPR = 2
+}
+
+enum
+{
+	CSSM_SAMPLE_TYPE_PASSWORD = CSSM_WORDID_PASSWORD,
+	CSSM_SAMPLE_TYPE_HASHED_PASSWORD = CSSM_WORDID_HASHED_PASSWORD,
+	CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD,
+	CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD,
+	CSSM_SAMPLE_TYPE_SIGNED_NONCE = CSSM_WORDID_SIGNED_NONCE,
+	CSSM_SAMPLE_TYPE_SIGNED_SECRET = CSSM_WORDID_SIGNED_SECRET,
+	CSSM_SAMPLE_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC,
+	CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC,
+	CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC,
+	CSSM_SAMPLE_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD
+}
+
+enum
+{
+	CSSM_CERT_UNKNOWN = 0x00,
+	CSSM_CERT_X_509v1 = 0x01,
+	CSSM_CERT_X_509v2 = 0x02,
+	CSSM_CERT_X_509v3 = 0x03,
+	CSSM_CERT_PGP = 0x04,
+	CSSM_CERT_SPKI = 0x05,
+	CSSM_CERT_SDSIv1 = 0x06,
+	CSSM_CERT_Intel = 0x08,
+	CSSM_CERT_X_509_ATTRIBUTE = 0x09,
+	CSSM_CERT_X9_ATTRIBUTE = 0x0A,
+	CSSM_CERT_TUPLE = 0x0B,
+	CSSM_CERT_ACL_ENTRY = 0x0C,
+	CSSM_CERT_MULTIPLE = 0x7FFE,
+	CSSM_CERT_LAST = 0x7FFF,
+	CSSM_CL_CUSTOM_CERT_TYPE = 0x08000
+}
+
+enum
+{
+	CSSM_CERT_ENCODING_UNKNOWN = 0x00,
+	CSSM_CERT_ENCODING_CUSTOM = 0x01,
+	CSSM_CERT_ENCODING_BER = 0x02,
+	CSSM_CERT_ENCODING_DER = 0x03,
+	CSSM_CERT_ENCODING_NDR = 0x04,
+	CSSM_CERT_ENCODING_SEXPR = 0x05,
+	CSSM_CERT_ENCODING_PGP = 0x06,
+	CSSM_CERT_ENCODING_MULTIPLE = 0x7FFE,
+	CSSM_CERT_ENCODING_LAST = 0x7FFF,
+	CSSM_CL_CUSTOM_CERT_ENCODING = 0x8000
+}
+
+enum
+{
+	CSSM_CERT_PARSE_FORMAT_NONE = 0x00,
+	CSSM_CERT_PARSE_FORMAT_CUSTOM = 0x01,
+	CSSM_CERT_PARSE_FORMAT_SEXPR = 0x02,
+	CSSM_CERT_PARSE_FORMAT_COMPLEX = 0x03,
+	CSSM_CERT_PARSE_FORMAT_OID_NAMED = 0x04,
+	CSSM_CERT_PARSE_FORMAT_TUPLE = 0x05,
+	CSSM_CERT_PARSE_FORMAT_MULTIPLE = 0x7FFE,
+	CSSM_CERT_PARSE_FORMAT_LAST = 0x7FFF,
+	CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = 0x8000
+}
+
+enum
+{
+	CSSM_CERTGROUP_DATA = 0x00,
+	CSSM_CERTGROUP_ENCODED_CERT = 0x01,
+	CSSM_CERTGROUP_PARSED_CERT = 0x02,
+	CSSM_CERTGROUP_CERT_PAIR = 0x03
+}
+
+enum
+{
+	CSSM_ACL_SUBJECT_TYPE_ANY = CSSM_WORDID__STAR_,
+	CSSM_ACL_SUBJECT_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD,
+	CSSM_ACL_SUBJECT_TYPE_PASSWORD = CSSM_WORDID_PASSWORD,
+	CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD,
+	CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD,
+	CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = CSSM_WORDID_PUBLIC_KEY,
+	CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = CSSM_WORDID_HASHED_SUBJECT,
+	CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC,
+	CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC,
+	CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC,
+	CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = CSSM_WORDID_LOGIN_NAME,
+	CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = CSSM_WORDID_PAM_NAME
+}
+
+enum
+{
+	CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = 0x00010000,
+	CSSM_ACL_AUTHORIZATION_ANY = CSSM_WORDID__STAR_,
+	CSSM_ACL_AUTHORIZATION_LOGIN = CSSM_WORDID_LOGIN,
+	CSSM_ACL_AUTHORIZATION_GENKEY = CSSM_WORDID_GENKEY,
+	CSSM_ACL_AUTHORIZATION_DELETE = CSSM_WORDID_DELETE,
+	CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = CSSM_WORDID_EXPORT_WRAPPED,
+	CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = CSSM_WORDID_EXPORT_CLEAR,
+	CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = CSSM_WORDID_IMPORT_WRAPPED,
+	CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = CSSM_WORDID_IMPORT_CLEAR,
+	CSSM_ACL_AUTHORIZATION_SIGN = CSSM_WORDID_SIGN,
+	CSSM_ACL_AUTHORIZATION_ENCRYPT = CSSM_WORDID_ENCRYPT,
+	CSSM_ACL_AUTHORIZATION_DECRYPT = CSSM_WORDID_DECRYPT,
+	CSSM_ACL_AUTHORIZATION_MAC = CSSM_WORDID_MAC,
+	CSSM_ACL_AUTHORIZATION_DERIVE = CSSM_WORDID_DERIVE,
+	CSSM_ACL_AUTHORIZATION_DBS_CREATE = CSSM_WORDID_DBS_CREATE,
+	CSSM_ACL_AUTHORIZATION_DBS_DELETE = CSSM_WORDID_DBS_DELETE,
+	CSSM_ACL_AUTHORIZATION_DB_READ = CSSM_WORDID_DB_READ,
+	CSSM_ACL_AUTHORIZATION_DB_INSERT = CSSM_WORDID_DB_INSERT,
+	CSSM_ACL_AUTHORIZATION_DB_MODIFY = CSSM_WORDID_DB_MODIFY,
+	CSSM_ACL_AUTHORIZATION_DB_DELETE = CSSM_WORDID_DB_DELETE
+}
+
+enum
+{
+	CSSM_ACL_EDIT_MODE_ADD = 1,
+	CSSM_ACL_EDIT_MODE_DELETE = 2,
+	CSSM_ACL_EDIT_MODE_REPLACE = 3
+}
+
+enum
+{
+	CSSM_KEYHEADER_VERSION = 2
+}
+
+enum
+{
+	CSSM_KEYBLOB_RAW = 0,
+	CSSM_KEYBLOB_REFERENCE = 2,
+	CSSM_KEYBLOB_WRAPPED = 3,
+	CSSM_KEYBLOB_OTHER = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_KEYBLOB_RAW_FORMAT_NONE = 0,
+	CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1,
+	CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2,
+	CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3,
+	CSSM_KEYBLOB_RAW_FORMAT_PGP = 4,
+	CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5,
+	CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6,
+	CSSM_KEYBLOB_RAW_FORMAT_CCA = 9,
+	CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10,
+	CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11,
+	CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12,
+	CSSM_KEYBLOB_RAW_FORMAT_OTHER = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3,
+	CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0,
+	CSSM_KEYBLOB_REF_FORMAT_STRING = 1,
+	CSSM_KEYBLOB_REF_FORMAT_SPKI = 2,
+	CSSM_KEYBLOB_REF_FORMAT_OTHER = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_KEYCLASS_PUBLIC_KEY = 0,
+	CSSM_KEYCLASS_PRIVATE_KEY = 1,
+	CSSM_KEYCLASS_SESSION_KEY = 2,
+	CSSM_KEYCLASS_SECRET_PART = 3,
+	CSSM_KEYCLASS_OTHER = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_KEYATTR_RETURN_DEFAULT = 0x00000000,
+	CSSM_KEYATTR_RETURN_DATA = 0x10000000,
+	CSSM_KEYATTR_RETURN_REF = 0x20000000,
+	CSSM_KEYATTR_RETURN_NONE = 0x40000000,
+	CSSM_KEYATTR_PERMANENT = 0x00000001,
+	CSSM_KEYATTR_PRIVATE = 0x00000002,
+	CSSM_KEYATTR_MODIFIABLE = 0x00000004,
+	CSSM_KEYATTR_SENSITIVE = 0x00000008,
+	CSSM_KEYATTR_EXTRACTABLE = 0x00000020,
+	CSSM_KEYATTR_ALWAYS_SENSITIVE = 0x00000010,
+	CSSM_KEYATTR_NEVER_EXTRACTABLE = 0x00000040
+}
+
+enum
+{
+	CSSM_KEYUSE_ANY = 0x80000000,
+	CSSM_KEYUSE_ENCRYPT = 0x00000001,
+	CSSM_KEYUSE_DECRYPT = 0x00000002,
+	CSSM_KEYUSE_SIGN = 0x00000004,
+	CSSM_KEYUSE_VERIFY = 0x00000008,
+	CSSM_KEYUSE_SIGN_RECOVER = 0x00000010,
+	CSSM_KEYUSE_VERIFY_RECOVER = 0x00000020,
+	CSSM_KEYUSE_WRAP = 0x00000040,
+	CSSM_KEYUSE_UNWRAP = 0x00000080,
+	CSSM_KEYUSE_DERIVE = 0x00000100
+}
+
+enum
+{
+	CSSM_ALGID_NONE = 0,
+	CSSM_ALGID_CUSTOM = CSSM_ALGID_NONE + 1,
+	CSSM_ALGID_DH = CSSM_ALGID_NONE + 2,
+	CSSM_ALGID_PH = CSSM_ALGID_NONE + 3,
+	CSSM_ALGID_KEA = CSSM_ALGID_NONE + 4,
+	CSSM_ALGID_MD2 = CSSM_ALGID_NONE + 5,
+	CSSM_ALGID_MD4 = CSSM_ALGID_NONE + 6,
+	CSSM_ALGID_MD5 = CSSM_ALGID_NONE + 7,
+	CSSM_ALGID_SHA1 = CSSM_ALGID_NONE + 8,
+	CSSM_ALGID_NHASH = CSSM_ALGID_NONE + 9,
+	CSSM_ALGID_HAVAL = CSSM_ALGID_NONE + 10,
+	CSSM_ALGID_RIPEMD = CSSM_ALGID_NONE + 11,
+	CSSM_ALGID_IBCHASH = CSSM_ALGID_NONE + 12,
+	CSSM_ALGID_RIPEMAC = CSSM_ALGID_NONE + 13,
+	CSSM_ALGID_DES = CSSM_ALGID_NONE + 14,
+	CSSM_ALGID_DESX = CSSM_ALGID_NONE + 15,
+	CSSM_ALGID_RDES = CSSM_ALGID_NONE + 16,
+	CSSM_ALGID_3DES_3KEY_EDE = CSSM_ALGID_NONE + 17,
+	CSSM_ALGID_3DES_2KEY_EDE = CSSM_ALGID_NONE + 18,
+	CSSM_ALGID_3DES_1KEY_EEE = CSSM_ALGID_NONE + 19,
+	CSSM_ALGID_3DES_3KEY = CSSM_ALGID_3DES_3KEY_EDE,
+	CSSM_ALGID_3DES_3KEY_EEE = CSSM_ALGID_NONE + 20,
+	CSSM_ALGID_3DES_2KEY = CSSM_ALGID_3DES_2KEY_EDE,
+	CSSM_ALGID_3DES_2KEY_EEE = CSSM_ALGID_NONE + 21,
+	CSSM_ALGID_3DES_1KEY = CSSM_ALGID_3DES_3KEY_EEE,
+	CSSM_ALGID_IDEA = CSSM_ALGID_NONE + 22,
+	CSSM_ALGID_RC2 = CSSM_ALGID_NONE + 23,
+	CSSM_ALGID_RC5 = CSSM_ALGID_NONE + 24,
+	CSSM_ALGID_RC4 = CSSM_ALGID_NONE + 25,
+	CSSM_ALGID_SEAL = CSSM_ALGID_NONE + 26,
+	CSSM_ALGID_CAST = CSSM_ALGID_NONE + 27,
+	CSSM_ALGID_BLOWFISH = CSSM_ALGID_NONE + 28,
+	CSSM_ALGID_SKIPJACK = CSSM_ALGID_NONE + 29,
+	CSSM_ALGID_LUCIFER = CSSM_ALGID_NONE + 30,
+	CSSM_ALGID_MADRYGA = CSSM_ALGID_NONE + 31,
+	CSSM_ALGID_FEAL = CSSM_ALGID_NONE + 32,
+	CSSM_ALGID_REDOC = CSSM_ALGID_NONE + 33,
+	CSSM_ALGID_REDOC3 = CSSM_ALGID_NONE + 34,
+	CSSM_ALGID_LOKI = CSSM_ALGID_NONE + 35,
+	CSSM_ALGID_KHUFU = CSSM_ALGID_NONE + 36,
+	CSSM_ALGID_KHAFRE = CSSM_ALGID_NONE + 37,
+	CSSM_ALGID_MMB = CSSM_ALGID_NONE + 38,
+	CSSM_ALGID_GOST = CSSM_ALGID_NONE + 39,
+	CSSM_ALGID_SAFER = CSSM_ALGID_NONE + 40,
+	CSSM_ALGID_CRAB = CSSM_ALGID_NONE + 41,
+	CSSM_ALGID_RSA = CSSM_ALGID_NONE + 42,
+	CSSM_ALGID_DSA = CSSM_ALGID_NONE + 43,
+	CSSM_ALGID_MD5WithRSA = CSSM_ALGID_NONE + 44,
+	CSSM_ALGID_MD2WithRSA = CSSM_ALGID_NONE + 45,
+	CSSM_ALGID_ElGamal = CSSM_ALGID_NONE + 46,
+	CSSM_ALGID_MD2Random = CSSM_ALGID_NONE + 47,
+	CSSM_ALGID_MD5Random = CSSM_ALGID_NONE + 48,
+	CSSM_ALGID_SHARandom = CSSM_ALGID_NONE + 49,
+	CSSM_ALGID_DESRandom = CSSM_ALGID_NONE + 50,
+	CSSM_ALGID_SHA1WithRSA = CSSM_ALGID_NONE + 51,
+	CSSM_ALGID_CDMF = CSSM_ALGID_NONE + 52,
+	CSSM_ALGID_CAST3 = CSSM_ALGID_NONE + 53,
+	CSSM_ALGID_CAST5 = CSSM_ALGID_NONE + 54,
+	CSSM_ALGID_GenericSecret = CSSM_ALGID_NONE + 55,
+	CSSM_ALGID_ConcatBaseAndKey = CSSM_ALGID_NONE + 56,
+	CSSM_ALGID_ConcatKeyAndBase = CSSM_ALGID_NONE + 57,
+	CSSM_ALGID_ConcatBaseAndData = CSSM_ALGID_NONE + 58,
+	CSSM_ALGID_ConcatDataAndBase = CSSM_ALGID_NONE + 59,
+	CSSM_ALGID_XORBaseAndData = CSSM_ALGID_NONE + 60,
+	CSSM_ALGID_ExtractFromKey = CSSM_ALGID_NONE + 61,
+	CSSM_ALGID_SSL3PreMasterGen = CSSM_ALGID_NONE + 62,
+	CSSM_ALGID_SSL3MasterDerive = CSSM_ALGID_NONE + 63,
+	CSSM_ALGID_SSL3KeyAndMacDerive = CSSM_ALGID_NONE + 64,
+	CSSM_ALGID_SSL3MD5_MAC = CSSM_ALGID_NONE + 65,
+	CSSM_ALGID_SSL3SHA1_MAC = CSSM_ALGID_NONE + 66,
+	CSSM_ALGID_PKCS5_PBKDF1_MD5 = CSSM_ALGID_NONE + 67,
+	CSSM_ALGID_PKCS5_PBKDF1_MD2 = CSSM_ALGID_NONE + 68,
+	CSSM_ALGID_PKCS5_PBKDF1_SHA1 = CSSM_ALGID_NONE + 69,
+	CSSM_ALGID_WrapLynks = CSSM_ALGID_NONE + 70,
+	CSSM_ALGID_WrapSET_OAEP = CSSM_ALGID_NONE + 71,
+	CSSM_ALGID_BATON = CSSM_ALGID_NONE + 72,
+	CSSM_ALGID_ECDSA = CSSM_ALGID_NONE + 73,
+	CSSM_ALGID_MAYFLY = CSSM_ALGID_NONE + 74,
+	CSSM_ALGID_JUNIPER = CSSM_ALGID_NONE + 75,
+	CSSM_ALGID_FASTHASH = CSSM_ALGID_NONE + 76,
+	CSSM_ALGID_3DES = CSSM_ALGID_NONE + 77,
+	CSSM_ALGID_SSL3MD5 = CSSM_ALGID_NONE + 78,
+	CSSM_ALGID_SSL3SHA1 = CSSM_ALGID_NONE + 79,
+	CSSM_ALGID_FortezzaTimestamp = CSSM_ALGID_NONE + 80,
+	CSSM_ALGID_SHA1WithDSA = CSSM_ALGID_NONE + 81,
+	CSSM_ALGID_SHA1WithECDSA = CSSM_ALGID_NONE + 82,
+	CSSM_ALGID_DSA_BSAFE = CSSM_ALGID_NONE + 83,
+	CSSM_ALGID_ECDH = CSSM_ALGID_NONE + 84,
+	CSSM_ALGID_ECMQV = CSSM_ALGID_NONE + 85,
+	CSSM_ALGID_PKCS12_SHA1_PBE = CSSM_ALGID_NONE + 86,
+	CSSM_ALGID_ECNRA = CSSM_ALGID_NONE + 87,
+	CSSM_ALGID_SHA1WithECNRA = CSSM_ALGID_NONE + 88,
+	CSSM_ALGID_ECES = CSSM_ALGID_NONE + 89,
+	CSSM_ALGID_ECAES = CSSM_ALGID_NONE + 90,
+	CSSM_ALGID_SHA1HMAC = CSSM_ALGID_NONE + 91,
+	CSSM_ALGID_FIPS186Random = CSSM_ALGID_NONE + 92,
+	CSSM_ALGID_ECC = CSSM_ALGID_NONE + 93,
+	CSSM_ALGID_MQV = CSSM_ALGID_NONE + 94,
+	CSSM_ALGID_NRA = CSSM_ALGID_NONE + 95,
+	CSSM_ALGID_IntelPlatformRandom = CSSM_ALGID_NONE + 96,
+	CSSM_ALGID_UTC = CSSM_ALGID_NONE + 97,
+	CSSM_ALGID_HAVAL3 = CSSM_ALGID_NONE + 98,
+	CSSM_ALGID_HAVAL4 = CSSM_ALGID_NONE + 99,
+	CSSM_ALGID_HAVAL5 = CSSM_ALGID_NONE + 100,
+	CSSM_ALGID_TIGER = CSSM_ALGID_NONE + 101,
+	CSSM_ALGID_MD5HMAC = CSSM_ALGID_NONE + 102,
+	CSSM_ALGID_PKCS5_PBKDF2 = CSSM_ALGID_NONE + 103,
+	CSSM_ALGID_RUNNING_COUNTER = CSSM_ALGID_NONE + 104,
+	CSSM_ALGID_LAST = CSSM_ALGID_NONE + 0x7FFFFFFF,
+	CSSM_ALGID_VENDOR_DEFINED = CSSM_ALGID_NONE + 0x80000000
+}
+
+enum
+{
+	CSSM_ALGMODE_NONE = 0,
+	CSSM_ALGMODE_CUSTOM = CSSM_ALGMODE_NONE + 1,
+	CSSM_ALGMODE_ECB = CSSM_ALGMODE_NONE + 2,
+	CSSM_ALGMODE_ECBPad = CSSM_ALGMODE_NONE + 3,
+	CSSM_ALGMODE_CBC = CSSM_ALGMODE_NONE + 4,
+	CSSM_ALGMODE_CBC_IV8 = CSSM_ALGMODE_NONE + 5,
+	CSSM_ALGMODE_CBCPadIV8 = CSSM_ALGMODE_NONE + 6,
+	CSSM_ALGMODE_CFB = CSSM_ALGMODE_NONE + 7,
+	CSSM_ALGMODE_CFB_IV8 = CSSM_ALGMODE_NONE + 8,
+	CSSM_ALGMODE_CFBPadIV8 = CSSM_ALGMODE_NONE + 9,
+	CSSM_ALGMODE_OFB = CSSM_ALGMODE_NONE + 10,
+	CSSM_ALGMODE_OFB_IV8 = CSSM_ALGMODE_NONE + 11,
+	CSSM_ALGMODE_OFBPadIV8 = CSSM_ALGMODE_NONE + 12,
+	CSSM_ALGMODE_COUNTER = CSSM_ALGMODE_NONE + 13,
+	CSSM_ALGMODE_BC = CSSM_ALGMODE_NONE + 14,
+	CSSM_ALGMODE_PCBC = CSSM_ALGMODE_NONE + 15,
+	CSSM_ALGMODE_CBCC = CSSM_ALGMODE_NONE + 16,
+	CSSM_ALGMODE_OFBNLF = CSSM_ALGMODE_NONE + 17,
+	CSSM_ALGMODE_PBC = CSSM_ALGMODE_NONE + 18,
+	CSSM_ALGMODE_PFB = CSSM_ALGMODE_NONE + 19,
+	CSSM_ALGMODE_CBCPD = CSSM_ALGMODE_NONE + 20,
+	CSSM_ALGMODE_PUBLIC_KEY = CSSM_ALGMODE_NONE + 21,
+	CSSM_ALGMODE_PRIVATE_KEY = CSSM_ALGMODE_NONE + 22,
+	CSSM_ALGMODE_SHUFFLE = CSSM_ALGMODE_NONE + 23,
+	CSSM_ALGMODE_ECB64 = CSSM_ALGMODE_NONE + 24,
+	CSSM_ALGMODE_CBC64 = CSSM_ALGMODE_NONE + 25,
+	CSSM_ALGMODE_OFB64 = CSSM_ALGMODE_NONE + 26,
+	CSSM_ALGMODE_CFB32 = CSSM_ALGMODE_NONE + 28,
+	CSSM_ALGMODE_CFB16 = CSSM_ALGMODE_NONE + 29,
+	CSSM_ALGMODE_CFB8 = CSSM_ALGMODE_NONE + 30,
+	CSSM_ALGMODE_WRAP = CSSM_ALGMODE_NONE + 31,
+	CSSM_ALGMODE_PRIVATE_WRAP = CSSM_ALGMODE_NONE + 32,
+	CSSM_ALGMODE_RELAYX = CSSM_ALGMODE_NONE + 33,
+	CSSM_ALGMODE_ECB128 = CSSM_ALGMODE_NONE + 34,
+	CSSM_ALGMODE_ECB96 = CSSM_ALGMODE_NONE + 35,
+	CSSM_ALGMODE_CBC128 = CSSM_ALGMODE_NONE + 36,
+	CSSM_ALGMODE_OAEP_HASH = CSSM_ALGMODE_NONE + 37,
+	CSSM_ALGMODE_PKCS1_EME_V15 = CSSM_ALGMODE_NONE + 38,
+	CSSM_ALGMODE_PKCS1_EME_OAEP = CSSM_ALGMODE_NONE + 39,
+	CSSM_ALGMODE_PKCS1_EMSA_V15 = CSSM_ALGMODE_NONE + 40,
+	CSSM_ALGMODE_ISO_9796 = CSSM_ALGMODE_NONE + 41,
+	CSSM_ALGMODE_X9_31 = CSSM_ALGMODE_NONE + 42,
+	CSSM_ALGMODE_LAST = CSSM_ALGMODE_NONE + 0x7FFFFFFF,
+	CSSM_ALGMODE_VENDOR_DEFINED = CSSM_ALGMODE_NONE + 0x80000000
+}
+
+enum
+{
+	CSSM_CSP_SOFTWARE = 1,
+	CSSM_CSP_HARDWARE = CSSM_CSP_SOFTWARE + 1,
+	CSSM_CSP_HYBRID = CSSM_CSP_SOFTWARE + 2
+}
+
+enum
+{
+	CSSM_ALGCLASS_NONE = 0,
+	CSSM_ALGCLASS_CUSTOM = CSSM_ALGCLASS_NONE + 1,
+	CSSM_ALGCLASS_SIGNATURE = CSSM_ALGCLASS_NONE + 2,
+	CSSM_ALGCLASS_SYMMETRIC = CSSM_ALGCLASS_NONE + 3,
+	CSSM_ALGCLASS_DIGEST = CSSM_ALGCLASS_NONE + 4,
+	CSSM_ALGCLASS_RANDOMGEN = CSSM_ALGCLASS_NONE + 5,
+	CSSM_ALGCLASS_UNIQUEGEN = CSSM_ALGCLASS_NONE + 6,
+	CSSM_ALGCLASS_MAC = CSSM_ALGCLASS_NONE + 7,
+	CSSM_ALGCLASS_ASYMMETRIC = CSSM_ALGCLASS_NONE + 8,
+	CSSM_ALGCLASS_KEYGEN = CSSM_ALGCLASS_NONE + 9,
+	CSSM_ALGCLASS_DERIVEKEY = CSSM_ALGCLASS_NONE + 10
+}
+
+enum
+{
+	CSSM_ATTRIBUTE_DATA_NONE = 0x00000000,
+	CSSM_ATTRIBUTE_DATA_UINT32 = 0x10000000,
+	CSSM_ATTRIBUTE_DATA_CSSM_DATA = 0x20000000,
+	CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = 0x30000000,
+	CSSM_ATTRIBUTE_DATA_KEY = 0x40000000,
+	CSSM_ATTRIBUTE_DATA_STRING = 0x50000000,
+	CSSM_ATTRIBUTE_DATA_DATE = 0x60000000,
+	CSSM_ATTRIBUTE_DATA_RANGE = 0x70000000,
+	CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = 0x80000000,
+	CSSM_ATTRIBUTE_DATA_VERSION = 0x01000000,
+	CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = 0x02000000,
+	CSSM_ATTRIBUTE_DATA_KR_PROFILE = 0x03000000,
+	CSSM_ATTRIBUTE_TYPE_MASK = 0xFF000000
+}
+
+enum
+{
+	CSSM_ATTRIBUTE_NONE = 0,
+	CSSM_ATTRIBUTE_CUSTOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 1,
+	CSSM_ATTRIBUTE_DESCRIPTION = CSSM_ATTRIBUTE_DATA_STRING | 2,
+	CSSM_ATTRIBUTE_KEY = CSSM_ATTRIBUTE_DATA_KEY | 3,
+	CSSM_ATTRIBUTE_INIT_VECTOR = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 4,
+	CSSM_ATTRIBUTE_SALT = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 5,
+	CSSM_ATTRIBUTE_PADDING = CSSM_ATTRIBUTE_DATA_UINT32 | 6,
+	CSSM_ATTRIBUTE_RANDOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 7,
+	CSSM_ATTRIBUTE_SEED = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 8,
+	CSSM_ATTRIBUTE_PASSPHRASE = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 9,
+	CSSM_ATTRIBUTE_KEY_LENGTH = CSSM_ATTRIBUTE_DATA_UINT32 | 10,
+	CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 11,
+	CSSM_ATTRIBUTE_BLOCK_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 12,
+	CSSM_ATTRIBUTE_OUTPUT_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 13,
+	CSSM_ATTRIBUTE_ROUNDS = CSSM_ATTRIBUTE_DATA_UINT32 | 14,
+	CSSM_ATTRIBUTE_IV_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 15,
+	CSSM_ATTRIBUTE_ALG_PARAMS = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 16,
+	CSSM_ATTRIBUTE_LABEL = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 17,
+	CSSM_ATTRIBUTE_KEY_TYPE = CSSM_ATTRIBUTE_DATA_UINT32 | 18,
+	CSSM_ATTRIBUTE_MODE = CSSM_ATTRIBUTE_DATA_UINT32 | 19,
+	CSSM_ATTRIBUTE_EFFECTIVE_BITS = CSSM_ATTRIBUTE_DATA_UINT32 | 20,
+	CSSM_ATTRIBUTE_START_DATE = CSSM_ATTRIBUTE_DATA_DATE | 21,
+	CSSM_ATTRIBUTE_END_DATE = CSSM_ATTRIBUTE_DATA_DATE | 22,
+	CSSM_ATTRIBUTE_KEYUSAGE = CSSM_ATTRIBUTE_DATA_UINT32 | 23,
+	CSSM_ATTRIBUTE_KEYATTR = CSSM_ATTRIBUTE_DATA_UINT32 | 24,
+	CSSM_ATTRIBUTE_VERSION = CSSM_ATTRIBUTE_DATA_VERSION | 25,
+	CSSM_ATTRIBUTE_PRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 26,
+	CSSM_ATTRIBUTE_BASE = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 27,
+	CSSM_ATTRIBUTE_SUBPRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 28,
+	CSSM_ATTRIBUTE_ALG_ID = CSSM_ATTRIBUTE_DATA_UINT32 | 29,
+	CSSM_ATTRIBUTE_ITERATION_COUNT = CSSM_ATTRIBUTE_DATA_UINT32 | 30,
+	CSSM_ATTRIBUTE_ROUNDS_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 31,
+	CSSM_ATTRIBUTE_KRPROFILE_LOCAL = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 32,
+	CSSM_ATTRIBUTE_KRPROFILE_REMOTE = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 33,
+	CSSM_ATTRIBUTE_CSP_HANDLE = CSSM_ATTRIBUTE_DATA_UINT32 | 34,
+	CSSM_ATTRIBUTE_DL_DB_HANDLE = CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE | 35,
+	CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS | 36,
+	CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 37,
+	CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 38,
+	CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 39,
+	CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 40
+}
+
+enum
+{
+	CSSM_PADDING_NONE = 0,
+	CSSM_PADDING_CUSTOM = CSSM_PADDING_NONE + 1,
+	CSSM_PADDING_ZERO = CSSM_PADDING_NONE + 2,
+	CSSM_PADDING_ONE = CSSM_PADDING_NONE + 3,
+	CSSM_PADDING_ALTERNATE = CSSM_PADDING_NONE + 4,
+	CSSM_PADDING_FF = CSSM_PADDING_NONE + 5,
+	CSSM_PADDING_PKCS5 = CSSM_PADDING_NONE + 6,
+	CSSM_PADDING_PKCS7 = CSSM_PADDING_NONE + 7,
+	CSSM_PADDING_CIPHERSTEALING = CSSM_PADDING_NONE + 8,
+	CSSM_PADDING_RANDOM = CSSM_PADDING_NONE + 9,
+	CSSM_PADDING_PKCS1 = CSSM_PADDING_NONE + 10,
+	CSSM_PADDING_VENDOR_DEFINED = CSSM_PADDING_NONE + 0x80000000
+}
+
+enum
+{
+	CSSM_CSP_TOK_RNG = 0x00000001,
+	CSSM_CSP_TOK_CLOCK_EXISTS = 0x00000040
+}
+
+enum
+{
+	CSSM_CSP_RDR_TOKENPRESENT = 0x00000001,
+	CSSM_CSP_RDR_EXISTS = 0x00000002,
+	CSSM_CSP_RDR_HW = 0x00000004
+}
+
+enum
+{
+	CSSM_CSP_TOK_WRITE_PROTECTED = 0x00000002,
+	CSSM_CSP_TOK_LOGIN_REQUIRED = 0x00000004,
+	CSSM_CSP_TOK_USER_PIN_INITIALIZED = 0x00000008,
+	CSSM_CSP_TOK_PROT_AUTHENTICATION = 0x00000100,
+	CSSM_CSP_TOK_USER_PIN_EXPIRED = 0x00100000,
+	CSSM_CSP_TOK_SESSION_KEY_PASSWORD = 0x00200000,
+	CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = 0x00400000,
+	CSSM_CSP_STORES_PRIVATE_KEYS = 0x01000000,
+	CSSM_CSP_STORES_PUBLIC_KEYS = 0x02000000,
+	CSSM_CSP_STORES_SESSION_KEYS = 0x04000000,
+	CSSM_CSP_STORES_CERTIFICATES = 0x08000000,
+	CSSM_CSP_STORES_GENERIC = 0x10000000
+}
+
+enum
+{
+	CSSM_PKCS_OAEP_MGF_NONE = 0,
+	CSSM_PKCS_OAEP_MGF1_SHA1 = CSSM_PKCS_OAEP_MGF_NONE + 1,
+	CSSM_PKCS_OAEP_MGF1_MD5 = CSSM_PKCS_OAEP_MGF_NONE + 2
+}
+
+enum
+{
+	CSSM_PKCS_OAEP_PSOURCE_NONE = 0,
+	CSSM_PKCS_OAEP_PSOURCE_Pspecified = CSSM_PKCS_OAEP_PSOURCE_NONE + 1
+}
+
+enum : uint
+{
+	CSSM_VALUE_NOT_AVAILABLE = ~0
+}
+
+enum
+{
+	CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA1 = 0
+}
+
+enum
+{
+	CSSM_TP_AUTHORITY_REQUEST_CERTISSUE = 0x01,
+	CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE = 0x02,
+	CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND = 0x03,
+	CSSM_TP_AUTHORITY_REQUEST_CERTRESUME = 0x04,
+	CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY = 0x05,
+	CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE = 0x06,
+	CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER = 0x07,
+	CSSM_TP_AUTHORITY_REQUEST_CRLISSUE = 0x100
+}
+
+enum
+{
+	CSSM_TP_KEY_ARCHIVE = 0x0001,
+	CSSM_TP_CERT_PUBLISH = 0x0002,
+	CSSM_TP_CERT_NOTIFY_RENEW = 0x0004,
+	CSSM_TP_CERT_DIR_UPDATE = 0x0008,
+	CSSM_TP_CRL_DISTRIBUTE = 0x0010
+}
+
+enum
+{
+	CSSM_TP_ACTION_DEFAULT = 0
+}
+
+enum
+{
+	CSSM_TP_STOP_ON_POLICY = 0,
+	CSSM_TP_STOP_ON_NONE = 1,
+	CSSM_TP_STOP_ON_FIRST_PASS = 2,
+	CSSM_TP_STOP_ON_FIRST_FAIL = 3
+}
+
+enum
+{
+	CSSM_CRL_PARSE_FORMAT_NONE = 0x00,
+	CSSM_CRL_PARSE_FORMAT_CUSTOM = 0x01,
+	CSSM_CRL_PARSE_FORMAT_SEXPR = 0x02,
+	CSSM_CRL_PARSE_FORMAT_COMPLEX = 0x03,
+	CSSM_CRL_PARSE_FORMAT_OID_NAMED = 0x04,
+	CSSM_CRL_PARSE_FORMAT_TUPLE = 0x05,
+	CSSM_CRL_PARSE_FORMAT_MULTIPLE = 0x7FFE,
+	CSSM_CRL_PARSE_FORMAT_LAST = 0x7FFF,
+	CSSM_CL_CUSTOM_CRL_PARSE_FORMAT = 0x8000
+}
+
+enum
+{
+	CSSM_CRL_TYPE_UNKNOWN = 0x00,
+	CSSM_CRL_TYPE_X_509v1 = 0x01,
+	CSSM_CRL_TYPE_X_509v2 = 0x02,
+	CSSM_CRL_TYPE_SPKI = 0x03,
+	CSSM_CRL_TYPE_MULTIPLE = 0x7FFE
+}
+
+enum
+{
+	CSSM_CRL_ENCODING_UNKNOWN = 0x00,
+	CSSM_CRL_ENCODING_CUSTOM = 0x01,
+	CSSM_CRL_ENCODING_BER = 0x02,
+	CSSM_CRL_ENCODING_DER = 0x03,
+	CSSM_CRL_ENCODING_BLOOM = 0x04,
+	CSSM_CRL_ENCODING_SEXPR = 0x05,
+	CSSM_CRL_ENCODING_MULTIPLE = 0x7FFE
+}
+
+enum
+{
+	CSSM_CRLGROUP_DATA = 0x00,
+	CSSM_CRLGROUP_ENCODED_CRL = 0x01,
+	CSSM_CRLGROUP_PARSED_CRL = 0x02,
+	CSSM_CRLGROUP_CRL_PAIR = 0x03
+}
+
+enum
+{
+	CSSM_EVIDENCE_FORM_UNSPECIFIC = 0x0,
+	CSSM_EVIDENCE_FORM_CERT = 0x1,
+	CSSM_EVIDENCE_FORM_CRL = 0x2,
+	CSSM_EVIDENCE_FORM_CERT_ID = 0x3,
+	CSSM_EVIDENCE_FORM_CRL_ID = 0x4,
+	CSSM_EVIDENCE_FORM_VERIFIER_TIME = 0x5,
+	CSSM_EVIDENCE_FORM_CRL_THISTIME = 0x6,
+	CSSM_EVIDENCE_FORM_CRL_NEXTTIME = 0x7,
+	CSSM_EVIDENCE_FORM_POLICYINFO = 0x8,
+	CSSM_EVIDENCE_FORM_TUPLEGROUP = 0x9
+}
+
+enum
+{
+	CSSM_TP_CONFIRM_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CONFIRM_ACCEPT = 0x1,
+	CSSM_TP_CONFIRM_REJECT = 0x2
+}
+
+enum
+{
+	CSSM_ESTIMATED_TIME_UNKNOWN = -1
+}
+
+enum
+{
+	CSSM_ELAPSED_TIME_UNKNOWN = -1,
+	CSSM_ELAPSED_TIME_COMPLETE = -2
+}
+
+enum
+{
+	CSSM_TP_CERTISSUE_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CERTISSUE_OK = 0x1,
+	CSSM_TP_CERTISSUE_OKWITHCERTMODS = 0x2,
+	CSSM_TP_CERTISSUE_OKWITHSERVICEMODS = 0x3,
+	CSSM_TP_CERTISSUE_REJECTED = 0x4,
+	CSSM_TP_CERTISSUE_NOT_AUTHORIZED = 0x5,
+	CSSM_TP_CERTISSUE_WILL_BE_REVOKED = 0x6
+}
+
+enum
+{
+	CSSM_TP_CERTCHANGE_NONE = 0x0,
+	CSSM_TP_CERTCHANGE_REVOKE = 0x1,
+	CSSM_TP_CERTCHANGE_HOLD = 0x2,
+	CSSM_TP_CERTCHANGE_RELEASE = 0x3
+}
+
+enum
+{
+	CSSM_TP_CERTCHANGE_REASON_UNKNOWN = 0x0,
+	CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE = 0x1,
+	CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE = 0x2,
+	CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION = 0x3,
+	CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE = 0x4,
+	CSSM_TP_CERTCHANGE_REASON_SUPERCEDED = 0x5,
+	CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE = 0x6,
+	CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE = 0x7
+}
+
+enum
+{
+	CSSM_TP_CERTCHANGE_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CERTCHANGE_OK = 0x1,
+	CSSM_TP_CERTCHANGE_OKWITHNEWTIME = 0x2,
+	CSSM_TP_CERTCHANGE_WRONGCA = 0x3,
+	CSSM_TP_CERTCHANGE_REJECTED = 0x4,
+	CSSM_TP_CERTCHANGE_NOT_AUTHORIZED = 0x5
+}
+
+enum
+{
+	CSSM_TP_CERTVERIFY_UNKNOWN = 0x0,
+	CSSM_TP_CERTVERIFY_VALID = 0x1,
+	CSSM_TP_CERTVERIFY_INVALID = 0x2,
+	CSSM_TP_CERTVERIFY_REVOKED = 0x3,
+	CSSM_TP_CERTVERIFY_SUSPENDED = 0x4,
+	CSSM_TP_CERTVERIFY_EXPIRED = 0x5,
+	CSSM_TP_CERTVERIFY_NOT_VALID_YET = 0x6,
+	CSSM_TP_CERTVERIFY_INVALID_AUTHORITY = 0x7,
+	CSSM_TP_CERTVERIFY_INVALID_SIGNATURE = 0x8,
+	CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE = 0x9,
+	CSSM_TP_CERTVERIFY_INVALID_CERTGROUP = 0xA,
+	CSSM_TP_CERTVERIFY_INVALID_POLICY = 0xB,
+	CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS = 0xC,
+	CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS = 0xD,
+	CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT = 0xE,
+	CSSM_TP_CERTVERIFY_INVALID_NAME_TREE = 0xF,
+	CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT = 0x10
+}
+
+enum
+{
+	CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CERTNOTARIZE_OK = 0x1,
+	CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS = 0x2,
+	CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS = 0x3,
+	CSSM_TP_CERTNOTARIZE_REJECTED = 0x4,
+	CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED = 0x5
+}
+
+enum
+{
+	CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CERTRECLAIM_OK = 0x1,
+	CSSM_TP_CERTRECLAIM_NOMATCH = 0x2,
+	CSSM_TP_CERTRECLAIM_REJECTED = 0x3,
+	CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED = 0x4
+}
+
+enum
+{
+	CSSM_TP_CRLISSUE_STATUS_UNKNOWN = 0x0,
+	CSSM_TP_CRLISSUE_OK = 0x1,
+	CSSM_TP_CRLISSUE_NOT_CURRENT = 0x2,
+	CSSM_TP_CRLISSUE_INVALID_DOMAIN = 0x3,
+	CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER = 0x4,
+	CSSM_TP_CRLISSUE_REJECTED = 0x5,
+	CSSM_TP_CRLISSUE_NOT_AUTHORIZED = 0x6
+}
+
+enum
+{
+	CSSM_TP_FORM_TYPE_GENERIC = 0x0,
+	CSSM_TP_FORM_TYPE_REGISTRATION = 0x1
+}
+
+enum
+{
+	CSSM_CL_TEMPLATE_INTERMEDIATE_CERT = 1,
+	CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE = 2
+}
+
+enum
+{
+	CSSM_CERT_BUNDLE_UNKNOWN = 0x00,
+	CSSM_CERT_BUNDLE_CUSTOM = 0x01,
+	CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA = 0x02,
+	CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA = 0x03,
+	CSSM_CERT_BUNDLE_PKCS12 = 0x04,
+	CSSM_CERT_BUNDLE_PFX = 0x05,
+	CSSM_CERT_BUNDLE_SPKI_SEQUENCE = 0x06,
+	CSSM_CERT_BUNDLE_PGP_KEYRING = 0x07,
+	CSSM_CERT_BUNDLE_LAST = 0x7FFF,
+	CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE = 0x8000
+}
+
+enum
+{
+	CSSM_CERT_BUNDLE_ENCODING_UNKNOWN = 0x00,
+	CSSM_CERT_BUNDLE_ENCODING_CUSTOM = 0x01,
+	CSSM_CERT_BUNDLE_ENCODING_BER = 0x02,
+	CSSM_CERT_BUNDLE_ENCODING_DER = 0x03,
+	CSSM_CERT_BUNDLE_ENCODING_SEXPR = 0x04,
+	CSSM_CERT_BUNDLE_ENCODING_PGP = 0x05
+}
+
+enum
+{
+	CSSM_FIELDVALUE_COMPLEX_DATA_TYPE = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_DB_ATTRIBUTE_NAME_AS_STRING = 0,
+	CSSM_DB_ATTRIBUTE_NAME_AS_OID = 1,
+	CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER = 2
+}
+
+enum
+{
+	CSSM_DB_ATTRIBUTE_FORMAT_STRING = 0,
+	CSSM_DB_ATTRIBUTE_FORMAT_SINT32 = 1,
+	CSSM_DB_ATTRIBUTE_FORMAT_UINT32 = 2,
+	CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM = 3,
+	CSSM_DB_ATTRIBUTE_FORMAT_REAL = 4,
+	CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE = 5,
+	CSSM_DB_ATTRIBUTE_FORMAT_BLOB = 6,
+	CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32 = 7,
+	CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX = 8
+}
+
+enum
+{
+	CSSM_DB_RECORDTYPE_SCHEMA_START = 0x00000000,
+	CSSM_DB_RECORDTYPE_SCHEMA_END = CSSM_DB_RECORDTYPE_SCHEMA_START + 4,
+	CSSM_DB_RECORDTYPE_OPEN_GROUP_START = 0x0000000A,
+	CSSM_DB_RECORDTYPE_OPEN_GROUP_END = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8,
+	CSSM_DB_RECORDTYPE_APP_DEFINED_START = 0x80000000,
+	CSSM_DB_RECORDTYPE_APP_DEFINED_END = 0xffffffff,
+	CSSM_DL_DB_SCHEMA_INFO = CSSM_DB_RECORDTYPE_SCHEMA_START + 0,
+	CSSM_DL_DB_SCHEMA_INDEXES = CSSM_DB_RECORDTYPE_SCHEMA_START + 1,
+	CSSM_DL_DB_SCHEMA_ATTRIBUTES = CSSM_DB_RECORDTYPE_SCHEMA_START + 2,
+	CSSM_DL_DB_SCHEMA_PARSING_MODULE = CSSM_DB_RECORDTYPE_SCHEMA_START + 3,
+	CSSM_DL_DB_RECORD_ANY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 0,
+	CSSM_DL_DB_RECORD_CERT = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 1,
+	CSSM_DL_DB_RECORD_CRL = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 2,
+	CSSM_DL_DB_RECORD_POLICY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 3,
+	CSSM_DL_DB_RECORD_GENERIC = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 4,
+	CSSM_DL_DB_RECORD_PUBLIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 5,
+	CSSM_DL_DB_RECORD_PRIVATE_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 6,
+	CSSM_DL_DB_RECORD_SYMMETRIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 7,
+	CSSM_DL_DB_RECORD_ALL_KEYS = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8
+}
+
+enum
+{
+	CSSM_DB_CERT_USE_TRUSTED = 0x00000001,
+	CSSM_DB_CERT_USE_SYSTEM = 0x00000002,
+	CSSM_DB_CERT_USE_OWNER = 0x00000004,
+	CSSM_DB_CERT_USE_REVOKED = 0x00000008,
+	CSSM_DB_CERT_USE_SIGNING = 0x00000010,
+	CSSM_DB_CERT_USE_PRIVACY = 0x00000020
+}
+
+enum
+{
+	CSSM_DB_INDEX_UNIQUE = 0,
+	CSSM_DB_INDEX_NONUNIQUE = 1
+}
+
+enum
+{
+	CSSM_DB_INDEX_ON_UNKNOWN = 0,
+	CSSM_DB_INDEX_ON_ATTRIBUTE = 1,
+	CSSM_DB_INDEX_ON_RECORD = 2
+}
+
+enum
+{
+	CSSM_DB_ACCESS_READ = 0x00001,
+	CSSM_DB_ACCESS_WRITE = 0x00002,
+	CSSM_DB_ACCESS_PRIVILEGED = 0x00004
+}
+
+enum
+{
+	CSSM_DB_MODIFY_ATTRIBUTE_NONE = 0,
+	CSSM_DB_MODIFY_ATTRIBUTE_ADD = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 1,
+	CSSM_DB_MODIFY_ATTRIBUTE_DELETE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 2,
+	CSSM_DB_MODIFY_ATTRIBUTE_REPLACE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 3
+}
+
+enum
+{
+	CSSM_DB_EQUAL = 0,
+	CSSM_DB_NOT_EQUAL = 1,
+	CSSM_DB_LESS_THAN = 2,
+	CSSM_DB_GREATER_THAN = 3,
+	CSSM_DB_CONTAINS = 4,
+	CSSM_DB_CONTAINS_INITIAL_SUBSTRING = 5,
+	CSSM_DB_CONTAINS_FINAL_SUBSTRING = 6
+}
+
+enum
+{
+	CSSM_DB_NONE = 0,
+	CSSM_DB_AND = 1,
+	CSSM_DB_OR = 2
+}
+
+enum
+{
+	CSSM_QUERY_TIMELIMIT_NONE = 0
+}
+
+enum
+{
+	CSSM_QUERY_SIZELIMIT_NONE = 0
+}
+
+enum
+{
+	CSSM_QUERY_RETURN_DATA = 0x01
+}
+
+enum
+{
+	CSSM_DL_UNKNOWN = 0,
+	CSSM_DL_CUSTOM = 1,
+	CSSM_DL_LDAP = 2,
+	CSSM_DL_ODBC = 3,
+	CSSM_DL_PKCS11 = 4,
+	CSSM_DL_FFS = 5,
+	CSSM_DL_MEMORY = 6,
+	CSSM_DL_REMOTEDIR = 7
+}
+
+enum
+{
+	CSSM_DB_DATASTORES_UNKNOWN = 0xFFFFFFFF
+}
+
+enum
+{
+	CSSM_DB_TRANSACTIONAL_MODE = 0,
+	CSSM_DB_FILESYSTEMSCAN_MODE = 1
+}
+
+struct CSSM_DATA
+{
+	uint Length;
+	char* Data;
+}
+
+
+struct CSSM_GUID
+{
+	uint Data1;
+	ushort Data2;
+	ushort Data3;
+	char* Data4;
+}
+
+
+struct CSSM_VERSION
+{
+	uint Major;
+	uint Minor;
+}
+
+
+struct CSSM_SUBSERVICE_UID
+{
+	CSSM_GUID Guid;
+	CSSM_VERSION Version;
+	uint SubserviceId;
+	uint SubserviceType;
+}
+
+
+struct CSSM_NET_ADDRESS
+{
+	uint AddressType;
+	CSSM_DATA Address;
+}
+
+
+struct CSSM_CRYPTO_DATA
+{
+	CSSM_DATA Param;
+	CSSM_CALLBACK Callback;
+	void* CallerCtx;
+}
+
+
+struct CSSM_LIST
+{
+	uint ListType;
+	CSSM_LIST_ELEMENT_PTR Head;
+	CSSM_LIST_ELEMENT_PTR Tail;
+}
+
+
+struct CSSM_LIST_ELEMENT
+{
+	CSSM_LIST_ELEMENT* NextElement;
+	CSSM_WORDID_TYPE WordID;
+	CSSM_LIST_ELEMENT_TYPE ElementType;
+	
+	union
+	{
+		CSSM_LIST Sublist;
+		CSSM_DATA Word;
+	}
+}
+
+struct CSSM_TUPLE
+{
+	CSSM_LIST Issuer;
+	int Subject;
+	CSSM_BOOL Delegate;
+	CSSM_LIST AuthorizationTag;
+	CSSM_LIST ValidityPeriod;
+}
+
+
+struct CSSM_TUPLEGROUP
+{
+	uint32 NumberOfTuples;
+	CSSM_TUPLE_PTR Tuples;
+}
+
+
+struct CSSM_SAMPLE
+{
+	CSSM_LIST TypedSample;
+	CSSM_SUBSERVICE_UID* Verifier;
+}
+
+
+struct CSSM_SAMPLEGROUP
+{
+	uint32 NumberOfSamples;
+	CSSM_SAMPLE* Samples;
+}
+
+
+struct CSSM_MEMORY_FUNCS
+{
+	CSSM_MALLOC malloc_func;
+	CSSM_FREE free_func;
+	CSSM_REALLOC realloc_func;
+	CSSM_CALLOC calloc_func;
+	void* AllocRef;
+}
+
+
+struct CSSM_ENCODED_CERT
+{
+	uint CertType;
+	CSSM_CERT_ENCODING CertEncoding;
+	CSSM_DATA CertBlob;
+}
+
+
+struct CSSM_PARSED_CERT
+{
+	uint CertType;
+	CSSM_CERT_PARSE_FORMAT ParsedCertFormat;
+	void* ParsedCert;
+}
+
+
+struct CSSM_CERT_PAIR
+{
+	CSSM_ENCODED_CERT EncodedCert;
+	CSSM_PARSED_CERT ParsedCert;
+}
+
+
+struct CSSM_CERTGROUP
+{
+	CSSM_CERT_TYPE CertType;
+	CSSM_CERT_ENCODING CertEncoding;
+	uint NumCerts;
+	
+	union
+	{
+		CSSM_DATA_PTR CertList;
+		CSSM_ENCODED_CERT_PTR EncodedCertList;
+		CSSM_PARSED_CERT_PTR ParsedCertList;
+		CSSM_CERT_PAIR_PTR PairCertList;
+	}
+	
+	CSSM_CERTGROUP_TYPE CertGroupType;
+	void* Reserved;
+}
+
+struct CSSM_BASE_CERTS
+{
+	CSSM_TP_HANDLE TPHandle;
+	CSSM_CL_HANDLE CLHandle;
+	byte[68] Certs;
+}
+
+
+struct CSSM_ACCESS_CREDENTIALS
+{
+	CSSM_STRING EntryTag;
+	CSSM_BASE_CERTS BaseCerts;
+	CSSM_SAMPLEGROUP Samples;
+	CSSM_CHALLENGE_CALLBACK Callback;
+	uint CallerCtx;
+}
+
+
+struct CSSM_AUTHORIZATIONGROUP
+{
+	uint32 NumberOfAuthTags;
+	CSSM_ACL_AUTHORIZATION_TAG* AuthTags;
+}
+
+
+struct CSSM_ACL_VALIDITY_PERIOD
+{
+	CSSM_DATA StartDate;
+	CSSM_DATA EndDate;
+}
+
+
+struct CSSM_ACL_ENTRY_PROTOTYPE
+{
+	CSSM_LIST TypedSubject;
+	CSSM_BOOL Delegate;
+	byte[68] Authorization;
+	CSSM_ACL_VALIDITY_PERIOD TimeRange;
+	CSSM_STRING EntryTag;
+}
+
+
+struct CSSM_ACL_OWNER_PROTOTYPE
+{
+	CSSM_LIST TypedSubject;
+	CSSM_BOOL Delegate;
+}
+
+
+struct CSSM_ACL_ENTRY_INPUT
+{
+	CSSM_ACL_ENTRY_PROTOTYPE Prototype;
+	CSSM_ACL_SUBJECT_CALLBACK Callback;
+	void* CallerContext;
+}
+
+
+struct CSSM_RESOURCE_CONTROL_CONTEXT
+{
+	CSSM_ACCESS_CREDENTIALS_PTR AccessCred;
+	CSSM_ACL_ENTRY_INPUT InitialAclEntry;
+}
+
+
+struct CSSM_ACL_ENTRY_INFO
+{
+	CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo;
+	uint EntryHandle;
+}
+
+
+struct CSSM_ACL_EDIT
+{
+	CSSM_ACL_EDIT_MODE EditMode;
+	CSSM_ACL_HANDLE OldEntryHandle;
+	byte[68] NewEntry;
+}
+
+
+struct CSSM_FUNC_NAME_ADDR
+{
+	CSSM_STRING Name;
+	char* Address;
+}
+
+
+struct CSSM_DATE
+{
+	char* Year;
+	uint8* Month;
+	uint Day;
+}
+
+
+struct CSSM_RANGE
+{
+	uint32 Min;
+	uint Max;
+}
+
+
+struct CSSM_QUERY_SIZE_DATA
+{
+	uint32 SizeInputBlock;
+	uint SizeOutputBlock;
+}
+
+
+struct CSSM_KEY_SIZE
+{
+	uint32 LogicalKeySizeInBits;
+	uint EffectiveKeySizeInBits;
+}
+
+
+struct CSSM_KEYHEADER
+{
+	uint HeaderVersion;
+	uint CspId;
+	uint BlobType;
+	uint Format;
+	uint AlgorithmId;
+	uint KeyClass;
+	uint LogicalKeySizeInBits;
+	CSSM_KEYATTR_FLAGS KeyAttr;
+	CSSM_KEYUSE KeyUsage;
+	uint StartDate;
+	uint EndDate;
+	uint WrapAlgorithmId;
+	CSSM_ENCRYPT_MODE WrapMode;
+	uint32 Reserved;
+}
+
+
+struct CSSM_KEY
+{
+	CSSM_KEYHEADER KeyHeader;
+	int KeyData;
+}
+
+
+struct CSSM_DL_DB_HANDLE
+{
+	CSSM_DL_HANDLE DLHandle;
+	CSSM_DB_HANDLE DBHandle;
+}
+
+
+struct CSSM_CONTEXT_ATTRIBUTE
+{
+	uint Attribute;
+}
+
+
+struct CSSM_CONTEXT
+{
+	CSSM_CONTEXT_TYPE ContextType;
+	int AlgorithmType;
+	int NumberOfAttributes;
+	uint ContextAttributes;
+	uint CSPHandle;
+	uint Privileged;
+	uint32 EncryptionProhibited;
+	uint WorkFactor;
+	uint32 Reserved;
+}
+
+
+struct CSSM_PKCS1_OAEP_PARAMS
+{
+	uint32 HashAlgorithm;
+	uint HashParams;
+	CSSM_PKCS_OAEP_MGF MGF;
+	CSSM_DATA MGFParams;
+	int PSource;
+	uint PSourceParams;
+}
+
+
+struct CSSM_CSP_OPERATIONAL_STATISTICS
+{
+	uint UserAuthenticated;
+	uint DeviceFlags;
+	uint TokenMaxSessionCount;
+	uint TokenOpenedSessionCount;
+	uint TokenMaxRWSessionCount;
+	uint TokenOpenedRWSessionCount;
+	uint TokenTotalPublicMem;
+	uint32 TokenFreePublicMem;
+	uint32 TokenTotalPrivateMem;
+	uint32 TokenFreePrivateMem;
+}
+
+
+struct CSSM_PKCS5_PBKDF1_PARAMS
+{
+	CSSM_DATA Passphrase;
+	uint InitVector;
+}
+
+
+struct CSSM_PKCS5_PBKDF2_PARAMS
+{
+	CSSM_DATA Passphrase;
+	CSSM_PKCS5_PBKDF2_PRF PseudoRandomFunction;
+}
+
+
+struct CSSM_KEA_DERIVE_PARAMS
+{
+	CSSM_DATA Rb;
+	CSSM_DATA Yb;
+}
+
+
+struct CSSM_TP_AUTHORITY_ID
+{
+	CSSM_DATA* AuthorityCert;
+	CSSM_NET_ADDRESS_PTR AuthorityLocation;
+}
+
+
+struct CSSM_FIELD
+{
+	uint FieldOid;
+	CSSM_DATA FieldValue;
+}
+
+
+struct CSSM_TP_POLICYINFO
+{
+	uint32 NumberOfPolicyIds;
+	uint PolicyIds;
+	void* PolicyControl;
+}
+
+
+struct CSSM_DL_DB_LIST
+{
+	uint32 NumHandles;
+	char* DLDBHandle;
+}
+
+
+struct CSSM_TP_CALLERAUTH_CONTEXT
+{
+	CSSM_TP_POLICYINFO Policy;
+	uint VerifyTime;
+	CSSM_TP_STOP_ON VerificationAbortOn;
+	CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert;
+	uint32 NumberOfAnchorCerts;
+	CSSM_DATA_PTR AnchorCerts;
+	uint DBList;
+	uint CallerCredentials;
+}
+
+
+struct CSSM_ENCODED_CRL
+{
+	CSSM_CRL_TYPE CrlType;
+	uint CrlEncoding;
+	uint CrlBlob;
+}
+
+
+struct CSSM_PARSED_CRL
+{
+	CSSM_CRL_TYPE CrlType;
+	CSSM_CRL_PARSE_FORMAT ParsedCrlFormat;
+	void* ParsedCrl;
+}
+
+
+struct CSSM_CRL_PAIR
+{
+	uint EncodedCrl;
+	CSSM_PARSED_CRL ParsedCrl;
+}
+
+
+struct CSSM_CRLGROUP
+{
+	CSSM_CRL_TYPE CrlType;
+	CSSM_CRL_ENCODING CrlEncoding;
+	uint NumberOfCrls;
+	
+	union
+	{
+		CSSM_DATA_PTR CrlList;
+		CSSM_ENCODED_CRL_PTR EncodedCrlList;
+		CSSM_PARSED_CRL_PTR ParsedCrlList;
+		CSSM_CRL_PAIR_PTR PairCrlList;
+	}
+	
+	CSSM_CRLGROUP_TYPE CrlGroupType;
+}
+
+struct CSSM_FIELDGROUP
+{
+	int NumberOfFields;
+	CSSM_FIELD_PTR Fields;
+}
+
+
+struct CSSM_EVIDENCE
+{
+	CSSM_EVIDENCE_FORM EvidenceForm;
+	void* Evidence;
+}
+
+
+struct CSSM_TP_VERIFY_CONTEXT
+{
+	CSSM_TP_ACTION Action;
+	uint ActionData;
+	CSSM_CRLGROUP Crls;
+	CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred;
+}
+
+
+struct CSSM_TP_VERIFY_CONTEXT_RESULT
+{
+	uint32 NumberOfEvidences;
+	CSSM_EVIDENCE_PTR Evidence;
+}
+
+
+struct CSSM_TP_REQUEST_SET
+{
+	uint32 NumberOfRequests;
+	void* Requests;
+}
+
+
+struct CSSM_TP_RESULT_SET
+{
+	uint32 NumberOfResults;
+	void* Results;
+}
+
+
+struct CSSM_TP_CONFIRM_RESPONSE
+{
+	int NumberOfResponses;
+	uint Responses;
+}
+
+
+struct CSSM_TP_CERTISSUE_INPUT
+{
+	uint CSPSubserviceUid;
+	uint CLHandle;
+	uint32 NumberOfTemplateFields;
+	CSSM_FIELD_PTR SubjectCertFields;
+	CSSM_TP_SERVICES MoreServiceRequests;
+	uint NumberOfServiceControls;
+	CSSM_FIELD_PTR ServiceControls;
+	uint UserCredentials;
+}
+
+
+struct CSSM_TP_CERTISSUE_OUTPUT
+{
+	uint IssueStatus;
+	uint CertGroup;
+	int PerformedServiceRequests;
+}
+
+
+struct CSSM_TP_CERTCHANGE_INPUT
+{
+	CSSM_TP_CERTCHANGE_ACTION Action;
+	char* Reason;
+	CSSM_CL_HANDLE CLHandle;
+	CSSM_DATA_PTR Cert;
+	uint ChangeInfo;
+	CSSM_TIMESTRING StartTime;
+	CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials;
+}
+
+
+struct CSSM_TP_CERTCHANGE_OUTPUT
+{
+	CSSM_TP_CERTCHANGE_STATUS ActionStatus;
+	CSSM_FIELD RevokeInfo;
+}
+
+
+struct CSSM_TP_CERTVERIFY_INPUT
+{
+	uint CLHandle;
+	uint Cert;
+	CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext;
+}
+
+
+struct CSSM_TP_CERTVERIFY_OUTPUT
+{
+	int VerifyStatus;
+	uint NumberOfEvidence;
+	CSSM_EVIDENCE_PTR Evidence;
+}
+
+
+struct CSSM_TP_CERTNOTARIZE_INPUT
+{
+	uint CLHandle;
+	uint NumberOfFields;
+	uint MoreFields;
+	CSSM_FIELD_PTR SignScope;
+	uint32 ScopeSize;
+	CSSM_TP_SERVICES MoreServiceRequests;
+	uint NumberOfServiceControls;
+	CSSM_FIELD_PTR ServiceControls;
+	uint UserCredentials;
+}
+
+
+struct CSSM_TP_CERTNOTARIZE_OUTPUT
+{
+	int NotarizeStatus;
+	uint NotarizedCertGroup;
+	CSSM_TP_SERVICES PerformedServiceRequests;
+}
+
+
+struct CSSM_TP_CERTRECLAIM_INPUT
+{
+	CSSM_CL_HANDLE CLHandle;
+	uint NumberOfSelectionFields;
+	CSSM_FIELD_PTR SelectionFields;
+	ulong UserCredentials;
+}
+
+
+struct CSSM_TP_CERTRECLAIM_OUTPUT
+{
+	int ReclaimStatus;
+	uint ReclaimedCertGroup;
+	char* KeyCacheHandle;
+}
+
+
+struct CSSM_TP_CRLISSUE_INPUT
+{
+	CSSM_CL_HANDLE CLHandle;
+	uint32 CrlIdentifier;
+	uint CrlThisTime;
+	CSSM_FIELD_PTR PolicyIdentifier;
+	char* CallerCredentials;
+}
+
+
+struct CSSM_TP_CRLISSUE_OUTPUT
+{
+	uint IssueStatus;
+	uint Crl;
+	CSSM_TIMESTRING CrlNextTime;
+}
+
+
+struct CSSM_CERT_BUNDLE_HEADER
+{
+	CSSM_CERT_BUNDLE_TYPE BundleType;
+	CSSM_CERT_BUNDLE_ENCODING BundleEncoding;
+}
+
+
+struct CSSM_CERT_BUNDLE
+{
+	CSSM_CERT_BUNDLE_HEADER BundleHeader;
+	CSSM_DATA Bundle;
+}
+
+
+struct CSSM_DB_ATTRIBUTE_INFO
+{
+	CSSM_DB_ATTRIBUTE_NAME_FORMAT AttributeNameFormat;
+	
+	union cssm_db_attribute_label
+	{
+		char* AttributeName;
+		CSSM_OID AttributeOID;
+		uint AttributeID;
+	}
+	
+	cssm_db_attribute_label Label;
+	CSSM_DB_ATTRIBUTE_FORMAT AttributeFormat;
+}
+
+struct CSSM_DB_ATTRIBUTE_DATA
+{
+	uint Info;
+	uint32 NumberOfValues;
+	CSSM_DATA_PTR Value;
+}
+
+
+struct CSSM_DB_RECORD_ATTRIBUTE_INFO
+{
+	uint DataRecordType;
+	uint NumberOfAttributes;
+	CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo;
+}
+
+
+struct CSSM_DB_RECORD_ATTRIBUTE_DATA
+{
+	uint DataRecordType;
+	uint32 SemanticInformation;
+	uint32 NumberOfAttributes;
+	uint AttributeData;
+}
+
+
+struct CSSM_DB_PARSING_MODULE_INFO
+{
+	CSSM_DB_RECORDTYPE RecordType;
+	CSSM_SUBSERVICE_UID ModuleSubserviceUid;
+}
+
+
+struct CSSM_DB_INDEX_INFO
+{
+	CSSM_DB_INDEX_TYPE IndexType;
+	CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation;
+	uint Info;
+}
+
+
+struct CSSM_DB_UNIQUE_RECORD
+{
+	CSSM_DB_INDEX_INFO RecordLocator;
+	CSSM_DATA RecordIdentifier;
+}
+
+
+struct CSSM_DB_RECORD_INDEX_INFO
+{
+	CSSM_DB_RECORDTYPE DataRecordType;
+	uint32 NumberOfIndexes;
+	CSSM_DB_INDEX_INFO_PTR IndexInfo;
+}
+
+
+struct CSSM_DBINFO
+{
+	char* NumberOfRecordTypes;
+	CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules;
+	CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames;
+	uint RecordIndexes;
+	CSSM_BOOL IsLocal;
+	char* AccessPath;
+	uint Reserved;
+}
+
+
+struct CSSM_SELECTION_PREDICATE
+{
+	CSSM_DB_OPERATOR DbOperator;
+	uint Attribute;
+}
+
+
+struct CSSM_QUERY_LIMITS
+{
+	uint TimeLimit;
+	uint32 SizeLimit;
+}
+
+
+struct CSSM_QUERY
+{
+	uint RecordType;
+	CSSM_DB_CONJUNCTIVE Conjunctive;
+	uint NumSelectionPredicates;
+	CSSM_SELECTION_PREDICATE_PTR SelectionPredicate;
+	uint QueryLimits;
+	CSSM_QUERY_FLAGS QueryFlags;
+}
+
+
+struct CSSM_DL_PKCS11_ATTRIBUTE
+{
+	uint DeviceAccessFlags;
+}
+
+
+struct CSSM_NAME_LIST
+{
+	uint32 NumStrings;
+	uint String;
+}
+
+
+struct CSSM_DB_SCHEMA_ATTRIBUTE_INFO
+{
+	uint AttributeId;
+	uint AttributeName;
+	uint AttributeNameID;
+	uint DataType;
+}
+
+
+struct CSSM_DB_SCHEMA_INDEX_INFO
+{
+	uint32 AttributeId;
+	uint32 IndexId;
+	CSSM_DB_INDEX_TYPE IndexType;
+	CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/eisl.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,99 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.eisl;
+
+import dstep.security.cssmconfig;
+
+alias void* ISL_ITERATOR_PTR;
+alias void* ISL_VERIFIED_SIGNATURE_ROOT_PTR;
+alias void* ISL_VERIFIED_CERTIFICATE_CHAIN_PTR;
+alias void* ISL_VERIFIED_CERTIFICATE_PTR;
+alias void* ISL_MANIFEST_SECTION_PTR;
+alias void* ISL_VERIFIED_MODULE_PTR;
+alias ISL_CONST_DATA* ISL_CONST_DATA_PTR;
+
+extern (C)
+{
+	alias void function () ISL_FUNCTION_PTR;
+}
+
+enum isl_status 
+{
+	ISL_OK = 0,
+	ISL_FAIL = -1
+}
+
+struct ISL_DATA
+{
+	uint Length;
+	char* Data;
+}
+
+
+struct ISL_CONST_DATA
+{
+	uint Length;
+	char* Data;
+}
+
+extern (C)
+{
+	ISL_VERIFIED_MODULE_PTR EISL_SelfCheck ();
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialDataWithCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentials (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialsWithCertificate (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialDataWithCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentials (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialsWithCertificate (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
+	ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_GetCertificateChain (ISL_VERIFIED_MODULE_PTR Module);
+	uint EISL_ContinueVerification (ISL_VERIFIED_MODULE_PTR Module, uint WorkFactor);
+	ISL_VERIFIED_MODULE_PTR EISL_DuplicateVerifiedModulePtr (ISL_VERIFIED_MODULE_PTR Module);
+	int EISL_RecycleVerifiedModuleCredentials (ISL_VERIFIED_MODULE_PTR Verification);
+	ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerifiedSignatureRootWithCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerifiedSignatureRootWithCredentialDataAndCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_VERIFIED_CERTIFICATE_PTR Cert);
+	ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerfiedSignatureRoot (ISL_CONST_DATA Credentials, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
+	ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerfiedSignatureRootWithCertificate (ISL_CONST_DATA Credentials, ISL_VERIFIED_CERTIFICATE_PTR Cert);
+	ISL_MANIFEST_SECTION_PTR EISL_FindManifestSection (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root, ISL_CONST_DATA Name);
+	ISL_ITERATOR_PTR EISL_CreateManifestSectionEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
+	ISL_MANIFEST_SECTION_PTR EISL_GetNextManifestSection (ISL_ITERATOR_PTR Iterator);
+	int EISL_RecycleManifestSectionEnumerator (ISL_ITERATOR_PTR Iterator);
+	int EISL_FindManifestAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
+	ISL_ITERATOR_PTR EISL_CreateManifestAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context);
+	int EISL_FindSignerInfoAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
+	ISL_ITERATOR_PTR EISL_CreateSignerInfoAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context);
+	int EISL_GetNextAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
+	int EISL_RecycleAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
+	int EISL_FindSignatureAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
+	ISL_ITERATOR_PTR EISL_CreateSignatureAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
+	int EISL_GetNextSignatureAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
+	int EISL_RecycleSignatureAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
+	int EISL_RecycleVerifiedSignatureRoot (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
+	ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCredentialData (ISL_CONST_DATA RootIssuer, ISL_CONST_DATA PublicKey, ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath);
+	ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCredentialDataAndCertificate (ISL_CONST_DATA Certificate, ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath);
+	ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChain (ISL_CONST_DATA RootIssuer, ISL_CONST_DATA PublicKey, ISL_CONST_DATA Credential);
+	ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCertificate (ISL_CONST_DATA Certificate, ISL_CONST_DATA Credential);
+	uint EISL_CopyCertificateChain (ISL_VERIFIED_CERTIFICATE_CHAIN_PTR Verification, ISL_VERIFIED_CERTIFICATE_PTR* Certs, uint MaxCertificates);
+	int EISL_RecycleVerifiedCertificateChain (ISL_VERIFIED_CERTIFICATE_CHAIN_PTR Chain);
+	int EISL_FindCertificateAttribute (ISL_VERIFIED_CERTIFICATE_PTR Cert, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
+	ISL_ITERATOR_PTR EISL_CreateCertificateAttributeEnumerator (ISL_VERIFIED_CERTIFICATE_PTR Cert);
+	int EISL_GetNextCertificateAttribute (ISL_ITERATOR_PTR CertIterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
+	int EISL_RecycleCertificateAttributeEnumerator (ISL_ITERATOR_PTR CertIterator);
+	ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_GetManifestSignatureRoot (ISL_MANIFEST_SECTION_PTR Section);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModule (ISL_MANIFEST_SECTION_PTR Section);
+	ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModule (ISL_MANIFEST_SECTION_PTR Section);
+	int EISL_FindManifestSectionAttribute (ISL_MANIFEST_SECTION_PTR Section, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
+	ISL_ITERATOR_PTR EISL_CreateManifestSectionAttributeEnumerator (ISL_MANIFEST_SECTION_PTR Section);
+	int EISL_GetNextManifestSectionAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
+	int EISL_RecycleManifestSectionAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
+	ISL_MANIFEST_SECTION_PTR EISL_GetModuleManifestSection (ISL_VERIFIED_MODULE_PTR Module);
+	ISL_FUNCTION_PTR EISL_LocateProcedureAddress (ISL_VERIFIED_MODULE_PTR Module, ISL_CONST_DATA Name);
+	int EISL_CheckAddressWithinModule (ISL_VERIFIED_MODULE_PTR Verification, ISL_FUNCTION_PTR Address);
+	int EISL_CheckDataAddressWithinModule (ISL_VERIFIED_MODULE_PTR Verification, void* Address);
+	void* EISL_GetLibHandle (ISL_VERIFIED_MODULE_PTR Verification);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/emmspi.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,62 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.emmspi;
+
+import dstep.security.cssmtype;
+import dstep.security.cssmspi;
+import dstep.security.emmtype;
+
+alias CSSM_MANAGER_REGISTRATION_INFO* CSSM_MANAGER_REGISTRATION_INFO_PTR;
+alias CSSM_STATE_FUNCS* CSSM_STATE_FUNCS_PTR;
+
+enum
+{
+	CSSM_HINT_NONE = 0,
+	CSSM_HINT_ADDRESS_APP = 1 << 0,
+	CSSM_HINT_ADDRESS_SP = 1 << 1
+}
+
+struct CSSM_STATE_FUNCS
+{
+	extern (C) int function (CSSM_MODULE_HANDLE hAddIn,
+						     CSSM_SERVICE_MASK AddinType,
+						     void* *SPFunctions,
+						     CSSM_GUID_PTR Guid,
+						     CSSM_BOOL* Serialized) cssm_GetAttachFunctions;
+	
+	extern (C) int function (CSSM_MODULE_HANDLE hAddIn) cssm_ReleaseAttachFunctions; 
+	
+	extern (C) int function (CSSM_MODULE_HANDLE hAddIn,
+							 CSSM_UPCALLS_PTR UpcallTable) cssm_GetAppMemoryFunctions;
+	
+	extern (C) int function (CSSM_MODULE_HANDLE hAddin,
+						     CSSM_PROC_ADDR SrcAddress,
+						     CSSM_PROC_ADDR DestAddress,
+						     CSSM_PRIVILEGE InPriv,
+						     CSSM_PRIVILEGE* OutPriv,
+						     CSSM_BITMASK Hints,
+						     CSSM_BOOL* IsOK) cssm_IsFuncCallValid;
+	
+	extern (C) int function (/*const*/ CSSM_GUID* GUID) cssm_DeregisterManagerServices;
+	extern (C) int function (/*const*/ CSSM_MANAGER_EVENT_NOTIFICATION* EventDescription) cssm_DeliverModuleManagerEvent;
+}
+
+struct CSSM_MANAGER_REGISTRATION_INFO
+{
+	extern (C) int function (uint VerMajor, uint VerMinor) Initialize;
+	extern (C) int function () Terminate;
+	extern (C) int function (CSSM_STATE_FUNCS_PTR CssmStateCallTable) RegisterDispatchTable;
+	extern (C) int function () DeregisterDispatchTable;
+	extern (C) int function (/*const*/ CSSM_MANAGER_EVENT_NOTIFICATION* EventDescription) EventNotifyManager;
+	extern (C) int function (CSSM_FUNC_NAME_ADDR_PTR FuncNameAddrPtr,
+							 uint NumOfFuncNameAddr) RefreshFunctionTable;
+}
+
+extern (C)
+{
+	int ModuleManagerAuthenticate (uint KeyHierarchy, CSSM_GUID* CssmGuid, CSSM_GUID* AppGuid, CSSM_MANAGER_REGISTRATION_INFO_PTR FunctionTable);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/emmtype.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,22 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.emmtype;
+
+import dstep.security.cssmtype;
+
+alias uint CSSM_MANAGER_EVENT_TYPES;
+alias CSSM_MANAGER_EVENT_NOTIFICATION* CSSM_MANAGER_EVENT_NOTIFICATION_PTR;
+
+struct CSSM_MANAGER_EVENT_NOTIFICATION
+{
+	uint DestinationModuleManagerType;
+	uint SourceModuleManagerType;
+	uint Event;
+	uint EventId;
+	CSSM_DATA EventData;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/mds.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,93 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.mds;
+
+import dstep.security.cssmtype;
+
+alias int MDS_HANDLE;
+alias CSSM_DL_DB_HANDLE MDS_DB_HANDLE;
+alias MDS_FUNCS* MDS_FUNCS_PTR;
+
+struct MDS_FUNCS
+{
+	extern (C) int function (MDS_HANDLE MdsHandle,
+						     /*const*/ char *DbName,
+						     /*const*/ CSSM_NET_ADDRESS *DbLocation,
+						     CSSM_DB_ACCESS_TYPE AccessRequest,
+						     /*const*/ CSSM_ACCESS_CREDENTIALS *AccessCred,
+						     /*const*/ void *OpenParameters,
+						     CSSM_DB_HANDLE *hMds) DbOpen;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle) DbClose;
+	
+	extern (C) int function (MDS_HANDLE MdsHandle,
+							 CSSM_NAME_LIST_PTR *NameList) GetDbNames;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle, char **DbName) GetDbNameFromHandle;
+	
+	extern (C) int function (MDS_HANDLE MdsHandle,
+							 CSSM_NAME_LIST_PTR NameList) FreeNameList;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     CSSM_DB_RECORDTYPE RecordType,
+						     /*const*/ CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
+						     /*const*/ CSSM_DATA *Data,
+						     CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) DataInsert;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+							 /*const*/ CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier) DataDelete;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     CSSM_DB_RECORDTYPE RecordType,
+						     CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
+						     /*const*/ CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
+						     /*const*/ CSSM_DATA *DataToBeModified,
+						     CSSM_DB_MODIFY_MODE ModifyMode) DataModify;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     /*const*/ CSSM_QUERY *Query,
+						     CSSM_HANDLE_PTR ResultsHandle,
+						     CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+						     CSSM_DATA_PTR Data,
+						     CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) DataGetFirst;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     CSSM_HANDLE ResultsHandle,
+						     CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+						     CSSM_DATA_PTR Data,
+						     CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) DataGetNext;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+							 CSSM_HANDLE ResultsHandle) DataAbortQuery;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     /*const*/ CSSM_DB_UNIQUE_RECORD *UniqueRecord,
+						     CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
+						     CSSM_DATA_PTR Data) DataGetFromUniqueRecordId;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+							 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord) FreeUniqueRecord;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+						     CSSM_DB_RECORDTYPE RelationID,
+						     /*const*/ char *RelationName,
+						     uint NumberOfAttributes,
+						     /*const*/ CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
+						     uint NumberOfIndexes,
+						     /*const*/ CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo) CreateRelation;
+	
+	extern (C) int function (MDS_DB_HANDLE MdsDbHandle,
+							 CSSM_DB_RECORDTYPE RelationID) DestroyRelation;
+}
+
+extern (C)
+{
+	int MDS_Initialize (CSSM_GUID* pCallerGuid, CSSM_MEMORY_FUNCS* pMemoryFunctions, MDS_FUNCS_PTR pDlFunctions, MDS_HANDLE* hMds);
+	int MDS_Terminate (int MdsHandle);
+	int MDS_Install (int MdsHandle);
+	int MDS_Uninstall (int MdsHandle);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/mds_schema.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,10 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.mds_schema;
+
+import dstep.security.cssmtype;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/oidsalg.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,121 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.oidsalg;
+
+import dstep.security.cssmtype;
+
+extern (C):
+	
+extern const CSSM_OID
+CSSMOID_MD2,
+CSSMOID_MD4,
+CSSMOID_MD5,
+CSSMOID_RSA,
+CSSMOID_MD2WithRSA,
+CSSMOID_MD4WithRSA,
+CSSMOID_MD5WithRSA,
+CSSMOID_SHA1WithRSA,
+CSSMOID_SHA224WithRSA,
+CSSMOID_SHA256WithRSA,
+CSSMOID_SHA384WithRSA,
+CSSMOID_SHA512WithRSA,
+CSSMOID_SHA1WithRSA_OIW,
+CSSMOID_RSAWithOAEP,
+CSSMOID_OAEP_MGF1,
+CSSMOID_OAEP_ID_PSPECIFIED,
+CSSMOID_DES_CBC,
+CSSMOID_ANSI_DH_PUB_NUMBER,
+CSSMOID_ANSI_DH_STATIC,
+CSSMOID_ANSI_DH_ONE_FLOW,
+CSSMOID_ANSI_DH_EPHEM,
+CSSMOID_ANSI_DH_HYBRID1,
+CSSMOID_ANSI_DH_HYBRID2,
+CSSMOID_ANSI_DH_HYBRID_ONEFLOW,
+CSSMOID_ANSI_MQV1,
+CSSMOID_ANSI_MQV2,
+CSSMOID_ANSI_DH_STATIC_SHA1,
+CSSMOID_ANSI_DH_ONE_FLOW_SHA1,
+CSSMOID_ANSI_DH_EPHEM_SHA1,
+CSSMOID_ANSI_DH_HYBRID1_SHA1,
+CSSMOID_ANSI_DH_HYBRID2_SHA1,
+CSSMOID_ANSI_MQV1_SHA1,
+CSSMOID_ANSI_MQV2_SHA1,
+CSSMOID_PKCS3,
+CSSMOID_DH,
+CSSMOID_DSA,				// BSAFE only
+CSSMOID_DSA_CMS,			// X509/CMS
+CSSMOID_DSA_JDK,			// JDK 1.1
+CSSMOID_SHA1WithDSA,		// BSAFE
+CSSMOID_SHA1WithDSA_CMS,	// X509/CMS	
+CSSMOID_SHA1WithDSA_JDK,	// JDK 1.1
+CSSMOID_SHA1,
+CSSMOID_SHA224,
+CSSMOID_SHA256,
+CSSMOID_SHA384,
+CSSMOID_SHA512,
+CSSMOID_APPLE_ISIGN,
+CSSMOID_APPLE_X509_BASIC,
+CSSMOID_APPLE_TP_SSL,
+CSSMOID_APPLE_TP_LOCAL_CERT_GEN,
+CSSMOID_APPLE_TP_CSR_GEN,
+CSSMOID_APPLE_TP_REVOCATION_CRL,
+CSSMOID_APPLE_TP_REVOCATION_OCSP,
+CSSMOID_APPLE_TP_SMIME,
+CSSMOID_APPLE_TP_EAP,
+CSSMOID_APPLE_TP_CODE_SIGN,
+CSSMOID_APPLE_TP_SW_UPDATE_SIGNING,
+CSSMOID_APPLE_TP_IP_SEC,
+CSSMOID_APPLE_TP_ICHAT,
+CSSMOID_APPLE_TP_RESOURCE_SIGN,
+CSSMOID_APPLE_TP_PKINIT_CLIENT,
+CSSMOID_APPLE_TP_PKINIT_SERVER,
+CSSMOID_APPLE_TP_CODE_SIGNING,
+CSSMOID_APPLE_TP_PACKAGE_SIGNING,
+CSSMOID_APPLE_FEE,
+CSSMOID_APPLE_ASC,
+CSSMOID_APPLE_FEE_MD5,
+CSSMOID_APPLE_FEE_SHA1,
+CSSMOID_APPLE_FEED,
+CSSMOID_APPLE_FEEDEXP,
+CSSMOID_APPLE_ECDSA,
+CSSMOID_DOTMAC_CERT,
+CSSMOID_DOTMAC_CERT_REQ,
+CSSMOID_DOTMAC_CERT_REQ_IDENTITY,
+CSSMOID_DOTMAC_CERT_REQ_EMAIL_SIGN,
+CSSMOID_DOTMAC_CERT_REQ_EMAIL_ENCRYPT,
+CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_LIST,
+CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_STORE,
+CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_FETCH,
+CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_REMOVE,
+CSSMOID_DOTMAC_CERT_REQ_SHARED_SERVICES,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_USERNAME,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_PASSWORD,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_HOSTNAME,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_RENEW,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_ASYNC,
+CSSMOID_DOTMAC_CERT_REQ_VALUE_IS_PENDING,
+CSSMOID_PKCS5_DIGEST_ALG,
+CSSMOID_PKCS5_ENCRYPT_ALG,
+CSSMOID_PKCS5_HMAC_SHA1,
+CSSMOID_PKCS5_pbeWithMD2AndDES,
+CSSMOID_PKCS5_pbeWithMD2AndRC2,
+CSSMOID_PKCS5_pbeWithMD5AndDES,
+CSSMOID_PKCS5_pbeWithMD5AndRC2,
+CSSMOID_PKCS5_pbeWithSHA1AndDES,
+CSSMOID_PKCS5_pbeWithSHA1AndRC2,
+CSSMOID_PKCS5_PBKDF2,
+CSSMOID_PKCS5_PBES2,
+CSSMOID_PKCS5_PBMAC1,
+CSSMOID_PKCS5_RC2_CBC,
+CSSMOID_PKCS5_DES_EDE3_CBC,
+CSSMOID_PKCS5_RC5_CBC,
+CSSMOID_PKCS12_pbeWithSHAAnd128BitRC4,
+CSSMOID_PKCS12_pbeWithSHAAnd40BitRC4,
+CSSMOID_PKCS12_pbeWithSHAAnd3Key3DESCBC,
+CSSMOID_PKCS12_pbeWithSHAAnd2Key3DESCBC,
+CSSMOID_PKCS12_pbeWithSHAAnd128BitRC2CBC,
+CSSMOID_PKCS12_pbewithSHAAnd40BitRC2CBC;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/oidsattr.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,147 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.oidsattr;
+
+import dstep.security.cssmtype;
+import dstep.security.oidsbase;
+
+extern (C):
+
+extern const CSSM_OID
+CSSMOID_ObjectClass,
+CSSMOID_AliasedEntryName,
+CSSMOID_KnowledgeInformation,
+CSSMOID_CommonName,
+CSSMOID_Surname,
+CSSMOID_SerialNumber,
+CSSMOID_CountryName,
+CSSMOID_LocalityName,
+CSSMOID_StateProvinceName,
+CSSMOID_CollectiveStateProvinceName,
+CSSMOID_StreetAddress,
+CSSMOID_CollectiveStreetAddress,
+CSSMOID_OrganizationName,
+CSSMOID_CollectiveOrganizationName,
+CSSMOID_OrganizationalUnitName,
+CSSMOID_CollectiveOrganizationalUnitName,
+CSSMOID_Title,
+CSSMOID_Description,
+CSSMOID_SearchGuide,
+CSSMOID_BusinessCategory,
+CSSMOID_PostalAddress,
+CSSMOID_CollectivePostalAddress,
+CSSMOID_PostalCode,
+CSSMOID_CollectivePostalCode,
+CSSMOID_PostOfficeBox,
+CSSMOID_CollectivePostOfficeBox,
+CSSMOID_PhysicalDeliveryOfficeName, 
+CSSMOID_CollectivePhysicalDeliveryOfficeName,
+CSSMOID_TelephoneNumber,
+CSSMOID_CollectiveTelephoneNumber,  
+CSSMOID_TelexNumber,
+CSSMOID_CollectiveTelexNumber,
+CSSMOID_TelexTerminalIdentifier,
+CSSMOID_CollectiveTelexTerminalIdentifier,
+CSSMOID_FacsimileTelephoneNumber,
+CSSMOID_CollectiveFacsimileTelephoneNumber,
+CSSMOID_X_121Address,
+CSSMOID_InternationalISDNNumber,
+CSSMOID_CollectiveInternationalISDNNumber,
+CSSMOID_RegisteredAddress,
+CSSMOID_DestinationIndicator,
+CSSMOID_PreferredDeliveryMethod,
+CSSMOID_PresentationAddress,
+CSSMOID_SupportedApplicationContext,
+CSSMOID_Member,
+CSSMOID_Owner,
+CSSMOID_RoleOccupant,
+CSSMOID_SeeAlso,
+CSSMOID_UserPassword,
+CSSMOID_UserCertificate,
+CSSMOID_CACertificate,
+CSSMOID_AuthorityRevocationList,
+CSSMOID_CertificateRevocationList,
+CSSMOID_CrossCertificatePair,
+CSSMOID_Name,
+CSSMOID_GivenName,
+CSSMOID_Initials,
+CSSMOID_GenerationQualifier,
+CSSMOID_UniqueIdentifier,
+CSSMOID_DNQualifier,
+CSSMOID_EnhancedSearchGuide,
+CSSMOID_ProtocolInformation,
+CSSMOID_DistinguishedName,
+CSSMOID_UniqueMember,
+CSSMOID_HouseIdentifier;
+
+/* PKCS 9 */
+extern const CSSM_OID
+CSSMOID_EmailAddress,
+CSSMOID_UnstructuredName,
+CSSMOID_ContentType,
+CSSMOID_MessageDigest,
+CSSMOID_SigningTime,
+CSSMOID_CounterSignature,
+CSSMOID_ChallengePassword,
+CSSMOID_UnstructuredAddress,
+CSSMOID_ExtendedCertificateAttributes;
+
+/* PKIX */
+extern const CSSM_OID
+CSSMOID_QT_CPS,
+CSSMOID_QT_UNOTICE,
+CSSMOID_AD_OCSP,
+CSSMOID_AD_CA_ISSUERS,
+CSSMOID_AD_TIME_STAMPING,
+CSSMOID_AD_CA_REPOSITORY,
+CSSMOID_PDA_DATE_OF_BIRTH,
+CSSMOID_PDA_PLACE_OF_BIRTH,
+CSSMOID_PDA_GENDER,
+CSSMOID_PDA_COUNTRY_CITIZEN,
+CSSMOID_PDA_COUNTRY_RESIDENCE,
+CSSMOID_OID_QCS_SYNTAX_V1,
+CSSMOID_OID_QCS_SYNTAX_V2;
+
+/* ETSI */
+extern const CSSM_OID
+CSSMOID_ETSI_QCS_QC_COMPLIANCE,
+CSSMOID_ETSI_QCS_QC_LIMIT_VALUE,
+CSSMOID_ETSI_QCS_QC_RETENTION,
+CSSMOID_ETSI_QCS_QC_SSCD;
+
+/* PKCS7 */
+extern const CSSM_OID
+CSSMOID_PKCS7_Data,
+CSSMOID_PKCS7_SignedData,
+CSSMOID_PKCS7_EnvelopedData,
+CSSMOID_PKCS7_SignedAndEnvelopedData,
+CSSMOID_PKCS7_DigestedData,
+CSSMOID_PKCS7_EncryptedData,
+CSSMOID_PKCS7_DataWithAttributes,
+CSSMOID_PKCS7_EncryptedPrivateKeyInfo,
+
+/* PKCS8 */
+CSSMOID_PKCS9_FriendlyName,
+CSSMOID_PKCS9_LocalKeyId,
+CSSMOID_PKCS9_CertTypes,
+CSSMOID_PKCS9_CrlTypes,
+CSSMOID_PKCS9_X509Certificate,
+CSSMOID_PKCS9_SdsiCertificate,
+CSSMOID_PKCS9_X509Crl,
+
+/* PKCS12 */
+CSSMOID_PKCS12_keyBag,
+CSSMOID_PKCS12_shroudedKeyBag,
+CSSMOID_PKCS12_certBag,
+CSSMOID_PKCS12_crlBag,
+CSSMOID_PKCS12_secretBag,
+CSSMOID_PKCS12_safeContentsBag,
+
+/* Kerberos PKINIT CMS ContentInfo types */
+CSSMOID_KERBv5_PKINIT_AUTH_DATA,
+CSSMOID_KERBv5_PKINIT_DH_KEY_DATA,
+CSSMOID_KERBv5_PKINIT_RKEY_DATA;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/oidsbase.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,7 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.oidsbase;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/oidscert.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,131 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.oidscert;
+
+import dstep.security.cssmconfig;
+import dstep.security.cssmtype;
+import dstep.security.oidsbase;
+
+extern (C):
+
+extern const CSSM_OID
+
+CSSMOID_X509V3SignedCertificate,
+CSSMOID_X509V3SignedCertificateCStruct,
+CSSMOID_X509V3Certificate,
+CSSMOID_X509V3CertificateCStruct,
+CSSMOID_X509V1Version,
+CSSMOID_X509V1SerialNumber,
+CSSMOID_X509V1IssuerName,			// normalized & encoded
+CSSMOID_X509V1IssuerNameStd,		// encoded
+CSSMOID_X509V1IssuerNameCStruct,	// CSSM_X509_NAME
+CSSMOID_X509V1IssuerNameLDAP,
+CSSMOID_X509V1ValidityNotBefore,
+CSSMOID_X509V1ValidityNotAfter,
+CSSMOID_X509V1SubjectName,			// normalized & encoded
+CSSMOID_X509V1SubjectNameStd,		// encoded
+CSSMOID_X509V1SubjectNameCStruct,	// CSSM_X509_NAME
+CSSMOID_X509V1SubjectNameLDAP,
+CSSMOID_CSSMKeyStruct,
+CSSMOID_X509V1SubjectPublicKeyCStruct,
+CSSMOID_X509V1SubjectPublicKeyAlgorithm,
+CSSMOID_X509V1SubjectPublicKeyAlgorithmParameters,
+CSSMOID_X509V1SubjectPublicKey,
+CSSMOID_X509V1CertificateIssuerUniqueId,
+CSSMOID_X509V1CertificateSubjectUniqueId,
+CSSMOID_X509V3CertificateExtensionsStruct,
+CSSMOID_X509V3CertificateExtensionsCStruct,
+CSSMOID_X509V3CertificateNumberOfExtensions,
+CSSMOID_X509V3CertificateExtensionStruct,
+CSSMOID_X509V3CertificateExtensionCStruct,
+CSSMOID_X509V3CertificateExtensionId,
+CSSMOID_X509V3CertificateExtensionCritical,
+CSSMOID_X509V3CertificateExtensionType,
+CSSMOID_X509V3CertificateExtensionValue,
+
+/* Signature OID Fields */
+CSSMOID_X509V1SignatureStruct,
+CSSMOID_X509V1SignatureCStruct,
+CSSMOID_X509V1SignatureAlgorithm,
+CSSMOID_X509V1SignatureAlgorithmTBS,
+CSSMOID_X509V1SignatureAlgorithmParameters,
+CSSMOID_X509V1Signature,
+
+/* Extension OID Fields */
+CSSMOID_SubjectSignatureBitmap,
+CSSMOID_SubjectPicture,
+CSSMOID_SubjectEmailAddress,
+CSSMOID_UseExemptions;
+
+/*** 
+*** Apple addenda
+***/
+
+/* 
+* Standard Cert and CRL extensions.
+*/
+extern const CSSM_OID
+CSSMOID_SubjectDirectoryAttributes,
+CSSMOID_SubjectKeyIdentifier,
+CSSMOID_KeyUsage,
+CSSMOID_PrivateKeyUsagePeriod,
+CSSMOID_SubjectAltName,
+CSSMOID_IssuerAltName,
+CSSMOID_BasicConstraints,
+CSSMOID_CrlNumber,
+CSSMOID_CrlReason,
+CSSMOID_HoldInstructionCode,
+CSSMOID_InvalidityDate,
+CSSMOID_DeltaCrlIndicator,
+CSSMOID_IssuingDistributionPoint,
+CSSMOID_IssuingDistributionPoints,
+CSSMOID_CertIssuer,
+CSSMOID_NameConstraints,
+CSSMOID_CrlDistributionPoints,
+CSSMOID_CertificatePolicies,
+CSSMOID_PolicyMappings,
+CSSMOID_PolicyConstraints,
+CSSMOID_AuthorityKeyIdentifier,
+CSSMOID_ExtendedKeyUsage,
+CSSMOID_AuthorityInfoAccess,
+CSSMOID_BiometricInfo,
+CSSMOID_QC_Statements,
+CSSMOID_SubjectInfoAccess,
+CSSMOID_ExtendedKeyUsageAny,
+CSSMOID_ServerAuth,
+CSSMOID_ClientAuth,
+CSSMOID_ExtendedUseCodeSigning,
+CSSMOID_EmailProtection,
+CSSMOID_TimeStamping,
+CSSMOID_OCSPSigning,
+CSSMOID_KERBv5_PKINIT_KP_CLIENT_AUTH,
+CSSMOID_KERBv5_PKINIT_KP_KDC,
+CSSMOID_EKU_IPSec,
+CSSMOID_DOTMAC_CERT_EXTENSION,
+CSSMOID_DOTMAC_CERT_IDENTITY,
+CSSMOID_DOTMAC_CERT_EMAIL_SIGN,
+CSSMOID_DOTMAC_CERT_EMAIL_ENCRYPT,
+CSSMOID_APPLE_CERT_POLICY,
+CSSMOID_DOTMAC_CERT_POLICY,
+CSSMOID_APPLE_EKU_CODE_SIGNING, 
+CSSMOID_APPLE_EKU_CODE_SIGNING_DEV,
+CSSMOID_APPLE_EKU_RESOURCE_SIGNING,
+CSSMOID_APPLE_EKU_ICHAT_SIGNING,
+CSSMOID_APPLE_EKU_ICHAT_ENCRYPTION,
+CSSMOID_APPLE_EKU_SYSTEM_IDENTITY
+;
+
+/*
+* Netscape extensions.
+*/
+extern const CSSM_OID	
+CSSMOID_NetscapeCertType,
+CSSMOID_NetscapeCertSequence,
+CSSMOID_NetscapeSGC;
+
+extern const CSSM_OID CSSMOID_MicrosoftSGC;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/oidscrl.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,66 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.oidscrl;
+
+import dstep.security.cssmconfig;
+import dstep.security.cssmtype;
+import dstep.security.oidsbase;
+
+extern (C):
+
+extern const CSSM_OID
+/* CRL OIDs */
+CSSMOID_X509V2CRLSignedCrlStruct,
+CSSMOID_X509V2CRLSignedCrlCStruct,
+CSSMOID_X509V2CRLTbsCertListStruct,
+CSSMOID_X509V2CRLTbsCertListCStruct,
+CSSMOID_X509V2CRLVersion,
+CSSMOID_X509V1CRLIssuerStruct,
+CSSMOID_X509V1CRLIssuerNameCStruct,
+CSSMOID_X509V1CRLIssuerNameLDAP,
+CSSMOID_X509V1CRLThisUpdate,
+CSSMOID_X509V1CRLNextUpdate,
+
+/* CRL Entry (CRL CertList) OIDS */
+CSSMOID_X509V1CRLRevokedCertificatesStruct,
+CSSMOID_X509V1CRLRevokedCertificatesCStruct,
+CSSMOID_X509V1CRLNumberOfRevokedCertEntries,
+CSSMOID_X509V1CRLRevokedEntryStruct,
+CSSMOID_X509V1CRLRevokedEntryCStruct,
+CSSMOID_X509V1CRLRevokedEntrySerialNumber,
+CSSMOID_X509V1CRLRevokedEntryRevocationDate,
+
+/* CRL Entry (CRL CertList) Extension OIDs */
+CSSMOID_X509V2CRLRevokedEntryAllExtensionsStruct,
+CSSMOID_X509V2CRLRevokedEntryAllExtensionsCStruct,
+CSSMOID_X509V2CRLRevokedEntryNumberOfExtensions,
+CSSMOID_X509V2CRLRevokedEntrySingleExtensionStruct,
+CSSMOID_X509V2CRLRevokedEntrySingleExtensionCStruct,
+CSSMOID_X509V2CRLRevokedEntryExtensionId,
+CSSMOID_X509V2CRLRevokedEntryExtensionCritical,
+CSSMOID_X509V2CRLRevokedEntryExtensionType,
+CSSMOID_X509V2CRLRevokedEntryExtensionValue,
+
+/* CRL Extension OIDs */
+CSSMOID_X509V2CRLAllExtensionsStruct,
+CSSMOID_X509V2CRLAllExtensionsCStruct,
+CSSMOID_X509V2CRLNumberOfExtensions,
+CSSMOID_X509V2CRLSingleExtensionStruct,
+CSSMOID_X509V2CRLSingleExtensionCStruct,
+CSSMOID_X509V2CRLExtensionId,
+CSSMOID_X509V2CRLExtensionCritical,
+CSSMOID_X509V2CRLExtensionType,
+
+/* OCSP */
+CSSMOID_PKIX_OCSP,
+CSSMOID_PKIX_OCSP_BASIC,
+CSSMOID_PKIX_OCSP_NONCE,
+CSSMOID_PKIX_OCSP_CRL,
+CSSMOID_PKIX_OCSP_RESPONSE,
+CSSMOID_PKIX_OCSP_NOCHECK,
+CSSMOID_PKIX_OCSP_ARCHIVE_CUTOFF,
+CSSMOID_PKIX_OCSP_SERVICE_LOCATOR;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/x509defs.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,206 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.x509defs;
+
+import dstep.security.cssmtype;
+
+alias ubyte CSSM_BER_TAG;
+alias int CSSM_X509_OPTION;
+alias CSSM_X509_TYPE_VALUE_PAIR* CSSM_X509_TYPE_VALUE_PAIR_PTR;
+alias CSSM_X509_RDN* CSSM_X509_RDN_PTR;
+alias CSSM_X509_EXTENSION* CSSM_X509_EXTENSION_PTR;
+alias extension_data_format CSSM_X509EXT_DATA_FORMAT;
+alias CSSM_X509_REVOKED_CERT_ENTRY* CSSM_X509_REVOKED_CERT_ENTRY_PTR;
+alias CSSM_X509_REVOKED_CERT_LIST* CSSM_X509_REVOKED_CERT_LIST_PTR;
+alias CSSM_X509_NAME* CSSM_X509_NAME_PTR;
+
+enum extension_data_format 
+{
+	CSSM_X509_DATAFORMAT_ENCODED = 0,
+	CSSM_X509_DATAFORMAT_PARSED,
+	CSSM_X509_DATAFORMAT_PAIR
+}
+
+struct CSSM_X509_ALGORITHM_IDENTIFIER
+{
+	CSSM_OID algorithm;
+	CSSM_DATA parameters;
+}
+
+
+struct CSSM_X509_TYPE_VALUE_PAIR
+{
+	CSSM_OID type;
+	ubyte valueType;
+	CSSM_DATA value;
+}
+
+
+struct CSSM_X509_RDN
+{
+	uint numberOfPairs;
+	CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue;
+}
+
+
+struct CSSM_X509_NAME
+{
+	uint numberOfRDNs;
+	CSSM_X509_RDN_PTR RelativeDistinguishedName;
+}
+
+
+struct CSSM_X509_SUBJECT_PUBLIC_KEY_INFO
+{
+	CSSM_X509_ALGORITHM_IDENTIFIER algorithm;
+	CSSM_DATA subjectPublicKey;
+}
+
+
+struct CSSM_X509_TIME
+{
+	ubyte timeType;
+	CSSM_DATA time;
+}
+
+
+struct CSSM_X509_VALIDITY
+{
+	CSSM_X509_TIME notBefore;
+	CSSM_X509_TIME notAfter;
+}
+
+
+struct CSSM_X509EXT_BASICCONSTRAINTS
+{
+	int cA;
+	int pathLenConstraintPresent;
+	uint pathLenConstraint;
+}
+
+
+struct CSSM_X509EXT_TAGandVALUE
+{
+	ubyte type;
+	CSSM_DATA value;
+}
+
+
+struct CSSM_X509EXT_PAIR
+{
+	CSSM_X509EXT_TAGandVALUE tagAndValue;
+	void* parsedValue;
+}
+
+
+struct CSSM_X509_EXTENSION
+{
+	CSSM_OID extnId;
+	CSSM_BOOL critical;
+	CSSM_X509EXT_DATA_FORMAT format;
+	
+	union cssm_x509ext_value
+	{
+		CSSM_X509EXT_TAGandVALUE* tagAndValue;
+		void* parsedValue;
+		CSSM_X509EXT_PAIR* valuePair;
+	}
+	
+	cssm_x509ext_value value;
+	CSSM_DATA BERvalue;
+}
+
+struct CSSM_X509_EXTENSIONS
+{
+	uint numberOfExtensions;
+	CSSM_X509_EXTENSION_PTR extensions;
+}
+
+
+struct CSSM_X509_TBS_CERTIFICATE
+{
+	CSSM_DATA version_;
+	CSSM_DATA serialNumber;
+	CSSM_X509_ALGORITHM_IDENTIFIER signature;
+	CSSM_X509_NAME issuer;
+	CSSM_X509_VALIDITY validity;
+	CSSM_X509_NAME subject;
+	CSSM_X509_SUBJECT_PUBLIC_KEY_INFO subjectPublicKeyInfo;
+	CSSM_DATA issuerUniqueIdentifier;
+	CSSM_DATA subjectUniqueIdentifier;
+	CSSM_X509_EXTENSIONS extensions;
+}
+
+
+struct CSSM_X509_SIGNATURE
+{
+	CSSM_X509_ALGORITHM_IDENTIFIER algorithmIdentifier;
+	CSSM_DATA encrypted;
+}
+
+
+struct CSSM_X509_SIGNED_CERTIFICATE
+{
+	CSSM_X509_TBS_CERTIFICATE certificate;
+	CSSM_X509_SIGNATURE signature;
+}
+
+
+struct CSSM_X509EXT_POLICYQUALIFIERINFO
+{
+	CSSM_OID policyQualifierId;
+	CSSM_DATA value;
+}
+
+
+struct CSSM_X509EXT_POLICYQUALIFIERS
+{
+	uint numberOfPolicyQualifiers;
+	CSSM_X509EXT_POLICYQUALIFIERINFO* policyQualifier;
+}
+
+
+struct CSSM_X509EXT_POLICYINFO
+{
+	CSSM_OID policyIdentifier;
+	CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers;
+}
+
+
+struct CSSM_X509_REVOKED_CERT_ENTRY
+{
+	CSSM_DATA certificateSerialNumber;
+	CSSM_X509_TIME revocationDate;
+	CSSM_X509_EXTENSIONS extensions;
+}
+
+
+struct CSSM_X509_REVOKED_CERT_LIST
+{
+	uint numberOfRevokedCertEntries;
+	CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry;
+}
+
+
+struct CSSM_X509_TBS_CERTLIST
+{
+	CSSM_DATA version_;
+	CSSM_X509_ALGORITHM_IDENTIFIER signature;
+	CSSM_X509_NAME issuer;
+	CSSM_X509_TIME thisUpdate;
+	CSSM_X509_TIME nextUpdate;
+	CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates;
+	CSSM_X509_EXTENSIONS extensions;
+}
+
+
+struct CSSM_X509_SIGNED_CRL
+{
+	CSSM_X509_TBS_CERTLIST tbsCertList;
+	CSSM_X509_SIGNATURE signature;
+}
+
--- a/scripts/dgen.rb	Thu Jul 09 23:25:18 2009 +0200
+++ b/scripts/dgen.rb	Sat Aug 01 15:03:28 2009 +0200
@@ -182,13 +182,15 @@
 
 # This Struct represents a C/Objective-C header
 HeaderFile = Struct.new(:name, :framework, :cftypes, :constants, :c_constants, :d_constants, :d_constants_static_this, :defines, 
-			  			:enums, :functions, :c_functions, :function_pointers, :function_wrappers, :imports, :path, :structs, :typedefs) do
+			  			:enums, :enums_gnu, :needs_type_encoding, :functions, :c_functions, :function_pointers, :function_wrappers, :imports, :path, :structs, :typedefs) do
 	def initialize
 		self.name = ""
 		self.cftypes = []
 		self.constants = []
 		self.defines = []
 		self.enums = []
+		self.enums_gnu = []
+		self.needs_type_encoding = false
 		self.framework = ""
 		self.functions = []
 		self.c_functions = []
@@ -225,12 +227,19 @@
 		@c_functions = []
 		@headers = []
 		@package = "dstep"
+		@needs_bridge = false
 	end	
 	
 	# Generates the D code from the xml metadata
 	def generate_code
 		@files.each do |dstep_file|
 			xml = XmlSimple.xml_in(dstep_file)
+			
+			@needs_bridge = !xml.protocol.nil? || !xml.category.nil? || !xml["class"].nil?
+			
+			interfaces(xml.protocol) unless xml.protocol.nil?
+			templates(xml.category) unless xml.category.nil?
+			classes(xml["class"]) unless xml["class"].nil?
 
 			unless xml.framework.nil?
 				frameworks = xml.framework
@@ -246,12 +255,12 @@
 						header.c_constants = c_constants unless file.constant.nil?
 						header.d_constants = d_constants unless file.constant.nil?
 						header.d_constants_static_this = d_constants_static_this unless file.constant.nil?
-						header.enums = enums(file.enum) unless file.enum.nil?
+						header.enums, header.enums_gnu, header.needs_type_encoding = enums(file.enum, header.name) unless file.enum.nil?
 						header.functions = functions(file.function) unless file.function.nil?
 						header.c_functions = c_functions unless file.function.nil?
 						header.function_pointers = function_pointers(file.functionPointer) unless file.functionPointer.nil?
 						header.function_wrappers = function_wrappers unless file.function.nil?
-						header.imports = imports(file.import, file.name, framework.name) unless file.import.nil?
+						header.imports = imports(header, file.import, file.name, framework.name) unless file.import.nil?
 						header.structs = structs(file.struct) unless file.struct.nil?
 
 						header.typedefs = typedefs(file.typedef) unless file.typedef.nil?
@@ -273,29 +282,26 @@
 					header.c_constants = c_constants unless file.constant.nil?
 					header.d_constants = d_constants unless file.constant.nil?
 					header.d_constants_static_this = d_constants_static_this unless file.constant.nil?
-					header.enums = enums(file.enum) unless file.enum.nil?
+					header.enums, header.enums_gnu, header.needs_type_encoding = enums(file.enum) unless file.enum.nil?
 					header.functions = functions(file.function) unless file.function.nil?
 					header.function_pointers = function_pointers(file.functionPointer) unless file.functionPointer.nil?
 					header.c_functions = c_functions unless file.function.nil?
 					header.function_wrappers = function_wrappers unless file.function.nil?
-					header.imports = imports(file.import, file.name) unless file.import.nil?
+					header.imports = imports(header, file.import, file.name) unless file.import.nil?
 					header.structs = structs(file.struct) unless file.struct.nil?
 					header.typedefs = typedefs(file.typedef) unless file.typedef.nil?
 
 					@headers << header
 				end
-			end
-			
-			interfaces(xml.protocol) unless xml.protocol.nil?
-			templates(xml.category) unless xml.category.nil?
-			classes(xml["class"]) unless xml["class"].nil?						
+			end					
 		end
 	end
 	
 	# Outputs the generate D code
 	def output_code
 		@frameworks.each do |framework|
-			framework_path = framework_path = "#{@out_dir}/#{@package}/#{get_identifier(get_framework_name(framework.name.downcase))}"
+			framework_path = framework_path = "#{@out_dir}/#{@package}/#{get_identifier(get_framework_name(framework.name.downcase))}" unless sub_framework?(framework.name.downcase)
+			framework_path = framework_path = "#{@out_dir}/#{@package}/#{get_identifier(get_parent_framework_name(framework.name.downcase))}/#{get_identifier(get_framework_name(framework.name.downcase))}" if sub_framework?(framework.name.downcase)
 			
 			FileUtils.mkdir_p(framework_path) unless File.exist?(framework_path)
 			
@@ -303,13 +309,13 @@
 				file_path = "#{framework_path}/#{get_identifier(header.name)}"
 				bindings_file_path = file_path + "_bindings.d"
 				file_path << ".d"
-				mod = "#{@package}.#{get_identifier(get_framework_name(framework.name.downcase))}.#{get_identifier(header.name)}"
+				mod = "#{@package}.#{get_identifier(get_framework_name(framework.name.downcase))}.#{get_identifier(header.name)}" unless sub_framework?(framework.name.downcase)
+				mod = "#{@package}.#{get_identifier(get_parent_framework_name(framework.name.downcase))}.#{get_identifier(get_framework_name(framework.name.downcase))}.#{get_identifier(header.name)}" if sub_framework?(framework.name.downcase)
 				
 				File.open(file_path, "w") do |file|
 					file << copyright
 					file << "module #{mod};"
 					file << header.imports
-					file << "\n" if header.d_constants.nil? || header.function_wrappers.nil?
 					file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil?
 					file << header.defines
 					file << header.typedefs
@@ -317,6 +323,7 @@
 					file << header.function_pointers
 					file << header.c_constants
 					file << header.d_constants
+					file << header.enums_gnu if header.needs_type_encoding
 					file << header.enums
 					file << header.structs
 					
@@ -376,7 +383,6 @@
 				file << copyright
 				file << "module #{mod};"
 				file << header.imports
-				file << "\n" if header.d_constants.nil? || header.function_wrappers.nil?
 				file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil?
 				file << header.defines
 				file << header.typedefs
@@ -384,6 +390,7 @@
 				file << header.function_pointers
 				file << header.c_constants
 				file << header.d_constants
+				file << header.enums_gnu if header.needs_type_encoding
 				file << header.enums
 				file << header.structs
 				
@@ -754,42 +761,108 @@
 	end	
 	
 	# Generates the D code for the enums
-	def enums (enums)
+	def enums (enums, header_name)
 		return "" if enums.length == 0
 		
 		str = StringIO.new
+		str_gnu = StringIO.new
+		consts = []
 		
 		enums.each do |enum|
+			localConsts = []
+			str_gnu2 = StringIO.new
 			str << "enum"
-								
+			needs_type_encoding = false
+					
 			if enum.name.length == 0
 				str << "\n{".nl(false)
 				
-				enum.member.each_with_index do |member, i|
-					str << get_identifier(member["name"]).indent
-					str << " = " if member.value.length > 0
-					str << member.value
-					str << ",".nl(false) unless i == enum.member.length - 1
-				end				
+				needs_type_encoding, localConsts = enum_helper(enum, str, str_gnu2, header_name)			
 			else
 				str << " "
 				str << get_identifier(enum["name"]).nl(false)
 				str << "{".nl(false)
 				
-				enum["member"].each_with_index do |member, i|
-					str << get_identifier(member["name"]).indent
-					str << " = " if member.value.length > 0
+				needs_type_encoding, localConsts = enum_helper(enum, str, str_gnu2, header_name)
+			end			
+			
+			str << "\n}".nl(false).nl(false)
+			
+			# if needs_type_encoding
+			# 	str_gnu << "// This is needed otherwise the enums will fail compiling with gdc\n"
+			# 	str_gnu << "version (GNU)\n{\n"
+			# 	str_gnu << "private\n".indent
+			# 	str_gnu << "{\n".indent
+			# 	str_gnu << str_gnu2.string				
+			# 	str_gnu << "\n"
+			# 	str_gnu << "}".indent
+			# 	str_gnu << "\n}".nl(false).nl(false)
+			# end
+			
+			consts << localConsts 
+		end
+		
+		consts.flatten!
+		
+		if @needs_type_encoding && consts.length > 0
+			str_gnu << "// This is needed otherwise the enums will fail compiling with gdc\n"
+			str_gnu << "version (GNU)\n{\n"
+			str_gnu << "private\n".indent
+			str_gnu << "{\n".indent
+			
+			consts.each do |const|
+				str_gnu << "const __".indent(2)
+				str_gnu << const.name
+				str_gnu << ' = getOSType!("'
+				str_gnu << const.value
+				str_gnu << '")'.nl
+			end
+			
+			str_gnu << "}".indent
+			str_gnu << "\n}".nl(false).nl(false)
+		end
+		
+		needs_type_encoding = @needs_type_encoding
+		@needs_type_encoding = false
+		
+		return str.string, str_gnu.string, needs_type_encoding
+	end
+	
+	def enum_helper (enum, str, str_gnu, header_name)	
+		needs_type_encoding = false
+		consts = []
+			
+		enum.member.each_with_index do |member, i|
+			str << get_identifier(member.name).indent			
+			
+			if member.value.length > 0
+				needs_type_encoding = true if member.value[0, 1] == "'"
+				@needs_type_encoding = true if needs_type_encoding
+				str << " = "	
+				
+				if member.value[0, 1] == "'"					
+					str << 'getOSType!("'
+					str << member.value[1 ... -1]
+					str << '")'
+					
+					consts << { :name => get_identifier(member.name), :value => member.value[1 ... -1] }
+					# str_gnu << "const __".indent(2)
+					# str_gnu << get_identifier(member.name)
+					# str_gnu << " = "					
+					# str_gnu << 'getOSType!("'
+					# str_gnu << member.value[1 ... -1]
+					# str_gnu << '")'.nl
+				else
 					str << member.value
-					str << ",".nl(false) unless i == enum.member.length - 1
 				end
 			end
 			
-			str << "\n}".nl(false).nl(false)
+			str << ",".nl(false) unless i == enum.member.length - 1
 		end
 		
-		str.string
+		return needs_type_encoding, consts
 	end
-	
+		
 	# Generates the D code for the function/method args
 	def args (args, variadic, method = false)
 		return "" if args.nil?
@@ -975,7 +1048,7 @@
 	end
 	
 	# Generates the D code for the imports
-	def imports (imports, filename, framework_name = nil)
+	def imports (header, imports, filename, framework_name = nil)
 		return "" if imports.length == 0
 		
 		str = StringIO.new
@@ -996,13 +1069,19 @@
 			str << splits[-1 .. -1]
 		end
 		
-		str << "import dstep.objc.bridge.Bridge".nl
-		str << "import dstep.objc.objc : id".nl
+		str << "import dstep.objc.bridge.TypeEncoding".nl if header.needs_type_encoding && !@needs_bridge
+		
+		if @needs_bridge
+			str << "import dstep.objc.bridge.Bridge".nl
+			str << "import dstep.objc.bridge.TypeEncoding".nl if header.needs_type_encoding
+			str << "import dstep.objc.objc : id".nl
+		end
 		
 		str << "\n\n"
-		str = str.string.sort.to_s		
+		str = str.string.sort.to_s
+		str << "\n"
 		
-		return "\n\npublic:" << str if filename == framework_name
+		return "\n\npublic:" << str if filename == get_framework_name(framework_name)
 		return str
 	end
 	
@@ -1121,13 +1200,24 @@
 				type = get_type(typedef.type, typedef.type64, typedef.declaredType)
 			end
 			
-			if struct
-				str << typedef.declaredType.gsub("*", "").nl
-				str << "alias "				
-				str << get_identifier(type.name)
-				str << "*" if typedef.declaredType =~ /\*/
-				str << " "
-				str << get_identifier(typedef.name).nl
+			if struct				
+				unless type.name == typedef.name
+					declaredType = typedef.declaredType
+					declaredType = declaredType[7 .. -1] if declaredType.length > 7 && declaredType[0 ... 6] == "struct"
+					
+					unless declaredType == typedef.name
+						str << "alias "
+						str << get_identifier(declaredType)
+						str << " "
+						str << get_identifier(typedef.name).nl
+					end
+					
+					# str << "alias "				
+					# str << get_identifier(type.name)
+					# str << "*" if typedef.declaredType =~ /\*{1}/
+					# str << " "
+					# str << get_identifier(typedef.name).nl
+				end
 			else
 				str << "alias "
 				str << type
@@ -1186,6 +1276,18 @@
 		get_identifier(selector[0 ... i])
 	end
 	
+	def get_matching_close_char (char)
+		case char
+		when "{"; return "}"
+		when "("; return ")"
+		when "["; return "]"
+		else
+			char
+		end
+	end
+	
+	
+	
 	# Gets the D type from the encoded C/Objective-C type
 	# type:: the type
 	# type64:: the type for 64bit targets
@@ -1243,9 +1345,15 @@
 				count = $1 if t =~ /(\d+)/				
 				t = $'
 				
-				t64 = type64[1 ... -1]
-				count = $1 if t64 =~ /(\d+)/				
-				t64 = $'
+				t64 = ""
+				
+				unless type64.nil?
+					t64 = type64[1 ... -1]
+					count = $1 if t64 =~ /(\d+)/				
+					t64 = $'
+				else
+					t64 = t
+				end
 				
 				str = get_type(t, t64, declared_type)
 				str << "[#{count}]"
@@ -1255,33 +1363,51 @@
 				resolved_types = []
 				types = $2 if type =~ /\((.+)=(.+)\)/
 				types64 = $2 if type64 =~ /\((.+)=(.+)\)/
+				i = 0
 				
-				for i in types
-					resolved_types << get_type(types[i], types64[i], declared_type)
-				end
+				while i < types.length
+					t = types[i, 1]
+					t64 = types64.nil? ? t : types64[i, 1]
+					
+					index = t =~ /(\(|\[|\{)/
+					
+					unless index.nil?
+						x = types.index(get_matching_close_char($1), index)
+						t = types[index .. x]
+						t64 = types64.nil? ? t : types64[index .. x]
+						i += x - index
+					end
+						
+					resolved_types << get_type(t, t64, declared_type)
+					i += 1			
+				end unless types.nil?
 				
-				return get_identifier(resolved_types)
-			when "^"	
-				if type == "^@"
-					return get_identifier(get_type(type[1 .. -1], type64[1 .. -1], declared_type).dup + "*")
-				elsif type.length > 2 && type[0 ... 2] == "^^"
-					return get_identifier(get_type(type[2 .. -1], type64[2 .. -1], declared_type).dup + "**")
-				elsif type == "^?" # assuming function pointer
-					tmp = cfp_to_dfp(type)
-					return get_identifier(tmp) unless tmp.nil?
-				end
+				get_identifier(resolved_types)
+			when "^"
+				t = type[1 .. -1]
+				t64 = type64.nil? ? t : type64[1 .. -1]
+				get_identifier(get_type(t, t64, declared_type).dup + "*")
 				
-				if !type.nil? && !type64.nil?
-					t = get_type(type[1 .. -1], type64[1 .. -1], declared_type).dup
-					
-					return get_identifier(t) if t =~ /\*/
-					return get_identifier(t + "*") if t !~ /\*/
-				elsif !type.nil?
-					t = get_type(type[1 .. -1], type64, declared_type).dup << "*"
-					
-					return get_identifier(t) if t =~ /\*/
-					return get_identifier(t + "*") if t !~ /\*/
-				end			
+				# if type == "^@"
+				# 	return get_identifier(get_type(type[1 .. -1], type64[1 .. -1], declared_type).dup + "*")
+				# elsif type.length > 2 && type[0 ... 2] == "^^"
+				# 	return get_identifier(get_type(type[2 .. -1], type64[2 .. -1], declared_type).dup + "**")
+				# elsif type == "^?" # assuming function pointer
+				# 	tmp = cfp_to_dfp(type)
+				# 	return get_identifier(tmp) unless tmp.nil?
+				# end
+				# 
+				# if !type.nil? && !type64.nil?
+				# 	t = get_type(type[1 .. -1], type64[1 .. -1], declared_type).dup
+				# 	
+				# 	return get_identifier(t) if t =~ /\*/
+				# 	return get_identifier(t + "*") if t !~ /\*/
+				# elsif !type.nil?
+				# 	t = get_type(type[1 .. -1], type64, declared_type).dup << "*"
+				# 	
+				# 	return get_identifier(t) if t =~ /\*/
+				# 	return get_identifier(t + "*") if t !~ /\*/
+				# end			
 			when "{"
 				return get_identifier(declared_type)
 			end
@@ -1521,6 +1647,22 @@
 		x = framework.rindex("/", i)
 		framework[x + 1 ... i]
 	end
+	
+	def sub_framework? (framework)
+		i = framework.index("framework")
+		return false if i.nil?
+		!framework.index("framework", i + 1).nil?
+	end
+	
+	def get_parent_framework_name (framework)
+		return get_framework_name(framework) unless sub_framework?(framework)
+		i = framework.index(".framework")
+		return framework if i.nil?
+		str = framework[0 ... i]
+		x = str.rindex("/")
+		return str if x.nil?
+		str[x + 1 .. -1]
+	end	
 end
 
 # Prints the message to stderr, exits
--- a/scripts/dstepgen.rb	Thu Jul 09 23:25:18 2009 +0200
+++ b/scripts/dstepgen.rb	Sat Aug 01 15:03:28 2009 +0200
@@ -273,8 +273,24 @@
 		re = /^\s*typedef\s+(.+)\s+([\w\*]+)\s*;$/
 		data = @cpp_result
 		data.scan(re).each do |m|
-			var = get_var_info(m[0] + " " + m[1])
-			header.typedefs << get_var_info(m[0] + " " + m[1]) if var
+			str = m[0] + m[1]
+			
+			if str =~ /,/
+				i = str.index(",")
+				i = str.rindex(" ", i)
+				type = str[0 ... i]
+				names = str[i .. -1]
+				names.gsub!(/ /, "")
+				names = names.split(",")
+				
+				names.each do |name|
+					var = get_var_info(type + " " + name)
+					header.typedefs << var if var
+				end
+			else
+				var = get_var_info(m[0] + " " + m[1])
+				header.typedefs << get_var_info(m[0] + " " + m[1]) if var				
+			end			
 		end
 	end
 	
@@ -488,12 +504,31 @@
 	end	
 	
 	def structs (header)
-		re = /typedef\s+struct\s*\w*\s*((\w+)|\{([^{}]*(\{[^}]+\})?)*\}\s*([^\s]+))\s*(__attribute__\(.+\))?\s*(;|,(.+)?;)/
+		re = /typedef\s+struct\s*\w*\s*((\w+)|\{([^{}]*(\{[^}]+\})?)*\}\s*([^\s]+))\s*(__attribute__\(.+\))?\s*((.+);|;)/
 		i = 0
 		body = nil
 		
 		@cpp_result.scan(re).each do |m|
-			struct = { :name => m[4], :members => [] }
+			#name = m[4]	
+			#name = m[5] if name.nil? || name =~ /__attribute__/
+					
+			name = ""
+			
+			if !m[7].nil? && m[7] !~ /typedef/ && m[7] !~ /\W/
+				name = m[7]
+			elsif !m[4].nil? && m[4] !~ /__attribute__/
+				name = m[4]
+			else
+				name = m[5]
+			end
+				
+			unless name.nil?
+				name.gsub!(/\W/, "")
+				name = name[6 .. -1] if name.length > 6 && name[0 ... 6] == "packed"
+				name = name[7 .. -1] if name.length > 7 && name[0 ... 7] == "typedef"
+			end
+			
+			struct = { :name => name, :members => [] }
 
 			unless struct[:name].nil?
 				if struct[:name][0, 1] == "*"
@@ -542,6 +577,58 @@
 		end
 	end
 	
+	def structs2 (header)
+		re = /^struct\s*(\w+)\s*((\w+)|\{([^{}]*(\{[^}]+\})?)*\}\s*([^\s]+))$/
+		i = 0
+		body = nil
+		
+		@cpp_result.scan(re).each do |m|
+			name = m[0]
+			
+			struct = { :name => name, :members => [] }
+			
+			return_type = nil
+			stripped_return_type = nil
+			body = m[3]
+
+			if m[3]
+				m[3].split(/,|;/).map do |i|				
+					str, bytes = i.split(":", 2).map do |x|
+						x.strip
+					end
+
+					var = get_var_info(str, true)
+	
+					if var				
+						if var.return_type == "***dummy***"
+							var.return_type = return_type
+							var.stripped_return_type = stripped_return_type
+						else
+							return_type = var.return_type
+							stripped_return_type = var.stripped_return_type
+						end
+
+						struct[:members] << { :name => var.name, :bytes => bytes, :declaredType => var.return_type, :type => "", :type64 => "" } unless str.empty? || str[0] == ?#
+						
+						names = []
+						
+						tmp = struct[:members].collect do |member|
+							unless names.include?(member[:name])
+								names << member[:name]
+								member
+							end
+						end
+				
+						struct[:members] = tmp.compact
+					end
+				end
+			end
+
+			header.structs << struct if body
+		end
+	end
+	
+	
 	def functions (header, inline = false)
 		if inline
 			inline_func_re = /(inline|__inline__)\s+((__attribute__\(\([^)]*\)\)\s+)?([\w\s\*<>]+)\s*\(([^)]*)\)\s*)\{/
@@ -602,6 +689,7 @@
 				constants(header)
 				enums(header)
 				structs(header)
+				structs2(header)
 				typedefs(header)
 				functions(header)
 				functions(header, true)
@@ -623,6 +711,7 @@
 			constants(header)
 			enums(header)
 			structs(header)
+			structs2(header)
 			typedefs(header)
 			functions(header)
 			functions(header, true)
@@ -910,7 +999,7 @@
 	
 	VERSION = 1.0
 	
-	attr_accessor :out_file, :scaner, :inject_path, :dependencies_switch, :options, :exclude
+	attr_accessor :out_file, :scaner, :inject_path, :dependencies_switch, :options, :exclude, :frameworks_do_add
 	
 	def initialize
 		@do_64bit = false
@@ -930,10 +1019,11 @@
 		@options = []
 		@extra = false
 		@exclude = []
+		@frameworks_do_add = []
 		
 		# link to foundation framework by default
 		@compiler_flags = "-framework Foundation"
-	end
+	end	
 	
 	def do_64bit
 		return @do_64bit
@@ -953,7 +1043,11 @@
 		@scaner.extra = extra
 	end		
 	
-	def collect		
+	def collect
+		@frameworks_do_add.each do |framework|
+			add_framework(framework)
+		end
+		
 		scaner.scan(@frameworks, @headers)
 		@classes = scaner.get_classes
 		@protocols = scaner.get_protocols
@@ -1000,25 +1094,34 @@
 			header_basenames.unshift("#{name}.h")
 		end
 		
-		exclude = false
-		
-		@exclude.each do |e|
-			p e
-			p pnames
-			exclude = true if e =~ pname
-		end
-		
 		if sub_framework
 			pp = framework_path(parent_framework.name)
 			tmp, pname = pp.scan(/^(.+)\/(\w+)\.framework\/?$/)[0]
-			@import_directives << "#import <#{pname}/#{pname}.h>"
+			
+			exclude = false
+			
+			@exclude.each do |e|
+				exclude = true if pname =~ /#{e}/
+			end
+			
+			header_path = "#{pp}/Frameworks/#{name}.framework/Headers/#{name}.h"
+			
+			@import_directives << '#import "' + header_path + '"' if File.exist?(header_path) && !exclude
+			
+			exclude = false
 		else
 			@import_directives << header_basenames.map do |x|
+				exclude = false
+				
+				@exclude.each do |e|
+					exclude = true if x =~ /#{e}/
+				end
+				
+				next if exclude
+				
 				"#import <#{name}/#{x}>"
-			end.join("\n")
-		end unless exclude
-		
-		exclude = false
+			end.join("\n") 
+		end
 		
 		@import_directives << "\n"
 		
@@ -1426,7 +1529,7 @@
 	end
 	
 	def resolve_types_helper (types, enable_64bit)
-		code = "#include <stdio.h>\n"				
+		code = "#include <stdio.h>\n"		
 		code << @import_directives
 		
 		@frameworks.each do |framework|			
@@ -1658,6 +1761,10 @@
 	end
 	
 	def write_dependencies
+		@frameworks_do_add.each do |framework|
+			add_framework(framework)
+		end
+		
 		file = STDOUT if @out_file == nil
 		file = File.open @out_file, "w" unless @out_file == nil
 		
@@ -1685,7 +1792,7 @@
 		opts.separator "Options:"
 		
 		opts.on("-f", "--framework FRAMEWORK", "Generate metadata for the given framework.") do |opt|
-			dstep_gen.add_framework(opt)
+			dstep_gen.frameworks_do_add << opt
 		end
 		
 		opts.on("-u", "--umbrella FRAMEWORK", "Link againts the given umbrella framework.") do |opt|