Browse Source

--- Merging r13518 through r13520 into '.':
U packages/univint/Makefile.fpc
U packages/univint/src/CFHTTPMessage.pas
A packages/univint/src/CFNetworkErrorss.pas
A packages/univint/src/CFHTTPAuthentication.pas
A packages/univint/src/CFError.pas
A packages/univint/src/CFNetDiagnostics.pas
U packages/univint/src/Endian.pas
A packages/univint/src/DriverServices.pas
A packages/univint/src/CFProxySupport.pas
U packages/univint/src/CFNetServices.pas
U packages/univint/src/CFStream.pas
U packages/univint/src/MacOS.pas
U packages/univint/src/CFHTTPStream.pas
U packages/univint/src/CFSocketStream.pas
A packages/univint/src/TextInputSources.pas
U packages/univint/src/MacOSAll.pas
U packages/univint/Makefile

git-svn-id: branches/fixes_2_4@13562 -

Jonas Maebe 16 years ago
parent
commit
e0a6be98a4

+ 7 - 0
.gitattributes

@@ -4681,14 +4681,18 @@ packages/univint/src/CFData.pas svneol=native#text/plain
 packages/univint/src/CFDate.pas svneol=native#text/plain
 packages/univint/src/CFDateFormatter.pas svneol=native#text/plain
 packages/univint/src/CFDictionary.pas svneol=native#text/plain
+packages/univint/src/CFError.pas svneol=native#text/plain
 packages/univint/src/CFFTPStream.pas svneol=native#text/plain
+packages/univint/src/CFHTTPAuthentication.pas svneol=native#text/plain
 packages/univint/src/CFHTTPMessage.pas svneol=native#text/plain
 packages/univint/src/CFHTTPStream.pas svneol=native#text/plain
 packages/univint/src/CFHost.pas svneol=native#text/plain
 packages/univint/src/CFLocale.pas svneol=native#text/plain
 packages/univint/src/CFMachPort.pas svneol=native#text/plain
 packages/univint/src/CFMessagePort.pas svneol=native#text/plain
+packages/univint/src/CFNetDiagnostics.pas svneol=native#text/plain
 packages/univint/src/CFNetServices.pas svneol=native#text/plain
+packages/univint/src/CFNetworkErrorss.pas svneol=native#text/plain
 packages/univint/src/CFNotificationCenter.pas svneol=native#text/plain
 packages/univint/src/CFNumber.pas svneol=native#text/plain
 packages/univint/src/CFNumberFormatter.pas svneol=native#text/plain
@@ -4696,6 +4700,7 @@ packages/univint/src/CFPlugIn.pas svneol=native#text/plain
 packages/univint/src/CFPlugInCOM.pas svneol=native#text/plain
 packages/univint/src/CFPreferences.pas svneol=native#text/plain
 packages/univint/src/CFPropertyList.pas svneol=native#text/plain
+packages/univint/src/CFProxySupport.pas svneol=native#text/plain
 packages/univint/src/CFRunLoop.pas svneol=native#text/plain
 packages/univint/src/CFSet.pas svneol=native#text/plain
 packages/univint/src/CFSocket.pas svneol=native#text/plain
@@ -4795,6 +4800,7 @@ packages/univint/src/Drag.pas svneol=native#text/plain
 packages/univint/src/DrawSprocket.pas svneol=native#text/plain
 packages/univint/src/DriverFamilyMatching.pas svneol=native#text/plain
 packages/univint/src/DriverGestalt.pas svneol=native#text/plain
+packages/univint/src/DriverServices.pas svneol=native#text/plain
 packages/univint/src/DriverSynchronization.pas svneol=native#text/plain
 packages/univint/src/Endian.pas svneol=native#text/plain
 packages/univint/src/Events.pas svneol=native#text/plain
@@ -4925,6 +4931,7 @@ packages/univint/src/TextCommon.pas svneol=native#text/plain
 packages/univint/src/TextEdit.pas svneol=native#text/plain
 packages/univint/src/TextEncodingConverter.pas svneol=native#text/plain
 packages/univint/src/TextEncodingPlugin.pas svneol=native#text/plain
+packages/univint/src/TextInputSources.pas svneol=native#text/plain
 packages/univint/src/TextServices.pas svneol=native#text/plain
 packages/univint/src/TextUtils.pas svneol=native#text/plain
 packages/univint/src/Threads.pas svneol=native#text/plain

File diff suppressed because it is too large
+ 0 - 0
packages/univint/Makefile


+ 2 - 1
packages/univint/Makefile.fpc

@@ -85,7 +85,8 @@ implicitunits=ABActions ABAddressBook ABGlobals ABPeoplePicker ABTypedefs \
   CGDisplayFades CGLTypes CVBase CVBuffer \
   CVDisplayLink CVHostTime CVImageBuffer CVPixelBuffer \
   CVPixelBufferPool CVPixelFormatDescription CVReturns \
-  ObjCRuntime
+  ObjCRuntime CFNetworkErrorss CFHTTPAuthentication \
+  CFError CFNetDiagnostics DriverServices TextInputSources
 
   
 exampledirs=examples

+ 260 - 0
packages/univint/src/CFError.pas

@@ -0,0 +1,260 @@
+{	CFError.h
+	Copyright (c) 2006-2007, Apple Inc. All rights reserved.
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit CFError;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFBase, CFDictionary;
+{$ALIGN POWER}
+
+
+{!
+	@header CFError
+        @discussion
+            CFErrors are used to encompass information about errors. At minimum, errors are identified by their domain (a string) and an error code within that domain. In addition a "userInfo" dictionary supplied at creation time enables providing additional info that might be useful for the interpretation and reporting of the error. This dictionary can even contain an "underlying" error, which is wrapped as an error bubbles up through various layers. 
+            
+            CFErrors have the ability to provide human-readable descriptions for the errors; in fact, they are designed to provide localizable, end-user presentable errors that can appear in the UI. CFError has a number of predefined userInfo keys to enable developers to supply the info.
+            
+            Usage recommendation for CFErrors is to return them as by-ref parameters in functions. This enables the caller to pass NULL in when they don't actually want information about the error. The presence of an error should be reported by other means, for instance a NULL or false return value from the function call proper:
+            
+            CFError *error;
+            if (!ReadFromFile(fd, &error)) (
+                ... process error ...
+                CFRelease(error);   // If an error occurs, the returned CFError must be released.
+            )
+            
+            It is the responsibility of anyone returning CFErrors this way to:
+            - Not touch the error argument if no error occurs
+            - Create and assign the error for return only if the error argument is non-NULL
+            
+            In addition, it's recommended that CFErrors be used in error situations only (not status), and where there are multiple possible errors to distinguish between. For instance there is no plan to add CFErrors to existing APIs in CF which currently don't return errors; in many cases, there is one possible reason for failure, and a false or NULL return is enough to indicate it.
+
+            CFError is toll-free bridged to NSError in Foundation. NSError in Foundation has some additional guidelines which makes it easy to automatically report errors to users and even try to recover from them.  See http://developer.apple.com/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/ErrorHandling/chapter_1_section_1.html for more info on NSError programming guidelines.
+}
+
+{!
+	@typedef CFErrorRef
+	    This is the type of a reference to CFErrors.  CFErrorRef is toll-free bridged with NSError.
+}
+type
+	CFErrorRef = ^SInt32; { an opaque 32-bit type }
+
+{!
+	@function CFErrorGetTypeID
+	    Returns the type identifier of all CFError instances.
+}
+function CFErrorGetTypeID: CFTypeID; external name '_CFErrorGetTypeID';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+// Predefined domains; value of "code" will correspond to preexisting values in these domains.
+var kCFErrorDomainPOSIX: CFStringRef; external name '_kCFErrorDomainPOSIX'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+var kCFErrorDomainOSStatus: CFStringRef; external name '_kCFErrorDomainOSStatus'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+var kCFErrorDomainMach: CFStringRef; external name '_kCFErrorDomainMach'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+var kCFErrorDomainCocoa: CFStringRef; external name '_kCFErrorDomainCocoa'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+// Keys in userInfo for localizable, end-user presentable error messages. At minimum provide one of first two; ideally provide all three.
+var kCFErrorLocalizedDescriptionKey: CFStringRef; external name '_kCFErrorLocalizedDescriptionKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // Key to identify the end user-presentable description in userInfo.
+var kCFErrorLocalizedFailureReasonKey: CFStringRef; external name '_kCFErrorLocalizedFailureReasonKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // Key to identify the end user-presentable failure reason in userInfo.
+var kCFErrorLocalizedRecoverySuggestionKey: CFStringRef; external name '_kCFErrorLocalizedRecoverySuggestionKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // Key to identify the end user-presentable recovery suggestion in userInfo.
+
+// If you do not have localizable error strings, you can provide a value for this key instead.
+var kCFErrorDescriptionKey: CFStringRef; external name '_kCFErrorDescriptionKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // Key to identify the description in the userInfo dictionary. Should be a complete sentence if possible. Should not contain domain name or error code.
+
+// Other keys in userInfo.
+var kCFErrorUnderlyingErrorKey: CFStringRef; external name '_kCFErrorUnderlyingErrorKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // Key to identify the underlying error in userInfo.
+
+
+{!
+	@function CFErrorCreate
+	@abstract Creates a new CFError.
+	@param allocator The CFAllocator which should be used to allocate memory for the error. This parameter may be NULL in which case the 
+	    current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
+	@param domain A CFString identifying the error domain. If this reference is NULL or is otherwise not a valid CFString, the behavior is undefined.
+	@param code A CFIndex identifying the error code. The code is interpreted within the context of the error domain.
+	@param userInfo A CFDictionary created with kCFCopyStringDictionaryKeyCallBacks and kCFTypeDictionaryValueCallBacks. It will be copied with CFDictionaryCreateCopy(). 
+	    If no userInfo dictionary is desired, NULL may be passed in as a convenience, in which case an empty userInfo dictionary will be assigned.
+	@result A reference to the new CFError.
+}
+function CFErrorCreate( allocator: CFAllocatorRef; domain: CFStringRef; code: CFIndex; userInfo: CFDictionaryRef ): CFErrorRef; external name '_CFErrorCreate';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorCreateWithUserInfoKeysAndValues
+	@abstract Creates a new CFError without having to create an intermediate userInfo dictionary.
+	@param allocator The CFAllocator which should be used to allocate memory for the error. This parameter may be NULL in which case the 
+	    current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
+	@param domain A CFString identifying the error domain. If this reference is NULL or is otherwise not a valid CFString, the behavior is undefined.
+	@param code A CFIndex identifying the error code. The code is interpreted within the context of the error domain.
+	@param userInfoKeys An array of numUserInfoValues CFStrings used as keys in creating the userInfo dictionary. NULL is valid only if numUserInfoValues is 0.
+	@param userInfoValues An array of numUserInfoValues CF types used as values in creating the userInfo dictionary.  NULL is valid only if numUserInfoValues is 0.
+	@param numUserInfoValues CFIndex representing the number of keys and values in the userInfoKeys and userInfoValues arrays.
+	@result A reference to the new CFError. numUserInfoValues CF types are gathered from each of userInfoKeys and userInfoValues to create the userInfo dictionary.
+}
+function CFErrorCreateWithUserInfoKeysAndValues( allocator: CFAllocatorRef; domain: CFStringRef; code: CFIndex; {const} userInfoKeys: {variable-size-array} UnivPtrPtr; {const} userInfoValues: {variable-size-array} UnivPtrPtr; numUserInfoValues: CFIndex ): CFErrorRef; external name '_CFErrorCreateWithUserInfoKeysAndValues';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorGetDomain
+	@abstract Returns the error domain the CFError was created with.
+	@param err The CFError whose error domain is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result The error domain of the CFError. Since this is a "Get" function, the caller shouldn't CFRelease the return value.
+}
+function CFErrorGetDomain( err: CFErrorRef ): CFStringRef; external name '_CFErrorGetDomain';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorGetCode
+	@abstract Returns the error code the CFError was created with.
+	@param err The CFError whose error code is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result The error code of the CFError (not an error return for the current call).
+}
+function CFErrorGetCode( err: CFErrorRef ): CFIndex; external name '_CFErrorGetCode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorCopyUserInfo
+        @abstract Returns CFError userInfo dictionary.
+	@discussion Returns a dictionary containing the same keys and values as in the userInfo dictionary the CFError was created with. Returns an empty dictionary if NULL was supplied to CFErrorCreate().
+	@param err The CFError whose error user info is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result The user info of the CFError.
+}
+function CFErrorCopyUserInfo( err: CFErrorRef ): CFDictionaryRef; external name '_CFErrorCopyUserInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorCopyDescription
+	@abstract Returns a human-presentable description for the error. CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedDescriptionKey at the time of CFError creation.
+        @discussion This is a complete sentence or two which says what failed and why it failed. Rules for computing the return value:
+            - Look for kCFErrorLocalizedDescriptionKey in the user info and if not NULL, returns that as-is.  
+            - Otherwise, if there is a kCFErrorLocalizedFailureReasonKey in the user info, generate an error from that. Something like: "Operation code not be completed. " + kCFErrorLocalizedFailureReasonKey
+            - Otherwise, generate a semi-user presentable string from kCFErrorDescriptionKey, the domain, and code. Something like: "Operation could not be completed. Error domain/code occurred. " or "Operation could not be completed. " + kCFErrorDescriptionKey + " (Error domain/code)"
+            Toll-free bridged NSError instances might provide additional behaviors for manufacturing a description string.  Do not count on the exact contents or format of the returned string, it might change.
+	@param err The CFError whose description is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result A CFString with human-presentable description of the CFError. Never NULL.
+}
+function CFErrorCopyDescription( err: CFErrorRef ): CFStringRef; external name '_CFErrorCopyDescription';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorCopyFailureReason
+        @abstract Returns a human-presentable failure reason for the error.  May return NULL.  CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedFailureReasonKey at the time of CFError creation.
+        @discussion This is a complete sentence which describes why the operation failed. In many cases this will be just the "because" part of the description (but as a complete sentence, which makes localization easier). By default this looks for kCFErrorLocalizedFailureReasonKey in the user info. Toll-free bridged NSError instances might provide additional behaviors for manufacturing this value. If no user-presentable string is available, returns NULL.
+            Example Description: "Could not save file 'Letter' in folder 'Documents' because the volume 'MyDisk' doesn't have enough space."
+            Corresponding FailureReason: "The volume 'MyDisk' doesn't have enough space."
+	@param err The CFError whose failure reason is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result A CFString with the localized, end-user presentable failure reason of the CFError, or NULL. 
+}
+function CFErrorCopyFailureReason( err: CFErrorRef ): CFStringRef; external name '_CFErrorCopyFailureReason';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{!
+	@function CFErrorCopyRecoverySuggestion
+        @abstract Returns a human presentable recovery suggestion for the error.  May return NULL.  CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedRecoverySuggestionKey at the time of CFError creation.
+        @discussion This is the string that can be displayed as the "informative" (aka "secondary") message on an alert panel. By default this looks for kCFErrorLocalizedRecoverySuggestionKey in the user info. Toll-free bridged NSError instances might provide additional behaviors for manufacturing this value. If no user-presentable string is available, returns NULL.
+            Example Description: "Could not save file 'Letter' in folder 'Documents' because the volume 'MyDisk' doesn't have enough space."
+            Corresponding RecoverySuggestion: "Remove some files from the volume and try again."
+	@param err The CFError whose recovery suggestion is to be returned. If this reference is not a valid CFError, the behavior is undefined.
+	@result A CFString with the localized, end-user presentable recovery suggestion of the CFError, or NULL. 
+}
+function CFErrorCopyRecoverySuggestion( err: CFErrorRef ): CFStringRef; external name '_CFErrorCopyRecoverySuggestion';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+end.

+ 613 - 0
packages/univint/src/CFHTTPAuthentication.pas

@@ -0,0 +1,613 @@
+{
+     File:       CFNetwork/CFHTTPAuthentication.h
+ 
+     Contains:   CoreFoundation Network HTTP authentication header
+ 
+     Version:    CFNetwork-129.20~17
+ 
+     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
+ 
+ 
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit CFHTTPAuthentication;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFArray, CFBase, CFDictionary, CFHTTPMessage, CFStream;
+{$ALIGN POWER}
+
+
+{
+ *  CFHTTPAuthenticationRef
+ *  
+ *  Discussion:
+ *    This is the type of a reference to HTTP authentication
+ *    information.
+ }
+type
+	CFHTTPAuthenticationRef = ^SInt32; { an opaque 32-bit type }
+
+{
+ *  CFStreamErrorHTTPAuthentication
+ *  
+ *  Discussion:
+ *    Authentication errors which may be returned as a result of trying
+ *    to apply authentication to a request.  These errors are in the
+ *    kCFStreamErrorDomainHTTP domain.
+ }
+type
+	CFStreamErrorHTTPAuthentication = SInt32;
+const
+{
+   * The type of authentication to be applied to a request is not
+   * supported.
+   }
+	kCFStreamErrorHTTPAuthenticationTypeUnsupported = -1000;
+
+  {
+   * The username was in a format not suitable for applying to the
+   * request.
+   }
+	kCFStreamErrorHTTPAuthenticationBadUserName = -1001;
+
+  {
+   * The password was in a format not suitable for applying to the
+   * request.
+   }
+	kCFStreamErrorHTTPAuthenticationBadPassword = -1002;
+
+
+{
+ *  kCFHTTPAuthenticationUsername
+ *  
+ *  Discussion:
+ *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *    username for authentication as a CFString.  Needs to be added if
+ *    CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFHTTPAuthenticationUsername: CFStringRef; external name '_kCFHTTPAuthenticationUsername'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+{
+ *  kCFHTTPAuthenticationPassword
+ *  
+ *  Discussion:
+ *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *    password for authentication as a CFString.  Needs to be added if
+ *    CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFHTTPAuthenticationPassword: CFStringRef; external name '_kCFHTTPAuthenticationPassword'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+{
+ *  kCFHTTPAuthenticationAccountDomain
+ *  
+ *  Discussion:
+ *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *    domain for authentication as a CFString.  Needs to be added if
+ *    CFHTTPAuthenticationRequiresAccountDomain returns TRUE.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFHTTPAuthenticationAccountDomain: CFStringRef; external name '_kCFHTTPAuthenticationAccountDomain'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+{
+ *  CFHTTPAuthenticationGetTypeID()
+ *  
+ *  Discussion:
+ *    Returns the type identifier of all CFHTTPAuthentication instances.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationGetTypeID: CFTypeID; external name '_CFHTTPAuthenticationGetTypeID';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationCreateFromResponse()
+ *  
+ *  Discussion:
+ *    Based on a response of 401 or 407, this function will create a
+ *    new authentication object which can be used for adding
+ *    credentials to future requests.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      Allocator to use for creating authentication object
+ *    
+ *    response:
+ *      Failed response.
+ *  
+ *  Result:
+ *    A freshly created authentication object useful for applying
+ *    authentication credentials to new requests.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationCreateFromResponse( alloc: CFAllocatorRef; response: CFHTTPMessageRef ): CFHTTPAuthenticationRef; external name '_CFHTTPAuthenticationCreateFromResponse';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationIsValid()
+ *  
+ *  Discussion:
+ *    Returns TRUE if the given authentication information was
+ *    instantiated correctly and contains enough information in order
+ *    to be applied to a request. If FALSE is returned, the object may
+ *    still contain information which is useful to the user, e.g.
+ *    unsupported method name.  An invalid object may be queried for
+ *    information but may not be applied to a request.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *    
+ *    error:
+ *      Reference to a CFStreamError which will be populated in the
+ *      case of an error in creation.  Pass NULL if not interested in
+ *      the failure reason.  The error domain will be
+ *      kCFStreamErrorDomainHTTP, and the error code will be one of
+ *      those defined in CFHTTPStream.h or one of those listed as
+ *      CFStreamErrorHTTPAuthentication.
+ *  
+ *  Result:
+ *    TRUE or FALSE depending on whether the authentication object is
+ *    good for applying credentials to further requests.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationIsValid( auth: CFHTTPAuthenticationRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPAuthenticationIsValid';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationAppliesToRequest()
+ *  
+ *  Discussion:
+ *    Returns TRUE if the given request requires credentials based upon
+ *    the given authentication information.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *    
+ *    request:
+ *      The request which is believed to need the given authentication.
+ *  
+ *  Result:
+ *    TRUE if the given authentication information should be applied to
+ *    the request, otherwise FALSE is returned.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationAppliesToRequest( auth: CFHTTPAuthenticationRef; request: CFHTTPMessageRef ): Boolean; external name '_CFHTTPAuthenticationAppliesToRequest';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationRequiresOrderedRequests()
+ *  
+ *  Discussion:
+ *    Some authentication methods require that future requests must be
+ *    performed in an ordered manner, so that information from a
+ *    response can be added to a following request.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    Returns TRUE if the given authentication method requires ordered
+ *    requests.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationRequiresOrderedRequests( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresOrderedRequests';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPMessageApplyCredentials()
+ *  
+ *  Discussion:
+ *    Perform the authentication method required on the request using
+ *    the given username and password.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      The request which is to receive the credentials.
+ *    
+ *    auth:
+ *      The authentication information for the given request.
+ *    
+ *    username:
+ *      The username to use for performing the authentication.
+ *    
+ *    password:
+ *      The password to use for performing the authentication.
+ *    
+ *    error:
+ *      Reference to a CFStreamError which will be populated with the
+ *      error information should one occurr during the application of
+ *      the credentials. Pass NULL if not interested in the failure
+ *      reason.  The error domain will be kCFStreamErrorDomainHTTP, and
+ *      the error code will be one of those define in CFHTTPStream.h or
+ *      one of those listed as CFStreamErrorHTTPAuthentication.
+ *  
+ *  Result:
+ *    TRUE will be returned if the application of the credentials to
+ *    the request was successful, otherwise FALSE is returned.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPMessageApplyCredentials( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; username: CFStringRef; password: CFStringRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentials';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPMessageApplyCredentialDictionary()
+ *  
+ *  Discussion:
+ *    Perform the authentication method required on the request using
+ *    the given credential information.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      The request which is to receive the credentials.
+ *    
+ *    auth:
+ *      The authentication information for the given request.
+ *    
+ *    dict:
+ *      A dictionary containing credentials to be applied to the
+ *      request.  Valid keys are declared above.
+ *    
+ *    error:
+ *      Reference to a CFStreamError which will be populated with the
+ *      error information should one occurr during the application of
+ *      the credentials. Pass NULL if not interested in the failure
+ *      reason.  The error domain will be kCFStreamErrorDomainHTTP, and
+ *      the error code will be one of those define in CFHTTPStream.h or
+ *      one of those listed as CFStreamErrorHTTPAuthentication.
+ *  
+ *  Result:
+ *    TRUE will be returned if the application of the credentials to
+ *    the request was successful, otherwise FALSE is returned.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPMessageApplyCredentialDictionary( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; dict: CFDictionaryRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentialDictionary';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationCopyRealm()
+ *  
+ *  Discussion:
+ *    Some authentication techniques provide for namespaces on top of
+ *    domains. This call will return the authentication information's
+ *    namespace if there is one, otherwise it will return NULL.  This
+ *    namespace is usually used for prompting the application user for
+ *    a name and password.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    This call will return the authentication information's namespace
+ *    if there is one, otherwise it will return NULL.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationCopyRealm( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyRealm';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationCopyDomains()
+ *  
+ *  Discussion:
+ *    Returns a list of domain URL's on which the given authentication
+ *    should be applied. This function is provided mostly for
+ *    informational purposes. CFHTTPAuthenticationAppliesToRequest
+ *    should be used in order to check whether a request requires the
+ *    authentication.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    Returns a list of domain URL's on which the given authentication
+ *    should be applied.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationCopyDomains( auth: CFHTTPAuthenticationRef ): CFArrayRef; external name '_CFHTTPAuthenticationCopyDomains';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationCopyMethod()
+ *  
+ *  Discussion:
+ *    Returns the method of authentication which will be performed when
+ *    applying credentials.  The strongest method of authentication
+ *    will be chosen in the case of multiple choices.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    Returns the method of authentication which will be performed when
+ *    applying credentials.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationCopyMethod( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyMethod';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationRequiresUserNameAndPassword()
+ *  
+ *  Discussion:
+ *    Returns TRUE if the chosen authentication scheme requires a
+ *    username and password.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    Returns TRUE if the chosen authentication scheme requires a
+ *    username and password.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.3 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationRequiresUserNameAndPassword( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresUserNameAndPassword';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+
+
+{
+ *  CFHTTPAuthenticationRequiresAccountDomain()
+ *  
+ *  Discussion:
+ *    Returns TRUE if the chosen authentication scheme requires a
+ *    domain for authentication.  Currently, this will return TRUE for
+ *    "NTLM" and FALSE for the other methods.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *    multiple threads are not altering the same
+ *    CFHTTPAuthenticationRef at the same time.
+ *  
+ *  Parameters:
+ *    
+ *    auth:
+ *      The authentication information being queried.
+ *  
+ *  Result:
+ *    Returns TRUE if the chosen authentication scheme requires a
+ *    domain for authentication.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFHTTPAuthenticationRequiresAccountDomain( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresAccountDomain';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+end.

+ 486 - 43
packages/univint/src/CFHTTPMessage.pas

@@ -3,9 +3,9 @@
  
      Contains:   CoreFoundation Network socket streams header
  
-     Version:    CFNetwork-71.2~1
+     Version:    CFNetwork-219~1
  
-     Copyright:  © 2001-2003 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,6 +14,7 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
+{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
 
 
 {
@@ -110,299 +111,741 @@ uses MacTypes,CFString,CFURL,CFBase,CFData,CFDictionary;
 {
  *  kCFHTTPVersion1_0
  *  
+ *  Discussion:
+ *    Version string for HTTP 1.0.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 var kCFHTTPVersion1_0: CFStringRef; external name '_kCFHTTPVersion1_0'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
+
 {
  *  kCFHTTPVersion1_1
  *  
+ *  Discussion:
+ *    Version string for HTTP 1.1.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 var kCFHTTPVersion1_1: CFStringRef; external name '_kCFHTTPVersion1_1'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
+
 {
  *  kCFHTTPAuthenticationSchemeBasic
  *  
+ *  Discussion:
+ *    HTTP Basic authentication scheme.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFHTTPAuthenticationSchemeBasic: CFStringRef; external name '_kCFHTTPAuthenticationSchemeBasic'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
  *  kCFHTTPAuthenticationSchemeDigest
  *  
+ *  Discussion:
+ *    HTTP Digest Access authentication scheme.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFHTTPAuthenticationSchemeDigest: CFStringRef; external name '_kCFHTTPAuthenticationSchemeDigest'; (* attribute const *)
-{ Currently unsupported }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+{
+ *  kCFHTTPAuthenticationSchemeNTLM
+ *  
+ *  Discussion:
+ *    HTTP NTLM authentication scheme.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFHTTPAuthenticationSchemeNTLM: CFStringRef; external name '_kCFHTTPAuthenticationSchemeNTLM'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFHTTPAuthenticationSchemeNegotiate
+ *  
+ *  Discussion:
+ *    HTTP Negotiate authentication scheme.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFHTTPAuthenticationSchemeNegotiate: CFStringRef; external name '_kCFHTTPAuthenticationSchemeNegotiate'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  CFHTTPMessageRef
+ *  
+ *  Discussion:
+ *    This is the type of a reference to an HTTP message. An HTTP
+ *    message can be a request or a response.
+ }
 type
 	CFHTTPMessageRef    = ^SInt32; { an opaque 32-bit type }
+
 {
  *  CFHTTPMessageGetTypeID()
  *  
+ *  Discussion:
+ *    Return the unique type for this class.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Result:
+ *    A unique CFType for CFHTTPMessage.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageGetTypeID: CFTypeID; external name '_CFHTTPMessageGetTypeID';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCreateRequest()
  *  
+ *  Discussion:
+ *    Create an HTTPMessage from an HTTP method, url and version.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    requestMethod:
+ *      A pointer to a CFString indicating the method of request. For a
+ *      "GET" request, for example, the value would be CFSTR("GET").
+ *    
+ *    url:
+ *      A pointer to a CFURL structure created any of the several
+ *      CFURLCreate... functions.  If this parameter is not a pointer
+ *      to a valid CFURL structure, the behavior is undefined.
+ *    
+ *    httpVersion:
+ *      A pointer to a CFString indicating the version of request.
+ *  
+ *  Result:
+ *    A pointer to the CFHTTPMessage created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    message.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
-function CFHTTPMessageCreateRequest( allocator: CFAllocatorRef; requestMethod: CFStringRef; url: CFURLRef; httpVersion: CFStringRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateRequest';
+function CFHTTPMessageCreateRequest( alloc: CFAllocatorRef; requestMethod: CFStringRef; url: CFURLRef; httpVersion: CFStringRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateRequest';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ Pass NULL to use the standard description for the given status code, as found in RFC 2616}
 {
  *  CFHTTPMessageCreateResponse()
  *  
+ *  Discussion:
+ *    Create an HTTPMessage from an HTTP status code, description and
+ *    version.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    statusCode:
+ *      An integer status code for the response.
+ *    
+ *    statusDescription:
+ *      A pointer to a CFString for the status. Pass NULL to use the
+ *      standard description for the given status code, as found in RFC
+ *      2616.
+ *    
+ *    httpVersion:
+ *      A pointer to a CFString for the HTTP version.
+ *  
+ *  Result:
+ *    A pointer to the CFHTTPMessage created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    message.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
-function CFHTTPMessageCreateResponse( allocator: CFAllocatorRef; statusCode: SInt32; statusDescription: CFStringRef; httpVersion: CFStringRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateResponse';
+function CFHTTPMessageCreateResponse( alloc: CFAllocatorRef; statusCode: CFIndex; statusDescription: CFStringRef; httpVersion: CFStringRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateResponse';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ Creates an empty request or response, which you can then append bytes to via CFHTTPMessageAppendBytes().  The HTTP header information will be parsed out as the bytes are appended.}
 {
  *  CFHTTPMessageCreateEmpty()
  *  
+ *  Discussion:
+ *    Creates an empty request or response, which you can then append
+ *    bytes to via CFHTTPMessageAppendBytes().
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    isRequest:
+ *      A boolean. Pass kCFBooleanTrue if the message should be a
+ *      request.
+ *  
+ *  Result:
+ *    A pointer to the CFHTTPMessage created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    message.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
-function CFHTTPMessageCreateEmpty( allocator: CFAllocatorRef; isRequest: Boolean ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateEmpty';
+function CFHTTPMessageCreateEmpty( alloc: CFAllocatorRef; isRequest: Boolean ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateEmpty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCreateCopy()
  *  
+ *  Discussion:
+ *    Creates a copy of a CFHTTPMessage.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A pointer to the CFHTTPMessage created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    message.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
-function CFHTTPMessageCreateCopy( allocator: CFAllocatorRef; message: CFHTTPMessageRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateCopy';
+function CFHTTPMessageCreateCopy( alloc: CFAllocatorRef; message: CFHTTPMessageRef ): CFHTTPMessageRef; external name '_CFHTTPMessageCreateCopy';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ Whether the message is a response or a request}
 {
  *  CFHTTPMessageIsRequest()
  *  
+ *  Discussion:
+ *    Returns whether the CFHTTPMessage is a request or a response.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A Boolean. A value of kCFBooleanTrue indicates the message is a
+ *    request. A value of kCFBooleanFalse indicates the message is a
+ *    response.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageIsRequest( message: CFHTTPMessageRef ): Boolean; external name '_CFHTTPMessageIsRequest';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyVersion()
  *  
+ *  Discussion:
+ *    Returns the HTTP version.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A pointer to a CFString, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the string.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyVersion( message: CFHTTPMessageRef ): CFStringRef; external name '_CFHTTPMessageCopyVersion';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyBody()
  *  
+ *  Discussion:
+ *    Returns the body of the message.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A pointer to a CFData, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the data.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyBody( message: CFHTTPMessageRef ): CFDataRef; external name '_CFHTTPMessageCopyBody';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageSetBody()
  *  
+ *  Discussion:
+ *    Sets the body of the message from a CFData.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *    
+ *    bodyData:
+ *      A pointer to a CFData containing the body to be set. If the
+ *      bodyData is NULL, the behavior is undefined.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 procedure CFHTTPMessageSetBody( message: CFHTTPMessageRef; bodyData: CFDataRef ); external name '_CFHTTPMessageSetBody';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyHeaderFieldValue()
  *  
+ *  Discussion:
+ *    Returns the specified header field.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *    
+ *    headerField:
+ *      A pointer to the CFString. If the headerField is NULL, the
+ *      behavior is undefined.
+ *  
+ *  Result:
+ *    A pointer to a CFString, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the string.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyHeaderFieldValue( message: CFHTTPMessageRef; headerField: CFStringRef ): CFStringRef; external name '_CFHTTPMessageCopyHeaderFieldValue';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyAllHeaderFields()
  *  
+ *  Discussion:
+ *    Returns a CFDictionary containing all of the header fields.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A pointer to a CFDictionary, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the dictionary.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyAllHeaderFields( message: CFHTTPMessageRef ): CFDictionaryRef; external name '_CFHTTPMessageCopyAllHeaderFields';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageSetHeaderFieldValue()
  *  
+ *  Discussion:
+ *    Sets the value of the specified header field.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *    
+ *    headerField:
+ *      A pointer to the CFString. If headerField is NULL, the behavior
+ *      is undefined.
+ *    
+ *    value:
+ *      A pointer to the CFString containing the value to set. Set the
+ *      value to NULL to remove the header field.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 procedure CFHTTPMessageSetHeaderFieldValue( message: CFHTTPMessageRef; headerField: CFStringRef; value: CFStringRef ); external name '_CFHTTPMessageSetHeaderFieldValue';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ The following function appends the given bytes to the message given (parsing out any control information if appropriate).  Returns FALSE if a parsing error occurs while processing the new data.}
 {
  *  CFHTTPMessageAppendBytes()
  *  
+ *  Discussion:
+ *    Appends the given bytes to the message given (parsing out any
+ *    control information if appropriate).  Returns kCFBooleanFalse if
+ *    a parsing error occurs while processing the new data.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *    
+ *    newBytes:
+ *      A pointer to the bytes. If newBytes is NULL, the behavior is
+ *      undefined.
+ *    
+ *    numBytes:
+ *      A CFIndex of the number of bytes to append.
+ *  
+ *  Result:
+ *    A Boolean indicating success or failure.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageAppendBytes( message: CFHTTPMessageRef; newBytes: UnivPtr; numBytes: CFIndex ): Boolean; external name '_CFHTTPMessageAppendBytes';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
-
-{ Whether further header data is expected by the message}
 {
  *  CFHTTPMessageIsHeaderComplete()
  *  
+ *  Discussion:
+ *    Returns whether further header data is expected by the message.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    message:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A Boolean. A value of kCFBooleanTrue indicates the header is
+ *    complete and no further data is expected.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageIsHeaderComplete( message: CFHTTPMessageRef ): Boolean; external name '_CFHTTPMessageIsHeaderComplete';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopySerializedMessage()
  *  
+ *  Discussion:
+ *    Creates a self-contained copy of a CFHTTPMessage. This would be
+ *    suitable for persistant storage or for transmitting over the
+ *    network independently.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      A pointer to the CFHTTPMessage to be seralized.
+ *  
+ *  Result:
+ *    A pointer to a CFData, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the data.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopySerializedMessage( request: CFHTTPMessageRef ): CFDataRef; external name '_CFHTTPMessageCopySerializedMessage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {*******************}
 { Request functions }
 {*******************}
+
 {
  *  CFHTTPMessageCopyRequestURL()
  *  
+ *  Discussion:
+ *    Creates a copy of the request URL.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      A pointer to the CFHTTPMessage.
+ *  
+ *  Result:
+ *    A pointer to a CFURL, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the url.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyRequestURL( request: CFHTTPMessageRef ): CFURLRef; external name '_CFHTTPMessageCopyRequestURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyRequestMethod()
  *  
+ *  Discussion:
+ *    Creates a copy of the request method.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      A pointer to the CFHTTPMessage.
+ *  
+ *  Result:
+ *    A pointer to a CFString, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the string.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyRequestMethod( request: CFHTTPMessageRef ): CFStringRef; external name '_CFHTTPMessageCopyRequestMethod';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ Tries to modify request to contain the authentication information 
-   requested by authenticationFailureResponse (which presumably is a 
-   401 or 407 response).  Returns TRUE if successful; FALSE otherwise 
-   (leaving request unmodified).  If authenticationScheme is NULL, the 
-   strongest supported scheme listed in failedResponse will be used. }
 {
  *  CFHTTPMessageAddAuthentication()
  *  
+ *  Discussion:
+ *    Adds authentication to the request. Tries to modify request to
+ *    contain the authentication information requested by the failed
+ *    response (which presumably is a 401 or 407 response).
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    request:
+ *      A pointer to a CFHTTPMessage request.
+ *    
+ *    authenticationFailureResponse:
+ *      A pointer to a CFHTTPMessage of the failed response.
+ *    
+ *    username:
+ *      A pointer to a CFString containing the user name to
+ *      authenticate.
+ *    
+ *    password:
+ *      A pointer to a CFString containing the password of the user.
+ *    
+ *    authenticationScheme:
+ *      A pointer to a CFString containing the authentication scheme to
+ *      use to authenticate. If authenticationScheme is NULL, strongest
+ *      supported scheme listed authenticationFailureResponse will be
+ *      used.
+ *    
+ *    forProxy:
+ *      A boolean indicating whether the authentication applies to a
+ *      proxy or not.
+ *  
+ *  Result:
+ *    A pointer to a CFString, or NULL if failed. It is caller's
+ *    responsibilty to release the memory allocated for the string.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageAddAuthentication( request: CFHTTPMessageRef; authenticationFailureResponse: CFHTTPMessageRef; username: CFStringRef; password: CFStringRef; authenticationScheme: CFStringRef; forProxy: Boolean ): Boolean; external name '_CFHTTPMessageAddAuthentication';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {********************}
 { Response functions }
 {********************}
+
 {
  *  CFHTTPMessageGetResponseStatusCode()
  *  
+ *  Discussion:
+ *    Returns the status code for the response.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    response:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A UInt32 indicating the status code.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
-function CFHTTPMessageGetResponseStatusCode( response: CFHTTPMessageRef ): UInt32; external name '_CFHTTPMessageGetResponseStatusCode';
+function CFHTTPMessageGetResponseStatusCode( response: CFHTTPMessageRef ): CFIndex; external name '_CFHTTPMessageGetResponseStatusCode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
 {
  *  CFHTTPMessageCopyResponseStatusLine()
  *  
+ *  Discussion:
+ *    Returns the status line for the response.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    response:
+ *      A pointer to the CFHTTPMessage to be copied. If the message is
+ *      NULL, the behavior is undefined.
+ *  
+ *  Result:
+ *    A CFString indicating the status code, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    string.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFHTTPMessageCopyResponseStatusLine( response: CFHTTPMessageRef ): CFStringRef; external name '_CFHTTPMessageCopyResponseStatusLine';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
 
 end.

+ 229 - 51
packages/univint/src/CFHTTPStream.pas

@@ -3,9 +3,9 @@
  
      Contains:   CoreFoundation Network HTTP streams header
  
-     Version:    CFNetwork-71.2~1
+     Version:    CFNetwork-219~1
  
-     Copyright:  © 2001-2003 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,6 +14,7 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
+{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
 
 
 {
@@ -110,198 +111,375 @@ uses MacTypes,CFStream,CFBase,CFHTTPMessage;
 {
  *  kCFStreamErrorDomainHTTP
  *  
+ *  Discussion:
+ *    Result code returned by HTTP server
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 var kCFStreamErrorDomainHTTP: SInt32; external name '_kCFStreamErrorDomainHTTP'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
+{
+ *  CFStreamErrorHTTP
+ *  
+ *  Discussion:
+ *    Errors from the kCFStreamErrorDomainHTTP domain.
+ }
 type
 	CFStreamErrorHTTP = SInt32;
 const
+{
+   * Could not parse the request/response.
+   }
   kCFStreamErrorHTTPParseFailure = -1;
+
+  {
+   * A loop was detected during redirection.
+   }
   kCFStreamErrorHTTPRedirectionLoop = -2;
+
+  {
+   * Could not retreive url for request/response.
+   }
   kCFStreamErrorHTTPBadURL      = -3;
 
-{ Value is a CFHTTPMessage with 0 bytes data. }
 {
  *  kCFStreamPropertyHTTPResponseHeader
  *  
+ *  Discussion:
+ *    Stream property key, for copy operations. Value is a
+ *    CFHTTPMessage with 0 bytes data.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 var kCFStreamPropertyHTTPResponseHeader: CFStringRef; external name '_kCFStreamPropertyHTTPResponseHeader'; (* attribute const *)
-{ Value is the CFURL from the final request; will only differ from the URL in the original request if an autoredirection has occurred. }
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
+
 {
  *  kCFStreamPropertyHTTPFinalURL
  *  
+ *  Discussion:
+ *    Stream property key, for copy operations. The response header
+ *    value is the CFURL from the final request; will only differ from
+ *    the URL in the original request if an autoredirection has
+ *    occurred.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPFinalURL: CFStringRef; external name '_kCFStreamPropertyHTTPFinalURL'; (* attribute const *)
-{************************************}
-{Set-able properties on HTTP streams }
-{************************************}
-{ HTTP proxy information is set the same way as SOCKS proxies (see CFSocketStream.h).
-   Call CFReadStreamSetProperty() passing an HTTP stream and the property kCFStreamPropertyHTTPProxy.  
-   The value should be a CFDictionary that includes at least one Host/Port pair from the keys below.  
-   The dictionary returned by SystemConfiguration.framework can also be passed directly as the value }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+{
+ *  kCFStreamPropertyHTTPFinalRequest
+ *  
+ *  Discussion:
+ *    Stream property key, for copy operations. The value is the
+ *    CFHTTPMessage transmitted by the stream, after all modifications
+ *    (such as for authentication, connection policy, or redirection)
+ *    have been made.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamPropertyHTTPFinalRequest: CFStringRef; external name '_kCFStreamPropertyHTTPFinalRequest'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
 {
  *  kCFStreamPropertyHTTPProxy
  *  
+ *  Discussion:
+ *    Stream property key, for both set and copy operations. The value
+ *    is a CFDictionary. HTTP proxy information is set the same way as
+ *    SOCKS proxies (see CFSocketStream.h). Call
+ *    CFReadStreamSetProperty() passing an HTTP stream and the property
+ *    kCFStreamPropertyHTTPProxy. The value should include at least one
+ *    Host/Port pair from the keys below. Use the dictionary returned
+ *    by SystemConfiguration.framework to set the default values for
+ *    the system. HTTP proxies are not applied automatically.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPProxy: CFStringRef; external name '_kCFStreamPropertyHTTPProxy'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
  *  kCFStreamPropertyHTTPProxyHost
  *  
+ *  Discussion:
+ *    Proxy dictionary key. The hostname of an HTTP proxy. The value is
+ *    a CFString. The key name matches kSCPropNetProxiesHTTPProxy.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPProxyHost: CFStringRef; external name '_kCFStreamPropertyHTTPProxyHost'; (* attribute const *)
-{ matches kSCPropNetProxiesHTTPProxy; value should be a CFString}
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
  *  kCFStreamPropertyHTTPProxyPort
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFNumber.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPProxyPort: CFStringRef; external name '_kCFStreamPropertyHTTPProxyPort'; (* attribute const *)
-{ matches kSCPropNetProxiesHTTPPort; value should be a CFNumber }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+{ matches kSCPropNetProxiesHTTPPort }
+
+
 {
  *  kCFStreamPropertyHTTPSProxyHost
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFString.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPSProxyHost: CFStringRef; external name '_kCFStreamPropertyHTTPSProxyHost'; (* attribute const *)
-{ matches kSCPropNetProxiesHTTPSProxy; value should be a CFString }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+{ matches kSCPropNetProxiesHTTPSProxy }
+
+
 {
  *  kCFStreamPropertyHTTPSProxyPort
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFNumber.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPSProxyPort: CFStringRef; external name '_kCFStreamPropertyHTTPSProxyPort'; (* attribute const *)
-{ matches kSCPropNetProxiesHTTPSPort; value should be a CFNumber }
-{ Value should be a CFBoolean }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+{ matches kSCPropNetProxiesHTTPSPort }
+
+
 {
  *  kCFStreamPropertyHTTPShouldAutoredirect
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFBoolean. Redirection is not
+ *    performed by default.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPShouldAutoredirect: CFStringRef; external name '_kCFStreamPropertyHTTPShouldAutoredirect'; (* attribute const *)
-{ Value should be a CFBoolean.  If this property is set to true, an HTTP stream will look for an appropriate extant persistent connection to use, and if it finds none, will try to create one.  }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
  *  kCFStreamPropertyHTTPAttemptPersistentConnection
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFBoolean.  If this property is
+ *    set to kCFBooleanTrue, an HTTP stream will look for an
+ *    appropriate extant persistent connection to use, and if it finds
+ *    none, will try to create one. Persistent connections are not used
+ *    by default.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 var kCFStreamPropertyHTTPAttemptPersistentConnection: CFStringRef; external name '_kCFStreamPropertyHTTPAttemptPersistentConnection'; (* attribute const *)
-{ Value is a CFNumber; this property can only be retrieved, not set.  The number returned is the number of bytes from the body of the request that have been written to the underlying socket }
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
  *  kCFStreamPropertyHTTPRequestBytesWrittenCount
  *  
+ *  Discussion:
+ *    Proxy dictionary key. Value is a CFNumber. This property can only
+ *    be retrieved, not set. The number returned is the number of bytes
+ *    from the body of the request that have been written to the
+ *    underlying socket
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.3 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyHTTPRequestBytesWrittenCount: CFStringRef; external name '_kCFStreamPropertyHTTPRequestBytesWrittenCount'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+
+
 {*******************}
 { Creation routines }
 {*******************}
-{ Creates a read stream for the response to the given request; when the stream is opened,
-  it will begin transmitting the request.  The bytes returned are the pure body bytes; the response header has been parsed off.
-  To retrieve the response header, ask for kCFStreamPropertyHTTPResponseHeader, above, any time after the first bytes arrive on 
-  the stream (or when stream end is reported, if there are no data bytes).
-}
 {
  *  CFReadStreamCreateForHTTPRequest()
  *  
+ *  Discussion:
+ *    Create an HTTP read stream for the response to the given request.
+ *    When the stream is opened, it will begin transmitting the
+ *    request. The bytes returned are the pure body bytes; the response
+ *    header has been parsed off. To retrieve the response header, ask
+ *    for kCFStreamPropertyHTTPResponseHeader, above, any time after
+ *    the first bytes arrive on the stream (or when stream end is
+ *    reported, if there are no data bytes). When an HTTP/1.1 server
+ *    returns a chunked a response, the chunks will be formed into one
+ *    continuous stream.
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    request:
+ *      A pointer to a CFHTTPMessage created by the
+ *      CFHTTPMessageCreateRequest function.
+ *  
+ *  Result:
+ *    A pointer to the CF read stream created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    read stream.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.1 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 function CFReadStreamCreateForHTTPRequest( alloc: CFAllocatorRef; request: CFHTTPMessageRef ): CFReadStreamRef; external name '_CFReadStreamCreateForHTTPRequest';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
 
 
-{ Creates a read stream for the response to the given requestHeaders plus requestBody.  Use in preference to
-  CFReadStreamCreateForHTTPRequest() when the body of the request is larger than you wish to be resident in memory.  Note that 
-  because streams cannot be reset, read streams created this way cannot have autoredirection enabled.  If the Content-Length 
-  header is set in requestHeaders, it is assumed that the caller got the length right and that requestBody will report 
-  end-of-stream after precisely Content-Length bytes have been read from it.  If the Content-Length header is not set, the 
-  chunked transfer-encoding will be added to requestHeaders, and bytes read from requestBody will be transmitted chunked.
-  The body of requestHeaders is ignored.
-}
 {
  *  CFReadStreamCreateForStreamedHTTPRequest()
  *  
+ *  Discussion:
+ *    Creates a read stream for the response to the given
+ *    requestHeaders plus requestBody. Use in preference to
+ *    CFReadStreamCreateForHTTPRequest() when the body of the request
+ *    is larger than you wish to be resident in memory.  Note that
+ *    because streams cannot be reset, read streams created this way
+ *    cannot have autoredirection enabled.  If the Content-Length
+ *    header is set in requestHeaders, it is assumed that the caller
+ *    got the length right and that requestBody will report
+ *    end-of-stream after precisely Content-Length bytes have been read
+ *    from it. If the Content-Length header is not set, the chunked
+ *    transfer-encoding will be added to requestHeaders, and bytes read
+ *    from requestBody will be transmitted chunked. The body of
+ *    requestHeaders is ignored.
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      A pointer to the CFAllocator which should be used to allocate
+ *      memory for the CF read stream and its storage for values. If
+ *      this reference is not a valid CFAllocator, the behavior is
+ *      undefined.
+ *    
+ *    requestHeaders:
+ *      A pointer to a CFHTTPMessage created by the
+ *      CFHTTPMessageCreateRequest function. The body of requestHeaders
+ *      is ignored.
+ *    
+ *    requestBody:
+ *      A pointer to a CFReadStream.
+ *  
+ *  Result:
+ *    A pointer to the CF read stream created, or NULL if failed. It is
+ *    caller's responsibilty to release the memory allocated for the
+ *    read stream.
+ *  
  *  Availability:
  *    Mac OS X:         in version 10.2 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 function CFReadStreamCreateForStreamedHTTPRequest( alloc: CFAllocatorRef; requestHeaders: CFHTTPMessageRef; requestBody: CFReadStreamRef ): CFReadStreamRef; external name '_CFReadStreamCreateForStreamedHTTPRequest';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
 
-{ Deprecated - Use the properties kCFStreamPropertyHTTPShouldAutoredirect and kCFStreamPropertyHTTPProxy above instead }
 {
- *  CFHTTPReadStreamSetRedirectsAutomatically()
+ *  CFHTTPReadStreamSetRedirectsAutomatically()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use the kCFStreamPropertyHTTPShouldAutoredirect property above
+ *    instead.
+ *  
+ *  Discussion:
+ *    Sets the redirection property on the http stream.
+ *  
+ *  Parameters:
+ *    
+ *    httpStream:
+ *      A pointer to the CFHTTPStream to be set.
+ *    
+ *    shouldAutoRedirect:
+ *      A boolean indicating whether to redirect or not.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework
+ *    Mac OS X:         in version 10.1 and later in CoreServices.framework but deprecated in 10.3
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 procedure CFHTTPReadStreamSetRedirectsAutomatically( httpStream: CFReadStreamRef; shouldAutoRedirect: Boolean ); external name '_CFHTTPReadStreamSetRedirectsAutomatically';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
 
 
 {
- *  CFHTTPReadStreamSetProxy()
+ *  CFHTTPReadStreamSetProxy()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use the kCFStreamPropertyHTTPProxy above instead.
+ *  
+ *  Discussion:
+ *    Sets the redirection property on the http stream.
+ *  
+ *  Parameters:
+ *    
+ *    httpStream:
+ *      A pointer to the CFHTTPStream to be set.
+ *    
+ *    proxyHost:
+ *      The proxy hostname. A CFString value.
+ *    
+ *    proxyPort:
+ *      The port number. A CFNumber value.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework
+ *    Mac OS X:         in version 10.1 and later in CoreServices.framework but deprecated in 10.3
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
 procedure CFHTTPReadStreamSetProxy( httpStream: CFReadStreamRef; proxyHost: CFStringRef; proxyPort: CFIndex ); external name '_CFHTTPReadStreamSetProxy';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+
 
 end.

+ 304 - 0
packages/univint/src/CFNetDiagnostics.pas

@@ -0,0 +1,304 @@
+{
+     File:       CFNetwork/CFNetDiagnostics.h
+ 
+     Contains:   CFNetDiagnostics interface
+ 
+     Version:    Technology: 1.0
+                 Release:    CFNetwork-219~1
+ 
+     Copyright:  © 2004-2006 by Apple Computer, Inc., all rights reserved
+ 
+ 
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit CFNetDiagnostics;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFBase, CFStream, CFURL;
+{$ALIGN POWER}
+
+
+
+{
+ *  CFNetDiagnosticRef
+ *  
+ *  Discussion:
+ *    This is the type used to describe the types of connection that
+ *    clients may be querying about
+ }
+type
+	CFNetDiagnosticRef = ^SInt32; { an opaque 32-bit type }
+
+{
+ *  CFNetDiagnosticStatusValues
+ *  
+ *  Discussion:
+ *    Values for CFNetDiagnosticStatus
+ }
+type
+	CFNetDiagnosticStatusValues = SInt32;
+const
+{
+   * There is no status, but no error has occured
+   }
+	kCFNetDiagnosticNoErr = 0;
+
+  {
+   * An error occured that prevented the call from completing
+   }
+	kCFNetDiagnosticErr = -66560;
+
+  {
+   * The connection appears to be working
+   }
+	kCFNetDiagnosticConnectionUp = -66559;
+	kCFNetDiagnosticConnectionIndeterminate = -66558;
+
+  {
+   * The connection does not appear to be working
+   }
+	kCFNetDiagnosticConnectionDown = -66557;
+
+
+{
+ *  CFNetDiagnosticStatus
+ *  
+ *  Discussion:
+ *    Returned by the various status and diagnostic calls
+ }
+type
+	CFNetDiagnosticStatus = CFIndex;
+{
+ *  CFNetDiagnosticCreateWithStreams()
+ *  
+ *  Discussion:
+ *    Creates a CFNetDiagnosticRef from a pair of CFStreams. Either
+ *    stream may be NULL. This is the preferred interface for creating
+ *    a CFNetDiagnosticRef.
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      The CF allocator to use.
+ *    
+ *    readStream:
+ *      CFReadStreamRef referring to the failed connection. May be NULL.
+ *    
+ *    writeStream:
+ *      CFWriteStreamRef referring to the failed connection. May be
+ *      NULL.
+ *  
+ *  Result:
+ *    A CFNetDiagnosticRef referring to the current networking issue.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetDiagnosticCreateWithStreams( alloc: CFAllocatorRef; readStream: CFReadStreamRef; writeStream: CFWriteStreamRef ): CFNetDiagnosticRef; external name '_CFNetDiagnosticCreateWithStreams';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  CFNetDiagnosticCreateWithURL()
+ *  
+ *  Discussion:
+ *    Creates a CFNetDiagnosticRef based on a CFURLRef passed in by the
+ *    application.
+ *  
+ *  Parameters:
+ *    
+ *    alloc:
+ *      The CF allocator to use.
+ *    
+ *    url:
+ *      CFURLRef referring to the failed connection.
+ *  
+ *  Result:
+ *    A CFNetDiagnosticRef referring to the current networking issue.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetDiagnosticCreateWithURL( alloc: CFAllocatorRef; url: CFURLRef ): CFNetDiagnosticRef; external name '_CFNetDiagnosticCreateWithURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  CFNetDiagnosticSetName()
+ *  
+ *  Discussion:
+ *    If the framework requires an application name to be displayed to
+ *    the user it will derive it from the bundle identifier of the
+ *    currently running application, in that application's current
+ *    localization. If you want to override that you may use
+ *    CFNetDiagnosticSetName to specify a CFStringRef to be used.
+ *  
+ *  Parameters:
+ *    
+ *    details:
+ *      CFNetDiagnosticRef referring to the current problem.
+ *    
+ *    name:
+ *      The localized name that should appear to the user when
+ *      referring to the application.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+procedure CFNetDiagnosticSetName( details: CFNetDiagnosticRef; name: CFStringRef ); external name '_CFNetDiagnosticSetName';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  CFNetDiagnosticDiagnoseProblemInteractively()
+ *  
+ *  Discussion:
+ *    Opens the Network Diagnostics window and returns immediately once
+ *    it is open. The client passes in a CFNetDiagnosticRef built with
+ *    one of the creator functions.
+ *  
+ *  Parameters:
+ *    
+ *    details:
+ *      CFNetDiagnosticRef referring to the current problem.
+ *  
+ *  Result:
+ *    A CFNetDiagnosticStatus. Will either be CFNetDiagnosticNoErr, or
+ *    CFNetDiagnosticErr if there was an error attempting to run the
+ *    diagnosis.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetDiagnosticDiagnoseProblemInteractively( details: CFNetDiagnosticRef ): CFNetDiagnosticStatus; external name '_CFNetDiagnosticDiagnoseProblemInteractively';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  CFNetDiagnosticCopyNetworkStatusPassively()
+ *  
+ *  Discussion:
+ *    Returns a status value that can be used to display basic
+ *    information about the connection. If the caller wishes they may
+ *    pass in a pointer to a CFStringRef that will be used to pass back
+ *    a localized description of the problem. It is the caller's
+ *    responsibility to release the CFStringRef. If the caller does not
+ *    want a description they may pass in NULL.
+ *    CFNetDiagnosticCopyNetworkStatusPassively() is guaranteed not to
+ *    cause network activity.
+ *  
+ *  Parameters:
+ *    
+ *    details:
+ *      CFNetDiagnosticRef referring to the current problem.
+ *    
+ *    description:
+ *      A pointer to a CFStringRef that, upon return, will point to a
+ *      localized string containing a description of the current
+ *      network status. May be NULL. If it is not NULL, the client must
+ *      call CFRelease on the returned object.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetDiagnosticCopyNetworkStatusPassively( details: CFNetDiagnosticRef; description: CFStringRefPtr { can be NULL } ): CFNetDiagnosticStatus; external name '_CFNetDiagnosticCopyNetworkStatusPassively';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+end.

File diff suppressed because it is too large
+ 590 - 136
packages/univint/src/CFNetServices.pas


+ 280 - 0
packages/univint/src/CFNetworkErrorss.pas

@@ -0,0 +1,280 @@
+{
+     File:       CFNetwork/CFNetworkErrors.h
+ 
+     Contains:   CFNetwork error header
+ 
+     Version:    CFNetwork-219~1
+ 
+     Copyright:  © 2006 by Apple Computer, Inc., all rights reserved
+ 
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit CFNetworkErrorss;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFBase;
+{$ALIGN POWER}
+
+{GRP translation note: Double 's' unit name ending intentional to avoid GPC redeclaration error with 'CFNetworkErrors' type identifier.}
+
+{
+ *  kCFErrorDomainCFNetwork
+ *  
+ *  Discussion:
+ *    Error domain for all errors originating in CFNetwork. Error codes
+ *    may be interpreted using the list below.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFErrorDomainCFNetwork: CFStringRef; external name '_kCFErrorDomainCFNetwork'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFErrorDomainWinSock
+ *  
+ *  Discussion:
+ *    On Windows, errors originating from WinSock are represented using
+ *    this domain.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFErrorDomainWinSock: CFStringRef; external name '_kCFErrorDomainWinSock'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  CFNetworkErrors
+ *  
+ *  Discussion:
+ *    The list of all error codes returned under the error domain
+ *    kCFErrorDomainCFNetwork
+ }
+type
+	CFNetworkErrors = SInt32;
+const
+	kCFHostErrorHostNotFound                   = 1;
+	kCFHostErrorUnknown                        = 2;    { Query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h}
+                                                       { SOCKS errors; in all cases you may query kCFSOCKSStatusCodeKey to recover the status code returned by the server}
+	kCFSOCKSErrorUnknownClientVersion          = 100;
+	kCFSOCKSErrorUnsupportedServerVersion      = 101; { Query the kCFSOCKSVersionKey to find the version requested by the server}
+                                                       { SOCKS4-specific errors}
+	kCFSOCKS4ErrorRequestFailed                = 110;  { request rejected or failed by the server}
+	kCFSOCKS4ErrorIdentdFailed                 = 111;  { request rejected because SOCKS server cannot connect to identd on the client}
+	kCFSOCKS4ErrorIdConflict                   = 112;  { request rejected because the client program and identd report different user-ids}
+	kCFSOCKS4ErrorUnknownStatusCode            = 113; { SOCKS5-specific errors}
+	kCFSOCKS5ErrorBadState                     = 120;
+	kCFSOCKS5ErrorBadResponseAddr              = 121;
+	kCFSOCKS5ErrorBadCredentials               = 122;
+	kCFSOCKS5ErrorUnsupportedNegotiationMethod = 123; { query kCFSOCKSNegotiationMethodKey to find the method requested}
+	kCFSOCKS5ErrorNoAcceptableMethod           = 124; { Errors originating from CFNetServices}
+	kCFNetServiceErrorUnknown                  = -72000;
+	kCFNetServiceErrorCollision                = -72001;
+	kCFNetServiceErrorNotFound                 = -72002;
+	kCFNetServiceErrorInProgress               = -72003;
+	kCFNetServiceErrorBadArgument              = -72004;
+	kCFNetServiceErrorCancel                   = -72005;
+	kCFNetServiceErrorInvalid                  = -72006;
+	kCFNetServiceErrorTimeout                  = -72007;
+	kCFNetServiceErrorDNSServiceFailure        = -73000; { An error from DNS discovery; look at kCFDNSServiceFailureKey to get the error number and interpret using dns_sd.h}
+                                                      { FTP errors; query the kCFFTPStatusCodeKey to get the status code returned by the server}
+	kCFFTPErrorUnexpectedStatusCode            = 200; { HTTP errors}
+	kCFErrorHTTPAuthenticationTypeUnsupported  = 300;
+	kCFErrorHTTPBadCredentials                 = 301;
+	kCFErrorHTTPConnectionLost                 = 302;
+	kCFErrorHTTPParseFailure                   = 303;
+	kCFErrorHTTPRedirectionLoopDetected        = 304;
+	kCFErrorHTTPBadURL                         = 305;
+	kCFErrorHTTPProxyConnectionFailure         = 306;
+	kCFErrorHTTPBadProxyCredentials            = 307;
+
+
+{ Keys used by CFNetwork to pass additional error information back to the user within CFError's userInfo dictionary }
+{
+ *  kCFGetAddrInfoFailureKey
+ *  
+ *  Discussion:
+ *    When an error of kCFHostErrorUnknown is returned, this key's
+ *    value is set to a CFNumber containing the raw error value
+ *    returned by getaddrinfo()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFGetAddrInfoFailureKey: CFStringRef; external name '_kCFGetAddrInfoFailureKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFSOCKSStatusCodeKey
+ *  
+ *  Discussion:
+ *    When a SOCKS failure has occurred, this key's value is set to a
+ *    CFString containing the status value returned by the SOCKS server.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFSOCKSStatusCodeKey: CFStringRef; external name '_kCFSOCKSStatusCodeKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFSOCKSVersionKey
+ *  
+ *  Discussion:
+ *    When an error of kCFSOCKSErrorUnsupportedServerVersion is
+ *    returned, this key's value is set to a CFString containing the
+ *    version number requested by the server.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFSOCKSVersionKey: CFStringRef; external name '_kCFSOCKSVersionKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFSOCKSNegotiationMethodKey
+ *  
+ *  Discussion:
+ *    When an error of kCFSOCKS5ErrorUnsupportedNegotiationMethod is
+ *    returned, this key's value is set to a CFString containing the
+ *    negotiation method requested by the server.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFSOCKSNegotiationMethodKey: CFStringRef; external name '_kCFSOCKSNegotiationMethodKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFDNSServiceFailureKey
+ *  
+ *  Discussion:
+ *    When an error of kCFNetServicesErrorDNSServiceFailure is
+ *    returned, this key's value is set to a CFNumber containing the
+ *    value returned from DNS; interret it using the values dns_sd.h
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFDNSServiceFailureKey: CFStringRef; external name '_kCFDNSServiceFailureKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFFTPStatusCodeKey
+ *  
+ *  Discussion:
+ *    When an error of kCFFTPErrorUnexpectedStatusCode is returned,
+ *    this key's value is set to a CFString containing the status code
+ *    returned by the server
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFFTPStatusCodeKey: CFStringRef; external name '_kCFFTPStatusCodeKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+end.

+ 401 - 0
packages/univint/src/CFProxySupport.pas

@@ -0,0 +1,401 @@
+{
+     File:       CFNetwork/CFProxySupport.h
+ 
+     Contains:   Support for computing which proxy applies when
+ 
+     Version:    CFNetwork-219~1
+ 
+     Copyright:  © 2006 by Apple Computer, Inc., all rights reserved
+  
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit CFProxySupport;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFArray, CFBase, CFDictionary, CFURL, CFError, CFRunLoop, CFStream;
+{$ALIGN POWER}
+
+
+{ 
+    These APIs return arrays of dictionaries, where each dictionary describes a single proxy. 
+    The arrays represent the order in which the proxies should be tried - try to download the URL
+    using the first entry in the array, and if that fails, try using the second entry, and so on.
+
+    The keys to the proxy dictionaries follow the function declarations; every proxy dictionary 
+    will have an entry for kCFProxyTypeKey.  If the type is anything except 
+    kCFProxyTypeAutoConfigurationURL, the dictionary will also have entries for the proxy's host
+    and port (under kCFProxyHostNameKey and kCFProxyPortNumberKey respectively).  If the type is
+    kCFProxyTypeAutoConfigurationURL, it will have an entry for kCFProxyAutoConfigurationURLKey.  
+    
+    The keys for username and password are optional and will only be present if the username 
+    or password could be extracted from the information passed in (i.e. either the URL itself
+    or the proxy dictionary supplied).  These APIs do not consult any external credential stores
+    (such as the Keychain).
+}
+
+
+{
+ *  CFNetworkCopyProxiesForURL()
+ *  
+ *  Discussion:
+ *    Given a URL and a proxy dictionary, determines the ordered list
+ *    of proxies that should be used to download the given URL.
+ *  
+ *  Parameters:
+ *    
+ *    url:
+ *      The URL to be accessed
+ *    
+ *    proxySettings:
+ *      A dictionary describing the available proxy settings; the
+ *      dictionary's format should match that described in and returned
+ *      by SystemConfiguration.framework
+ *  
+ *  Result:
+ *    An array of dictionaries; each dictionary describes a single
+ *    proxy.  See the comment at the top of this file for how to
+ *    interpret the returned dictionaries.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetworkCopyProxiesForURL( url: CFURLRef; proxySettings: CFDictionaryRef ): CFArrayRef; external name '_CFNetworkCopyProxiesForURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  CFProxyAutoConfigurationResultCallback
+ *  
+ *  Discussion:
+ *    Callback function to be called when a PAC file computation
+ *    (initiated by either CFNetworkExecuteProxyAutoConfigurationScript
+ *    or CFNetworkExecuteProxyAutoConfigurationURL) has completed.
+ *  
+ *  Parameters:
+ *    
+ *    client:
+ *      The client reference passed in to
+ *      CFNetworkExecuteProxyAutoConfigurationScript or
+ *      CFNetworkExecuteProxyAutoConfigurationURL
+ *    
+ *    proxyList:
+ *      Upon success, the list of proxies returned by the
+ *      autoconfiguration script.  The list has the same format as
+ *      returned by CFProxyCopyProxiesForURL, above, except that no
+ *      entry may be of type kCFProxyTypeAutoConfigurationURL.  Note
+ *      that if the client wishes to keep this list, they must retain
+ *      it when they receive this callback.
+ *    
+ *    error:
+ *      Upon failure, an error object explaining the failure.
+ }
+type
+	CFProxyAutoConfigurationResultCallback = procedure( client: UnivPtr; proxyList: CFArrayRef; error: CFErrorRef );
+{
+ *  CFNetworkCopyProxiesForAutoConfigurationScript()
+ *  
+ *  Discussion:
+ *    Begins the process of executing proxyAutoConfigurationScript to
+ *    determine the correct proxy to use to retrieve targetURL.  The
+ *    caller should schedule the returned run loop source; when the
+ *    results are found, the caller's callback will be called via the
+ *    run loop, passing a valid proxyList and NULL error upon success,
+ *    or a NULL proxyList and valid error on failure.  The caller
+ *    should invalidate the returned run loop source if it wishes to
+ *    terminate the request before completion.
+ *  
+ *  Parameters:
+ *    
+ *    proxyAutoConfigurationScript:
+ *      A CFString containing the code of the script to be executed.
+ *    
+ *    targetURL:
+ *      The URL that should be input in to the autoconfiguration script
+ *  
+ *  Result:
+ *    An array of dictionaries describing the proxies returned by the
+ *    script.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetworkCopyProxiesForAutoConfigurationScript( proxyAutoConfigurationScript: CFStringRef; targetURL: CFURLRef ): CFArrayRef; external name '_CFNetworkCopyProxiesForAutoConfigurationScript';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  CFNetworkExecuteProxyAutoConfigurationURL()
+ *  
+ *  Discussion:
+ *    As CFNetworkExecuteProxyAutoConfigurationScript(), above, except
+ *    that CFNetworkExecuteProxyAutoConfigurationURL will additionally
+ *    download the contents of proxyAutoConfigURL, convert it to a
+ *    JavaScript string, and then execute that script.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CFNetworkExecuteProxyAutoConfigurationURL( proxyAutoConfigURL: CFURLRef; targetURL: CFURLRef; cb: CFProxyAutoConfigurationResultCallback; var clientContext: CFStreamClientContext ): CFRunLoopSourceRef; external name '_CFNetworkExecuteProxyAutoConfigurationURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  kCFProxyTypeKey
+ *  
+ *  Discussion:
+ *    Key for the type of proxy being represented; value will be one of
+ *    the kCFProxyType constants listed below.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeKey: CFStringRef; external name '_kCFProxyTypeKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFProxyHostNameKey
+ *  
+ *  Discussion:
+ *    Key for the proxy's hostname; value is a CFString.  Note that
+ *    this may be an IPv4 or IPv6 dotted-IP string.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyHostNameKey: CFStringRef; external name '_kCFProxyHostNameKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFProxyPortNumberKey
+ *  
+ *  Discussion:
+ *    Key for the proxy's port number; value is a CFNumber specifying
+ *    the port on which to contact the proxy
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyPortNumberKey: CFStringRef; external name '_kCFProxyPortNumberKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFProxyAutoConfigurationURLKey
+ *  
+ *  Discussion:
+ *    Key for the proxy's PAC file location; this key is only present
+ *    if the proxy's type is kCFProxyTypeAutoConfigurationURL.  Value
+ *    is a CFURL specifying the location of a proxy auto-configuration
+ *    file
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyAutoConfigurationURLKey: CFStringRef; external name '_kCFProxyAutoConfigurationURLKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFProxyUsernameKey
+ *  
+ *  Discussion:
+ *    Key for the username to be used with the proxy; value is a
+ *    CFString. Note that this key will only be present if the username
+ *    could be extracted from the information passed in.  No external
+ *    credential stores (like the Keychain) are consulted.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyUsernameKey: CFStringRef; external name '_kCFProxyUsernameKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{
+ *  kCFProxyPasswordKey
+ *  
+ *  Discussion:
+ *    Key for the password to be used with the proxy; value is a
+ *    CFString. Note that this key will only be present if the username
+ *    could be extracted from the information passed in.  No external
+ *    credential stores (like the Keychain) are consulted.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyPasswordKey: CFStringRef; external name '_kCFProxyPasswordKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{ 
+    Possible values for kCFProxyTypeKey:
+    kCFProxyTypeNone - no proxy should be used; contact the origin server directly
+    kCFProxyTypeHTTP - the proxy is an HTTP proxy
+    kCFProxyTypeHTTPS - the proxy is a tunneling proxy as used for HTTPS
+    kCFProxyTypeSOCKS - the proxy is a SOCKS proxy
+    kCFProxyTypeFTP - the proxy is an FTP proxy
+    kCFProxyTypeAutoConfigurationURL - the proxy is specified by a proxy autoconfiguration (PAC) file
+}
+{
+ *  kCFProxyTypeNone
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeNone: CFStringRef; external name '_kCFProxyTypeNone'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kCFProxyTypeHTTP
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeHTTP: CFStringRef; external name '_kCFProxyTypeHTTP'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kCFProxyTypeHTTPS
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeHTTPS: CFStringRef; external name '_kCFProxyTypeHTTPS'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kCFProxyTypeSOCKS
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeSOCKS: CFStringRef; external name '_kCFProxyTypeSOCKS'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kCFProxyTypeFTP
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeFTP: CFStringRef; external name '_kCFProxyTypeFTP'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kCFProxyTypeAutoConfigurationURL
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFProxyTypeAutoConfigurationURL: CFStringRef; external name '_kCFProxyTypeAutoConfigurationURL'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+end.

+ 275 - 76
packages/univint/src/CFSocketStream.pas

@@ -3,9 +3,9 @@
  
      Contains:   CoreFoundation Network socket streams header
  
-     Version:    CFNetwork-71.2~1
+     Version:    CFNetwork-219~1
  
-     Copyright:  © 2001-2003 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,7 +14,7 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
+{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
 
 {
     Modified for use with Free Pascal
@@ -108,114 +108,189 @@ uses MacTypes,CFStream,CFBase,CFHost,CFNetServices;
 {$ALIGN MAC68K}
 
 {
- *  kCFStreamErrorDomainSSL
+ *  kCFStreamPropertySSLPeerCertificates
  *  
  *  Discussion:
- *    Errors located in Security/SecureTransport.h
+ *    Stream property key for copy operations.  CFArrayRef containing
+ *    SecCertificateRefs. See SSLGetPeerCertificates in
+ *    Security/SecureTransport.h for more information.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamErrorDomainSSL: SInt32; external name '_kCFStreamErrorDomainSSL'; (* attribute const *)
-
+var kCFStreamPropertySSLPeerCertificates: CFStringRef; external name '_kCFStreamPropertySSLPeerCertificates'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamPropertySocketSecurityLevel
+ *  kCFStreamPropertySSLSettings
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations. To set a
- *    stream to be secure, call CFReadStreamSetProperty or
- *    CFWriteStreamSetPropertywith the property name set to
- *    kCFStreamPropertySocketSecurityLevel and the value being one of
- *    the following values.  Streams may set a security level after
- *    open in order to allow on-the-fly securing of a stream.
+ *    Stream property key for set operations.  CFDictionaryRef filled
+ *    with different security settings.  By default, there are no
+ *    security settings.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamPropertySocketSecurityLevel: CFStringRef; external name '_kCFStreamPropertySocketSecurityLevel'; (* attribute const *)
-
+var kCFStreamPropertySSLSettings: CFStringRef; external name '_kCFStreamPropertySSLSettings'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamSocketSecurityLevelNone
+ *  kCFStreamSSLLevel
  *  
  *  Discussion:
- *    Stream property value, for both set and copy operations.
- *    Indicates to use no security (default setting).
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFStringRef being one of the security levels.  The value is
+ *    kCFStreamSocketSecurityLevelNegotiatedSSL by default (not set).
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamSocketSecurityLevelNone: CFStringRef; external name '_kCFStreamSocketSecurityLevelNone'; (* attribute const *)
-
+var kCFStreamSSLLevel: CFStringRef; external name '_kCFStreamSSLLevel'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamSocketSecurityLevelSSLv2
+ *  kCFStreamSSLAllowsExpiredCertificates
  *  
  *  Discussion:
- *    Stream property value, for both set and copy operations.
- *    Indicates to use SSLv2 security.
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFBooleanRef indicating whether expired certificates should be
+ *    allowed or not.  The value is kCFBooleanFalse by default (not
+ *    set).
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamSocketSecurityLevelSSLv2: CFStringRef; external name '_kCFStreamSocketSecurityLevelSSLv2'; (* attribute const *)
-
+var kCFStreamSSLAllowsExpiredCertificates: CFStringRef; external name '_kCFStreamSSLAllowsExpiredCertificates'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamSocketSecurityLevelSSLv3
+ *  kCFStreamSSLAllowsExpiredRoots
  *  
  *  Discussion:
- *    Stream property value, for both set and copy operations.
- *    Indicates to use SSLv3 security.
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFBooleanRef indicating whether expired root certificates should
+ *    be allowed or not.  The value is kCFBooleanFalse by default (not
+ *    set).
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamSocketSecurityLevelSSLv3: CFStringRef; external name '_kCFStreamSocketSecurityLevelSSLv3'; (* attribute const *)
-
+var kCFStreamSSLAllowsExpiredRoots: CFStringRef; external name '_kCFStreamSSLAllowsExpiredRoots'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamSocketSecurityLevelTLSv1
+ *  kCFStreamSSLAllowsAnyRoot
  *  
  *  Discussion:
- *    Stream property value, for both set and copy operations.
- *    Indicates to use TLSv1 security.
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFBooleanRef indicating whether any root certificates should be
+ *    allowed or not.  The value is kCFBooleanFalse by default (not
+ *    set).
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamSocketSecurityLevelTLSv1: CFStringRef; external name '_kCFStreamSocketSecurityLevelTLSv1'; (* attribute const *)
+var kCFStreamSSLAllowsAnyRoot: CFStringRef; external name '_kCFStreamSSLAllowsAnyRoot'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+{
+ *  kCFStreamSSLValidatesCertificateChain
+ *  
+ *  Discussion:
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFBooleanRef indicating whether the certificate chain should be
+ *    validated or not.  The value is kCFBooleanTrue by default (not
+ *    set).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSSLValidatesCertificateChain: CFStringRef; external name '_kCFStreamSSLValidatesCertificateChain'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 {
- *  kCFStreamSocketSecurityLevelNegotiatedSSL
+ *  kCFStreamSSLPeerName
  *  
  *  Discussion:
- *    Stream property value, for both set and copy operations.
- *    Indicates to use TLS or SSL with fallback to lower versions. This
- *    is what HTTPS does, for instance.
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFStringRef overriding the name used for certificate
+ *    verification.  Set to kCFNull to prevent name verification. 
+ *    Default is the host name with which the streams were created.  If
+ *    no host name was used, no peer name will be used.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-var kCFStreamSocketSecurityLevelNegotiatedSSL: CFStringRef; external name '_kCFStreamSocketSecurityLevelNegotiatedSSL'; (* attribute const *)
+var kCFStreamSSLPeerName: CFStringRef; external name '_kCFStreamSSLPeerName'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+{
+ *  kCFStreamSSLCertificates
+ *  
+ *  Discussion:
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFArrayRef of SecCertificateRefs, except for index [0], which is
+ *    a SecIdentityRef.  See SSLSetCertificate in
+ *    Security/SecureTransport.h for more information.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSSLCertificates: CFStringRef; external name '_kCFStreamSSLCertificates'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+{
+ *  kCFStreamSSLIsServer
+ *  
+ *  Discussion:
+ *    Security property key for kCFStreamPropertySSLSettings. 
+ *    CFBooleanRef indicating whether the connection is to act as a
+ *    server in the SSL process or not.  The value is kCFBooleanFalse
+ *    by default (not set).  If set to kCFBooleanTrue, there must be a
+ *    valid value for the kCFStreamSSLCertificates key too.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSSLIsServer: CFStringRef; external name '_kCFStreamSSLIsServer'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+{
+ *  kCFStreamErrorDomainWinSock
+ *  
+ *  Discussion:
+ *    WinSock error domain.  On Win32 platforms, networking errors will
+ *    come in this domain.  See <winsock2.h> for values.  Note that
+ *    non-networking errors, like ENOMEM, will continue to come in the
+ *    POSIX domain as on OS X.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamErrorDomainWinSock: CFIndex; external name '_kCFStreamErrorDomainWinSock'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
 {
  *  kCFStreamErrorDomainSOCKS
  *  
@@ -229,41 +304,40 @@ var kCFStreamSocketSecurityLevelNegotiatedSSL: CFStringRef; external name '_kCFS
  }
 var kCFStreamErrorDomainSOCKS: SInt32; external name '_kCFStreamErrorDomainSOCKS'; (* attribute const *)
 
-
 {
 CF_INLINE
 SInt32 CFSocketStreamSOCKSGetErrorSubdomain(CFStreamError* error)
-    return ((error->domain >> 16) & 0x0000FFFF);
+    return ((error->error >> 16) & 0x0000FFFF);
 
 CF_INLINE
 SInt32 CFSocketStreamSOCKSGetError(CFStreamError* error)
-    return (error->domain & 0x0000FFFF);
+    return (error->error & 0x0000FFFF);
 }
 
 const
-  kCFStreamErrorSOCKSSubDomainNone = 0; { Error code is a general SOCKS error }
-  kCFStreamErrorSOCKSSubDomainVersionCode = 1; { Error code is the version of SOCKS which the server wishes to use }
-  kCFStreamErrorSOCKS4SubDomainResponse = 2; { Error code is the status code returned by the server }
-  kCFStreamErrorSOCKS5SubDomainUserPass = 3; { Error code is the status code that the server returned }
-  kCFStreamErrorSOCKS5SubDomainMethod = 4; { Error code is the server's desired negotiation method }
-  kCFStreamErrorSOCKS5SubDomainResponse = 5; { Error code is the response code that the server returned in reply to the connection request }
+	kCFStreamErrorSOCKSSubDomainNone = 0; { Error code is a general SOCKS error}
+	kCFStreamErrorSOCKSSubDomainVersionCode = 1; { Error code is the version of SOCKS which the server wishes to use}
+	kCFStreamErrorSOCKS4SubDomainResponse = 2; { Error code is the status code returned by the server}
+	kCFStreamErrorSOCKS5SubDomainUserPass = 3; { Error code is the status code that the server returned}
+	kCFStreamErrorSOCKS5SubDomainMethod = 4; { Error code is the server's desired negotiation method}
+	kCFStreamErrorSOCKS5SubDomainResponse = 5; { Error code is the response code that the server returned in reply to the connection request}
 
 
 { kCFStreamErrorSOCKSSubDomainNone}
 const
-  kCFStreamErrorSOCKS5BadResponseAddr = 1;
-  kCFStreamErrorSOCKS5BadState  = 2;
-  kCFStreamErrorSOCKSUnknownClientVersion = 3;
+	kCFStreamErrorSOCKS5BadResponseAddr = 1;
+	kCFStreamErrorSOCKS5BadState = 2;
+	kCFStreamErrorSOCKSUnknownClientVersion = 3;
 
 { kCFStreamErrorSOCKS4SubDomainResponse}
 const
-  kCFStreamErrorSOCKS4RequestFailed = 91; { request rejected or failed }
-  kCFStreamErrorSOCKS4IdentdFailed = 92; { request rejected because SOCKS server cannot connect to identd on the client }
-  kCFStreamErrorSOCKS4IdConflict = 93;   { request rejected because the client program and identd report different user-ids }
+	kCFStreamErrorSOCKS4RequestFailed = 91; { request rejected or failed }
+	kCFStreamErrorSOCKS4IdentdFailed = 92; { request rejected because SOCKS server cannot connect to identd on the client }
+	kCFStreamErrorSOCKS4IdConflict = 93;   { request rejected because the client program and identd report different user-ids }
 
 { kCFStreamErrorSOCKS5SubDomainMethod}
 const
-  kSOCKS5NoAcceptableMethod     = $0FF;  { other values indicate the server's desired method }
+	kSOCKS5NoAcceptableMethod = $FF;  { other values indicate the server's desired method }
 
 
 {
@@ -290,7 +364,7 @@ var kCFStreamPropertySOCKSProxy: CFStringRef; external name '_kCFStreamPropertyS
  *  kCFStreamPropertySOCKSProxyHost
  *  
  *  Discussion:
- *    CFDictinary key for SOCKS proxy information.  The key
+ *    CFDictionary key for SOCKS proxy information.  The key
  *    kCFStreamPropertySOCKSProxyHost should contain a CFStringRef
  *    value representing the SOCKS proxy host.  Defined to match
  *    kSCPropNetProxiesSOCKSProxy
@@ -306,7 +380,7 @@ var kCFStreamPropertySOCKSProxyHost: CFStringRef; external name '_kCFStreamPrope
  *  kCFStreamPropertySOCKSProxyPort
  *  
  *  Discussion:
- *    CFDictinary key for SOCKS proxy information.  The key
+ *    CFDictionary key for SOCKS proxy information.  The key
  *    kCFStreamPropertySOCKSProxyPort should contain a CFNumberRef
  *    which itself is of type kCFNumberSInt32Type.  This value should
  *    represent the port on which the proxy is listening.  Defined to
@@ -323,7 +397,7 @@ var kCFStreamPropertySOCKSProxyPort: CFStringRef; external name '_kCFStreamPrope
  *  kCFStreamPropertySOCKSVersion
  *  
  *  Discussion:
- *    CFDictinary key for SOCKS proxy information.  By default, SOCKS5
+ *    CFDictionary key for SOCKS proxy information.  By default, SOCKS5
  *    will be used unless there is a kCFStreamPropertySOCKSVersion key
  *    in the dictionary.  Its value must be
  *    kCFStreamSocketSOCKSVersion4 or kCFStreamSocketSOCKSVersion5 to
@@ -368,7 +442,7 @@ var kCFStreamSocketSOCKSVersion5: CFStringRef; external name '_kCFStreamSocketSO
  *  kCFStreamPropertySOCKSUser
  *  
  *  Discussion:
- *    CFDictinary key for SOCKS proxy information.  To set a user name
+ *    CFDictionary key for SOCKS proxy information.  To set a user name
  *    and/or password, if required, the dictionary must contain the
  *    key(s) kCFStreamPropertySOCKSUser and/or  
  *    kCFStreamPropertySOCKSPassword with the value being the user's
@@ -386,7 +460,7 @@ var kCFStreamPropertySOCKSUser: CFStringRef; external name '_kCFStreamPropertySO
  *  kCFStreamPropertySOCKSPassword
  *  
  *  Discussion:
- *    CFDictinary key for SOCKS proxy information.  To set a user name
+ *    CFDictionary key for SOCKS proxy information.  To set a user name
  *    and/or password, if required, the dictionary must contain the
  *    key(s) kCFStreamPropertySOCKSUser and/or  
  *    kCFStreamPropertySOCKSPassword with the value being the user's
@@ -400,6 +474,113 @@ var kCFStreamPropertySOCKSUser: CFStringRef; external name '_kCFStreamPropertySO
  }
 var kCFStreamPropertySOCKSPassword: CFStringRef; external name '_kCFStreamPropertySOCKSPassword'; (* attribute const *)
 
+{
+ *  kCFStreamErrorDomainSSL
+ *  
+ *  Discussion:
+ *    Errors located in Security/SecureTransport.h
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamErrorDomainSSL: SInt32; external name '_kCFStreamErrorDomainSSL'; (* attribute const *)
+
+
+{
+ *  kCFStreamPropertySocketSecurityLevel
+ *  
+ *  Discussion:
+ *    Stream property key, for both set and copy operations. To set a
+ *    stream to be secure, call CFReadStreamSetProperty or
+ *    CFWriteStreamSetPropertywith the property name set to
+ *    kCFStreamPropertySocketSecurityLevel and the value being one of
+ *    the following values.  Streams may set a security level after
+ *    open in order to allow on-the-fly securing of a stream.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamPropertySocketSecurityLevel: CFStringRef; external name '_kCFStreamPropertySocketSecurityLevel'; (* attribute const *)
+
+
+{
+ *  kCFStreamSocketSecurityLevelNone
+ *  
+ *  Discussion:
+ *    Stream property value, for both set and copy operations.
+ *    Indicates to use no security (default setting).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSocketSecurityLevelNone: CFStringRef; external name '_kCFStreamSocketSecurityLevelNone'; (* attribute const *)
+
+
+{
+ *  kCFStreamSocketSecurityLevelSSLv2
+ *  
+ *  Discussion:
+ *    Stream property value, for both set and copy operations.
+ *    Indicates to use SSLv2 security.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSocketSecurityLevelSSLv2: CFStringRef; external name '_kCFStreamSocketSecurityLevelSSLv2'; (* attribute const *)
+
+
+{
+ *  kCFStreamSocketSecurityLevelSSLv3
+ *  
+ *  Discussion:
+ *    Stream property value, for both set and copy operations.
+ *    Indicates to use SSLv3 security.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSocketSecurityLevelSSLv3: CFStringRef; external name '_kCFStreamSocketSecurityLevelSSLv3'; (* attribute const *)
+
+
+{
+ *  kCFStreamSocketSecurityLevelTLSv1
+ *  
+ *  Discussion:
+ *    Stream property value, for both set and copy operations.
+ *    Indicates to use TLSv1 security.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSocketSecurityLevelTLSv1: CFStringRef; external name '_kCFStreamSocketSecurityLevelTLSv1'; (* attribute const *)
+
+
+{
+ *  kCFStreamSocketSecurityLevelNegotiatedSSL
+ *  
+ *  Discussion:
+ *    Stream property value, for both set and copy operations.
+ *    Indicates to use TLS or SSL with fallback to lower versions. This
+ *    is what HTTPS does, for instance.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.2 and later
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamSocketSecurityLevelNegotiatedSSL: CFStringRef; external name '_kCFStreamSocketSecurityLevelNegotiatedSSL'; (* attribute const *)
 
 {
  *  kCFStreamPropertyShouldCloseNativeSocket
@@ -436,8 +617,8 @@ var kCFStreamPropertyShouldCloseNativeSocket: CFStringRef; external name '_kCFSt
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertySocketRemoteHost: CFStringRef; external name '_kCFStreamPropertySocketRemoteHost'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 
 {
@@ -452,8 +633,8 @@ var kCFStreamPropertySocketRemoteHost: CFStringRef; external name '_kCFStreamPro
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertySocketRemoteNetService: CFStringRef; external name '_kCFStreamPropertySocketRemoteNetService'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 
 {
@@ -494,8 +675,8 @@ var kCFStreamPropertySocketRemoteNetService: CFStringRef; external name '_kCFStr
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure CFStreamCreatePairWithSocketToCFHost( alloc: CFAllocatorRef; host: CFHostRef; port: UInt32; readStream: CFReadStreamRefPtr; writeStream: CFWriteStreamRefPtr ); external name '_CFStreamCreatePairWithSocketToCFHost';
+procedure CFStreamCreatePairWithSocketToCFHost( alloc: CFAllocatorRef; host: CFHostRef; port: SInt32; readStream: CFReadStreamRefPtr { can be NULL }; writeStream: CFWriteStreamRefPtr { can be NULL } ); external name '_CFStreamCreatePairWithSocketToCFHost';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 
 {
@@ -534,8 +715,8 @@ procedure CFStreamCreatePairWithSocketToCFHost( alloc: CFAllocatorRef; host: CFH
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure CFStreamCreatePairWithSocketToNetService( alloc: CFAllocatorRef; service: CFNetServiceRef; readStream: CFReadStreamRefPtr; writeStream: CFWriteStreamRefPtr ); external name '_CFStreamCreatePairWithSocketToNetService';
+procedure CFStreamCreatePairWithSocketToNetService( alloc: CFAllocatorRef; service: CFNetServiceRef; readStream: CFReadStreamRefPtr { can be NULL }; writeStream: CFWriteStreamRefPtr { can be NULL } ); external name '_CFStreamCreatePairWithSocketToNetService';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 
 {
@@ -550,7 +731,7 @@ procedure CFStreamCreatePairWithSocketToNetService( alloc: CFAllocatorRef; servi
 type
 	CFStreamSocketSecurityProtocol = SInt32;
 const
-  {
+{
    * DEPRECATED, use kCFStreamSocketSecurityLevelNone
    }
   kCFStreamSocketSecurityNone   = 0;
@@ -610,7 +791,25 @@ const
  *    CarbonLib:        not available
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
 function CFSocketStreamPairSetSecurityProtocol( socketReadStream: CFReadStreamRef; socketWriteStream: CFWriteStreamRef; securityProtocol: CFStreamSocketSecurityProtocol ): Boolean; external name '_CFSocketStreamPairSetSecurityProtocol';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 *)
+
+
+{
+ *  kCFStreamPropertyProxyLocalBypass
+ *  
+ *  Discussion:
+ *    CFDictionary key for proxy information.  It matches
+ *    kSCPropNetProxiesExcludeSimpleHostnames defined in
+ *    SCSchemaDefinitions.h.  CFNumber (0 or 1) indicating to bypass
+ *    the proxies for simple hostnames (names without dots).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kCFStreamPropertyProxyLocalBypass: CFStringRef; external name '_kCFStreamPropertyProxyLocalBypass'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 end.

+ 39 - 27
packages/univint/src/CFStream.pas

@@ -1,8 +1,10 @@
 {	CFStream.h
-	Copyright (c) 2000-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2000-2007, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, November 2005 }
+{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
+
 {
     Modified for use with Free Pascal
     Version 210
@@ -91,12 +93,10 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,CFBase,CFString,CFDictionary,CFURL,CFRunLoop,CFSocket;
+uses MacTypes,CFBase,CFString,CFDictionary,CFURL,CFRunLoop,CFSocket,CFError;
 {$ALIGN POWER}
 
 
-type
-	CFStreamStatus = SInt32;
 const
     kCFStreamStatusNotOpen = 0;
     kCFStreamStatusOpening = 1;  { open is in-progress }
@@ -106,23 +106,9 @@ const
     kCFStreamStatusAtEnd = 5;    { no further bytes can be read/written }
     kCFStreamStatusClosed = 6;
     kCFStreamStatusError = 7;
-
 type
-	CFStreamErrorDomain = SInt32;
-const
-    kCFStreamErrorDomainCustom = -1;      { custom to the kind of stream in question }
-    kCFStreamErrorDomainPOSIX = 1;        { POSIX errno; interpret using <sys/errno.h> }
-    kCFStreamErrorDomainMacOSStatus = 2;      { OSStatus type from Carbon APIs; interpret using <MacTypes.h> }
+	CFStreamStatus = CFIndex;
 
-type
-	CFStreamError = record
-		domain: CFStreamErrorDomain;
-		error: SInt32;
-	end;
-	CFStreamErrorPtr = ^CFStreamError;
-
-type
-	CFStreamEventType = SInt32;
 const
     kCFStreamEventNone = 0;
     kCFStreamEventOpenCompleted = 1;
@@ -130,6 +116,8 @@ const
     kCFStreamEventCanAcceptBytes = 4; 
     kCFStreamEventErrorOccurred = 8;
     kCFStreamEventEndEncountered = 16;
+type
+	CFStreamEventType = CFOptionFlags;
 
 type
 	CFStreamClientContext = record
@@ -170,6 +158,7 @@ function CFWriteStreamCreateWithAllocatedBuffers( alloc: CFAllocatorRef; bufferA
 { File streams }
 function CFReadStreamCreateWithFile( alloc: CFAllocatorRef; fileURL: CFURLRef ): CFReadStreamRef; external name '_CFReadStreamCreateWithFile';
 function CFWriteStreamCreateWithFile( alloc: CFAllocatorRef; fileURL: CFURLRef ): CFWriteStreamRef; external name '_CFWriteStreamCreateWithFile';
+procedure CFStreamCreateBoundPair( alloc: CFAllocatorRef; var readStream: CFReadStreamRef; var writeStream: CFWriteStreamRef; transferBufferSize: CFIndex ); external name '_CFStreamCreateBoundPair';
 
 {#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
 { Property for file write streams; value should be a CFBoolean.  Set to TRUE to append to a file, rather than to replace its contents }
@@ -202,11 +191,11 @@ procedure CFStreamCreatePairWithPeerSocketSignature( alloc: CFAllocatorRef; cons
 function CFReadStreamGetStatus( stream: CFReadStreamRef ): CFStreamStatus; external name '_CFReadStreamGetStatus';
 function CFWriteStreamGetStatus( stream: CFWriteStreamRef ): CFStreamStatus; external name '_CFWriteStreamGetStatus';
 
-{ 0 is returned if no error has occurred.  errorDomain specifies the domain
-   in which the error code should be interpretted; pass NULL if you are not 
-   interested. }
-function CFReadStreamGetError( stream: CFReadStreamRef ): CFStreamError; external name '_CFReadStreamGetError';
-function CFWriteStreamGetError( stream: CFWriteStreamRef ): CFStreamError; external name '_CFWriteStreamGetError';
+{ Returns NULL if no error has occurred; otherwise returns the error. }
+function CFReadStreamCopyError( stream: CFReadStreamRef ): CFErrorRef; external name '_CFReadStreamCopyError';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+function CFWriteStreamCopyError( stream: CFWriteStreamRef ): CFErrorRef; external name '_CFWriteStreamCopyError';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
 
 { Returns success/failure.  Opening a stream causes it to reserve all the system
    resources it requires.  If the stream can open non-blocking, this will always 
@@ -285,9 +274,11 @@ function CFWriteStreamSetProperty( stream: CFWriteStreamRef; propertyName: CFStr
    run loops; It is the caller's responsibility to ensure that at least one of the 
    scheduled run loops is being run.
 
-   NOTE: not all streams provide these notifications.  If a stream does not support
-   asynchronous notification, CFStreamSetClient() will return NO; typically, such
-   streams will never block for device I/O (e.g. a stream on memory)
+   NOTE: Unlike other CoreFoundation APIs, pasing a NULL clientContext here will remove
+   the client.  If you do not care about the client context (i.e. your only concern
+   is that your callback be called), you should pass in a valid context where every
+   entry is 0 or NULL.
+
 }
 
 function CFReadStreamSetClient( stream: CFReadStreamRef; streamEvents: CFOptionFlags; clientCB: CFReadStreamClientCallBack; var clientContext: CFStreamClientContext ): Boolean; external name '_CFReadStreamSetClient';
@@ -300,4 +291,25 @@ procedure CFReadStreamUnscheduleFromRunLoop( stream: CFReadStreamRef; runLoop: C
 procedure CFWriteStreamUnscheduleFromRunLoop( stream: CFWriteStreamRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFWriteStreamUnscheduleFromRunLoop';
 
 
+{ The following API is deprecated starting in 10.5; please use CFRead/WriteStreamCopyError(), above, instead }
+const
+	kCFStreamErrorDomainCustom = -1;      { custom to the kind of stream in question }
+	kCFStreamErrorDomainPOSIX = 1;        { POSIX errno; interpret using <sys/errno.h> }
+	kCFStreamErrorDomainMacOSStatus = 2;      { OSStatus type from Carbon APIs; interpret using <MacTypes.h> }
+type
+	CFStreamErrorDomain = CFIndex;
+
+type
+	CFStreamError = record
+		domain: CFIndex; 
+		error: SInt32;
+	end;
+	CFStreamErrorPtr = ^CFStreamError;
+
+{ 0 is returned if no error has occurred.  errorDomain specifies the domain
+   in which the error code should be interpretted; pass NULL if you are not 
+   interested. }
+function CFReadStreamGetError( stream: CFReadStreamRef ): CFStreamError; external name '_CFReadStreamGetError';
+function CFWriteStreamGetError( stream: CFWriteStreamRef ): CFStreamError; external name '_CFWriteStreamGetError';
+
 end.

+ 308 - 0
packages/univint/src/DriverServices.pas

@@ -0,0 +1,308 @@
+{
+     File:       CarbonCore/DriverServices.h
+ 
+     Contains:   Driver Services Interfaces.
+ 
+     Version:    CarbonCore-783~2
+ 
+     Copyright:  © 1985-2006 by Apple Computer, Inc., all rights reserved
+ 
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit DriverServices;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes;
+{$ALIGN POWER}
+
+
+const
+	durationMicrosecond = -1;  { Microseconds are negative}
+	durationMillisecond = 1;   { Milliseconds are positive}
+	durationSecond = 1000; { 1000 * durationMillisecond}
+	durationMinute = 60000; { 60 * durationSecond,}
+	durationHour = 3600000; { 60 * durationMinute,}
+	durationDay = 86400000; { 24 * durationHour,}
+	durationNoWait = 0;   { don't block}
+	durationForever = $7FFFFFFF; { no time limit}
+
+
+type
+	Nanoseconds = UnsignedWide;
+{
+ *  UpTime()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function UpTime: AbsoluteTime; external name '_UpTime';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  GetTimeBaseInfo()
+ *  
+ *  Availability:
+ *    Mac OS X:         not available
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+
+
+{
+ *  AbsoluteToNanoseconds()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AbsoluteToNanoseconds( absoluteTime_: AbsoluteTime ): Nanoseconds; external name '_AbsoluteToNanoseconds';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AbsoluteToDuration()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AbsoluteToDuration( absoluteTime_: AbsoluteTime ): Duration; external name '_AbsoluteToDuration';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  NanosecondsToAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function NanosecondsToAbsolute( nanoseconds_: Nanoseconds ): AbsoluteTime; external name '_NanosecondsToAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  DurationToAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function DurationToAbsolute( duration_: Duration ): AbsoluteTime; external name '_DurationToAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AddAbsoluteToAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AddAbsoluteToAbsolute( absoluteTime1: AbsoluteTime; absoluteTime2: AbsoluteTime ): AbsoluteTime; external name '_AddAbsoluteToAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  SubAbsoluteFromAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function SubAbsoluteFromAbsolute( leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime ): AbsoluteTime; external name '_SubAbsoluteFromAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AddNanosecondsToAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AddNanosecondsToAbsolute( nanoseconds_: Nanoseconds; absoluteTime_: AbsoluteTime ): AbsoluteTime; external name '_AddNanosecondsToAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AddDurationToAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AddDurationToAbsolute( duration_: Duration; absoluteTime_: AbsoluteTime ): AbsoluteTime; external name '_AddDurationToAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  SubNanosecondsFromAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function SubNanosecondsFromAbsolute( nanoseconds_: Nanoseconds; absoluteTime_: AbsoluteTime ): AbsoluteTime; external name '_SubNanosecondsFromAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  SubDurationFromAbsolute()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function SubDurationFromAbsolute( duration_: Duration; absoluteTime_: AbsoluteTime ): AbsoluteTime; external name '_SubDurationFromAbsolute';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AbsoluteDeltaToNanoseconds()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AbsoluteDeltaToNanoseconds( leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime ): Nanoseconds; external name '_AbsoluteDeltaToNanoseconds';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AbsoluteDeltaToDuration()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function AbsoluteDeltaToDuration( leftAbsoluteTime: AbsoluteTime; rightAbsoluteTime: AbsoluteTime ): Duration; external name '_AbsoluteDeltaToDuration';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  DurationToNanoseconds()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function DurationToNanoseconds( theDuration: Duration ): Nanoseconds; external name '_DurationToNanoseconds';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  NanosecondsToDuration()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0.2 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.6 and later
+ }
+function NanosecondsToDuration( theNanoseconds: Nanoseconds ): Duration; external name '_NanosecondsToDuration';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+end.

+ 62 - 1
packages/univint/src/Endian.pas

@@ -515,7 +515,7 @@ end;
 
 function EndianS64_Swap( arg: SInt64 ): SInt64; inline;
 begin
-	EndianS64_Swap := (Endian32_Swap( arg and $FFFFFFFF ) shl 32) or Endian32_Swap( (arg shr 32) and $FFFFFFFF );
+	EndianS64_Swap := (SInt64( Endian32_Swap( arg and $FFFFFFFF ) ) shl 32) or Endian32_Swap( (arg shr 32) and $FFFFFFFF );
 end;
 
 {$ifc TARGET_RT_BIG_ENDIAN}
@@ -764,5 +764,66 @@ end;
 
 {$endc}
 
+function EndianS16_LtoB( arg: SInt16 ): SInt16; inline;
+begin
+  EndianS16_LtoB:=EndianS16_Swap(arg);
+end;
+
+function EndianS16_BtoL( arg: SInt16 ): SInt16; inline;
+begin
+  EndianS16_BtoL:=EndianS16_Swap(arg);
+end;
+
+function EndianU16_LtoB( arg: UInt16 ): UInt16; inline;
+begin
+  EndianU16_LtoB:=Endian16_Swap(arg);
+end;
+
+function EndianU16_BtoL( arg: UInt16 ): UInt16; inline;
+begin
+  EndianU16_BtoL:=Endian16_Swap(arg);
+end;
+
+function EndianS32_LtoB( arg: SInt32 ): SInt32; inline;
+begin
+  EndianS32_LtoB:=EndianS32_Swap(arg);
+end;
+
+function EndianS32_BtoL( arg: SInt32 ): SInt32; inline;
+begin
+  EndianS32_BtoL:=EndianS32_Swap(arg);
+end;
+
+function EndianU32_LtoB( arg: UInt32 ): UInt32; inline;
+begin
+  EndianU32_LtoB:=Endian32_Swap(arg);
+end;
+
+function EndianU32_BtoL( arg: UInt32 ): UInt32; inline;
+begin
+  EndianU32_BtoL:=Endian32_Swap(arg);
+end;
+
+function EndianS64_LtoB( arg: SInt64 ): SInt64; inline;
+begin
+  EndianS64_LtoB:=EndianS64_Swap(arg);
+end;
+
+function EndianS64_BtoL( arg: SInt64 ): SInt64; inline;
+begin
+  EndianS64_BtoL:=EndianS64_Swap(arg);
+end;
+
+function EndianU64_LtoB( arg: UInt64 ): UInt64; inline;
+begin
+  EndianU64_LtoB:=Endian64_Swap_Pascal(arg);
+end;
+
+function EndianU64_BtoL( arg: UInt64 ): UInt64; inline;
+begin
+  EndianU64_BtoL:=Endian64_Swap_Pascal(arg);
+end;
+
+
 
 end.

+ 7 - 0
packages/univint/src/MacOS.pas

@@ -69,14 +69,18 @@ uses
   CFDate,
   CFDateFormatter,
   CFDictionary,
+  CFError,
   CFFTPStream,
+  CFHTTPAuthentication,
   CFHTTPMessage,
   CFHTTPStream,
   CFHost,
   CFLocale,
   CFMachPort,
   CFMessagePort,
+  CFNetDiagnostics,
   CFNetServices,
+  CFNetworkErrorss,
   CFNotificationCenter,
   CFNumber,
   CFNumberFormatter,
@@ -84,6 +88,7 @@ uses
   CFPlugInCOM,
   CFPreferences,
   CFPropertyList,
+  CFProxySupport,
   CFRunLoop,
   CFSet,
   CFSocket,
@@ -183,6 +188,7 @@ uses
   DrawSprocket,
   DriverFamilyMatching,
   DriverGestalt,
+  DriverServices,
   DriverSynchronization,
   Endian,
   Events,
@@ -310,6 +316,7 @@ uses
   TextEdit,
   TextEncodingConverter,
   TextEncodingPlugin,
+  TextInputSources,
   TextServices,
   TextUtils,
   Threads,

File diff suppressed because it is too large
+ 1990 - 0
packages/univint/src/MacOSAll.pas


+ 1470 - 0
packages/univint/src/TextInputSources.pas

@@ -0,0 +1,1470 @@
+{
+     File:       HIToolbox/TextInputSources.h
+ 
+     Version:    HIToolbox-343~1
+ 
+     Copyright:  © 2006 Apple Inc. All rights reserved.
+ 
+}
+
+{	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+
+{
+    Modified for use with Free Pascal
+    Version 210
+    Please report any bugs to <[email protected]>
+}
+
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit TextInputSources;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
+{$setc GAP_INTERFACES_VERSION := $0210}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+{$elsec}
+	{$error Neither __ppc__ nor __i386__ is defined.}
+{$endc}
+{$setc TARGET_CPU_PPC_64 := FALSE}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_MAC := TRUE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes, CFArray, CFBase, CFDictionary, CFURL;
+{$ALIGN POWER}
+
+
+{
+ *  TextInputSources.h
+ *  
+ *  Summary:
+ *    Specifies the modern, non-Script-Manager-based interfaces for
+ *    operating on text input sources: finding information about them,
+ *    selecting/enabling/disabling them, and receiving notifications
+ *    about relevant changes.
+ *  
+ *  Discussion:
+ *    Text input sources are of three general categories: keyboard
+ *    input sources (keyboard layouts, keyboard input methods and input
+ *    modes), palette input sources (character palette, keyboard
+ *    viewer, private dictionary panels), and ink. Palette input
+ *    sources and ink input sources are categorized as non-keyboard
+ *    input sources, although palette input sources may still involve
+ *    some keyboard interaction. Keyboard input methods may be
+ *    mode-enabled (e.g. Kotoeri), in which case they may be the parent
+ *    of several input modes which are directly selectable in the user
+ *    interface (e.g. hiragana, katakana, romaji); in this case the
+ *    parent input method is not directly selectable. Non-mode-enabled
+ *    input methods are directly selectable. 
+ *    
+ *    
+ *    Some input sources are invisible to system UI; they do not appear
+ *    in the normal user interface for manipulating input sources.
+ *    Examples include input sources such as ink, the dictionary panel,
+ *    and some assistiveware; these have their own special UI for
+ *    enabling, disabling, etc. Other examples include special keyboard
+ *    layouts used by input methods, which have their own ways of
+ *    controlling use of these keyboard layouts. 
+ *    
+ *    
+ *    Some input sources are pre-installed by Apple. Other input
+ *    sources (of any type) may be installed as third party products
+ *    themselves or as part of installing certain applications. Most
+ *    non-invisible input sources may be enabled or disabled by users
+ *    using International Preferences, which displays a list of all
+ *    visible installed input sources (Setup Assistant also enables
+ *    some input sources); there is a separate UI for enabling ink.
+ *    Applications may enable or disable input sources programmatically
+ *    using some of the functions here. At least one keyboard input
+ *    source is enabled (the system ensures this). At most one ink
+ *    input source may be enabled; multiple instances of other input
+ *    source types may be enabled. 
+ *    
+ *    
+ *    Some enabled input sources are invisible but programmatically
+ *    selectable, such as ink. Some are visible but not
+ *    programmatically selectable, such as mode-savvy parent input
+ *    methods (which must be visible so that International Preferences
+ *    can display the parent input method for a group of input modes).
+ *    
+ *    
+ *    
+ *    Input modes can only be changed from disabled to enabled if their
+ *    parent input method is enabled. Input modes can only be selected
+ *    if both they and their parent input method are enabled. 
+ *     
+ *    
+ *    Exactly one keyboard input source is selected at any time; this
+ *    is the current keyboard input source. Selecting a new keyboard
+ *    input source deselects the previous keyboard input source.
+ *    Multiple palette input sources may be selected - e.g. there may
+ *    be one or more character palettes and one or more keyboard
+ *    viewers selected in addition to the selected keyboard input
+ *    source. Selecting or deselecting a palette (or ink) input source
+ *    does not affect any other input source. Input methods that
+ *    provide associated input palettes may programmatically deselect
+ *    the palette when the input method is deselected, for example.
+ }
+{
+*===============================================================================
+*   Basic type
+*===============================================================================
+}
+
+{
+ *  TISInputSourceRef
+ *  
+ *  Summary:
+ *    Opaque CF object that unambiguously (within a single process)
+ *    represents a text input source.
+ *  
+ *  Discussion:
+ *    Cannot be shared cross-process.
+ }
+type
+	TISInputSourceRef = ^SInt32; { an opaque 32-bit type }
+{
+ *  TISInputSourceGetTypeID()
+ *  
+ *  Summary:
+ *    Gets the CFTypeID of a TISInputSourceRef.
+ *  
+ *  Result:
+ *    Returns the CFTypeID of a TISInputSourceRef, for comparison with
+ *    the result of CFGetTypeID().
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISInputSourceGetTypeID: CFTypeID; external name '_TISInputSourceGetTypeID';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Property key constants,
+*
+*   Input sources may have additional properties beyond those listed here,
+*   and some input sources do not have values for some of the properties
+*   listed here. The property value for a particular input source can be
+*   obtained using TISGetInputSourceProperty. A set of specific property
+*   key-value pairs can also be used as a filter when creating a list of
+*   input sources using TISCreateInputSourceList.
+*
+*   The following keys may be used with both TISGetInputSourceProperty and
+*   TISCreateInputSourceList:
+*===============================================================================
+}
+{
+ *  kTISPropertyInputSourceCategory
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value that indicates
+ *    the category of input source.
+ *  
+ *  Discussion:
+ *    The possible values are specified by property value constants
+ *    kTISCategoryKeyboardInputSource, kTISCategoryPaletteInputSource,
+ *    kTISCategoryInkInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceCategory: CFStringRef; external name '_kTISPropertyInputSourceCategory'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceType
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value that indicates
+ *    the specific type of input source.
+ *  
+ *  Discussion:
+ *    The possible values are specified by property value constants
+ *    kTISTypeKeyboardLayout, kTISTypeKeyboardInputMethodWithoutModes,
+ *    kTISTypeKeyboardInputMethodModeEnabled,
+ *    kTISTypeKeyboardInputMode, kTISTypeCharacterPalette,
+ *    kTISTypeKeyboardViewer, kTISTypeInk.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceType: CFStringRef; external name '_kTISPropertyInputSourceType'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceIsASCIICapable
+ *  
+ *  Summary:
+ *    The property key constant for a CFBooleanRef value that indicates
+ *    whether the input source identifies itself as ASCII-capable.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceIsASCIICapable: CFStringRef; external name '_kTISPropertyInputSourceIsASCIICapable'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceIsEnableCapable
+ *  
+ *  Summary:
+ *    The property key constant for a CFBooleanRef value that indicates
+ *    whether the input source can ever (given the right conditions) be
+ *    programmatically enabled using TISEnableInputSource.
+ *  
+ *  Discussion:
+ *    This is a static property of an input source, and does not depend
+ *    on any current state. 
+ *    
+ *    Most input sources can be programmatically enabled at any time;
+ *    kTISPropertyInputSourceIsEnableCapable is true for these.
+ *    
+ *    
+ *    Some input sources can never be programmatically enabled. These
+ *    are mainly input method private keyboard layouts that are used by
+ *    the input method via TISSetInputMethodKeyboardLayoutOverride, but
+ *    which cannot be directly enabled and used as keyboard layout
+ *    input sources. kTISPropertyInputSourceIsEnableCapable is false
+ *    for these. 
+ *    
+ *    Some input sources can only be programmatically enabled under the
+ *    correct conditions. These are mainly input modes, which can only
+ *    be changed from disabled to enabled if their parent input method
+ *    is enabled (however, they can already be in the enabled state -
+ *    but not currently selectable - if their parent input method is
+ *    disabled). kTISPropertyInputSourceIsEnableCapable is true for
+ *    these.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceIsEnableCapable: CFStringRef; external name '_kTISPropertyInputSourceIsEnableCapable'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceIsSelectCapable
+ *  
+ *  Summary:
+ *    The property key constant for a CFBooleanRef value that indicates
+ *    whether the input source can ever (given the right conditions) be
+ *    programmatically selected using TISSelectInputSource.
+ *  
+ *  Discussion:
+ *    This is a static property of an input source, and does not depend
+ *    on any current state. 
+ *    
+ *    Most input sources can be programmatically selected if they are
+ *    enabled; kTISPropertyInputSourceIsSelectCapable is true for
+ *    these. 
+ *    
+ *    Some input sources can never be programmatically selected even if
+ *    they are enabled. These are mainly input methods that have modes
+ *    (parent input methods); only their modes can be selected.
+ *    kTISPropertyInputSourceIsSelectCapable is false for these.
+ *    
+ *    
+ *    Some input sources which are enabled can only be programmatically
+ *    selected under the correct conditions. These are mainly input
+ *    modes, which can only be selected if both they and their parent
+ *    input method are enabled.  kTISPropertyInputSourceIsSelectCapable
+ *    is true for these. 
+ *    
+ *    Input source which can never be enabled - i.e. for which
+ *    kTISPropertyInputSourceIsEnableCapable is false - can also never
+ *    be selected. kTISPropertyInputSourceIsSelectCapable is false for
+ *    these.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceIsSelectCapable: CFStringRef; external name '_kTISPropertyInputSourceIsSelectCapable'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceIsEnabled
+ *  
+ *  Summary:
+ *    The property key constant for a CFBooleanRef value that indicates
+ *    whether the input source is currently enabled.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceIsEnabled: CFStringRef; external name '_kTISPropertyInputSourceIsEnabled'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceIsSelected
+ *  
+ *  Summary:
+ *    The property key constant for a CFBooleanRef value that indicates
+ *    whether the input source is currently selected.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceIsSelected: CFStringRef; external name '_kTISPropertyInputSourceIsSelected'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputSourceID
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value for the unique
+ *    reverse DNS name associated with the input source.
+ *  
+ *  Discussion:
+ *    1. For keyboard input methods and for input sources of the
+ *    palette or ink category, this is typically the bundle ID, e.g.
+ *    "com.apple.Kotoeri". 
+ *    
+ *    2. For keyboard input modes, this is typically the bundle ID of
+ *    the parent input method plus a suffix that uniquely identifies
+ *    the input mode, e.g. "com.apple.Kotoeri.Katakana" (it is not the
+ *    generic input mode name used across input methods, e.g.
+ *    "com.apple.inputmethod.Japanese.Katakana"). 
+ *    
+ *    3. For keyboard layouts this is a new identification mechanism
+ *    typically structured as "com.company.keyboardlayout.name", e.g.
+ *    "com.apple.keyboardlayout.US".
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceID: CFStringRef; external name '_kTISPropertyInputSourceID'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyBundleID
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value for the reverse
+ *    DNS BundleID associated with the input source.
+ *  
+ *  Discussion:
+ *    Not valid for all input sources (especially some keyboard
+ *    layouts).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyBundleID: CFStringRef; external name '_kTISPropertyBundleID'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyInputModeID
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value that identifies
+ *    a particular usage class for input modes.
+ *  
+ *  Discussion:
+ *    For example, "com.apple.inputmethod.Japanese.Katakana" identifies
+ *    a standard Katakana-input usage class that may be associated with
+ *    input modes from several different input methods. 
+ *    
+ *    This InputModeID can be attached to a TSMDocument using
+ *    TSMSetDocumentProperty with the tag
+ *    kTSMDocumentInputModePropertyTag, in order to control which input
+ *    mode usage class should be used with that TSMDocument.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputModeID: CFStringRef; external name '_kTISPropertyInputModeID'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyLocalizedName
+ *  
+ *  Summary:
+ *    The property key constant for a CFStringRef value for the input
+ *    source's localized name for UI purposes.
+ *  
+ *  Discussion:
+ *    Uses the best match (determined by CFBundle) between the
+ *    localization being used by the caller and the available
+ *    localizations of the input source name. In some cases this may
+ *    fall back to an unlocalized name.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyLocalizedName: CFStringRef; external name '_kTISPropertyLocalizedName'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+*===============================================================================
+*   The following keys may be used with TISGetInputSourceProperty, but may NOT
+*   be used in the filter dictionary passed to TISCreateInputSourceList:
+*===============================================================================
+}
+{
+ *  kTISPropertyInputSourceLanguages
+ *  
+ *  Summary:
+ *    The property key constant for a value which is a CFArrayRef of
+ *    CFStringRefs, where each CFString is the language code for a
+ *    language that can be input using the input source.
+ *  
+ *  Discussion:
+ *    Languages codes are in the same BCP 47 format as returned by
+ *    CFLocaleCreateCanonicalLanguageIdentifierFromString. The first
+ *    language code in the array is the language for which the input
+ *    source is intended. If there is no such language (e.g. for the
+ *    Unicode Hex Input keyboard layout), the first language code is an
+ *    empty string. 
+ *    
+ *    NOTE: This key (and a corresponding value) may not be used in the
+ *    filter dictionary passed to TISCreateInputSourceList.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyInputSourceLanguages: CFStringRef; external name '_kTISPropertyInputSourceLanguages'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyUnicodeKeyLayoutData
+ *  
+ *  Summary:
+ *    The property key constant for a value which is a CFDataRef that
+ *    refers to the 'uchr' keyboard layout data for a keyboard layout
+ *    input source.
+ *  
+ *  Discussion:
+ *    The uchr data is in native-endian order. If the input source is
+ *    not a keyboard layout, or is a keyboard layout for which only
+ *    'KCHR data' is available, the value is NULL. 
+ *    
+ *    NOTE: This key (and a corresponding value) may not be used in the
+ *    filter dictionary passed to TISCreateInputSourceList.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyUnicodeKeyLayoutData: CFStringRef; external name '_kTISPropertyUnicodeKeyLayoutData'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyIconRef
+ *  
+ *  Summary:
+ *    The property key constant for an IconRef value for the input
+ *    source icon.
+ *  
+ *  Discussion:
+ *    IconRefs are the normal icon format for keyboard layouts and
+ *    input methods. If an IconRef is not available for the specified
+ *    input source, the value is NULL. 
+ *    
+ *    NOTE: This key (and a corresponding value) may not be used in the
+ *    filter dictionary passed to TISCreateInputSourceList.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyIconRef: CFStringRef; external name '_kTISPropertyIconRef'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISPropertyIconImageURL
+ *  
+ *  Summary:
+ *    The property key constant for a CFURLRef value indicating the
+ *    file containing the image (typically TIFF) to be used as the
+ *    input source icon.
+ *  
+ *  Discussion:
+ *    TIFF files are the normal icon format for input modes. If an
+ *    image file URL is not available for the specified input source,
+ *    the value will be NULL. Note that other image formats (e.g. JPEG,
+ *    PNG) may also be used in the future. 
+ *    
+ *    NOTE: This key (and a corresponding value) may not be used in the
+ *    filter dictionary passed to TISCreateInputSourceList.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISPropertyIconImageURL: CFStringRef; external name '_kTISPropertyIconImageURL'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+*===============================================================================
+*   Property value constants for input source category
+*===============================================================================
+}
+{
+ *  kTISCategoryKeyboardInputSource
+ *  
+ *  Summary:
+ *    The property value constant for one input source category value
+ *    associated with the property key kTISPropertyInputSourceCategory.
+ *  
+ *  Discussion:
+ *    This category includes keyboard layouts, keyboard input methods
+ *    (both with modes and without), and keyboard input modes. At least
+ *    one input source in this category is installed. Of all input
+ *    sources in this category, exactly one is selected; selecting a
+ *    new one deselects the previous one.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISCategoryKeyboardInputSource: CFStringRef; external name '_kTISCategoryKeyboardInputSource'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISCategoryPaletteInputSource
+ *  
+ *  Summary:
+ *    The property value constant for one input source category value
+ *    associated with the property key kTISPropertyInputSourceCategory.
+ *  
+ *  Discussion:
+ *    This category includes character palettes and keyboard viewers.
+ *    Zero or more of these can be selected.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISCategoryPaletteInputSource: CFStringRef; external name '_kTISCategoryPaletteInputSource'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISCategoryInkInputSource
+ *  
+ *  Summary:
+ *    The property value constant for one input source category value
+ *    associated with the property key kTISPropertyInputSourceCategory.
+ *  
+ *  Discussion:
+ *    Zero or one ink input sources can be installed and selected.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISCategoryInkInputSource: CFStringRef; external name '_kTISCategoryInkInputSource'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+*===============================================================================
+*   Property value constants for input source type
+*===============================================================================
+}
+{
+ *  kTISTypeKeyboardLayout
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryKeyboardInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeKeyboardLayout: CFStringRef; external name '_kTISTypeKeyboardLayout'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeKeyboardInputMethodWithoutModes
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryKeyboardInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeKeyboardInputMethodWithoutModes: CFStringRef; external name '_kTISTypeKeyboardInputMethodWithoutModes'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeKeyboardInputMethodModeEnabled
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryKeyboardInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeKeyboardInputMethodModeEnabled: CFStringRef; external name '_kTISTypeKeyboardInputMethodModeEnabled'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeKeyboardInputMode
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryKeyboardInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeKeyboardInputMode: CFStringRef; external name '_kTISTypeKeyboardInputMode'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeCharacterPalette
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryPaletteInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeCharacterPalette: CFStringRef; external name '_kTISTypeCharacterPalette'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeKeyboardViewer
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryPaletteInputSource.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeKeyboardViewer: CFStringRef; external name '_kTISTypeKeyboardViewer'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISTypeInk
+ *  
+ *  Summary:
+ *    The property value constant for one input source type value
+ *    associated with the property key kTISPropertyInputSourceType.
+ *  
+ *  Discussion:
+ *    This type belongs to the category kTISCategoryInkInputSource.
+ *    Even though it is the only type in that category, a type is
+ *    provided so that clients who donÕt need category information can
+ *    just check input source type.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISTypeInk: CFStringRef; external name '_kTISTypeInk'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+*===============================================================================
+*   Find out information about text input sources
+*===============================================================================
+}
+{
+ *  TISGetInputSourceProperty()
+ *  
+ *  Summary:
+ *    Gets value of specified property for specified input source.
+ *  
+ *  Parameters:
+ *    
+ *    inputSource:
+ *      The text input source for which a property value is requested.
+ *    
+ *    propertyKey:
+ *      The property key constant specifying the desired property value.
+ *  
+ *  Result:
+ *    Returns a pointer type appropriate for value object associated
+ *    with the property key. The specific pointer type is specified for
+ *    each key. Typically it is a CFTypeRef of some sort, but in one
+ *    case it is IconRef. The function may return NULL if the specified
+ *    property is missing or invalid for the specified input source.
+ *    The objects referred to by the pointer follow the "Get" rule and
+ *    should not be be released by the caller (unless first retained by
+ *    the caller).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISGetInputSourceProperty( inputSource: TISInputSourceRef; propertyKey: CFStringRef ): UnivPtr; external name '_TISGetInputSourceProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCreateInputSourceList()
+ *  
+ *  Summary:
+ *    Creates a list of input sources that match specified properties.
+ *  
+ *  Discussion:
+ *    This list represents a snapshot of input sources that matched the
+ *    specified properties at the time the call was made. If the caller
+ *    desires to include input sources that are installed but not
+ *    currently enabled, the includeAllInstalled parameter may be set
+ *    true. Typically this is done in order to obtain a
+ *    TISInputSourceRef for a newly-installed input source; in this
+ *    case the properties parameter would include very specific
+ *    criteria limiting the matching input sources. 
+ *    
+ *    Warning: Calling this with includeAllInstalled true can have
+ *    significant memory impact on the calling application if the
+ *    properties parameter is NULL (match all) or if it specifies
+ *    criteria that may match many installed input sources, since this
+ *    may force caching of data for all matching input sources (which
+ *    can result in allocation of up to 120K). If
+ *    TISCreateInputSourceList is being called in order to find a
+ *    specific input source or sources from among the sources included
+ *    in the list, then it is best to first call
+ *    TISCreateInputSourceList with includeAllInstalled = false and
+ *    check whether the returned array includes the desired input
+ *    source(s); if not, then call TISCreateInputSourceList again with
+ *    includeAllInstalled = true.
+ *  
+ *  Parameters:
+ *    
+ *    properties:
+ *      Dictionary of property keys and corresponding values to filter
+ *      the input source list. May be NULL, in which case no filtering
+ *      is performed.
+ *    
+ *    includeAllInstalled:
+ *      Normally false so that only enabled input sources will be
+ *      included; set true to include all installed input sources that
+ *      match the filter (see discussion).
+ *  
+ *  Result:
+ *    Returns a CFArrayRef for a list of TISInputSourceRefs that match
+ *    the specified properties.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCreateInputSourceList( properties: CFDictionaryRef; includeAllInstalled: Boolean ): CFArrayRef; external name '_TISCreateInputSourceList';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Get specific input sources
+*===============================================================================
+}
+{
+ *  TISCopyCurrentKeyboardInputSource()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the currently-selected keyboard
+ *    input source; convenience function.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyCurrentKeyboardInputSource: TISInputSourceRef; external name '_TISCopyCurrentKeyboardInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCopyCurrentKeyboardLayoutInputSource()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the keyboard layout currently
+ *    being used. If the currently-selected keyboard input source is a
+ *    keyboard layout, the TISInputSourceRef refers to that layout; if
+ *    the currently-selected keyboard input source is an input method
+ *    or mode, the TISInputSourceRef refers to the keyboard layout
+ *    being used by that input method or mode.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyCurrentKeyboardLayoutInputSource: TISInputSourceRef; external name '_TISCopyCurrentKeyboardLayoutInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCopyCurrentASCIICapableKeyboardInputSource()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the most-recently-used
+ *    ASCII-capable keyboard input source.
+ *  
+ *  Discussion:
+ *    If no ASCII-capable keyboard input source has been used yet,
+ *    returns the default ASCII-capable keyboard layout (chosen by
+ *    Setup Assistant).
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyCurrentASCIICapableKeyboardInputSource: TISInputSourceRef; external name '_TISCopyCurrentASCIICapableKeyboardInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCopyCurrentASCIICapableKeyboardLayoutInputSource()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the most-recently-used
+ *    ASCII-capable keyboard layout.
+ *  
+ *  Discussion:
+ *    If no ASCII-capable keyboard input source has been used yet,
+ *    returns the default ASCII-capable keyboard layout (chosen by
+ *    Setup Assistant). 
+ *    
+ *    This is used by input methods to get the keyboard layout that
+ *    will be used for key translation if there is no specific keyboard
+ *    layout override. 
+ *    
+ *    Note the similar TISCopyCurrentASCIICapableKeyboardInputSource,
+ *    which can return input sources that are not keyboard layouts.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyCurrentASCIICapableKeyboardLayoutInputSource: TISInputSourceRef; external name '_TISCopyCurrentASCIICapableKeyboardLayoutInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCopyInputSourceForLanguage()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the input source that should be
+ *    used to input the specified language.
+ *  
+ *  Discussion:
+ *    Sample usage: If a text field is expected to have input in a
+ *    particular language, an application can call
+ *    TISCopyInputSourceForLanguage and then TISSelectInputSource to
+ *    select an input source that would be appropriate for that
+ *    language. 
+ *    
+ *    This is intended to provide a replacement for one way in which
+ *    the now-deprecated KeyScript API was used: Selection of the
+ *    default input source associated with a particular ScriptCode.
+ *  
+ *  Parameters:
+ *    
+ *    language:
+ *      A language tag in BCP 47 format (i.e. in the same form as
+ *      returned by
+ *      CFLocaleCreateCanonicalLanguageIdentifierFromString) that
+ *      represents the language for which an input source should be
+ *      returned.
+ *  
+ *  Result:
+ *    TISInputSourceRef for an enabled input source that can input the
+ *    specified language. If there is more than one such input source
+ *    and at least one has previously been used, then the
+ *    most-recently-used one will be chosen. If none of them has
+ *    previously been used, one will be chosen based on the intended
+ *    languages of the input sources. If there is no enabled input
+ *    source that can input the specified language, the function will
+ *    return NULL.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyInputSourceForLanguage( language: CFStringRef ): TISInputSourceRef; external name '_TISCopyInputSourceForLanguage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCreateASCIICapableInputSourceList()
+ *  
+ *  Summary:
+ *    Creates a list of ASCII capable keyboard input sources.
+ *  
+ *  Discussion:
+ *    This list represents a snapshot of ASCII capable keyboard input
+ *    sources that were enabled at the time the call was made.
+ *    Successive calls to TISCreateASCIICapableInputSourceList may
+ *    return different results because, for example, in between the
+ *    calls the user may enable or disable an input source in the
+ *    International Preferences pane. When a keyboard input source is
+ *    enabled or disabled, whether by the user or programmatically, the
+ *    kTISNotifyEnabledKeyboardInputSourcesChanged CF distributed
+ *    notification is posted.
+ *  
+ *  Result:
+ *    Returns a CFArrayRef containing a list of TISInputSourceRefs.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCreateASCIICapableInputSourceList: CFArrayRef; external name '_TISCreateASCIICapableInputSourceList';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Manipulate input sources
+*===============================================================================
+}
+{
+ *  TISSelectInputSource()
+ *  
+ *  Summary:
+ *    Selects the specified input source.
+ *  
+ *  Discussion:
+ *    Calling TISSelectInputSource on a keyboard input source that can
+ *    be selected makes the specified input source the new current
+ *    keyboard input source, and deselects the previous one. Calling
+ *    TISSelectInputSource on a palette input source usually results in
+ *    the palette being displayed and available for input. Ink input
+ *    sources are typically enabled and selected at the same time.
+ *    Calling TISSelectInputSource on a palette or ink input source has
+ *    no effect on other input sources. Calling TISSelectInputSource
+ *    for an already-selected input source has no effect. 
+ *    
+ *    For TISSelectInputSource to succeed, the input source must be
+ *    capable of being selected (kTISPropertyInputSourceIsSelectCapable
+ *    must be true) and the input source must be enabled
+ *    (kTISPropertyInputSourceIsEnabled must be true). Furthermore, if
+ *    if the input source is an input mode, its parent must be enabled
+ *    for it to be selected.
+ *  
+ *  Result:
+ *    Returns an error code: paramErr if the input source is not
+ *    selectable, else noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISSelectInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISSelectInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISDeselectInputSource()
+ *  
+ *  Summary:
+ *    Deselects the specified input source.
+ *  
+ *  Discussion:
+ *    TISDeselectInputSource is only intended for use with palette or
+ *    ink input sources; calling it has no effect on other input
+ *    sources. When palette input sources are disabled, the palette
+ *    disappears. Ink input sources are usually deselected and disabled
+ *    at the same time.
+ *  
+ *  Result:
+ *    Returns an error code: paramErr if the input source is not
+ *    deselectable, else noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISDeselectInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISDeselectInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISEnableInputSource()
+ *  
+ *  Summary:
+ *    Enables the specified input source.
+ *  
+ *  Discussion:
+ *    TISEnableInputSource is mainly intended for input methods, or for
+ *    applications that supply their own input sources (e.g.
+ *    applications that provide keyboard layouts or palette input
+ *    methods, and keyboard input methods that provide their own
+ *    keyboard layouts and/or input modes). It makes the specified
+ *    input source available in UI for selection. 
+ *    
+ *    For TISEnableInputSource to succeed, the input source must be
+ *    capable of being enabled (kTISPropertyInputSourceIsEnableCapable
+ *    must be true). Furthermore, if the input source is an input mode,
+ *    its parent must already be enabled for the mode to become enabled.
+ *  
+ *  Result:
+ *    Returns an error code: paramErr if the input source cannot be
+ *    enabled, else noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISEnableInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISEnableInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISDisableInputSource()
+ *  
+ *  Summary:
+ *    Disables the specified input source.
+ *  
+ *  Discussion:
+ *    TISDisableInputSource is mainly intended for input methods, or
+ *    for applications that supply their own input sources (e.g.
+ *    applications that provide keyboard layouts or palette input
+ *    methods, and keyboard input methods that provide their own
+ *    keyboard layouts and/or input modes). It makes the specified
+ *    input source unavailable for selection, and removes it from
+ *    system UI.
+ *  
+ *  Result:
+ *    Returns an error code: paramErr if the input source cannot be
+ *    disabled, else noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISDisableInputSource( inputSource: TISInputSourceRef ): OSStatus; external name '_TISDisableInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Notification constants
+*===============================================================================
+}
+{
+ *  kTISNotifySelectedKeyboardInputSourceChanged
+ *  
+ *  Summary:
+ *    The name of the CF distributed notification for a change to the
+ *    selected keyboard input source.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISNotifySelectedKeyboardInputSourceChanged: CFStringRef; external name '_kTISNotifySelectedKeyboardInputSourceChanged'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+ *  kTISNotifyEnabledKeyboardInputSourcesChanged
+ *  
+ *  Summary:
+ *    The name of the CF distributed notification for a change to the
+ *    set of enabled keyboard input sources.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+var kTISNotifyEnabledKeyboardInputSourcesChanged: CFStringRef; external name '_kTISNotifyEnabledKeyboardInputSourcesChanged'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{
+*===============================================================================
+*   Allow input method to override keyboard layout
+*===============================================================================
+}
+{
+ *  TISSetInputMethodKeyboardLayoutOverride()
+ *  
+ *  Summary:
+ *    Sets the keyboard layout override for an input method or mode.
+ *  
+ *  Discussion:
+ *    When an input method or mode is the selected input source, TSM
+ *    will by default use the most-recently-used ASCII-capable keyboard
+ *    layout to translate key events* (this keyboard layout is also the
+ *    one that will appear in Keyboard Viewer); an input source for
+ *    this keyboard layout is returned by
+ *    TISCopyCurrentASCIICapableKeyboardLayout. If a different keyboard
+ *    layout should be used for a particular input method or mode, then
+ *    when that input method/mode is activated it should call
+ *    TISSetInputMethodKeyboardLayoutOverride to specify the desired
+ *    keyboard layout. 
+ *    
+ *    For example, when a Kotoeri user selects kana layout for kana
+ *    input, Kotoeri should call
+ *    TISSetInputMethodKeyboardLayoutOverride to set the kana keyboard
+ *    as the override for the appropriate input modes. 
+ *    
+ *    The keyboard layout set in this way will be used for the final
+ *    stage of key translation in the Window Server - the connection or
+ *    application-specific key translation. 
+ *    
+ *    The override setting is lost when the input method that set it is
+ *    deactivated. 
+ *    
+ *    The keyboardLayout to be used for overriding need not be enabled
+ *    or explicitly selectable. It can be a non-selectable layout that
+ *    is included in an input method bundle and automatically
+ *    registered. 
+ *    
+ *    *The default behavior is new for Mac OS X 10.5, and is meant to
+ *    eliminate the necessity for input methods to have UI for setting
+ *    which ASCII- capable keyboard to use for latin-character-based
+ *    phonetic input.
+ *  
+ *  Parameters:
+ *    
+ *    keyboardLayout:
+ *      TISInputSourceRef for the keyboard layout that should be used
+ *      until the current input method is deactivated (if it should be
+ *      something other than the most-recently-used ASCII-capable
+ *      keyboard layout).
+ *  
+ *  Result:
+ *    Returns an error code: paramErr if the current keyboard input
+ *    source is not an input method/mode or if keyboardLayout does not
+ *    designate a keyboard layout, else noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISSetInputMethodKeyboardLayoutOverride( keyboardLayout: TISInputSourceRef ): OSStatus; external name '_TISSetInputMethodKeyboardLayoutOverride';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  TISCopyInputMethodKeyboardLayoutOverride()
+ *  
+ *  Summary:
+ *    Copies a TISInputSourceRef for the currently-selected input
+ *    method's keyboard layout override, if any.
+ *  
+ *  Result:
+ *    If the current keyboard input source is an input method or mode
+ *    that has a keyboard layout override, then a TISInputSourceRef for
+ *    that keyboard layout is returned; otherwise, NULL is returned.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISCopyInputMethodKeyboardLayoutOverride: TISInputSourceRef; external name '_TISCopyInputMethodKeyboardLayoutOverride';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Install/register an input source
+*===============================================================================
+}
+{
+ *  TISRegisterInputSource()
+ *  
+ *  Summary:
+ *    Registers the new input source(s) in a file or bundle so that a
+ *    TISInputSourceRef can immediately be obtained for each of the new
+ *    input source(s).
+ *  
+ *  Discussion:
+ *    This allows an installer for an input method bundle or a keyboard
+ *    layout file or bundle to notify the system that these new input
+ *    sources should be registered. The system can then locate the
+ *    specified file or bundle and perform any necessary cache rebuilds
+ *    so that the installer can immediately call
+ *    TISCreateInputSourceList with appropriate properties (e.g.
+ *    BundleID or InputSourceID) in order to get TISInputSourceRefs for
+ *    one or more of the newly registered input sources. 
+ *    
+ *    This can only be used to register the following: 
+ *    
+ *    - Keyboard layout files or bundles in "/Library/Keyboard
+ *    Layouts/" or "~/Library/Keyboard Layouts/" (available to all
+ *    users or current user, respectively). Such keyboard layouts, once
+ *    enabled, are selectable. 
+ *    
+ *    - Input method bundles in the new "/Library/Input Methods/" or
+ *    "~/Library/Input Methods/" directories (available to all users or
+ *    current user, respectively). 
+ *    
+ *    Note: Input method bundles can include private non-selectable
+ *    keyboard layouts for use with
+ *    TISSetInputMethodKeyboardLayoutOverride. These are registered
+ *    automatically when the input method is registered, and do not
+ *    need to be separately registered. 
+ *    
+ *    Security: Any code that calls TISRegisterInputSource is part of
+ *    an application or service that has already been validated in some
+ *    way (e.g. by the user).
+ *  
+ *  Parameters:
+ *    
+ *    location:
+ *      CFURLRef for the location of the input source(s), a file or
+ *      bundle.
+ *  
+ *  Result:
+ *    Error code: paramErr if location is invalid or the input
+ *    source(s) in the specified location cannot be registered;
+ *    otherwise noErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function TISRegisterInputSource( location: CFURLRef ): OSStatus; external name '_TISRegisterInputSource';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+*===============================================================================
+*   Text Input Sources properties and bundle-packaged text input sources
+*===============================================================================
+*
+*   For Leopard, there are two new keys for use in plists to provide information
+*   that supports the Text Input Sources functions above (these keys will be
+*   ignored in earlier systems):
+*
+*   "TISInputSourceID" - a key to specify the InputSourceID, a reverse-DNS-style
+*   string meant to uniquely identify any input source. If this key is not
+*   specified, the Text Input Sources functions will attempt to construct an
+*   InputSourceID from other information.
+*
+*   "TISIntendedLanguage" - a key to specify the primary language which the
+*   input source is intended to input. If there is none - as with the Unicode
+*   Hex Input key layout, for example - this key need not be specified. The
+*   language is indicated by a string in in the format described by BCP 47
+*   (the successor to RFC 3066).
+*
+*   How these keys are used depends on the type of input source, as described
+*   below.
+*
+*   1. Keyboard layouts ( in <domain>/Library/Keyboard Layouts/ )
+*
+*   Keyboard layouts packaged in bundles use either a resource file or a set of
+*   xml keylayout files together with optional icns files. The following example
+*   shows the two methods of packaging a set of two key layouts in Unicode 'uchr'
+*   format with key layout names "MyLayoutOne" and "MyLayoutTwo" and corresponding
+*   numeric IDs -9001 and -9002 (see Tech Note 2056).
+*
+*   MyKeyboardLayouts.bundle/
+*       Contents/
+*           Info.plist
+*           version.plist
+*           Resources/
+*               MyKeyboardLayouts.rsrc, containing the following resources:
+*                   resources 'uchr' (-9001, "MyLayoutOne"), 'kcs#' (-9001), 'kcs4' (-9001)
+*                   resources 'uchr' (-9002, "MyLayoutTwo"), 'kcs#' (-9002), 'kcs4' (-9002)
+*               en.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
+*               ja.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
+*               ...
+*
+*   MyKeyboardLayouts.bundle/
+*       Contents/
+*           Info.plist
+*           version.plist
+*           Resources/
+*               MyLayoutOne.keylayout, specifying name="MyLayoutOne" and id=-9001
+*               MyLayoutOne.icns (optional)
+*               MyLayoutTwo.keylayout, specifying name="MyLayoutTwo" and id=-9002
+*               MyLayoutTwo.icns (optional)
+*               en.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
+*               ja.lproj/InfoPlist.strings, maps "MyLayoutOne" & "MyLayoutTwo" to localized names
+*               ...
+*
+*   In the Info.plist file, the value for the CFBundleIdentifier key must be a
+*   string that includes ".keyboardlayout."; typically this might be something
+*   like "com.companyname.keyboardlayout.MyKeyboardLayouts" (Before Leopard,
+*   it was required to be a string that began "com.apple.keyboardlayout", even
+*   for keyboard layouts not supplied by Apple).
+*
+*   A dictionary of properties for each key layout in the bundle should be
+*   provided using a key of the form "KLInfo_keylayoutname" (even if
+*   keylayoutname includes spaces or punctuation). This dictionary is where to
+*   specify the keys "TISInputSourceID" and "TISIntendedLanguage" and their
+*   associated values.
+*
+*   "TISInputSourceID" note: For keyboard layouts this should typically be
+*   something like "com.companyname.keylayout.keylayoutname". If this key is
+*   not specified, an InputSourceID will be constructed by combining
+*   bundleID + ". keylayout." + keylayoutname.
+*
+*   If the keyboard layouts in the above example were intended to input
+*   Azerbaijani in Latin script, then the Info.plist entries could be:
+*
+*       <key>KLInfo_MyLayoutOne</key>
+*       <dict>
+*           <key>TISInputSourceID</key>
+*           <string>com.companyname.keylayout.MyLayoutOne</string>
+*           <key>TISIntendedLanguage</key>
+*           <string>az-Latn</string>
+*       </dict>
+*       <key>KLInfo_MyLayoutTwo</key>
+*       <dict>
+*           <key>TISInputSourceID</key>
+*           <string>com.companyname.keylayout.MyLayoutTwo</string>
+*           <key>TISIntendedLanguage</key>
+*           <string>az-Latn</string>
+*       </dict>
+*
+*   2. Input methods
+*
+*   Input methods are always packaged as bundles, either as Component bundles
+*   in "<domain>/Library/Components/" (the old way, still supported in Leopard)
+*   or as application bundles in "<domain>/Library/Input Methods/" (new for
+*   Leopard).
+*
+*   The new keys keys "TISInputSourceID" and "TISIntendedLanguage" and their
+*   associated values are added at the top level of the Info.plist file.
+*
+*   "TISInputSourceID" note: For input methods this is typically the same as
+*   the BundleID, and if this key is not specified the BundleID will be used
+*   as the InputSourceID.
+*
+*   3. Input modes
+*
+*   An input method's input modes are defined using the "ComponentInputModeDict"
+*   key at the top level of the input method's Info.plist file (even for
+*   non-component application-based input methods). The value of this key is a
+*   dictionary, one of whose keys is "tsInputModeListKey"; the value of this
+*   key is also a dictionary of input modes, with the InputModeID as the key
+*   and the input mode's dictionary as the value (see TextServices.h).
+*
+*   The new keys keys "TISInputSourceID" and "TISIntendedLanguage" and their
+*   associated values are added to the input mode's dictionary.
+*
+*   "TISInputSourceID" note: For input modes this is a string that begins with
+*   the parent input method's InputSourceID or BundleID, followed by something
+*   that identifies the mode. For example, "com.apple.Kotoeri.Japanese.Katakana".
+*   In general it is not necessarily the same as the InputModeID, since a
+*   particular InputModeID such as "com.apple.inputmethod.Japanese.Katakana"
+*   may be used by multiple input methods. If this key is not specified, an
+*   InputSourceID will be constructed by combining the BundleID with an
+*   InputModeID suffix formed by deleting any prefix that matches the BundleID
+*   or that ends in ".inputmethod."
+}
+{
+*===============================================================================
+}
+
+
+end.

Some files were not shown because too many files changed in this diff