mirror of
https://github.com/darlinghq/darling-corefoundation.git
synced 2024-11-26 21:30:22 +00:00
Create proper include directory for CoreFoundation
This commit is contained in:
parent
9f7c99bb2b
commit
5a22df59f9
696
CFArray.h
696
CFArray.h
@ -1,696 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFArray.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@header CFArray
|
||||
CFArray implements an ordered, compact container of pointer-sized
|
||||
values. Values are accessed via integer keys (indices), from the
|
||||
range 0 to N-1, where N is the number of values in the array when
|
||||
an operation is performed. The array is said to be "compact" because
|
||||
deleted or inserted values do not leave a gap in the key space --
|
||||
the values with higher-numbered indices have their indices
|
||||
renumbered lower (or higher, in the case of insertion) so that the
|
||||
set of valid indices is always in the integer range [0, N-1]. Thus,
|
||||
the index to access a particular value in the array may change over
|
||||
time as other values are inserted into or deleted from the array.
|
||||
|
||||
Arrays come in two flavors, immutable, which cannot have values
|
||||
added to them or removed from them after the array is created, and
|
||||
mutable, to which you can add values or from which remove values.
|
||||
Mutable arrays can have an unlimited number of values (or rather,
|
||||
limited only by constraints external to CFArray, like the amount
|
||||
of available memory).
|
||||
|
||||
As with all CoreFoundation collection types, arrays maintain hard
|
||||
references on the values you put in them, but the retaining and
|
||||
releasing functions are user-defined callbacks that can actually do
|
||||
whatever the user wants (for example, nothing).
|
||||
|
||||
Computational Complexity
|
||||
The access time for a value in the array is guaranteed to be at
|
||||
worst O(lg N) for any implementation, current and future, but will
|
||||
often be O(1) (constant time). Linear search operations similarly
|
||||
have a worst case complexity of O(N*lg N), though typically the
|
||||
bounds will be tighter, and so on. Insertion or deletion operations
|
||||
will typically be linear in the number of values in the array, but
|
||||
may be O(N*lg N) clearly in the worst case in some implementations.
|
||||
There are no favored positions within the array for performance;
|
||||
that is, it is not necessarily faster to access values with low
|
||||
indices, or to insert or delete values with high indices, or
|
||||
whatever.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFARRAY__)
|
||||
#define __COREFOUNDATION_CFARRAY__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFArrayCallBacks
|
||||
Structure containing the callbacks of a CFArray.
|
||||
@field version The version number of the structure type being passed
|
||||
in as a parameter to the CFArray creation functions. This
|
||||
structure is version 0.
|
||||
@field retain The callback used to add a retain for the array on
|
||||
values as they are put into the array. This callback returns
|
||||
the value to store in the array, which is usually the value
|
||||
parameter passed to this callback, but may be a different
|
||||
value if a different value should be stored in the array.
|
||||
The array's allocator is passed as the first argument.
|
||||
@field release The callback used to remove a retain previously added
|
||||
for the array from values as they are removed from the
|
||||
array. The array's allocator is passed as the first
|
||||
argument.
|
||||
@field copyDescription The callback used to create a descriptive
|
||||
string representation of each value in the array. This is
|
||||
used by the CFCopyDescription() function.
|
||||
@field equal The callback used to compare values in the array for
|
||||
equality for some operations.
|
||||
*/
|
||||
typedef const void * (*CFArrayRetainCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef void (*CFArrayReleaseCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef CFStringRef (*CFArrayCopyDescriptionCallBack)(const void *value);
|
||||
typedef Boolean (*CFArrayEqualCallBack)(const void *value1, const void *value2);
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CFArrayRetainCallBack retain;
|
||||
CFArrayReleaseCallBack release;
|
||||
CFArrayCopyDescriptionCallBack copyDescription;
|
||||
CFArrayEqualCallBack equal;
|
||||
} CFArrayCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFTypeArrayCallBacks
|
||||
Predefined CFArrayCallBacks structure containing a set of callbacks
|
||||
appropriate for use when the values in a CFArray are all CFTypes.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFArrayCallBacks kCFTypeArrayCallBacks;
|
||||
|
||||
/*!
|
||||
@typedef CFArrayApplierFunction
|
||||
Type of the callback function used by the apply functions of
|
||||
CFArrays.
|
||||
@param value The current value from the array.
|
||||
@param context The user-defined context parameter given to the apply
|
||||
function.
|
||||
*/
|
||||
typedef void (*CFArrayApplierFunction)(const void *value, void *context);
|
||||
|
||||
/*!
|
||||
@typedef CFArrayRef
|
||||
This is the type of a reference to immutable CFArrays.
|
||||
*/
|
||||
typedef const struct CF_BRIDGED_TYPE(NSArray) __CFArray * CFArrayRef;
|
||||
|
||||
/*!
|
||||
@typedef CFMutableArrayRef
|
||||
This is the type of a reference to mutable CFArrays.
|
||||
*/
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableArray) __CFArray * CFMutableArrayRef;
|
||||
|
||||
/*!
|
||||
@function CFArrayGetTypeID
|
||||
Returns the type identifier of all CFArray instances.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFTypeID CFArrayGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFArrayCreate
|
||||
Creates a new immutable array with the given values.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 values A C array of the pointer-sized values to be in the
|
||||
array. The values in the array are ordered in the same order
|
||||
in which they appear in this C array. This parameter may be
|
||||
NULL if the numValues parameter is 0. This C array is not
|
||||
changed or freed by this function. If this parameter is not
|
||||
a valid pointer to a C array of at least numValues pointers,
|
||||
the behavior is undefined.
|
||||
@param numValues The number of values to copy from the values C
|
||||
array into the CFArray. This number will be the count of the
|
||||
array.
|
||||
If this parameter is negative, or greater than the number of
|
||||
values actually in the value's C array, the behavior is
|
||||
undefined.
|
||||
@param callBacks A pointer to a CFArrayCallBacks structure
|
||||
initialized with the callbacks for the array to use on each
|
||||
value in the array. The retain callback will be used within
|
||||
this function, for example, to retain all of the new values
|
||||
from the values C array. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a
|
||||
structure on the stack can be passed in, or can be reused
|
||||
for multiple array creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFArray, the behavior is undefined. The retain field may be
|
||||
NULL, in which case the CFArray will do nothing to add a
|
||||
retain to the contained values for the array. The release
|
||||
field may be NULL, in which case the CFArray will do nothing
|
||||
to remove the array's retain (if any) on the values when the
|
||||
array is destroyed. If the copyDescription field is NULL,
|
||||
the array will create a simple description for the value. If
|
||||
the equal field is NULL, the array will use pointer equality
|
||||
to test for equality of values. This callbacks parameter
|
||||
itself may be NULL, which is treated as if a valid structure
|
||||
of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFArrayCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
array is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is
|
||||
undefined.
|
||||
@result A reference to the new immutable CFArray.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks);
|
||||
|
||||
/*!
|
||||
@function CFArrayCreateCopy
|
||||
Creates a new immutable array with the values from the given array.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theArray The array which is to be copied. The values from the
|
||||
array are copied as pointers into the new array (that is,
|
||||
the values themselves are copied, not that which the values
|
||||
point to, if anything). However, the values are also
|
||||
retained by the new array. The count of the new array will
|
||||
be the same as the given array. The new array uses the same
|
||||
callbacks as the array to be copied. If this parameter is
|
||||
not a valid CFArray, the behavior is undefined.
|
||||
@result A reference to the new immutable CFArray.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef theArray);
|
||||
|
||||
/*!
|
||||
@function CFArrayCreateMutable
|
||||
Creates a new empty mutable array.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFArray. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. An array's actual capacity is only limited by
|
||||
address space and available memory constraints). If this
|
||||
parameter is negative, the behavior is undefined.
|
||||
@param callBacks A pointer to a CFArrayCallBacks structure
|
||||
initialized with the callbacks for the array to use on each
|
||||
value in the array. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a
|
||||
structure on the stack can be passed in, or can be reused
|
||||
for multiple array creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFArray, the behavior is undefined. The retain field may be
|
||||
NULL, in which case the CFArray will do nothing to add a
|
||||
retain to the contained values for the array. The release
|
||||
field may be NULL, in which case the CFArray will do nothing
|
||||
to remove the array's retain (if any) on the values when the
|
||||
array is destroyed. If the copyDescription field is NULL,
|
||||
the array will create a simple description for the value. If
|
||||
the equal field is NULL, the array will use pointer equality
|
||||
to test for equality of values. This callbacks parameter
|
||||
itself may be NULL, which is treated as if a valid structure
|
||||
of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFArrayCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
array is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is
|
||||
undefined.
|
||||
@result A reference to the new mutable CFArray.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks);
|
||||
|
||||
/*!
|
||||
@function CFArrayCreateMutableCopy
|
||||
Creates a new mutable array with the values from the given array.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFArray. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. An array's actual capacity is only limited by
|
||||
address space and available memory constraints).
|
||||
This parameter must be greater than or equal
|
||||
to the count of the array which is to be copied, or the
|
||||
behavior is undefined. If this parameter is negative, the
|
||||
behavior is undefined.
|
||||
@param theArray The array which is to be copied. The values from the
|
||||
array are copied as pointers into the new array (that is,
|
||||
the values themselves are copied, not that which the values
|
||||
point to, if anything). However, the values are also
|
||||
retained by the new array. The count of the new array will
|
||||
be the same as the given array. The new array uses the same
|
||||
callbacks as the array to be copied. If this parameter is
|
||||
not a valid CFArray, the behavior is undefined.
|
||||
@result A reference to the new mutable CFArray.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetCount
|
||||
Returns the number of values currently in the array.
|
||||
@param theArray The array to be queried. If this parameter is not a valid
|
||||
CFArray, the behavior is undefined.
|
||||
@result The number of values in the array.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFArrayGetCount(CFArrayRef theArray);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetCountOfValue
|
||||
Counts the number of times the given value occurs in the array.
|
||||
@param theArray The array to be searched. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param range The range within the array to search. If the range
|
||||
location or end point (defined by the location plus length
|
||||
minus 1) is outside the index space of the array (0 to
|
||||
N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
@param value The value for which to find matches in the array. The
|
||||
equal() callback provided when the array was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the array, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The number of times the given value occurs in the array,
|
||||
within the specified range.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFArrayGetCountOfValue(CFArrayRef theArray, CFRange range, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayContainsValue
|
||||
Reports whether or not the value is in the array.
|
||||
@param theArray The array to be searched. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param range The range within the array to search. If the range
|
||||
location or end point (defined by the location plus length
|
||||
minus 1) is outside the index space of the array (0 to
|
||||
N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
@param value The value for which to find matches in the array. The
|
||||
equal() callback provided when the array was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the array, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result true, if the value is in the specified range of the array,
|
||||
otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFArrayContainsValue(CFArrayRef theArray, CFRange range, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetValueAtIndex
|
||||
Retrieves the value at the given index.
|
||||
@param theArray The array to be queried. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param idx The index of the value to retrieve. If the index is
|
||||
outside the index space of the array (0 to N-1 inclusive,
|
||||
where N is the count of the array), the behavior is
|
||||
undefined.
|
||||
@result The value with the given index in the array.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetValues
|
||||
Fills the buffer with values from the array.
|
||||
@param theArray The array to be queried. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param range The range of values within the array to retrieve. If
|
||||
the range location or end point (defined by the location
|
||||
plus length minus 1) is outside the index space of the
|
||||
array (0 to N-1 inclusive, where N is the count of the
|
||||
array), the behavior is undefined. If the range length is
|
||||
negative, the behavior is undefined. The range may be empty
|
||||
(length 0), in which case no values are put into the buffer.
|
||||
@param values A C array of pointer-sized values to be filled with
|
||||
values from the array. The values in the C array are ordered
|
||||
in the same order in which they appear in the array. If this
|
||||
parameter is not a valid pointer to a C array of at least
|
||||
range.length pointers, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayGetValues(CFArrayRef theArray, CFRange range, const void **values);
|
||||
|
||||
/*!
|
||||
@function CFArrayApplyFunction
|
||||
Calls a function once for each value in the array.
|
||||
@param theArray The array to be operated upon. If this parameter is not
|
||||
a valid CFArray, the behavior is undefined.
|
||||
@param range The range of values within the array to which to apply
|
||||
the function. If the range location or end point (defined by
|
||||
the location plus length minus 1) is outside the index
|
||||
space of the array (0 to N-1 inclusive, where N is the count
|
||||
of the array), the behavior is undefined. If the range
|
||||
length is negative, the behavior is undefined. The range may
|
||||
be empty (length 0).
|
||||
@param applier The callback function to call once for each value in
|
||||
the given range in the array. If this parameter is not a
|
||||
pointer to a function of the correct prototype, the behavior
|
||||
is undefined. If there are values in the range which the
|
||||
applier function does not expect or cannot properly apply
|
||||
to, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the second parameter to the applier function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the applier function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayApplyFunction(CFArrayRef theArray, CFRange range, CFArrayApplierFunction applier, void *context);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetFirstIndexOfValue
|
||||
Searches the array for the value.
|
||||
@param theArray The array to be searched. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param range The range within the array to search. If the range
|
||||
location or end point (defined by the location plus length
|
||||
minus 1) is outside the index space of the array (0 to
|
||||
N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
The search progresses from the smallest index defined by
|
||||
the range to the largest.
|
||||
@param value The value for which to find a match in the array. The
|
||||
equal() callback provided when the array was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the array, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The lowest index of the matching values in the range, or
|
||||
kCFNotFound if no value in the range matched.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayGetLastIndexOfValue
|
||||
Searches the array for the value.
|
||||
@param theArray The array to be searched. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined.
|
||||
@param range The range within the array to search. If the range
|
||||
location or end point (defined by the location plus length
|
||||
minus 1) is outside the index space of the array (0 to
|
||||
N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
The search progresses from the largest index defined by the
|
||||
range to the smallest.
|
||||
@param value The value for which to find a match in the array. The
|
||||
equal() callback provided when the array was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the array, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The highest index of the matching values in the range, or
|
||||
kCFNotFound if no value in the range matched.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFArrayGetLastIndexOfValue(CFArrayRef theArray, CFRange range, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayBSearchValues
|
||||
Searches the array for the value using a binary search algorithm.
|
||||
@param theArray The array to be searched. If this parameter is not a
|
||||
valid CFArray, the behavior is undefined. If the array is
|
||||
not sorted from least to greatest according to the
|
||||
comparator function, the behavior is undefined.
|
||||
@param range The range within the array to search. If the range
|
||||
location or end point (defined by the location plus length
|
||||
minus 1) is outside the index space of the array (0 to
|
||||
N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
@param value The value for which to find a match in the array. If
|
||||
value, or any of the values in the array, are not understood
|
||||
by the comparator callback, the behavior is undefined.
|
||||
@param comparator The function with the comparator function type
|
||||
signature which is used in the binary search operation to
|
||||
compare values in the array with the given value. If this
|
||||
parameter is not a pointer to a function of the correct
|
||||
prototype, the behavior is undefined. If there are values
|
||||
in the range which the comparator function does not expect
|
||||
or cannot properly compare, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the third parameter to the comparator function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the comparator function, the behavior is
|
||||
undefined.
|
||||
@result The return value is either 1) the index of a value that
|
||||
matched, if the target value matches one or more in the
|
||||
range, 2) greater than or equal to the end point of the
|
||||
range, if the value is greater than all the values in the
|
||||
range, or 3) the index of the value greater than the target
|
||||
value, if the value lies between two of (or less than all
|
||||
of) the values in the range.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFArrayBSearchValues(CFArrayRef theArray, CFRange range, const void *value, CFComparatorFunction comparator, void *context);
|
||||
|
||||
/*!
|
||||
@function CFArrayAppendValue
|
||||
Adds the value to the array giving it a new largest index.
|
||||
@param theArray The array to which the value is to be added. If this
|
||||
parameter is not a valid mutable CFArray, the behavior is
|
||||
undefined.
|
||||
@param value The value to add to the array. The value is retained by
|
||||
the array using the retain callback provided when the array
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The value is
|
||||
assigned to the index one larger than the previous largest
|
||||
index, and the count of the array is increased by one.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayInsertValueAtIndex
|
||||
Adds the value to the array, giving it the given index.
|
||||
@param theArray The array to which the value is to be added. If this
|
||||
parameter is not a valid mutable CFArray, the behavior is
|
||||
undefined.
|
||||
@param idx The index to which to add the new value. If the index is
|
||||
outside the index space of the array (0 to N inclusive,
|
||||
where N is the count of the array before the operation), the
|
||||
behavior is undefined. If the index is the same as N, this
|
||||
function has the same effect as CFArrayAppendValue().
|
||||
@param value The value to add to the array. The value is retained by
|
||||
the array using the retain callback provided when the array
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The value is
|
||||
assigned to the given index, and all values with equal and
|
||||
larger indices have their indexes increased by one.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayInsertValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArraySetValueAtIndex
|
||||
Changes the value with the given index in the array.
|
||||
@param theArray The array in which the value is to be changed. If this
|
||||
parameter is not a valid mutable CFArray, the behavior is
|
||||
undefined.
|
||||
@param idx The index to which to set the new value. If the index is
|
||||
outside the index space of the array (0 to N inclusive,
|
||||
where N is the count of the array before the operation), the
|
||||
behavior is undefined. If the index is the same as N, this
|
||||
function has the same effect as CFArrayAppendValue().
|
||||
@param value The value to set in the array. The value is retained by
|
||||
the array using the retain callback provided when the array
|
||||
was created, and the previous value with that index is
|
||||
released. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The indices of
|
||||
other values is not affected.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFArrayRemoveValueAtIndex
|
||||
Removes the value with the given index from the array.
|
||||
@param theArray The array from which the value is to be removed. If
|
||||
this parameter is not a valid mutable CFArray, the behavior
|
||||
is undefined.
|
||||
@param idx The index from which to remove the value. If the index is
|
||||
outside the index space of the array (0 to N-1 inclusive,
|
||||
where N is the count of the array before the operation), the
|
||||
behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayRemoveValueAtIndex(CFMutableArrayRef theArray, CFIndex idx);
|
||||
|
||||
/*!
|
||||
@function CFArrayRemoveAllValues
|
||||
Removes all the values from the array, making it empty.
|
||||
@param theArray The array from which all of the values are to be
|
||||
removed. If this parameter is not a valid mutable CFArray,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayRemoveAllValues(CFMutableArrayRef theArray);
|
||||
|
||||
/*!
|
||||
@function CFArrayReplaceValues
|
||||
Replaces a range of values in the array.
|
||||
@param theArray The array from which all of the values are to be
|
||||
removed. If this parameter is not a valid mutable CFArray,
|
||||
the behavior is undefined.
|
||||
@param range The range of values within the array to replace. If the
|
||||
range location or end point (defined by the location plus
|
||||
length minus 1) is outside the index space of the array (0
|
||||
to N inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0),
|
||||
in which case the new values are merely inserted at the
|
||||
range location.
|
||||
@param newValues A C array of the pointer-sized values to be placed
|
||||
into the array. The new values in the array are ordered in
|
||||
the same order in which they appear in this C array. This
|
||||
parameter may be NULL if the newCount parameter is 0. This
|
||||
C array is not changed or freed by this function. If this
|
||||
parameter is not a valid pointer to a C array of at least
|
||||
newCount pointers, the behavior is undefined.
|
||||
@param newCount The number of values to copy from the values C
|
||||
array into the CFArray. If this parameter is different than
|
||||
the range length, the excess newCount values will be
|
||||
inserted after the range, or the excess range values will be
|
||||
deleted. This parameter may be 0, in which case no new
|
||||
values are replaced into the array and the values in the
|
||||
range are simply removed. If this parameter is negative, or
|
||||
greater than the number of values actually in the newValues
|
||||
C array, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayReplaceValues(CFMutableArrayRef theArray, CFRange range, const void **newValues, CFIndex newCount);
|
||||
|
||||
/*!
|
||||
@function CFArrayExchangeValuesAtIndices
|
||||
Exchanges the values at two indices of the array.
|
||||
@param theArray The array of which the values are to be swapped. If
|
||||
this parameter is not a valid mutable CFArray, the behavior
|
||||
is undefined.
|
||||
@param idx1 The first index whose values should be swapped. If the
|
||||
index is outside the index space of the array (0 to N-1
|
||||
inclusive, where N is the count of the array before the
|
||||
operation), the behavior is undefined.
|
||||
@param idx2 The second index whose values should be swapped. If the
|
||||
index is outside the index space of the array (0 to N-1
|
||||
inclusive, where N is the count of the array before the
|
||||
operation), the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayExchangeValuesAtIndices(CFMutableArrayRef theArray, CFIndex idx1, CFIndex idx2);
|
||||
|
||||
/*!
|
||||
@function CFArraySortValues
|
||||
Sorts the values in the array using the given comparison function.
|
||||
@param theArray The array whose values are to be sorted. If this
|
||||
parameter is not a valid mutable CFArray, the behavior is
|
||||
undefined.
|
||||
@param range The range of values within the array to sort. If the
|
||||
range location or end point (defined by the location plus
|
||||
length minus 1) is outside the index space of the array (0
|
||||
to N-1 inclusive, where N is the count of the array), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0).
|
||||
@param comparator The function with the comparator function type
|
||||
signature which is used in the sort operation to compare
|
||||
values in the array with the given value. If this parameter
|
||||
is not a pointer to a function of the correct prototype, the
|
||||
the behavior is undefined. If there are values in the array
|
||||
which the comparator function does not expect or cannot
|
||||
properly compare, the behavior is undefined. The values in
|
||||
the range are sorted from least to greatest according to
|
||||
this function.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the third parameter to the comparator function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the comparator function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArraySortValues(CFMutableArrayRef theArray, CFRange range, CFComparatorFunction comparator, void *context);
|
||||
|
||||
/*!
|
||||
@function CFArrayAppendArray
|
||||
Adds the values from an array to another array.
|
||||
@param theArray The array to which values from the otherArray are to
|
||||
be added. If this parameter is not a valid mutable CFArray,
|
||||
the behavior is undefined.
|
||||
@param otherArray The array providing the values to be added to the
|
||||
array. If this parameter is not a valid CFArray, the
|
||||
behavior is undefined.
|
||||
@param otherRange The range within the otherArray from which to add
|
||||
the values to the array. If the range location or end point
|
||||
(defined by the location plus length minus 1) is outside
|
||||
the index space of the otherArray (0 to N-1 inclusive, where
|
||||
N is the count of the otherArray), the behavior is
|
||||
undefined. The new values are retained by the array using
|
||||
the retain callback provided when the array was created. If
|
||||
the values are not of the sort expected by the retain
|
||||
callback, the behavior is undefined. The values are assigned
|
||||
to the indices one larger than the previous largest index
|
||||
in the array, and beyond, and the count of the array is
|
||||
increased by range.length. The values are assigned new
|
||||
indices in the array from smallest to largest index in the
|
||||
order in which they appear in the otherArray.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFARRAY__ */
|
||||
|
@ -1,40 +0,0 @@
|
||||
#if !defined(__COREFOUNDATION_CFATTRIBUTEDSTRING__)
|
||||
#define __COREFOUNDATION_CFATTRIBUTEDSTRING__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef const struct __CFAttributedString *CFAttributedStringRef;
|
||||
typedef struct __CFAttributedString *CFMutableAttributedStringRef;
|
||||
|
||||
CF_EXPORT CFTypeID CFAttributedStringGetTypeID(void);
|
||||
CF_EXPORT CFAttributedStringRef CFAttributedStringCreate(CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes);
|
||||
CF_EXPORT CFAttributedStringRef CFAttributedStringCreateWithSubstring(CFAllocatorRef alloc, CFAttributedStringRef aStr, CFRange range);
|
||||
CF_EXPORT CFAttributedStringRef CFAttributedStringCreateCopy(CFAllocatorRef alloc, CFAttributedStringRef aStr);
|
||||
CF_EXPORT CFStringRef CFAttributedStringGetString(CFAttributedStringRef aStr);
|
||||
CF_EXPORT CFIndex CFAttributedStringGetLength(CFAttributedStringRef aStr);
|
||||
CF_EXPORT CFDictionaryRef CFAttributedStringGetAttributes(CFAttributedStringRef aStr, CFIndex loc, CFRange *effectiveRange);
|
||||
CF_EXPORT CFTypeRef CFAttributedStringGetAttribute(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange *effectiveRange);
|
||||
CF_EXPORT CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFRange inRange, CFRange *longestEffectiveRange);
|
||||
CF_EXPORT CFTypeRef CFAttributedStringGetAttributeAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange inRange, CFRange *longestEffectiveRange);
|
||||
CF_EXPORT CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFAttributedStringRef aStr);
|
||||
CF_EXPORT CFMutableAttributedStringRef CFAttributedStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength);
|
||||
CF_EXPORT void CFAttributedStringReplaceString(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef replacement);
|
||||
CF_EXPORT CFMutableStringRef CFAttributedStringGetMutableString(CFMutableAttributedStringRef aStr);
|
||||
CF_EXPORT void CFAttributedStringSetAttributes(CFMutableAttributedStringRef aStr, CFRange range, CFDictionaryRef replacement, Boolean clearOtherAttributes);
|
||||
CF_EXPORT void CFAttributedStringSetAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, CFTypeRef value);
|
||||
CF_EXPORT void CFAttributedStringRemoveAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName);
|
||||
CF_EXPORT void CFAttributedStringReplaceAttributedString(CFMutableAttributedStringRef aStr, CFRange range, CFAttributedStringRef replacement);
|
||||
CF_EXPORT void CFAttributedStringBeginEditing(CFMutableAttributedStringRef aStr);
|
||||
CF_EXPORT void CFAttributedStringEndEditing(CFMutableAttributedStringRef aStr);
|
||||
|
||||
CF_EXPORT void _CFAttributedStringSetMutable(CFAttributedStringRef aStr, Boolean isMutable);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif
|
1
CFAttributedString.h
Symbolic link
1
CFAttributedString.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFAttributedString.h
|
233
CFAvailability.h
233
CFAvailability.h
@ -1,233 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFAvailability.h
|
||||
Copyright (c) 2013-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFAVAILABILITY__)
|
||||
#define __COREFOUNDATION_CFAVAILABILITY__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#if (TARGET_OS_MAC || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_WIN32)
|
||||
// Even if unused, these must remain here for compatibility, because projects rely on them being included.
|
||||
#include <AvailabilityMacros.h>
|
||||
#endif
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
#ifndef __has_extension
|
||||
#define __has_extension(x) 0
|
||||
#endif
|
||||
|
||||
// The arguments to these availability macros is a version number, e.g. 10_6, 3_0 or 'NA'
|
||||
// To use a deprecation message with the macro, add a string as the last argument.
|
||||
#if __has_feature(attribute_availability_with_message)
|
||||
|
||||
#define __NSi_2_0 introduced=2.0
|
||||
#define __NSi_2_1 introduced=2.1
|
||||
#define __NSi_2_2 introduced=2.2
|
||||
#define __NSi_3_0 introduced=3.0
|
||||
#define __NSi_3_1 introduced=3.1
|
||||
#define __NSi_3_2 introduced=3.2
|
||||
#define __NSi_4_0 introduced=4.0
|
||||
#define __NSi_4_1 introduced=4.1
|
||||
#define __NSi_4_2 introduced=4.2
|
||||
#define __NSi_4_3 introduced=4.3
|
||||
#define __NSi_5_0 introduced=5.0
|
||||
#define __NSi_5_1 introduced=5.1
|
||||
#define __NSi_6_0 introduced=6.0
|
||||
#define __NSi_6_1 introduced=6.1
|
||||
#define __NSi_7_0 introduced=7.0
|
||||
#define __NSi_7_1 introduced=7.1
|
||||
#define __NSi_8_0 introduced=8.0
|
||||
#define __NSi_8_1 introduced=8.1
|
||||
#define __NSi_9_0 introduced=9.0
|
||||
#define __NSi_9_1 introduced=9.1
|
||||
#define __NSi_10_0 introduced=10.0
|
||||
#define __NSi_10_1 introduced=10.1
|
||||
#define __NSi_10_2 introduced=10.2
|
||||
#define __NSi_10_3 introduced=10.3
|
||||
#define __NSi_10_4 introduced=10.4
|
||||
#define __NSi_10_5 introduced=10.5
|
||||
#define __NSi_10_6 introduced=10.6
|
||||
#define __NSi_10_7 introduced=10.7
|
||||
#define __NSi_10_8 introduced=10.8
|
||||
#define __NSi_10_9 introduced=10.9
|
||||
#define __NSi_10_10 introduced=10.10
|
||||
#define __NSi_10_10_2 introduced=10.10.2
|
||||
#define __NSi_10_10_3 introduced=10.10.3
|
||||
#define __NSi_10_11 introduced=10.11
|
||||
#define __NSi_10_12 introduced=10.12
|
||||
|
||||
#define __NSd_2_0 ,deprecated=2.0
|
||||
#define __NSd_2_1 ,deprecated=2.1
|
||||
#define __NSd_2_2 ,deprecated=2.2
|
||||
#define __NSd_3_0 ,deprecated=3.0
|
||||
#define __NSd_3_1 ,deprecated=3.1
|
||||
#define __NSd_3_2 ,deprecated=3.2
|
||||
#define __NSd_4_0 ,deprecated=4.0
|
||||
#define __NSd_4_1 ,deprecated=4.1
|
||||
#define __NSd_4_2 ,deprecated=4.2
|
||||
#define __NSd_4_3 ,deprecated=4.3
|
||||
#define __NSd_5_0 ,deprecated=5.0
|
||||
#define __NSd_5_1 ,deprecated=5.1
|
||||
#define __NSd_6_0 ,deprecated=6.0
|
||||
#define __NSd_6_1 ,deprecated=6.1
|
||||
#define __NSd_7_0 ,deprecated=7.0
|
||||
#define __NSd_7_1 ,deprecated=7.1
|
||||
#define __NSd_8_0 ,deprecated=8.0
|
||||
#define __NSd_8_1 ,deprecated=8.1
|
||||
#define __NSd_9_0 ,deprecated=9.0
|
||||
#define __NSd_9_1 ,deprecated=9.1
|
||||
#define __NSd_10_0 ,deprecated=10.0
|
||||
#define __NSd_10_1 ,deprecated=10.1
|
||||
#define __NSd_10_2 ,deprecated=10.2
|
||||
#define __NSd_10_3 ,deprecated=10.3
|
||||
#define __NSd_10_4 ,deprecated=10.4
|
||||
#define __NSd_10_5 ,deprecated=10.5
|
||||
#define __NSd_10_6 ,deprecated=10.6
|
||||
#define __NSd_10_7 ,deprecated=10.7
|
||||
#define __NSd_10_8 ,deprecated=10.8
|
||||
#define __NSd_10_9 ,deprecated=10.9
|
||||
#define __NSd_10_10 ,deprecated=10.10
|
||||
#define __NSd_10_10_2 ,deprecated=10.10.2
|
||||
#define __NSd_10_10_3 ,deprecated=10.10.3
|
||||
#define __NSd_10_11 ,deprecated=10.11
|
||||
#define __NSd_10_12 ,deprecated=10.12
|
||||
|
||||
#define __NSi_NA unavailable
|
||||
#define __NSd_NA
|
||||
|
||||
// Do not use TBD as an argument to NS_AVAILABLE
|
||||
#define __NSi_TBD introduced=9876.5
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
// This section is for compilers targeting OS X which support attribute_availability_with_message
|
||||
|
||||
#define CF_AVAILABLE(_mac, _ios) __attribute__((availability(macosx,__NSi_##_mac)))
|
||||
#define CF_AVAILABLE_MAC(_mac) __attribute__((availability(macosx,__NSi_##_mac)))
|
||||
#define CF_AVAILABLE_IOS(_ios) __attribute__((availability(macosx,unavailable)))
|
||||
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) __attribute__((availability(macosx,__NSi_##_macIntro __NSd_##_macDep,message="" __VA_ARGS__)))
|
||||
#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...) __attribute__((availability(macosx,__NSi_##_macIntro __NSd_##_macDep,message="" __VA_ARGS__)))
|
||||
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...) __attribute__((availability(macosx,unavailable)))
|
||||
|
||||
#elif (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
// This section is for compilers targeting iOS which support attribute_availability_with_message
|
||||
|
||||
#define CF_AVAILABLE(_mac, _ios) __attribute__((availability(ios,__NSi_##_ios)))
|
||||
#define CF_AVAILABLE_MAC(_mac) __attribute__((availability(ios,unavailable)))
|
||||
#define CF_AVAILABLE_IOS(_ios) __attribute__((availability(ios,__NSi_##_ios)))
|
||||
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) __attribute__((availability(ios,__NSi_##_iosIntro __NSd_##_iosDep,message="" __VA_ARGS__)))
|
||||
#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...) __attribute__((availability(ios,unavailable)))
|
||||
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...) __attribute__((availability(ios,__NSi_##_iosIntro __NSd_##_iosDep,message="" __VA_ARGS__)))
|
||||
|
||||
#endif
|
||||
|
||||
#elif (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
// This section is for OS X or iOS, and compilers without support for attribute_availability_with_message. We fall back to Availability.h.
|
||||
|
||||
#ifndef __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0
|
||||
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0 __AVAILABILITY_INTERNAL_DEPRECATED
|
||||
#endif
|
||||
|
||||
#define CF_AVAILABLE(_mac, _ios) __OSX_AVAILABLE_STARTING(__MAC_##_mac, __IPHONE_##_ios)
|
||||
#define CF_AVAILABLE_MAC(_mac) __OSX_AVAILABLE_STARTING(__MAC_##_mac, __IPHONE_NA)
|
||||
#define CF_AVAILABLE_IOS(_ios) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_##_ios)
|
||||
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_##_macIntro, __MAC_##_macDep, __IPHONE_##_iosIntro, __IPHONE_##_iosDep)
|
||||
#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_##_macIntro, __MAC_##_macDep, __IPHONE_NA, __IPHONE_NA)
|
||||
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_##_iosIntro, __IPHONE_##_iosDep)
|
||||
|
||||
#endif // __has_feature(attribute_availability_with_message)
|
||||
|
||||
#ifndef CF_AVAILABLE
|
||||
// This section is for platforms which do not support availability
|
||||
#define CF_AVAILABLE(_mac, _ios)
|
||||
#define CF_AVAILABLE_MAC(_mac)
|
||||
#define CF_AVAILABLE_IOS(_ios)
|
||||
#define CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...)
|
||||
#define CF_DEPRECATED_MAC(_macIntro, _macDep, ...)
|
||||
#define CF_DEPRECATED_IOS(_iosIntro, _iosDep, ...)
|
||||
#endif
|
||||
|
||||
// Older versions of these macros; use iOS versions instead
|
||||
#define CF_AVAILABLE_IPHONE(_ios) CF_AVAILABLE_IOS(_ios)
|
||||
#define CF_DEPRECATED_IPHONE(_iosIntro, _iosDep) CF_DEPRECATED_IOS(_iosIntro, _iosDep)
|
||||
|
||||
// Enum availability macros
|
||||
#if __has_feature(enumerator_attributes) && __has_attribute(availability)
|
||||
#define CF_ENUM_AVAILABLE(_mac, _ios) CF_AVAILABLE(_mac, _ios)
|
||||
#define CF_ENUM_AVAILABLE_MAC(_mac) CF_AVAILABLE_MAC(_mac)
|
||||
#define CF_ENUM_AVAILABLE_IOS(_ios) CF_AVAILABLE_IOS(_ios)
|
||||
#define CF_ENUM_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, __VA_ARGS__)
|
||||
#define CF_ENUM_DEPRECATED_MAC(_macIntro, _macDep, ...) CF_DEPRECATED_MAC(_macIntro, _macDep, __VA_ARGS__)
|
||||
#define CF_ENUM_DEPRECATED_IOS(_iosIntro, _iosDep, ...) CF_DEPRECATED_IOS(_iosIntro, _iosDep, __VA_ARGS__)
|
||||
#else
|
||||
#define CF_ENUM_AVAILABLE(_mac, _ios)
|
||||
#define CF_ENUM_AVAILABLE_MAC(_mac)
|
||||
#define CF_ENUM_AVAILABLE_IOS(_ios)
|
||||
#define CF_ENUM_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...)
|
||||
#define CF_ENUM_DEPRECATED_MAC(_macIntro, _macDep, ...)
|
||||
#define CF_ENUM_DEPRECATED_IOS(_iosIntro, _iosDep, ...)
|
||||
#endif
|
||||
|
||||
// Enums and Options
|
||||
// Enums and Options
|
||||
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
|
||||
#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
|
||||
#define __CF_NAMED_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
||||
#define __CF_ANON_ENUM(_type) enum : _type
|
||||
#if (__cplusplus)
|
||||
#define CF_OPTIONS(_type, _name) _type _name; enum : _type
|
||||
#else
|
||||
#define CF_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
|
||||
#endif
|
||||
#else
|
||||
#define __CF_NAMED_ENUM(_type, _name) _type _name; enum
|
||||
#define __CF_ANON_ENUM(_type) enum
|
||||
#define CF_OPTIONS(_type, _name) _type _name; enum
|
||||
#endif
|
||||
|
||||
/* CF_ENUM supports the use of one or two arguments. The first argument is always the integer type used for the values of the enum. The second argument is an optional type name for the macro. When specifying a type name, you must precede the macro with 'typedef' like so:
|
||||
typedef CF_ENUM(CFIndex, CFComparisonResult) {
|
||||
...
|
||||
};
|
||||
If you do not specify a type name, do not use 'typdef', like so:
|
||||
CF_ENUM(CFIndex) {
|
||||
...
|
||||
};
|
||||
*/
|
||||
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
|
||||
|
||||
// Extension availability macros
|
||||
#define CF_EXTENSION_UNAVAILABLE(_msg) __OS_EXTENSION_UNAVAILABLE(_msg)
|
||||
#define CF_EXTENSION_UNAVAILABLE_MAC(_msg) __OSX_EXTENSION_UNAVAILABLE(_msg)
|
||||
#define CF_EXTENSION_UNAVAILABLE_IOS(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)
|
||||
|
||||
#endif // __COREFOUNDATION_CFAVAILABILITY__
|
1
CFAvailability.h
Symbolic link
1
CFAvailability.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFAvailability.h
|
115
CFBag.h
115
CFBag.h
@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBag.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBAG__)
|
||||
#define __COREFOUNDATION_CFBAG__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value);
|
||||
typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2);
|
||||
typedef CFHashCode (*CFBagHashCallBack)(const void *value);
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CFBagRetainCallBack retain;
|
||||
CFBagReleaseCallBack release;
|
||||
CFBagCopyDescriptionCallBack copyDescription;
|
||||
CFBagEqualCallBack equal;
|
||||
CFBagHashCallBack hash;
|
||||
} CFBagCallBacks;
|
||||
|
||||
CF_EXPORT
|
||||
const CFBagCallBacks kCFTypeBagCallBacks;
|
||||
CF_EXPORT
|
||||
const CFBagCallBacks kCFCopyStringBagCallBacks;
|
||||
|
||||
typedef void (*CFBagApplierFunction)(const void *value, void *context);
|
||||
|
||||
typedef const struct __CFBag * CFBagRef;
|
||||
typedef struct __CFBag * CFMutableBagRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFBagGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks);
|
||||
|
||||
CF_EXPORT
|
||||
CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag);
|
||||
|
||||
CF_EXPORT
|
||||
CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks);
|
||||
|
||||
CF_EXPORT
|
||||
CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFBagGetCount(CFBagRef theBag);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBagContainsValue(CFBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
const void *CFBagGetValue(CFBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagGetValues(CFBagRef theBag, const void **values);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagAddValue(CFMutableBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagReplaceValue(CFMutableBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagSetValue(CFMutableBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagRemoveValue(CFMutableBagRef theBag, const void *value);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBagRemoveAllValues(CFMutableBagRef theBag);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBAG__ */
|
||||
|
618
CFBase.h
618
CFBase.h
@ -1,618 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBase.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBASE__)
|
||||
#define __COREFOUNDATION_CFBASE__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
#include <CoreFoundation/CFAvailability.h>
|
||||
|
||||
#if (defined(__CYGWIN32__) || defined(_WIN32)) && !defined(__WIN32__)
|
||||
#define __WIN32__ 1
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) && !defined(__WIN64__)
|
||||
#define __WIN64__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__WIN64__) && !defined(__LLP64__)
|
||||
#define __LLP64__ 1
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && defined(_M_IX86)
|
||||
#define __i386__ 1
|
||||
#endif
|
||||
|
||||
#if (defined(__i386__) || defined(__x86_64__)) && !defined(__LITTLE_ENDIAN__)
|
||||
#define __LITTLE_ENDIAN__ 1
|
||||
#endif
|
||||
|
||||
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
||||
#error Do not know the endianess of this architecture
|
||||
#endif
|
||||
|
||||
#if !__BIG_ENDIAN__ && !__LITTLE_ENDIAN__
|
||||
#error Both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ cannot be false
|
||||
#endif
|
||||
|
||||
#if __BIG_ENDIAN__ && __LITTLE_ENDIAN__
|
||||
#error Both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ cannot be true
|
||||
#endif
|
||||
|
||||
// Some compilers provide the capability to test if certain features are available. This macro provides a compatibility path for other compilers.
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
|
||||
// Some compilers provide the capability to test if certain attributes are available. This macro provides a compatibility path for other compilers.
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef __has_extension
|
||||
#define __has_extension(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || TARGET_OS_WIN32
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#if __BLOCKS__
|
||||
#include <Block.h>
|
||||
#endif
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#include <libkern/OSTypes.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__MACTYPES__)
|
||||
#if !defined(_OS_OSTYPES_H)
|
||||
typedef unsigned char Boolean;
|
||||
typedef unsigned char UInt8;
|
||||
typedef signed char SInt8;
|
||||
typedef unsigned short UInt16;
|
||||
typedef signed short SInt16;
|
||||
typedef unsigned int UInt32;
|
||||
typedef signed int SInt32;
|
||||
typedef uint64_t UInt64;
|
||||
typedef int64_t SInt64;
|
||||
typedef SInt32 OSStatus;
|
||||
#endif
|
||||
typedef float Float32;
|
||||
typedef double Float64;
|
||||
typedef unsigned short UniChar;
|
||||
typedef unsigned long UniCharCount;
|
||||
typedef unsigned char * StringPtr;
|
||||
typedef const unsigned char * ConstStringPtr;
|
||||
typedef unsigned char Str255[256];
|
||||
typedef const unsigned char * ConstStr255Param;
|
||||
typedef SInt16 OSErr;
|
||||
typedef SInt16 RegionCode;
|
||||
typedef SInt16 LangCode;
|
||||
typedef SInt16 ScriptCode;
|
||||
typedef UInt32 FourCharCode;
|
||||
typedef FourCharCode OSType;
|
||||
typedef UInt8 Byte;
|
||||
typedef SInt8 SignedByte;
|
||||
#endif
|
||||
#if !defined(__MACTYPES__) || (defined(UNIVERSAL_INTERFACES_VERSION) && UNIVERSAL_INTERFACES_VERSION < 0x0340)
|
||||
typedef UInt32 UTF32Char;
|
||||
typedef UInt16 UTF16Char;
|
||||
typedef UInt8 UTF8Char;
|
||||
#endif
|
||||
|
||||
#if !defined(CF_EXTERN_C_BEGIN)
|
||||
#if defined(__cplusplus)
|
||||
#define CF_EXTERN_C_BEGIN extern "C" {
|
||||
#define CF_EXTERN_C_END }
|
||||
#else
|
||||
#define CF_EXTERN_C_BEGIN
|
||||
#define CF_EXTERN_C_END
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
|
||||
#if !defined(CF_EXPORT)
|
||||
#if defined(CF_BUILDING_CF) && defined(__cplusplus)
|
||||
#define CF_EXPORT extern "C" __declspec(dllexport)
|
||||
#elif defined(CF_BUILDING_CF) && !defined(__cplusplus)
|
||||
#define CF_EXPORT extern __declspec(dllexport)
|
||||
#elif defined(__cplusplus)
|
||||
#define CF_EXPORT extern "C" __declspec(dllimport)
|
||||
#else
|
||||
#define CF_EXPORT extern __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define CF_EXPORT extern
|
||||
#endif
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#if !defined(NULL)
|
||||
#if defined(__GNUG__)
|
||||
#define NULL __null
|
||||
#elif defined(__cplusplus)
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(TRUE)
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#if !defined(FALSE)
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#if !defined(CF_INLINE)
|
||||
#if defined(__GNUC__) && (__GNUC__ == 4) && !defined(DEBUG)
|
||||
#define CF_INLINE static __inline__ __attribute__((always_inline))
|
||||
#elif defined(__GNUC__)
|
||||
#define CF_INLINE static __inline__
|
||||
#elif defined(__cplusplus)
|
||||
#define CF_INLINE static inline
|
||||
#elif defined(_MSC_VER)
|
||||
#define CF_INLINE static __inline
|
||||
#elif TARGET_OS_WIN32
|
||||
#define CF_INLINE static __inline__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define CF_ASSUME_NONNULL_BEGIN
|
||||
#define CF_ASSUME_NONNULL_END
|
||||
|
||||
// Marks functions which return a CF type that needs to be released by the caller but whose names are not consistent with CoreFoundation naming rules. The recommended fix to this is to rename the functions, but this macro can be used to let the clang static analyzer know of any exceptions that cannot be fixed.
|
||||
// This macro is ONLY to be used in exceptional circumstances, not to annotate functions which conform to the CoreFoundation naming rules.
|
||||
#ifndef CF_RETURNS_RETAINED
|
||||
#if __has_feature(attribute_cf_returns_retained)
|
||||
#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
|
||||
#else
|
||||
#define CF_RETURNS_RETAINED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Marks functions which return a CF type that may need to be retained by the caller but whose names are not consistent with CoreFoundation naming rules. The recommended fix to this is to rename the functions, but this macro can be used to let the clang static analyzer know of any exceptions that cannot be fixed.
|
||||
// This macro is ONLY to be used in exceptional circumstances, not to annotate functions which conform to the CoreFoundation naming rules.
|
||||
#ifndef CF_RETURNS_NOT_RETAINED
|
||||
#if __has_feature(attribute_cf_returns_not_retained)
|
||||
#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
|
||||
#else
|
||||
#define CF_RETURNS_NOT_RETAINED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Marks function arguments which are released by the callee.
|
||||
#ifndef CF_RELEASES_ARGUMENT
|
||||
#if __has_feature(attribute_cf_consumed)
|
||||
#define CF_RELEASES_ARGUMENT __attribute__((cf_consumed))
|
||||
#else
|
||||
#define CF_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Compatibility
|
||||
#ifndef CF_CONSUMED
|
||||
#if __has_feature(attribute_cf_consumed)
|
||||
#define CF_CONSUMED __attribute__((cf_consumed))
|
||||
#else
|
||||
#define CF_CONSUMED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Marks functions which cannot be used when compiling in automatic reference counting mode.
|
||||
#if __has_feature(objc_arc)
|
||||
#define CF_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
|
||||
#else
|
||||
#define CF_AUTOMATED_REFCOUNT_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef CF_IMPLICIT_BRIDGING_ENABLED
|
||||
#if __has_feature(arc_cf_code_audited)
|
||||
#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
|
||||
#else
|
||||
#define CF_IMPLICIT_BRIDGING_ENABLED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CF_IMPLICIT_BRIDGING_DISABLED
|
||||
#if __has_feature(arc_cf_code_audited)
|
||||
#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
|
||||
#else
|
||||
#define CF_IMPLICIT_BRIDGING_DISABLED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_bridge)
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class NSArray;
|
||||
@class NSAttributedString;
|
||||
@class NSString;
|
||||
@class NSNull;
|
||||
@class NSCharacterSet;
|
||||
@class NSData;
|
||||
@class NSDate;
|
||||
@class NSTimeZone;
|
||||
@class NSDictionary;
|
||||
@class NSError;
|
||||
@class NSLocale;
|
||||
@class NSNumber;
|
||||
@class NSNumber;
|
||||
@class NSSet;
|
||||
@class NSURL;
|
||||
#endif
|
||||
|
||||
#define CF_BRIDGED_TYPE(T) __attribute__((objc_bridge(T)))
|
||||
#define CF_BRIDGED_MUTABLE_TYPE(T) __attribute__((objc_bridge_mutable(T)))
|
||||
#define CF_RELATED_TYPE(T,C,I) __attribute__((objc_bridge_related(T,C,I)))
|
||||
#else
|
||||
#define CF_BRIDGED_TYPE(T)
|
||||
#define CF_BRIDGED_MUTABLE_TYPE(T)
|
||||
#define CF_RELATED_TYPE(T,C,I)
|
||||
#endif
|
||||
|
||||
|
||||
CF_EXPORT double kCFCoreFoundationVersionNumber;
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#define kCFCoreFoundationVersionNumber10_0 196.40
|
||||
#define kCFCoreFoundationVersionNumber10_0_3 196.50
|
||||
#define kCFCoreFoundationVersionNumber10_1 226.00
|
||||
#define kCFCoreFoundationVersionNumber10_1_1 226.00
|
||||
/* Note the next three do not follow the usual numbering policy from the base release */
|
||||
#define kCFCoreFoundationVersionNumber10_1_2 227.20
|
||||
#define kCFCoreFoundationVersionNumber10_1_3 227.20
|
||||
#define kCFCoreFoundationVersionNumber10_1_4 227.30
|
||||
#define kCFCoreFoundationVersionNumber10_2 263.00
|
||||
#define kCFCoreFoundationVersionNumber10_2_1 263.10
|
||||
#define kCFCoreFoundationVersionNumber10_2_2 263.10
|
||||
#define kCFCoreFoundationVersionNumber10_2_3 263.30
|
||||
#define kCFCoreFoundationVersionNumber10_2_4 263.30
|
||||
#define kCFCoreFoundationVersionNumber10_2_5 263.50
|
||||
#define kCFCoreFoundationVersionNumber10_2_6 263.50
|
||||
#define kCFCoreFoundationVersionNumber10_2_7 263.50
|
||||
#define kCFCoreFoundationVersionNumber10_2_8 263.50
|
||||
#define kCFCoreFoundationVersionNumber10_3 299.00
|
||||
#define kCFCoreFoundationVersionNumber10_3_1 299.00
|
||||
#define kCFCoreFoundationVersionNumber10_3_2 299.00
|
||||
#define kCFCoreFoundationVersionNumber10_3_3 299.30
|
||||
#define kCFCoreFoundationVersionNumber10_3_4 299.31
|
||||
#define kCFCoreFoundationVersionNumber10_3_5 299.31
|
||||
#define kCFCoreFoundationVersionNumber10_3_6 299.32
|
||||
#define kCFCoreFoundationVersionNumber10_3_7 299.33
|
||||
#define kCFCoreFoundationVersionNumber10_3_8 299.33
|
||||
#define kCFCoreFoundationVersionNumber10_3_9 299.35
|
||||
#define kCFCoreFoundationVersionNumber10_4 368.00
|
||||
#define kCFCoreFoundationVersionNumber10_4_1 368.10
|
||||
#define kCFCoreFoundationVersionNumber10_4_2 368.11
|
||||
#define kCFCoreFoundationVersionNumber10_4_3 368.18
|
||||
#define kCFCoreFoundationVersionNumber10_4_4_Intel 368.26
|
||||
#define kCFCoreFoundationVersionNumber10_4_4_PowerPC 368.25
|
||||
#define kCFCoreFoundationVersionNumber10_4_5_Intel 368.26
|
||||
#define kCFCoreFoundationVersionNumber10_4_5_PowerPC 368.25
|
||||
#define kCFCoreFoundationVersionNumber10_4_6_Intel 368.26
|
||||
#define kCFCoreFoundationVersionNumber10_4_6_PowerPC 368.25
|
||||
#define kCFCoreFoundationVersionNumber10_4_7 368.27
|
||||
#define kCFCoreFoundationVersionNumber10_4_8 368.27
|
||||
#define kCFCoreFoundationVersionNumber10_4_9 368.28
|
||||
#define kCFCoreFoundationVersionNumber10_4_10 368.28
|
||||
#define kCFCoreFoundationVersionNumber10_4_11 368.31
|
||||
#define kCFCoreFoundationVersionNumber10_5 476.00
|
||||
#define kCFCoreFoundationVersionNumber10_5_1 476.00
|
||||
#define kCFCoreFoundationVersionNumber10_5_2 476.10
|
||||
#define kCFCoreFoundationVersionNumber10_5_3 476.13
|
||||
#define kCFCoreFoundationVersionNumber10_5_4 476.14
|
||||
#define kCFCoreFoundationVersionNumber10_5_5 476.15
|
||||
#define kCFCoreFoundationVersionNumber10_5_6 476.17
|
||||
#define kCFCoreFoundationVersionNumber10_5_7 476.18
|
||||
#define kCFCoreFoundationVersionNumber10_5_8 476.19
|
||||
#define kCFCoreFoundationVersionNumber10_6 550.00
|
||||
#define kCFCoreFoundationVersionNumber10_6_1 550.00
|
||||
#define kCFCoreFoundationVersionNumber10_6_2 550.13
|
||||
#define kCFCoreFoundationVersionNumber10_6_3 550.19
|
||||
#define kCFCoreFoundationVersionNumber10_6_4 550.29
|
||||
#define kCFCoreFoundationVersionNumber10_6_5 550.42
|
||||
#define kCFCoreFoundationVersionNumber10_6_6 550.42
|
||||
#define kCFCoreFoundationVersionNumber10_6_7 550.42
|
||||
#define kCFCoreFoundationVersionNumber10_6_8 550.43
|
||||
#define kCFCoreFoundationVersionNumber10_7 635.00
|
||||
#define kCFCoreFoundationVersionNumber10_7_1 635.00
|
||||
#define kCFCoreFoundationVersionNumber10_7_2 635.15
|
||||
#define kCFCoreFoundationVersionNumber10_7_3 635.19
|
||||
#define kCFCoreFoundationVersionNumber10_7_4 635.21
|
||||
#define kCFCoreFoundationVersionNumber10_7_5 635.21
|
||||
#define kCFCoreFoundationVersionNumber10_8 744.00
|
||||
#define kCFCoreFoundationVersionNumber10_8_1 744.00
|
||||
#define kCFCoreFoundationVersionNumber10_8_2 744.12
|
||||
#define kCFCoreFoundationVersionNumber10_8_3 744.18
|
||||
#define kCFCoreFoundationVersionNumber10_8_4 744.19
|
||||
#define kCFCoreFoundationVersionNumber10_9 855.11
|
||||
#define kCFCoreFoundationVersionNumber10_9_1 855.11
|
||||
#define kCFCoreFoundationVersionNumber10_9_2 855.14
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_0 478.23
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_1 478.26
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_2 478.29
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_1 478.52
|
||||
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_2 478.61
|
||||
#define kCFCoreFoundationVersionNumber_iOS_4_0 550.32
|
||||
#define kCFCoreFoundationVersionNumber_iOS_4_1 550.38
|
||||
#define kCFCoreFoundationVersionNumber_iOS_4_2 550.52
|
||||
#define kCFCoreFoundationVersionNumber_iOS_4_3 550.52
|
||||
#define kCFCoreFoundationVersionNumber_iOS_5_0 675.00
|
||||
#define kCFCoreFoundationVersionNumber_iOS_5_1 690.10
|
||||
#define kCFCoreFoundationVersionNumber_iOS_6_0 793.00
|
||||
#define kCFCoreFoundationVersionNumber_iOS_6_1 793.00
|
||||
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20
|
||||
#define kCFCoreFoundationVersionNumber_iOS_7_1 847.24
|
||||
#endif
|
||||
|
||||
#if __LLP64__
|
||||
typedef unsigned long long CFTypeID;
|
||||
typedef unsigned long long CFOptionFlags;
|
||||
typedef unsigned long long CFHashCode;
|
||||
typedef signed long long CFIndex;
|
||||
#else
|
||||
typedef unsigned long CFTypeID;
|
||||
typedef unsigned long CFOptionFlags;
|
||||
typedef unsigned long CFHashCode;
|
||||
typedef signed long CFIndex;
|
||||
#endif
|
||||
|
||||
/* Base "type" of all "CF objects", and polymorphic functions on them */
|
||||
typedef const void * CFTypeRef;
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSString) __CFString * CFStringRef;
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableString) __CFString * CFMutableStringRef;
|
||||
|
||||
/*
|
||||
Type to mean any instance of a property list type;
|
||||
currently, CFString, CFData, CFNumber, CFBoolean, CFDate,
|
||||
CFArray, and CFDictionary.
|
||||
*/
|
||||
typedef CFTypeRef CFPropertyListRef;
|
||||
|
||||
/* Values returned from comparison functions */
|
||||
typedef CF_ENUM(CFIndex, CFComparisonResult) {
|
||||
kCFCompareLessThan = -1L,
|
||||
kCFCompareEqualTo = 0,
|
||||
kCFCompareGreaterThan = 1
|
||||
};
|
||||
|
||||
/* A standard comparison function */
|
||||
typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
|
||||
|
||||
/* Constant used by some functions to indicate failed searches. */
|
||||
/* This is of type CFIndex. */
|
||||
enum {
|
||||
kCFNotFound = -1
|
||||
};
|
||||
|
||||
|
||||
/* Range type */
|
||||
typedef struct {
|
||||
CFIndex location;
|
||||
CFIndex length;
|
||||
} CFRange;
|
||||
|
||||
#if defined(CF_INLINE)
|
||||
CF_INLINE CFRange CFRangeMake(CFIndex loc, CFIndex len) {
|
||||
CFRange range;
|
||||
range.location = loc;
|
||||
range.length = len;
|
||||
return range;
|
||||
}
|
||||
#else
|
||||
#define CFRangeMake(LOC, LEN) __CFRangeMake(LOC, LEN)
|
||||
#endif
|
||||
|
||||
/* Private; do not use */
|
||||
CF_EXPORT
|
||||
CFRange __CFRangeMake(CFIndex loc, CFIndex len);
|
||||
|
||||
|
||||
/* Null representant */
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSNull) __CFNull * CFNullRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFNullGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
const CFNullRef kCFNull; // the singleton null instance
|
||||
|
||||
|
||||
/* Allocator API
|
||||
|
||||
Most of the time when specifying an allocator to Create functions, the NULL
|
||||
argument indicates "use the default"; this is the same as using kCFAllocatorDefault
|
||||
or the return value from CFAllocatorGetDefault(). This assures that you will use
|
||||
the allocator in effect at that time.
|
||||
*/
|
||||
typedef const struct __CFAllocator * CFAllocatorRef;
|
||||
|
||||
/* This is a synonym for NULL, if you'd rather use a named constant. */
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorDefault;
|
||||
|
||||
/* Default system allocator; you rarely need to use this. */
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorSystemDefault;
|
||||
|
||||
/* This allocator uses malloc(), realloc(), and free(). This should not be
|
||||
generally used; stick to kCFAllocatorDefault whenever possible. This
|
||||
allocator is useful as the "bytesDeallocator" in CFData or
|
||||
"contentsDeallocator" in CFString where the memory was obtained as a
|
||||
result of malloc() type functions.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorMalloc;
|
||||
|
||||
/* This allocator explicitly uses the default malloc zone, returned by
|
||||
malloc_default_zone(). It should only be used when an object is
|
||||
safe to be allocated in non-scanned memory.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorMallocZone;
|
||||
|
||||
/* Null allocator which does nothing and allocates no memory. This allocator
|
||||
is useful as the "bytesDeallocator" in CFData or "contentsDeallocator"
|
||||
in CFString where the memory should not be freed.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorNull;
|
||||
|
||||
/* Special allocator argument to CFAllocatorCreate() which means
|
||||
"use the functions given in the context to allocate the allocator
|
||||
itself as well".
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFAllocatorRef kCFAllocatorUseContext;
|
||||
|
||||
typedef const void * (*CFAllocatorRetainCallBack)(const void *info);
|
||||
typedef void (*CFAllocatorReleaseCallBack)(const void *info);
|
||||
typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info);
|
||||
typedef void * (*CFAllocatorAllocateCallBack)(CFIndex allocSize, CFOptionFlags hint, void *info);
|
||||
typedef void * (*CFAllocatorReallocateCallBack)(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info);
|
||||
typedef void (*CFAllocatorDeallocateCallBack)(void *ptr, void *info);
|
||||
typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size, CFOptionFlags hint, void *info);
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
CFAllocatorRetainCallBack retain;
|
||||
CFAllocatorReleaseCallBack release;
|
||||
CFAllocatorCopyDescriptionCallBack copyDescription;
|
||||
CFAllocatorAllocateCallBack allocate;
|
||||
CFAllocatorReallocateCallBack reallocate;
|
||||
CFAllocatorDeallocateCallBack deallocate;
|
||||
CFAllocatorPreferredSizeCallBack preferredSize;
|
||||
} CFAllocatorContext;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFAllocatorGetTypeID(void);
|
||||
|
||||
/*
|
||||
CFAllocatorSetDefault() sets the allocator that is used in the current
|
||||
thread whenever NULL is specified as an allocator argument. This means
|
||||
that most, if not all allocations will go through this allocator. It
|
||||
also means that any allocator set as the default needs to be ready to
|
||||
deal with arbitrary memory allocation requests; in addition, the size
|
||||
and number of requests will change between releases.
|
||||
|
||||
An allocator set as the default will never be released, even if later
|
||||
another allocator replaces it as the default. Not only is it impractical
|
||||
for it to be released (as there might be caches created under the covers
|
||||
that refer to the allocator), in general it's also safer and more
|
||||
efficient to keep it around.
|
||||
|
||||
If you wish to use a custom allocator in a context, it's best to provide
|
||||
it as the argument to the various creation functions rather than setting
|
||||
it as the default. Setting the default allocator is not encouraged.
|
||||
|
||||
If you do set an allocator as the default, either do it for all time in
|
||||
your app, or do it in a nested fashion (by restoring the previous allocator
|
||||
when you exit your context). The latter might be appropriate for plug-ins
|
||||
or libraries that wish to set the default allocator.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFAllocatorSetDefault(CFAllocatorRef allocator);
|
||||
|
||||
CF_EXPORT
|
||||
CFAllocatorRef CFAllocatorGetDefault(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context);
|
||||
|
||||
CF_EXPORT
|
||||
void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
|
||||
|
||||
CF_EXPORT
|
||||
void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint);
|
||||
|
||||
CF_EXPORT
|
||||
void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
|
||||
|
||||
CF_EXPORT
|
||||
void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context);
|
||||
|
||||
|
||||
/* Polymorphic CF functions */
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFGetTypeID(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFCopyTypeIDDescription(CFTypeID type_id);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFRetain(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
void CFRelease(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFAutorelease(CFTypeRef CF_RELEASES_ARGUMENT arg) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFGetRetainCount(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFEqual(CFTypeRef cf1, CFTypeRef cf2);
|
||||
|
||||
CF_EXPORT
|
||||
CFHashCode CFHash(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFCopyDescription(CFTypeRef cf);
|
||||
|
||||
CF_EXPORT
|
||||
CFAllocatorRef CFGetAllocator(CFTypeRef cf);
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
// This function is unavailable in ARC mode.
|
||||
CF_EXPORT
|
||||
CFTypeRef CFMakeCollectable(CFTypeRef cf) CF_AUTOMATED_REFCOUNT_UNAVAILABLE;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBASE__ */
|
||||
|
156
CFBasicHash.h
156
CFBasicHash.h
@ -1,156 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBasicHash.h
|
||||
Copyright (c) 2008-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include "CFInternal.h"
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
struct __objcFastEnumerationStateEquivalent2 {
|
||||
unsigned long state;
|
||||
unsigned long *itemsPtr;
|
||||
unsigned long *mutationsPtr;
|
||||
unsigned long extra[5];
|
||||
};
|
||||
|
||||
enum {
|
||||
__kCFBasicHashLinearHashingValue = 1,
|
||||
__kCFBasicHashDoubleHashingValue = 2,
|
||||
__kCFBasicHashExponentialHashingValue = 3,
|
||||
};
|
||||
|
||||
enum {
|
||||
kCFBasicHashHasKeys = (1UL << 0),
|
||||
kCFBasicHashHasCounts = (1UL << 1),
|
||||
kCFBasicHashHasHashCache = (1UL << 2),
|
||||
|
||||
kCFBasicHashIntegerValues = (1UL << 6),
|
||||
kCFBasicHashIntegerKeys = (1UL << 7),
|
||||
|
||||
kCFBasicHashStrongValues = (1UL << 8),
|
||||
kCFBasicHashStrongKeys = (1UL << 9),
|
||||
|
||||
kCFBasicHashWeakValues = (1UL << 10),
|
||||
kCFBasicHashWeakKeys = (1UL << 11),
|
||||
|
||||
kCFBasicHashIndirectKeys = (1UL << 12),
|
||||
|
||||
kCFBasicHashLinearHashing = (__kCFBasicHashLinearHashingValue << 13), // bits 13-14
|
||||
kCFBasicHashDoubleHashing = (__kCFBasicHashDoubleHashingValue << 13),
|
||||
kCFBasicHashExponentialHashing = (__kCFBasicHashExponentialHashingValue << 13),
|
||||
|
||||
kCFBasicHashAggressiveGrowth = (1UL << 15),
|
||||
};
|
||||
|
||||
// Note that for a hash table without keys, the value is treated as the key,
|
||||
// and the value should be passed in as the key for operations which take a key.
|
||||
|
||||
typedef struct {
|
||||
CFIndex idx;
|
||||
uintptr_t weak_key;
|
||||
uintptr_t weak_value;
|
||||
uintptr_t count;
|
||||
} CFBasicHashBucket;
|
||||
|
||||
typedef struct __CFBasicHash *CFBasicHashRef;
|
||||
typedef const struct __CFBasicHash *CFConstBasicHashRef;
|
||||
|
||||
// Bit 6 in the CF_INFO_BITS of the CFRuntimeBase inside the CFBasicHashRef is the "is immutable" bit
|
||||
CF_INLINE Boolean CFBasicHashIsMutable(CFConstBasicHashRef ht) {
|
||||
return __CFBitfieldGetValue(((CFRuntimeBase *)ht)->_cfinfo[CF_INFO_BITS], 6, 6) ? false : true;
|
||||
}
|
||||
|
||||
CF_INLINE void CFBasicHashMakeImmutable(CFBasicHashRef ht) {
|
||||
__CFBitfieldSetValue(((CFRuntimeBase *)ht)->_cfinfo[CF_INFO_BITS], 6, 6, 1);
|
||||
}
|
||||
|
||||
|
||||
typedef struct __CFBasicHashCallbacks CFBasicHashCallbacks;
|
||||
|
||||
struct __CFBasicHashCallbacks {
|
||||
uintptr_t (*retainValue)(CFAllocatorRef alloc, uintptr_t stack_value); // Return 2nd arg or new value
|
||||
uintptr_t (*retainKey)(CFAllocatorRef alloc, uintptr_t stack_key); // Return 2nd arg or new key
|
||||
void (*releaseValue)(CFAllocatorRef alloc, uintptr_t stack_value);
|
||||
void (*releaseKey)(CFAllocatorRef alloc, uintptr_t stack_key);
|
||||
Boolean (*equateValues)(uintptr_t coll_value1, uintptr_t stack_value2); // 1st arg is in-collection value, 2nd arg is probe parameter OR in-collection value for a second collection
|
||||
Boolean (*equateKeys)(uintptr_t coll_key1, uintptr_t stack_key2); // 1st arg is in-collection key, 2nd arg is probe parameter
|
||||
CFHashCode (*hashKey)(uintptr_t stack_key);
|
||||
uintptr_t (*getIndirectKey)(uintptr_t coll_value); // Return key; 1st arg is in-collection value
|
||||
CFStringRef (*copyValueDescription)(uintptr_t stack_value);
|
||||
CFStringRef (*copyKeyDescription)(uintptr_t stack_key);
|
||||
};
|
||||
|
||||
Boolean CFBasicHashHasStrongValues(CFConstBasicHashRef ht);
|
||||
Boolean CFBasicHashHasStrongKeys(CFConstBasicHashRef ht);
|
||||
|
||||
CFOptionFlags CFBasicHashGetFlags(CFConstBasicHashRef ht);
|
||||
CFIndex CFBasicHashGetNumBuckets(CFConstBasicHashRef ht);
|
||||
CFIndex CFBasicHashGetCapacity(CFConstBasicHashRef ht);
|
||||
void CFBasicHashSetCapacity(CFBasicHashRef ht, CFIndex capacity);
|
||||
|
||||
CFIndex CFBasicHashGetCount(CFConstBasicHashRef ht);
|
||||
CFBasicHashBucket CFBasicHashGetBucket(CFConstBasicHashRef ht, CFIndex idx);
|
||||
CFBasicHashBucket CFBasicHashFindBucket(CFConstBasicHashRef ht, uintptr_t stack_key);
|
||||
CFIndex CFBasicHashGetCountOfKey(CFConstBasicHashRef ht, uintptr_t stack_key);
|
||||
CFIndex CFBasicHashGetCountOfValue(CFConstBasicHashRef ht, uintptr_t stack_value);
|
||||
Boolean CFBasicHashesAreEqual(CFConstBasicHashRef ht1, CFConstBasicHashRef ht2);
|
||||
void CFBasicHashApply(CFConstBasicHashRef ht, Boolean (^block)(CFBasicHashBucket));
|
||||
void CFBasicHashApplyIndexed(CFConstBasicHashRef ht, CFRange range, Boolean (^block)(CFBasicHashBucket));
|
||||
void CFBasicHashGetElements(CFConstBasicHashRef ht, CFIndex bufferslen, uintptr_t *weak_values, uintptr_t *weak_keys);
|
||||
|
||||
Boolean CFBasicHashAddValue(CFBasicHashRef ht, uintptr_t stack_key, uintptr_t stack_value);
|
||||
void CFBasicHashReplaceValue(CFBasicHashRef ht, uintptr_t stack_key, uintptr_t stack_value);
|
||||
void CFBasicHashSetValue(CFBasicHashRef ht, uintptr_t stack_key, uintptr_t stack_value);
|
||||
CFIndex CFBasicHashRemoveValue(CFBasicHashRef ht, uintptr_t stack_key);
|
||||
CFIndex CFBasicHashRemoveValueAtIndex(CFBasicHashRef ht, CFIndex idx);
|
||||
void CFBasicHashRemoveAllValues(CFBasicHashRef ht);
|
||||
|
||||
Boolean CFBasicHashAddIntValueAndInc(CFBasicHashRef ht, uintptr_t stack_key, uintptr_t int_value);
|
||||
void CFBasicHashRemoveIntValueAndDec(CFBasicHashRef ht, uintptr_t int_value);
|
||||
|
||||
size_t CFBasicHashGetSize(CFConstBasicHashRef ht, Boolean total);
|
||||
void CFBasicHashSuppressRC(CFBasicHashRef ht);
|
||||
void CFBasicHashUnsuppressRC(CFBasicHashRef ht);
|
||||
|
||||
CFStringRef CFBasicHashCopyDescription(CFConstBasicHashRef ht, Boolean detailed, CFStringRef linePrefix, CFStringRef entryLinePrefix, Boolean describeElements);
|
||||
|
||||
CFTypeID CFBasicHashGetTypeID(void);
|
||||
|
||||
extern Boolean __CFBasicHashEqual(CFTypeRef cf1, CFTypeRef cf2);
|
||||
extern CFHashCode __CFBasicHashHash(CFTypeRef cf);
|
||||
extern CFStringRef __CFBasicHashCopyDescription(CFTypeRef cf);
|
||||
extern void __CFBasicHashDeallocate(CFTypeRef cf);
|
||||
extern unsigned long __CFBasicHashFastEnumeration(CFConstBasicHashRef ht, struct __objcFastEnumerationStateEquivalent2 *state, void *stackbuffer, unsigned long count);
|
||||
|
||||
// creation functions create mutable CFBasicHashRefs
|
||||
CFBasicHashRef CFBasicHashCreate(CFAllocatorRef allocator, CFOptionFlags flags, const CFBasicHashCallbacks *cb);
|
||||
CFBasicHashRef CFBasicHashCreateCopy(CFAllocatorRef allocator, CFConstBasicHashRef ht);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
1
CFBasicHash.h
Symbolic link
1
CFBasicHash.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBasicHash.h
|
@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBigNumber.h
|
||||
Copyright (c) 2012-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBIGNUMBER__)
|
||||
#define __COREFOUNDATION_CFBIGNUMBER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFNumber.h>
|
||||
|
||||
|
||||
// Base 1 billion number: each digit represents 0 to 999999999
|
||||
typedef struct {
|
||||
uint32_t digits[5];
|
||||
int32_t sign:8;
|
||||
uint32_t __:24;
|
||||
} _CFBigNum;
|
||||
|
||||
void _CFBigNumInitWithInt8(_CFBigNum *r, int8_t inNum);
|
||||
void _CFBigNumInitWithInt16(_CFBigNum *r, int16_t inNum);
|
||||
void _CFBigNumInitWithInt32(_CFBigNum *r, int32_t inNum);
|
||||
void _CFBigNumInitWithInt64(_CFBigNum *r, int64_t inNum);
|
||||
#ifdef __LP64__
|
||||
void _CFBigNumInitWithInt128(_CFBigNum *r, __int128_t inNum);
|
||||
#endif
|
||||
|
||||
void _CFBigNumInitWithUInt8(_CFBigNum *r, uint8_t inNum);
|
||||
void _CFBigNumInitWithUInt16(_CFBigNum *r, uint16_t inNum);
|
||||
void _CFBigNumInitWithUInt32(_CFBigNum *r, uint32_t inNum);
|
||||
void _CFBigNumInitWithUInt64(_CFBigNum *r, uint64_t inNum);
|
||||
#ifdef __LP64__
|
||||
void _CFBigNumInitWithUInt128(_CFBigNum *r, __uint128_t inNum);
|
||||
#endif
|
||||
|
||||
int8_t _CFBigNumGetInt8(const _CFBigNum *num);
|
||||
int16_t _CFBigNumGetInt16(const _CFBigNum *num);
|
||||
int32_t _CFBigNumGetInt32(const _CFBigNum *num);
|
||||
int64_t _CFBigNumGetInt64(const _CFBigNum *num);
|
||||
#ifdef __LP64__
|
||||
__int128_t _CFBigNumGetInt128(const _CFBigNum *num);
|
||||
#endif
|
||||
|
||||
uint8_t _CFBigNumGetUInt8(const _CFBigNum *num);
|
||||
uint16_t _CFBigNumGetUInt16(const _CFBigNum *num);
|
||||
uint32_t _CFBigNumGetUInt32(const _CFBigNum *num);
|
||||
uint64_t _CFBigNumGetUInt64(const _CFBigNum *num);
|
||||
#ifdef __LP64__
|
||||
__uint128_t _CFBigNumGetUInt128(const _CFBigNum *num);
|
||||
#endif
|
||||
|
||||
void _CFBigNumInitWithCFNumber(_CFBigNum *r, CFNumberRef input);
|
||||
void _CFBigNumInitWithBytes(_CFBigNum *r, const void *bytes, CFNumberType type);
|
||||
CFNumberRef _CFNumberCreateWithBigNum(const _CFBigNum *input);
|
||||
|
||||
|
||||
CFComparisonResult _CFBigNumCompare(const _CFBigNum *a, const _CFBigNum *b);
|
||||
|
||||
void _CFBigNumNeg(_CFBigNum *r, const _CFBigNum *a);
|
||||
uint8_t _CFBigNumAdd(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b);
|
||||
uint8_t _CFBigNumSub(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b);
|
||||
|
||||
|
||||
void _CFBigNumToCString(const _CFBigNum *vp, Boolean leading_zeros, Boolean leading_plus, char *buffer, size_t buflen);
|
||||
void _CFBigNumFromCString(_CFBigNum *r, const char *string);
|
||||
|
||||
char *_CFBigNumCopyDescription(const _CFBigNum *num); // caller must free() returned ptr
|
||||
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBIGNUMBER__ */
|
||||
|
1
CFBigNumber.h
Symbolic link
1
CFBigNumber.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBigNumber.h
|
312
CFBinaryHeap.h
312
CFBinaryHeap.h
@ -1,312 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBinaryHeap.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
/*!
|
||||
@header CFBinaryHeap
|
||||
CFBinaryHeap implements a container which stores values sorted using
|
||||
a binary search algorithm. CFBinaryHeaps can be useful as priority
|
||||
queues.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBINARYHEAP__)
|
||||
#define __COREFOUNDATION_CFBINARYHEAP__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFBinaryHeapCompareContext;
|
||||
|
||||
/*!
|
||||
@typedef CFBinaryHeapCallBacks
|
||||
Structure containing the callbacks for values of a CFBinaryHeap.
|
||||
@field version The version number of the structure type being passed
|
||||
in as a parameter to the CFBinaryHeap creation functions.
|
||||
This structure is version 0.
|
||||
@field retain The callback used to add a retain for the binary heap
|
||||
on values as they are put into the binary heap.
|
||||
This callback returns the value to use as the value in the
|
||||
binary heap, which is usually the value parameter passed to
|
||||
this callback, but may be a different value if a different
|
||||
value should be added to the binary heap. The binary heap's
|
||||
allocator is passed as the first argument.
|
||||
@field release The callback used to remove a retain previously added
|
||||
for the binary heap from values as they are removed from
|
||||
the binary heap. The binary heap's allocator is passed as the
|
||||
first argument.
|
||||
@field copyDescription The callback used to create a descriptive
|
||||
string representation of each value in the binary heap. This
|
||||
is used by the CFCopyDescription() function.
|
||||
@field compare The callback used to compare values in the binary heap for
|
||||
equality in some operations.
|
||||
*/
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
const void *(*retain)(CFAllocatorRef allocator, const void *ptr);
|
||||
void (*release)(CFAllocatorRef allocator, const void *ptr);
|
||||
CFStringRef (*copyDescription)(const void *ptr);
|
||||
CFComparisonResult (*compare)(const void *ptr1, const void *ptr2, void *context);
|
||||
} CFBinaryHeapCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFStringBinaryHeapCallBacks
|
||||
Predefined CFBinaryHeapCallBacks structure containing a set
|
||||
of callbacks appropriate for use when the values in a CFBinaryHeap
|
||||
are all CFString types.
|
||||
*/
|
||||
CF_EXPORT const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
|
||||
|
||||
/*!
|
||||
@typedef CFBinaryHeapApplierFunction
|
||||
Type of the callback function used by the apply functions of
|
||||
CFBinaryHeap.
|
||||
@param value The current value from the binary heap.
|
||||
@param context The user-defined context parameter given to the apply
|
||||
function.
|
||||
*/
|
||||
typedef void (*CFBinaryHeapApplierFunction)(const void *val, void *context);
|
||||
|
||||
/*!
|
||||
@typedef CFBinaryHeapRef
|
||||
This is the type of a reference to CFBinaryHeaps.
|
||||
*/
|
||||
typedef struct __CFBinaryHeap * CFBinaryHeapRef;
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetTypeID
|
||||
Returns the type identifier of all CFBinaryHeap instances.
|
||||
*/
|
||||
CF_EXPORT CFTypeID CFBinaryHeapGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapCreate
|
||||
Creates a new mutable binary heap with the given values.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the binary heap and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFBinaryHeap. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A heap's actual capacity is only limited by
|
||||
address space and available memory constraints). If this
|
||||
parameter is negative, the behavior is undefined.
|
||||
@param callBacks A pointer to a CFBinaryHeapCallBacks structure
|
||||
initialized with the callbacks for the binary heap to use on
|
||||
each value in the binary heap. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a structure
|
||||
on the stack can be passed in, or can be reused for multiple
|
||||
binary heap creations. If the version field of this callbacks
|
||||
structure is not one of the defined ones for CFBinaryHeap, the
|
||||
behavior is undefined. The retain field may be NULL, in which
|
||||
case the CFBinaryHeap will do nothing to add a retain to values
|
||||
as they are put into the binary heap. The release field may be
|
||||
NULL, in which case the CFBinaryHeap will do nothing to remove
|
||||
the binary heap's retain (if any) on the values when the
|
||||
heap is destroyed or a key-value pair is removed. If the
|
||||
copyDescription field is NULL, the binary heap will create a
|
||||
simple description for a value. If the equal field is NULL, the
|
||||
binary heap will use pointer equality to test for equality of
|
||||
values. This callbacks parameter itself may be NULL, which is
|
||||
treated as if a valid structure of version 0 with all fields
|
||||
NULL had been passed in. Otherwise,
|
||||
if any of the fields are not valid pointers to functions
|
||||
of the correct type, or this parameter is not a valid
|
||||
pointer to a CFBinaryHeapCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
binary heap is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is undefined.
|
||||
@param compareContext A pointer to a CFBinaryHeapCompareContext structure.
|
||||
@result A reference to the new CFBinaryHeap.
|
||||
*/
|
||||
CF_EXPORT CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callBacks, const CFBinaryHeapCompareContext *compareContext);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapCreateCopy
|
||||
Creates a new mutable binary heap with the values from the given binary heap.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the binary heap and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFBinaryHeap. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A heap's actual capacity is only limited by
|
||||
address space and available memory constraints).
|
||||
This parameter must be greater than or equal
|
||||
to the count of the heap which is to be copied, or the
|
||||
behavior is undefined. If this parameter is negative, the
|
||||
behavior is undefined.
|
||||
@param heap The binary heap which is to be copied. The values from the
|
||||
binary heap are copied as pointers into the new binary heap (that is,
|
||||
the values themselves are copied, not that which the values
|
||||
point to, if anything). However, the values are also
|
||||
retained by the new binary heap. The count of the new binary will
|
||||
be the same as the given binary heap. The new binary heap uses the same
|
||||
callbacks as the binary heap to be copied. If this parameter is
|
||||
not a valid CFBinaryHeap, the behavior is undefined.
|
||||
@result A reference to the new mutable binary heap.
|
||||
*/
|
||||
CF_EXPORT CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef heap);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetCount
|
||||
Returns the number of values currently in the binary heap.
|
||||
@param heap The binary heap to be queried. If this parameter is not a valid
|
||||
CFBinaryHeap, the behavior is undefined.
|
||||
@result The number of values in the binary heap.
|
||||
*/
|
||||
CF_EXPORT CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef heap);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetCountOfValue
|
||||
Counts the number of times the given value occurs in the binary heap.
|
||||
@param heap The binary heap to be searched. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@param value The value for which to find matches in the binary heap. The
|
||||
compare() callback provided when the binary heap was created is
|
||||
used to compare. If the compare() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the binary heap, are not understood by the compare() callback,
|
||||
the behavior is undefined.
|
||||
@result The number of times the given value occurs in the binary heap.
|
||||
*/
|
||||
CF_EXPORT CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef heap, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapContainsValue
|
||||
Reports whether or not the value is in the binary heap.
|
||||
@param heap The binary heap to be searched. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@param value The value for which to find matches in the binary heap. The
|
||||
compare() callback provided when the binary heap was created is
|
||||
used to compare. If the compare() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the binary heap, are not understood by the compare() callback,
|
||||
the behavior is undefined.
|
||||
@result true, if the value is in the specified binary heap, otherwise false.
|
||||
*/
|
||||
CF_EXPORT Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef heap, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetMinimum
|
||||
Returns the minimum value is in the binary heap. If the heap contains several equal
|
||||
minimum values, any one may be returned.
|
||||
@param heap The binary heap to be searched. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@result A reference to the minimum value in the binary heap, or NULL if the
|
||||
binary heap contains no values.
|
||||
*/
|
||||
CF_EXPORT const void * CFBinaryHeapGetMinimum(CFBinaryHeapRef heap);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetMinimumIfPresent
|
||||
Returns the minimum value is in the binary heap, if present. If the heap contains several equal
|
||||
minimum values, any one may be returned.
|
||||
@param heap The binary heap to be searched. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@param value A C pointer to pointer-sized storage to be filled with the minimum value in
|
||||
the binary heap. If this value is not a valid C pointer to a pointer-sized block
|
||||
of storage, the result is undefined. If the result of the function is false, the value
|
||||
stored at this address is undefined.
|
||||
@result true, if a minimum value was found in the specified binary heap, otherwise false.
|
||||
*/
|
||||
CF_EXPORT Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef heap, const void **value);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapGetValues
|
||||
Fills the buffer with values from the binary heap.
|
||||
@param heap The binary heap to be queried. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@param values A C array of pointer-sized values to be filled with
|
||||
values from the binary heap. The values in the C array are ordered
|
||||
from least to greatest. If this parameter is not a valid pointer to a
|
||||
C array of at least CFBinaryHeapGetCount() pointers, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFBinaryHeapGetValues(CFBinaryHeapRef heap, const void **values);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapApplyFunction
|
||||
Calls a function once for each value in the binary heap.
|
||||
@param heap The binary heap to be operated upon. If this parameter is not a
|
||||
valid CFBinaryHeap, the behavior is undefined.
|
||||
@param applier The callback function to call once for each value in
|
||||
the given binary heap. If this parameter is not a
|
||||
pointer to a function of the correct prototype, the behavior
|
||||
is undefined. If there are values in the binary heap which the
|
||||
applier function does not expect or cannot properly apply
|
||||
to, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the second parameter to the applier function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the applier function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT void CFBinaryHeapApplyFunction(CFBinaryHeapRef heap, CFBinaryHeapApplierFunction applier, void *context);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapAddValue
|
||||
Adds the value to the binary heap.
|
||||
@param heap The binary heap to which the value is to be added. If this parameter is not a
|
||||
valid mutable CFBinaryHeap, the behavior is undefined.
|
||||
@param value The value to add to the binary heap. The value is retained by
|
||||
the binary heap using the retain callback provided when the binary heap
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFBinaryHeapAddValue(CFBinaryHeapRef heap, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapRemoveMinimumValue
|
||||
Removes the minimum value from the binary heap.
|
||||
@param heap The binary heap from which the minimum value is to be removed. If this
|
||||
parameter is not a valid mutable CFBinaryHeap, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef heap);
|
||||
|
||||
/*!
|
||||
@function CFBinaryHeapRemoveAllValues
|
||||
Removes all the values from the binary heap, making it empty.
|
||||
@param heap The binary heap from which all of the values are to be
|
||||
removed. If this parameter is not a valid mutable CFBinaryHeap,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef heap);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBINARYHEAP__ */
|
||||
|
1
CFBinaryHeap.h
Symbolic link
1
CFBinaryHeap.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBinaryHeap.h
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBitVector.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBITVECTOR__)
|
||||
#define __COREFOUNDATION_CFBITVECTOR__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef UInt32 CFBit;
|
||||
|
||||
typedef const struct __CFBitVector * CFBitVectorRef;
|
||||
typedef struct __CFBitVector * CFMutableBitVectorRef;
|
||||
|
||||
CF_EXPORT CFTypeID CFBitVectorGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits);
|
||||
CF_EXPORT CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv);
|
||||
CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
|
||||
CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv);
|
||||
|
||||
CF_EXPORT CFIndex CFBitVectorGetCount(CFBitVectorRef bv);
|
||||
CF_EXPORT CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
|
||||
CF_EXPORT Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value);
|
||||
CF_EXPORT CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx);
|
||||
CF_EXPORT void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes);
|
||||
CF_EXPORT CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
|
||||
CF_EXPORT CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
|
||||
|
||||
CF_EXPORT void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count);
|
||||
CF_EXPORT void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx);
|
||||
CF_EXPORT void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range);
|
||||
CF_EXPORT void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value);
|
||||
CF_EXPORT void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value);
|
||||
CF_EXPORT void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBITVECTOR__ */
|
||||
|
1
CFBitVector.h
Symbolic link
1
CFBitVector.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBitVector.h
|
358
CFBundle.h
358
CFBundle.h
@ -1,358 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBundle.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBUNDLE__)
|
||||
#define __COREFOUNDATION_CFBUNDLE__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <CoreFoundation/CFError.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFBundle *CFBundleRef;
|
||||
typedef struct __CFBundle *CFPlugInRef;
|
||||
|
||||
/* ===================== Standard Info.plist keys ===================== */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleInfoDictionaryVersionKey;
|
||||
/* The version of the Info.plist format */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleExecutableKey;
|
||||
/* The name of the executable in this bundle, if any */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleIdentifierKey;
|
||||
/* The bundle identifier (for CFBundleGetBundleWithIdentifier()) */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleVersionKey;
|
||||
/* The version number of the bundle. For Mac OS 9 style version numbers (for example "2.5.3d5"), */
|
||||
/* clients can use CFBundleGetVersionNumber() instead of accessing this key directly since that */
|
||||
/* function will properly convert the version string into its compact integer representation. */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleDevelopmentRegionKey;
|
||||
/* The name of the development language of the bundle. */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleNameKey;
|
||||
/* The human-readable name of the bundle. This key is often found in the InfoPlist.strings since it is usually localized. */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFBundleLocalizationsKey;
|
||||
/* Allows an unbundled application that handles localization itself to specify which localizations it has available. */
|
||||
|
||||
/* ===================== Finding Bundles ===================== */
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef CFBundleGetMainBundle(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID);
|
||||
/* A bundle can name itself by providing a key in the info dictionary. */
|
||||
/* This facility is meant to allow bundle-writers to get hold of their */
|
||||
/* bundle from their code without having to know where it was on the disk. */
|
||||
/* This is meant to be a replacement mechanism for +bundleForClass: users. */
|
||||
/* Note that this does not search for bundles on the disk; it will locate */
|
||||
/* only bundles already loaded or otherwise known to the current process. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleGetAllBundles(void);
|
||||
/* This is potentially expensive, and not thread-safe. Use with care. */
|
||||
/* Best used for debuggging or other diagnostic purposes. */
|
||||
|
||||
/* ===================== Creating Bundles ===================== */
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFBundleGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL);
|
||||
/* Might return an existing instance with the ref-count bumped. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType);
|
||||
/* Create instances for all bundles in the given directory matching the given type */
|
||||
/* (or all of them if bundleType is NULL). Instances are created using CFBundleCreate() and are not released. */
|
||||
|
||||
/* ==================== Basic Bundle Info ==================== */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef bundle, CFStringRef key);
|
||||
/* Returns a localized value if available, otherwise the global value. */
|
||||
/* This is the recommended function for examining the info dictionary. */
|
||||
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFBundleGetInfoDictionary(CFBundleRef bundle);
|
||||
/* This is the global info dictionary. Note that CFBundle may add */
|
||||
/* extra keys to the dictionary for its own use. */
|
||||
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFBundleGetLocalInfoDictionary(CFBundleRef bundle);
|
||||
/* This is the localized info dictionary. */
|
||||
|
||||
CF_EXPORT
|
||||
void CFBundleGetPackageInfo(CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFBundleGetIdentifier(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
UInt32 CFBundleGetVersionNumber(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle);
|
||||
|
||||
/* ------------- Basic Bundle Info without a CFBundle instance ------------- */
|
||||
/* This API is provided to enable developers to retrieve basic information */
|
||||
/* about a bundle without having to create an instance of CFBundle. */
|
||||
/* Because of caching behavior when a CFBundle instance exists, it will be faster */
|
||||
/* to actually create a CFBundle if you need to retrieve multiple pieces of info. */
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory(CFURLRef bundleURL);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundleGetPackageInfoInDirectory(CFURLRef url, UInt32 *packageType, UInt32 *packageCreator);
|
||||
|
||||
/* ==================== Resource Handling API ==================== */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyResourceURL(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyResourceURLsOfType(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName) CF_FORMAT_ARGUMENT(2);
|
||||
|
||||
#define CFCopyLocalizedString(key, comment) \
|
||||
CFBundleCopyLocalizedString(CFBundleGetMainBundle(), (key), (key), NULL)
|
||||
#define CFCopyLocalizedStringFromTable(key, tbl, comment) \
|
||||
CFBundleCopyLocalizedString(CFBundleGetMainBundle(), (key), (key), (tbl))
|
||||
#define CFCopyLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \
|
||||
CFBundleCopyLocalizedString((bundle), (key), (key), (tbl))
|
||||
#define CFCopyLocalizedStringWithDefaultValue(key, tbl, bundle, value, comment) \
|
||||
CFBundleCopyLocalizedString((bundle), (key), (value), (tbl))
|
||||
|
||||
/* ------------- Resource Handling without a CFBundle instance ------------- */
|
||||
/* This API is provided to enable developers to use the CFBundle resource */
|
||||
/* searching policy without having to create an instance of CFBundle. */
|
||||
/* Because of caching behavior when a CFBundle instance exists, it will be faster */
|
||||
/* to actually create a CFBundle if you need to access several resources. */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName);
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName);
|
||||
|
||||
/* =========== Localization-specific Resource Handling API =========== */
|
||||
/* This API allows finer-grained control over specific localizations, */
|
||||
/* as distinguished from the above API, which always uses the user's */
|
||||
/* preferred localizations for the bundle in the current app context. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyBundleLocalizations(CFBundleRef bundle);
|
||||
/* Lists the localizations that a bundle contains. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyPreferredLocalizationsFromArray(CFArrayRef locArray);
|
||||
/* Given an array of possible localizations, returns the one or more */
|
||||
/* of them that CFBundle would use in the current application context. */
|
||||
/* To determine the localizations that would be used for a particular */
|
||||
/* bundle in the current application context, apply this function to the */
|
||||
/* result of CFBundleCopyBundleLocalizations(). */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyLocalizationsForPreferences(CFArrayRef locArray, CFArrayRef prefArray);
|
||||
/* Given an array of possible localizations, returns the one or more of */
|
||||
/* them that CFBundle would use, without reference to the current application */
|
||||
/* context, if the user's preferred localizations were given by prefArray. */
|
||||
/* If prefArray is NULL, the current user's actual preferred localizations will */
|
||||
/* be used. This is not the same as CFBundleCopyPreferredLocalizationsFromArray(), */
|
||||
/* because that function takes the current application context into account. */
|
||||
/* To determine the localizations that another application would use, apply */
|
||||
/* this function to the result of CFBundleCopyBundleLocalizations(). */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyResourceURLForLocalization(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName);
|
||||
/* The localizationName argument to CFBundleCopyResourceURLForLocalization() or */
|
||||
/* CFBundleCopyResourceURLsOfTypeForLocalization() must be identical to one of the */
|
||||
/* localizations in the bundle, as returned by CFBundleCopyBundleLocalizations(). */
|
||||
/* It is recommended that either CFBundleCopyPreferredLocalizationsFromArray() or */
|
||||
/* CFBundleCopyLocalizationsForPreferences() be used to select the localization. */
|
||||
|
||||
/* =================== Unbundled application info ===================== */
|
||||
/* This API is provided to enable developers to retrieve bundle-related */
|
||||
/* information about an application that may be bundled or unbundled. */
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFBundleCopyInfoDictionaryForURL(CFURLRef url);
|
||||
/* For a directory URL, this is equivalent to CFBundleCopyInfoDictionaryInDirectory(). */
|
||||
/* For a plain file URL representing an unbundled executable, this will attempt to read */
|
||||
/* an info dictionary from the (__TEXT, __info_plist) section, if it is a Mach-o file, */
|
||||
/* or from a 'plst' resource. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url);
|
||||
/* For a directory URL, this is equivalent to calling CFBundleCopyBundleLocalizations() */
|
||||
/* on the corresponding bundle. For a plain file URL representing an unbundled executable, */
|
||||
/* this will attempt to determine its localizations using the CFBundleLocalizations and */
|
||||
/* CFBundleDevelopmentRegion keys in the dictionary returned by CFBundleCopyInfoDictionaryForURL,*/
|
||||
/* or from a 'vers' resource if those are not present. */
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyExecutableArchitecturesForURL(CFURLRef url) CF_AVAILABLE(10_5, 2_0);
|
||||
/* For a directory URL, this is equivalent to calling CFBundleCopyExecutableArchitectures() */
|
||||
/* on the corresponding bundle. For a plain file URL representing an unbundled executable, */
|
||||
/* this will return the architectures it provides, if it is a Mach-o file, or NULL otherwise. */
|
||||
|
||||
/* ==================== Primitive Code Loading API ==================== */
|
||||
/* This API abstracts the various different executable formats supported on */
|
||||
/* various platforms. It can load DYLD, CFM, or DLL shared libraries (on their */
|
||||
/* appropriate platforms) and gives a uniform API for looking up functions. */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle);
|
||||
|
||||
enum {
|
||||
kCFBundleExecutableArchitectureI386 = 0x00000007,
|
||||
kCFBundleExecutableArchitecturePPC = 0x00000012,
|
||||
kCFBundleExecutableArchitectureX86_64 = 0x01000007,
|
||||
kCFBundleExecutableArchitecturePPC64 = 0x01000012
|
||||
} CF_ENUM_AVAILABLE(10_5, 2_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFBundleCopyExecutableArchitectures(CFBundleRef bundle) CF_AVAILABLE(10_5, 2_0);
|
||||
/* If the bundle's executable exists and is a Mach-o file, this function will return an array */
|
||||
/* of CFNumbers whose values are integers representing the architectures the file provides. */
|
||||
/* The values currently in use are those listed in the enum above, but others may be added */
|
||||
/* in the future. If the executable is not a Mach-o file, this function returns NULL. */
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundlePreflightExecutable(CFBundleRef bundle, CFErrorRef *error) CF_AVAILABLE(10_5, 2_0);
|
||||
/* This function will return true if the bundle is loaded, or if the bundle appears to be */
|
||||
/* loadable upon inspection. This does not mean that the bundle is definitively loadable, */
|
||||
/* since it may fail to load due to link errors or other problems not readily detectable. */
|
||||
/* If this function detects problems, it will return false, and return a CFError by reference. */
|
||||
/* It is the responsibility of the caller to release the CFError. */
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, CFErrorRef *error) CF_AVAILABLE(10_5, 2_0);
|
||||
/* If the bundle is already loaded, this function will return true. Otherwise, it will attempt */
|
||||
/* to load the bundle, and it will return true if that attempt succeeds. If the bundle fails */
|
||||
/* to load, this function will return false, and it will return a CFError by reference. */
|
||||
/* It is the responsibility of the caller to release the CFError. */
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundleLoadExecutable(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBundleUnloadExecutable(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
void *CFBundleGetFunctionPointerForName(CFBundleRef bundle, CFStringRef functionName);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
|
||||
|
||||
CF_EXPORT
|
||||
void *CFBundleGetDataPointerForName(CFBundleRef bundle, CFStringRef symbolName);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBundleGetDataPointersForNames(CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[]);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName);
|
||||
/* This function can be used to find executables other than your main */
|
||||
/* executable. This is useful, for instance, for applications that have */
|
||||
/* some command line tool that is packaged with and used by the application. */
|
||||
/* The tool can be packaged in the various platform executable directories */
|
||||
/* in the bundle and can be located with this function. This allows an */
|
||||
/* app to ship versions of the tool for each platform as it does for the */
|
||||
/* main app executable. */
|
||||
|
||||
/* ==================== Getting a bundle's plugIn ==================== */
|
||||
|
||||
CF_EXPORT
|
||||
CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle);
|
||||
|
||||
/* ==================== Resource Manager-Related API ==================== */
|
||||
|
||||
#if __LP64__
|
||||
typedef int CFBundleRefNum;
|
||||
#else
|
||||
typedef SInt16 CFBundleRefNum;
|
||||
#endif
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRefNum CFBundleOpenBundleResourceMap(CFBundleRef bundle);
|
||||
/* This function opens the non-localized and the localized resource files */
|
||||
/* (if any) for the bundle, creates and makes current a single read-only */
|
||||
/* resource map combining both, and returns a reference number for it. */
|
||||
/* If it is called multiple times, it opens the files multiple times, */
|
||||
/* and returns distinct reference numbers. */
|
||||
|
||||
CF_EXPORT
|
||||
SInt32 CFBundleOpenBundleResourceFiles(CFBundleRef bundle, CFBundleRefNum *refNum, CFBundleRefNum *localizedRefNum);
|
||||
/* Similar to CFBundleOpenBundleResourceMap(), except that it creates two */
|
||||
/* separate resource maps and returns reference numbers for both. */
|
||||
|
||||
CF_EXPORT
|
||||
void CFBundleCloseBundleResourceMap(CFBundleRef bundle, CFBundleRefNum refNum);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBUNDLE__ */
|
||||
|
1
CFBundle.h
Symbolic link
1
CFBundle.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBundle.h
|
304
CFBundlePriv.h
304
CFBundlePriv.h
@ -1,304 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBundlePriv.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBUNDLEPRIV__)
|
||||
#define __COREFOUNDATION_CFBUNDLEPRIV__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFBundle.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/* Finder stuff */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundlePackageTypeKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleSignatureKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleIconFileKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleDocumentTypesKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleURLTypesKey;
|
||||
|
||||
/* Localizable Finder stuff */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleDisplayNameKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleShortVersionStringKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleGetInfoStringKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleGetInfoHTMLKey;
|
||||
|
||||
/* Sub-keys for CFBundleDocumentTypes dictionaries */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeNameKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeRoleKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeIconFileKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeOSTypesKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeExtensionsKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleTypeMIMETypesKey;
|
||||
|
||||
/* Sub-keys for CFBundleURLTypes dictionaries */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleURLNameKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleURLIconFileKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleURLSchemesKey;
|
||||
|
||||
/* Compatibility key names */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldExecutableKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldInfoDictionaryVersionKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldNameKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldIconFileKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldDocumentTypesKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldShortVersionStringKey;
|
||||
|
||||
/* Compatibility CFBundleDocumentTypes key names */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeNameKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeRoleKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeIconFileKey;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeExtensions1Key;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeExtensions2Key;
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleOldTypeOSTypesKey;
|
||||
|
||||
/* For platform specification */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleSupportedPlatformsKey;
|
||||
|
||||
/* For Code Signing */
|
||||
CF_EXPORT
|
||||
const CFStringRef _kCFBundleResourceSpecificationKey;
|
||||
|
||||
|
||||
/* Functions for examining directories that may "look like" bundles */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean _CFBundleURLLooksLikeBundle(CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL);
|
||||
|
||||
// This function is obsolete.
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFBundleGetSupportedPlatforms(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef _CFBundleGetCurrentPlatform(void);
|
||||
|
||||
|
||||
/* For Code Signing */
|
||||
|
||||
// This function is obsolete. Use CFBundleCreate instead.
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleCreateIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url) CF_DEPRECATED(10_6, 10_10, 2_0, 8_0);
|
||||
|
||||
// This function is for code signing only. Do not use this function.
|
||||
CF_EXPORT
|
||||
CFBundleRef _CFBundleCreateWithExecutableURLIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url);
|
||||
|
||||
|
||||
/* Functions for examining the structure of a bundle */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle) CF_AVAILABLE_MAC(10_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyInfoPlistURL(CFBundleRef bundle);
|
||||
|
||||
|
||||
/* Functions for working without a bundle instance */
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url);
|
||||
|
||||
|
||||
/* Functions for dealing with localizations */
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleGetLanguageAndRegionCodes(SInt32 *languageCode, SInt32 *regionCode);
|
||||
// may return -1 for either one if no code can be found
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
|
||||
/* Gets the appropriate language and region codes, and the default */
|
||||
/* script code and encoding, for the localization specified. */
|
||||
/* Pass NULL for the localizationName to get these values for the */
|
||||
/* single most preferred localization in the current context. */
|
||||
/* May give -1 if there is no language or region code for a particular */
|
||||
/* localization. Returns false if CFBundle has no information about */
|
||||
/* the given localization. */
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
|
||||
/* Returns the default localization for the combination of codes */
|
||||
/* specified. Pass in -1 for language, region code, or script code, or */
|
||||
/* 0xFFFF for stringEncoding, if you do not wish to specify one of these. */
|
||||
|
||||
// Get a localized string for a specific localization (including processing as strings dict file). This skips the usual cache for localized strings.
|
||||
CF_EXPORT CFStringRef CFBundleCopyLocalizedStringForLocalization(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName, CFStringRef localizationName) CF_AVAILABLE(10_10, 8_0);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleSetDefaultLocalization(CFStringRef localizationName);
|
||||
|
||||
|
||||
/* Functions for dealing specifically with CFM executables */
|
||||
|
||||
CF_EXPORT
|
||||
void *_CFBundleGetCFMFunctionPointerForName(CFBundleRef bundle, CFStringRef funcName);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleGetCFMFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID);
|
||||
|
||||
|
||||
/* Miscellaneous functions */
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef _CFBundleCopyFileTypeForFileURL(CFURLRef url);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef _CFBundleCopyFileTypeForFileData(CFDataRef data);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean _CFBundleGetHasChanged(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleFlushCaches(void) CF_DEPRECATED(10_0, 10_8, 2_0, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleFlushCachesForURL(CFURLRef url) CF_DEPRECATED(10_0, 10_8, 2_0, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleFlushBundleCaches(CFBundleRef bundle); // The previous two functions flush cached resource paths; this one also flushes bundle-specific caches such as the info dictionary and strings files
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFBundleCopyAllBundles(void); // Pending publication, the only known client of this is PowerBox. Email david_smith@apple.com before using this.
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFStringRef executablePath);
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#include <xpc/xpc.h>
|
||||
CF_EXPORT
|
||||
void _CFBundleSetupXPCBootstrap(xpc_object_t bootstrap) CF_AVAILABLE(10_10, 8_0);
|
||||
#endif
|
||||
|
||||
/* Functions deprecated as SPI */
|
||||
|
||||
CF_EXPORT
|
||||
CFDictionaryRef _CFBundleGetLocalInfoDictionary(CFBundleRef bundle); // deprecated in favor of CFBundleGetLocalInfoDictionary
|
||||
|
||||
CF_EXPORT
|
||||
CFPropertyListRef _CFBundleGetValueForInfoKey(CFBundleRef bundle, CFStringRef key); // deprecated in favor of CFBundleGetValueForInfoDictionaryKey
|
||||
|
||||
CF_EXPORT
|
||||
Boolean _CFBundleGetPackageInfoInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); // deprecated in favor of CFBundleGetPackageInfoInDirectory
|
||||
|
||||
CF_EXPORT
|
||||
CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceFork(CFURLRef url); // CFBundleCopyInfoDictionaryForURL is usually preferred; for the main bundle, however, no special call is necessary, since the info dictionary will automatically be available whether the app is bundled or not
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyPrivateFrameworksURL
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedFrameworksURL
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedSupportURL
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBuiltInPlugInsURL
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFBundleCopyResourceURLForLanguage(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLForLocalization
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFBundleCopyResourceURLsOfTypeForLanguage(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLsOfTypeForLocalization
|
||||
|
||||
CF_EXPORT
|
||||
CFBundleRefNum _CFBundleOpenBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleOpenBundleResourceMap
|
||||
|
||||
CF_EXPORT
|
||||
void _CFBundleCloseBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleCloseBundleResourceMap
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBUNDLEPRIV__ */
|
||||
|
1
CFBundlePriv.h
Symbolic link
1
CFBundlePriv.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBundlePriv.h
|
@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBundle_BinaryTypes.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBUNDLE_BINARYTYPES__)
|
||||
#define __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ 1
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX
|
||||
#define BINARY_SUPPORT_DYLD 1
|
||||
#define BINARY_SUPPORT_DLFCN 1
|
||||
#define USE_DYLD_PRIV 1
|
||||
#elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
#define BINARY_SUPPORT_DYLD 1
|
||||
#define BINARY_SUPPORT_DLFCN 1
|
||||
#define USE_DYLD_PRIV 1
|
||||
#elif DEPLOYMENT_TARGET_WINDOWS
|
||||
#define BINARY_SUPPORT_DLL 1
|
||||
#else
|
||||
#error Unknown or unspecified DEPLOYMENT_TARGET
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum {
|
||||
__CFBundleUnknownBinary,
|
||||
__CFBundleCFMBinary,
|
||||
__CFBundleDYLDExecutableBinary,
|
||||
__CFBundleDYLDBundleBinary,
|
||||
__CFBundleDYLDFrameworkBinary,
|
||||
__CFBundleDLLBinary,
|
||||
__CFBundleUnreadableBinary,
|
||||
__CFBundleNoBinary,
|
||||
__CFBundleELFBinary
|
||||
} __CFPBinaryType;
|
||||
|
||||
/* Intended for eventual public consumption */
|
||||
typedef enum {
|
||||
kCFBundleOtherExecutableType = 0,
|
||||
kCFBundleMachOExecutableType,
|
||||
kCFBundlePEFExecutableType,
|
||||
kCFBundleELFExecutableType,
|
||||
kCFBundleDLLExecutableType
|
||||
} CFBundleExecutableType;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ */
|
||||
|
1
CFBundle_BinaryTypes.h
Symbolic link
1
CFBundle_BinaryTypes.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBundle_BinaryTypes.h
|
@ -1,374 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBundle_Internal.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBUNDLE_INTERNAL__)
|
||||
#define __COREFOUNDATION_CFBUNDLE_INTERNAL__ 1
|
||||
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFBundle.h>
|
||||
#include <CoreFoundation/CFPlugIn.h>
|
||||
#include <CoreFoundation/CFError.h>
|
||||
#include "CFInternal.h"
|
||||
#include "CFPlugIn_Factory.h"
|
||||
#include "CFBundle_BinaryTypes.h"
|
||||
#include "CFByteOrder.h"
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#define __kCFLogBundle 3
|
||||
#define __kCFLogPlugIn 3
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define PLATFORM_PATH_STYLE kCFURLWindowsPathStyle
|
||||
#else
|
||||
#define PLATFORM_PATH_STYLE kCFURLPOSIXPathStyle
|
||||
#endif
|
||||
|
||||
#define CFBundleExecutableNotFoundError 4
|
||||
#define CFBundleExecutableNotLoadableError 3584
|
||||
#define CFBundleExecutableArchitectureMismatchError 3585
|
||||
#define CFBundleExecutableRuntimeMismatchError 3586
|
||||
#define CFBundleExecutableLoadError 3587
|
||||
#define CFBundleExecutableLinkError 3588
|
||||
|
||||
CF_INLINE uint32_t _CFBundleSwapInt32Conditional(uint32_t arg, Boolean swap) {return swap ? CFSwapInt32(arg) : arg;}
|
||||
CF_INLINE uint32_t _CFBundleSwapInt64Conditional(uint64_t arg, Boolean swap) {return swap ? CFSwapInt64(arg) : arg;}
|
||||
|
||||
// uncomment this to enable the checking for 8302591
|
||||
//#define CFBUNDLE_NO_TRAVERSE_OUTSIDE
|
||||
|
||||
typedef struct __CFResourceData {
|
||||
Boolean _executableLacksResourceFork;
|
||||
Boolean _infoDictionaryFromResourceFork;
|
||||
char _padding[2];
|
||||
} _CFResourceData;
|
||||
|
||||
CF_PRIVATE _CFResourceData *__CFBundleGetResourceData(CFBundleRef bundle);
|
||||
|
||||
typedef struct __CFPlugInData {
|
||||
Boolean _isPlugIn;
|
||||
Boolean _loadOnDemand;
|
||||
Boolean _isDoingDynamicRegistration;
|
||||
Boolean _unused1;
|
||||
UInt32 _instanceCount;
|
||||
CFMutableArrayRef _factories;
|
||||
} _CFPlugInData;
|
||||
|
||||
struct __CFBundle {
|
||||
CFRuntimeBase _base;
|
||||
|
||||
CFURLRef _url;
|
||||
CFDateRef _modDate;
|
||||
|
||||
__strong CFDictionaryRef _infoDict;
|
||||
__strong CFDictionaryRef _localInfoDict;
|
||||
CFArrayRef _searchLanguages;
|
||||
|
||||
__CFPBinaryType _binaryType;
|
||||
Boolean _isLoaded;
|
||||
uint8_t _version;
|
||||
Boolean _sharesStringsFiles;
|
||||
char _padding[1];
|
||||
|
||||
/* CFM goop */
|
||||
void *_connectionCookie;
|
||||
|
||||
/* DYLD goop */
|
||||
const void *_imageCookie;
|
||||
const void *_moduleCookie;
|
||||
|
||||
/* dlfcn goop */
|
||||
void *_handleCookie;
|
||||
|
||||
/* CFM<->DYLD glue */
|
||||
CFMutableDictionaryRef _glueDict;
|
||||
|
||||
/* Resource fork goop */
|
||||
_CFResourceData _resourceData;
|
||||
|
||||
_CFPlugInData _plugInData;
|
||||
|
||||
pthread_mutex_t _bundleLoadingLock;
|
||||
|
||||
CFStringRef _executablePath; // Calculated and cached here
|
||||
CFStringRef _developmentRegion; // Calculated and cached here
|
||||
dispatch_once_t _developmentRegionCalculated;
|
||||
|
||||
CFLock_t _lock;
|
||||
|
||||
CFArrayRef _localizations; // List of localizations, including the development language fallback if required
|
||||
Boolean _lookedForLocalizations;
|
||||
|
||||
CFMutableDictionaryRef _resourceDirectoryContents;
|
||||
|
||||
CFMutableDictionaryRef _stringTable;
|
||||
|
||||
CFLock_t _queryLock;
|
||||
CFMutableDictionaryRef _queryTable;
|
||||
CFStringRef _bundleBasePath;
|
||||
|
||||
#if defined(BINARY_SUPPORT_DLL)
|
||||
HMODULE _hModule;
|
||||
#endif /* BINARY_SUPPORT_DLL */
|
||||
|
||||
};
|
||||
|
||||
extern _CFPlugInData *__CFBundleGetPlugInData(CFBundleRef bundle);
|
||||
|
||||
/* Private CFBundle API */
|
||||
|
||||
CF_PRIVATE CFErrorRef _CFBundleCreateErrorDebug(CFAllocatorRef allocator, CFBundleRef bundle, CFIndex code, CFStringRef debugString);
|
||||
|
||||
CF_PRIVATE void _CFBundleInfoPlistProcessInfoDictionary(CFMutableDictionaryRef dict);
|
||||
CF_PRIVATE Boolean _CFBundleSupportedProductName(CFStringRef fileName, CFRange searchRange);
|
||||
CF_PRIVATE Boolean _CFBundleSupportedPlatformName(CFStringRef fileName, CFRange searchRange);
|
||||
|
||||
CF_EXPORT CFStringRef _CFGetProductName(void);
|
||||
CF_EXPORT CFStringRef _CFGetPlatformName(void);
|
||||
CF_EXPORT CFStringRef _CFGetAlternatePlatformName(void);
|
||||
|
||||
CF_PRIVATE void _CFBundleFlushQueryTableCache(CFBundleRef bundle);
|
||||
|
||||
CF_PRIVATE SInt32 _CFBundleCurrentArchitecture(void);
|
||||
CF_PRIVATE Boolean _CFBundleGetObjCImageInfo(CFBundleRef bundle, uint32_t *objcVersion, uint32_t *objcFlags);
|
||||
|
||||
#if defined(BINARY_SUPPORT_DYLD)
|
||||
CF_PRIVATE CFMutableDictionaryRef _CFBundleCreateInfoDictFromMainExecutable();
|
||||
CF_PRIVATE Boolean _CFBundleGrokObjCImageInfoFromMainExecutable(uint32_t *objcVersion, uint32_t *objcFlags);
|
||||
#endif
|
||||
|
||||
CF_PRIVATE CFStringRef _CFBundleCopyLoadedImagePathForPointer(void *p);
|
||||
|
||||
// Languages and locales
|
||||
|
||||
CF_PRIVATE CFArrayRef _CFBundleCopyLanguageSearchListInDirectory(CFURLRef url, uint8_t *version);
|
||||
CF_PRIVATE CFArrayRef _CFBundleCopyLanguageSearchListInBundle(CFBundleRef bundle);
|
||||
|
||||
CF_PRIVATE Boolean CFBundleAllowMixedLocalizations(void);
|
||||
|
||||
// Misc
|
||||
|
||||
extern Boolean _CFIsResourceAtURL(CFURLRef url, Boolean *isDir);
|
||||
extern Boolean _CFIsResourceAtPath(CFStringRef path, Boolean *isDir);
|
||||
|
||||
CF_PRIVATE uint8_t _CFBundleGetBundleVersionForURL(CFURLRef url);
|
||||
extern CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt8 *version);
|
||||
extern CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectoryWithVersion(CFAllocatorRef alloc, CFURLRef url, UInt8 version);
|
||||
extern CFURLRef _CFBundleCopySupportFilesDirectoryURLInDirectory(CFURLRef bundleURL, UInt8 version);
|
||||
extern CFURLRef _CFBundleCopyResourcesDirectoryURLInDirectory(CFURLRef bundleURL, UInt8 version);
|
||||
|
||||
extern Boolean _CFBundleCouldBeBundle(CFURLRef url);
|
||||
extern CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceForkWithAllocator(CFAllocatorRef alloc, CFURLRef url);
|
||||
CF_PRIVATE CFStringRef _CFBundleCopyExecutableName(CFBundleRef bundle, CFURLRef url, CFDictionaryRef infoDict);
|
||||
#if DEPLOYMENT_TARGET_MACOSX
|
||||
CF_PRIVATE CFStringRef _CFBundleCopyBundleDevelopmentRegionFromVersResource(CFBundleRef bundle);
|
||||
#endif
|
||||
extern CFDictionaryRef _CFBundleCopyInfoDictionaryInExecutable(CFURLRef url);
|
||||
extern CFArrayRef _CFBundleCopyArchitecturesForExecutable(CFURLRef url);
|
||||
|
||||
extern CFStringRef _CFBundleGetPlatformExecutablesSubdirectoryName(void);
|
||||
extern CFStringRef _CFBundleGetAlternatePlatformExecutablesSubdirectoryName(void);
|
||||
extern CFStringRef _CFBundleGetOtherPlatformExecutablesSubdirectoryName(void);
|
||||
extern CFStringRef _CFBundleGetOtherAlternatePlatformExecutablesSubdirectoryName(void);
|
||||
|
||||
extern CFStringRef _CFCreateStringFromVersionNumber(CFAllocatorRef alloc, UInt32 vers);
|
||||
extern UInt32 _CFVersionNumberFromString(CFStringRef versStr);
|
||||
|
||||
extern void _CFBundleScheduleForUnloading(CFBundleRef bundle);
|
||||
extern void _CFBundleUnscheduleForUnloading(CFBundleRef bundle);
|
||||
extern void _CFBundleUnloadScheduledBundles(void);
|
||||
|
||||
CF_PRIVATE void _CFBundleAppendResourceDir(CFMutableStringRef path, uint8_t version);
|
||||
|
||||
CF_PRIVATE UInt8 _CFBundleLayoutVersion(CFBundleRef bundle);
|
||||
|
||||
#if defined(BINARY_SUPPORT_DYLD)
|
||||
// DYLD API
|
||||
extern __CFPBinaryType _CFBundleGrokBinaryType(CFURLRef executableURL);
|
||||
extern CFArrayRef _CFBundleDYLDCopyLoadedImagePathsIfChanged(void);
|
||||
extern CFArrayRef _CFBundleDYLDCopyLoadedImagePathsForHint(CFStringRef hint);
|
||||
#if !defined(BINARY_SUPPORT_DLFCN)
|
||||
extern Boolean _CFBundleDYLDCheckLoaded(CFBundleRef bundle);
|
||||
extern Boolean _CFBundleDYLDLoadBundle(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error);
|
||||
extern Boolean _CFBundleDYLDLoadFramework(CFBundleRef bundle, CFErrorRef *error);
|
||||
extern void _CFBundleDYLDUnloadBundle(CFBundleRef bundle);
|
||||
extern void *_CFBundleDYLDGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName);
|
||||
#endif /* !BINARY_SUPPORT_DLFCN */
|
||||
#endif /* BINARY_SUPPORT_DYLD */
|
||||
|
||||
#if defined(BINARY_SUPPORT_DLFCN)
|
||||
// dlfcn API
|
||||
extern Boolean _CFBundleDlfcnCheckLoaded(CFBundleRef bundle);
|
||||
extern Boolean _CFBundleDlfcnPreflight(CFBundleRef bundle, CFErrorRef *error);
|
||||
extern Boolean _CFBundleDlfcnLoadBundle(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error);
|
||||
extern Boolean _CFBundleDlfcnLoadFramework(CFBundleRef bundle, CFErrorRef *error);
|
||||
extern void _CFBundleDlfcnUnload(CFBundleRef bundle);
|
||||
extern void *_CFBundleDlfcnGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName);
|
||||
#endif /* BINARY_SUPPORT_DLFCN */
|
||||
|
||||
#if defined(BINARY_SUPPORT_DLL)
|
||||
extern Boolean _CFBundleDLLLoad(CFBundleRef bundle, CFErrorRef *error);
|
||||
extern void _CFBundleDLLUnload(CFBundleRef bundle);
|
||||
extern void *_CFBundleDLLGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName);
|
||||
#endif /* BINARY_SUPPORT_DLL */
|
||||
|
||||
|
||||
/* Private PlugIn-related CFBundle API */
|
||||
|
||||
extern Boolean _CFBundleNeedsInitPlugIn(CFBundleRef bundle);
|
||||
extern void _CFBundleInitPlugIn(CFBundleRef bundle);
|
||||
extern void _CFBundlePlugInLoaded(CFBundleRef bundle);
|
||||
extern void _CFBundleDeallocatePlugIn(CFBundleRef bundle);
|
||||
|
||||
extern void _CFPlugInWillUnload(CFPlugInRef plugIn);
|
||||
|
||||
extern void _CFPlugInAddPlugInInstance(CFPlugInRef plugIn);
|
||||
extern void _CFPlugInRemovePlugInInstance(CFPlugInRef plugIn);
|
||||
|
||||
extern void _CFPlugInAddFactory(CFPlugInRef plugIn, _CFPFactoryRef factory);
|
||||
extern void _CFPlugInRemoveFactory(CFPlugInRef plugIn, _CFPFactoryRef factory);
|
||||
|
||||
|
||||
/* Strings for parsing bundle structure */
|
||||
#define _CFBundleSupportFilesDirectoryName1 CFSTR("Support Files")
|
||||
#define _CFBundleSupportFilesDirectoryName2 CFSTR("Contents")
|
||||
#define _CFBundleResourcesDirectoryName CFSTR("Resources")
|
||||
#define _CFBundleExecutablesDirectoryName CFSTR("Executables")
|
||||
#define _CFBundleNonLocalizedResourcesDirectoryName CFSTR("Non-localized Resources")
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define _CFBundleSupportFilesDirectoryName1WithResources CFSTR("Support Files\\Resources")
|
||||
#define _CFBundleSupportFilesDirectoryName2WithResources CFSTR("Contents\\Resources")
|
||||
#else
|
||||
#define _CFBundleSupportFilesDirectoryName1WithResources CFSTR("Support Files/Resources")
|
||||
#define _CFBundleSupportFilesDirectoryName2WithResources CFSTR("Contents/Resources")
|
||||
#endif
|
||||
|
||||
#define _CFBundleSupportFilesURLFromBase1 CFSTR("Support%20Files/")
|
||||
#define _CFBundleSupportFilesURLFromBase2 CFSTR("Contents/")
|
||||
#define _CFBundleResourcesURLFromBase0 CFSTR("Resources/")
|
||||
#define _CFBundleResourcesURLFromBase1 CFSTR("Support%20Files/Resources/")
|
||||
#define _CFBundleResourcesURLFromBase2 CFSTR("Contents/Resources/")
|
||||
#define _CFBundleAppStoreReceiptURLFromBase0 CFSTR("_MASReceipt/receipt")
|
||||
#define _CFBundleAppStoreReceiptURLFromBase1 CFSTR("Support%20Files/_MASReceipt/receipt")
|
||||
#define _CFBundleAppStoreReceiptURLFromBase2 CFSTR("Contents/_MASReceipt/receipt")
|
||||
#define _CFBundleExecutablesURLFromBase1 CFSTR("Support%20Files/Executables/")
|
||||
#define _CFBundleExecutablesURLFromBase2 CFSTR("Contents/")
|
||||
|
||||
#define _CFBundleInfoURLFromBase0 CFSTR("Resources/Info.plist")
|
||||
#define _CFBundleInfoURLFromBase1 CFSTR("Support%20Files/Info.plist")
|
||||
#define _CFBundleInfoURLFromBase2 CFSTR("Contents/Info.plist")
|
||||
#define _CFBundleInfoURLFromBase3 CFSTR("Info.plist")
|
||||
#define _CFBundleInfoURLFromBaseNoExtension3 CFSTR("Info")
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX
|
||||
#define _CFBundlePlatformInfoURLFromBase0 CFSTR("Resources/Info-macos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase1 CFSTR("Support%20Files/Info-macos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase2 CFSTR("Contents/Info-macos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase3 CFSTR("Info-macos.plist")
|
||||
#elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
#define _CFBundlePlatformInfoURLFromBase0 CFSTR("Resources/Info-iphoneos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase1 CFSTR("Support%20Files/Info-iphoneos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase2 CFSTR("Contents/Info-iphoneos.plist")
|
||||
#define _CFBundlePlatformInfoURLFromBase3 CFSTR("Info-iphoneos.plist")
|
||||
#else
|
||||
// No platform-specific variants in these cases
|
||||
#define _CFBundlePlatformInfoURLFromBase0 _CFBundleInfoURLFromBase0
|
||||
#define _CFBundlePlatformInfoURLFromBase1 _CFBundleInfoURLFromBase1
|
||||
#define _CFBundlePlatformInfoURLFromBase2 _CFBundleInfoURLFromBase2
|
||||
#define _CFBundlePlatformInfoURLFromBase3 _CFBundleInfoURLFromBase3
|
||||
#endif
|
||||
|
||||
#define _CFBundleInfoPlistName CFSTR("Info.plist")
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX
|
||||
#define _CFBundlePlatformInfoPlistName CFSTR("Info-macos.plist")
|
||||
#elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
#define _CFBundlePlatformInfoPlistName CFSTR("Info-iphoneos.plist")
|
||||
#else
|
||||
// No platform-specific Info.plist for these
|
||||
#define _CFBundlePlatformInfoPlistName _CFBundleInfoPlistName
|
||||
#endif
|
||||
|
||||
#define _CFBundleInfoExtension CFSTR("plist")
|
||||
#define _CFBundleLocalInfoName CFSTR("InfoPlist")
|
||||
#define _CFBundlePkgInfoURLFromBase1 CFSTR("Support%20Files/PkgInfo")
|
||||
#define _CFBundlePkgInfoURLFromBase2 CFSTR("Contents/PkgInfo")
|
||||
#define _CFBundlePseudoPkgInfoURLFromBase CFSTR("PkgInfo")
|
||||
#define _CFBundlePrivateFrameworksURLFromBase0 CFSTR("Frameworks/")
|
||||
#define _CFBundlePrivateFrameworksURLFromBase1 CFSTR("Support%20Files/Frameworks/")
|
||||
#define _CFBundlePrivateFrameworksURLFromBase2 CFSTR("Contents/Frameworks/")
|
||||
#define _CFBundleSharedFrameworksURLFromBase0 CFSTR("SharedFrameworks/")
|
||||
#define _CFBundleSharedFrameworksURLFromBase1 CFSTR("Support%20Files/SharedFrameworks/")
|
||||
#define _CFBundleSharedFrameworksURLFromBase2 CFSTR("Contents/SharedFrameworks/")
|
||||
#define _CFBundleSharedSupportURLFromBase0 CFSTR("SharedSupport/")
|
||||
#define _CFBundleSharedSupportURLFromBase1 CFSTR("Support%20Files/SharedSupport/")
|
||||
#define _CFBundleSharedSupportURLFromBase2 CFSTR("Contents/SharedSupport/")
|
||||
#define _CFBundleBuiltInPlugInsURLFromBase0 CFSTR("PlugIns/")
|
||||
#define _CFBundleBuiltInPlugInsURLFromBase1 CFSTR("Support%20Files/PlugIns/")
|
||||
#define _CFBundleBuiltInPlugInsURLFromBase2 CFSTR("Contents/PlugIns/")
|
||||
#define _CFBundleAlternateBuiltInPlugInsURLFromBase0 CFSTR("Plug-ins/")
|
||||
#define _CFBundleAlternateBuiltInPlugInsURLFromBase1 CFSTR("Support%20Files/Plug-ins/")
|
||||
#define _CFBundleAlternateBuiltInPlugInsURLFromBase2 CFSTR("Contents/Plug-ins/")
|
||||
|
||||
#define _CFBundleLprojExtension CFSTR("lproj")
|
||||
#define _CFBundleLprojExtensionWithDot CFSTR(".lproj")
|
||||
#define _CFBundleDot CFSTR(".")
|
||||
#define _CFBundleAllFiles CFSTR("_CFBAF_")
|
||||
#define _CFBundleTypeIndicator CFSTR("_CFBT_")
|
||||
// This directory contains resources (especially nibs) that may look up localized resources or may fall back to the development language resources
|
||||
#define _CFBundleBaseDirectory CFSTR("Base")
|
||||
|
||||
#define _CFBundleMacOSXPlatformName CFSTR("macos")
|
||||
#define _CFBundleAlternateMacOSXPlatformName CFSTR("macosx")
|
||||
#define _CFBundleiPhoneOSPlatformName CFSTR("iphoneos")
|
||||
#define _CFBundleMacOS8PlatformName CFSTR("macosclassic")
|
||||
#define _CFBundleAlternateMacOS8PlatformName CFSTR("macos8")
|
||||
#define _CFBundleWindowsPlatformName CFSTR("windows")
|
||||
#define _CFBundleHPUXPlatformName CFSTR("hpux")
|
||||
#define _CFBundleSolarisPlatformName CFSTR("solaris")
|
||||
#define _CFBundleLinuxPlatformName CFSTR("linux")
|
||||
#define _CFBundleFreeBSDPlatformName CFSTR("freebsd")
|
||||
|
||||
#define _CFBundleDefaultStringTableName CFSTR("Localizable")
|
||||
#define _CFBundleStringTableType CFSTR("strings")
|
||||
#define _CFBundleStringDictTableType CFSTR("stringsdict")
|
||||
|
||||
#define _CFBundleUserLanguagesPreferenceName CFSTR("AppleLanguages")
|
||||
#define _CFBundleOldUserLanguagesPreferenceName CFSTR("NSLanguages")
|
||||
|
||||
#define _CFBundleLocalizedResourceForkFileName CFSTR("Localized")
|
||||
|
||||
#define _CFBundleWindowsResourceDirectoryExtension CFSTR("resources")
|
||||
|
||||
#define _CFBundleMacOSXInfoPlistPlatformName_OLD CFSTR("macos")
|
||||
#define _CFBundleWindowsInfoPlistPlatformName_OLD CFSTR("win32")
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBUNDLE_INTERNAL__ */
|
||||
|
1
CFBundle_Internal.h
Symbolic link
1
CFBundle_Internal.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBundle_Internal.h
|
199
CFBurstTrie.h
199
CFBurstTrie.h
@ -1,199 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFBurstTrie.h
|
||||
Copyright (c) 2008-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBURSTTRIE__)
|
||||
#define __COREFOUNDATION_CFBURSTTRIE__ 1
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct _CFBurstTrie *CFBurstTrieRef;
|
||||
typedef struct _CFBurstTrieCursor *CFBurstTrieCursorRef;
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFBurstTrieOpts) {
|
||||
/*!
|
||||
BurstTrie Options
|
||||
Use one or more of these options with CFBurstTrieCreate to tailor optimizations to the data
|
||||
structure for a specific kind of application. Default is no read-write, no compression.
|
||||
*/
|
||||
|
||||
/* kCFBurstTrieReadOnly
|
||||
When specified, the dictionary file will be serialized in an optimized format so as to be
|
||||
memory-mapped on the next read. Once a trie is serialized as read-only, insertions can no
|
||||
longer occur.
|
||||
*/
|
||||
kCFBurstTrieReadOnly = 1<<1,
|
||||
|
||||
/* kCFBurstTrieBitmapCompression
|
||||
This option can only be used with a read-only trie, and can be used to reduce on disk file size.
|
||||
*/
|
||||
kCFBurstTrieBitmapCompression = 1<<2,
|
||||
|
||||
/*
|
||||
kCFBurstTriePrefixCompression
|
||||
This option can only be used with a read-only trie, and can be used to reduce on-disk file size.
|
||||
It is important to note that any optimizations based on word frequency will be lost; recommended
|
||||
for applications that often search for infrequent or uncommon words. This also allow you to use
|
||||
cursor interface.
|
||||
*/
|
||||
kCFBurstTriePrefixCompression = 1<<3,
|
||||
|
||||
/*
|
||||
kCFBurstTriePrefixCompression
|
||||
By default, keys at list level are sorted by weight. Use this option to sort them by key value.
|
||||
This allow you to use cursor interface.
|
||||
*/
|
||||
kCFBurstTrieSortByKey = 1 << 4
|
||||
};
|
||||
|
||||
// Value for this option should be a CFNumber which contains an int.
|
||||
#define kCFBurstTrieCreationOptionNameContainerSize CFSTR("ContainerSize")
|
||||
|
||||
typedef void (*CFBurstTrieTraversalCallback)(void* context, const UInt8* key, uint32_t keyLength, uint32_t payload, Boolean *stop);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieRef CFBurstTrieCreate() CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieRef CFBurstTrieCreateWithOptions(CFDictionaryRef options) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieRef CFBurstTrieCreateFromFile(CFStringRef path) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieRef CFBurstTrieCreateFromMapBytes(char *mapBase) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsert(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAdd(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsertCharacters(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAddCharacters(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsertUTF8String(CFBurstTrieRef trie, UInt8 *chars, CFIndex numChars, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAddUTF8String(CFBurstTrieRef trie, UInt8 *chars, CFIndex numChars, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsertWithWeight(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, CFIndex weight, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAddWithWeight(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, uint32_t weight, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsertCharactersWithWeight(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, CFIndex weight, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAddCharactersWithWeight(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, uint32_t weight, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieInsertUTF8StringWithWeight(CFBurstTrieRef trie, UInt8 *chars, CFIndex numChars, CFIndex weight, CFIndex payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieAddUTF8StringWithWeight(CFBurstTrieRef trie, UInt8 *chars, CFIndex numChars, uint32_t weight, uint32_t payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieFind(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, CFIndex *payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieContains(CFBurstTrieRef trie, CFStringRef term, CFRange termRange, uint32_t *payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieFindCharacters(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, CFIndex *payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieContainsCharacters(CFBurstTrieRef trie, UniChar *chars, CFIndex numChars, uint32_t *payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieFindUTF8String(CFBurstTrieRef trie, UInt8 *key, CFIndex length, CFIndex *payload) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieContainsUTF8String(CFBurstTrieRef trie, UInt8 *key, CFIndex length, uint32_t *payload) CF_AVAILABLE(10_7, 5_0);
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieSerialize(CFBurstTrieRef trie, CFStringRef path, CFBurstTrieOpts opts) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieSerializeWithFileDescriptor(CFBurstTrieRef trie, int fd, CFBurstTrieOpts opts) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBurstTrieTraverse(CFBurstTrieRef trie, void *ctx, void (*callback)(void*, const UInt8*, uint32_t, uint32_t)) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFBurstTrieGetCount(CFBurstTrieRef trie) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieRef CFBurstTrieRetain(CFBurstTrieRef trie) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBurstTrieRelease(CFBurstTrieRef trie) CF_AVAILABLE(10_7, 4_2);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieCursorRef CFBurstTrieCreateCursorForBytes(CFBurstTrieRef trie, const UInt8* bytes, CFIndex length) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFBurstTrieCursorRef CFBurstTrieCursorCreateByCopy(CFBurstTrieCursorRef cursor) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieSetCursorForBytes(CFBurstTrieRef trie, CFBurstTrieCursorRef cursor, const UInt8* bytes, CFIndex length) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieCursorIsEqual(CFBurstTrieCursorRef lhs, CFBurstTrieCursorRef rhs) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieCursorAdvanceForBytes(CFBurstTrieCursorRef cursor, const UInt8* bytes, CFIndex length) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBurstTrieCursorGetPayload(CFBurstTrieCursorRef cursor, uint32_t *payload) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBurstTrieTraverseFromCursor(CFBurstTrieCursorRef cursor, void *ctx, CFBurstTrieTraversalCallback callback) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT
|
||||
void CFBurstTrieCursorRelease(CFBurstTrieCursorRef cursor) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* __COREFOUNDATION_CFBURSTTRIE__ */
|
1
CFBurstTrie.h
Symbolic link
1
CFBurstTrie.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFBurstTrie.h
|
323
CFByteOrder.h
323
CFByteOrder.h
@ -1,323 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFByteOrder.h
|
||||
Copyright (c) 1995-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFBYTEORDER__)
|
||||
#define __COREFOUNDATION_CFBYTEORDER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#if ((TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) && !defined(CF_USE_OSBYTEORDER_H)
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#define CF_USE_OSBYTEORDER_H 1
|
||||
#endif
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
enum __CFByteOrder {
|
||||
CFByteOrderUnknown,
|
||||
CFByteOrderLittleEndian,
|
||||
CFByteOrderBigEndian
|
||||
};
|
||||
typedef CFIndex CFByteOrder;
|
||||
|
||||
CF_INLINE CFByteOrder CFByteOrderGetCurrent(void) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
int32_t byteOrder = OSHostByteOrder();
|
||||
switch (byteOrder) {
|
||||
case OSLittleEndian: return CFByteOrderLittleEndian;
|
||||
case OSBigEndian: return CFByteOrderBigEndian;
|
||||
default: break;
|
||||
}
|
||||
return CFByteOrderUnknown;
|
||||
#else
|
||||
#if __LITTLE_ENDIAN__
|
||||
return CFByteOrderLittleEndian;
|
||||
#elif __BIG_ENDIAN__
|
||||
return CFByteOrderBigEndian;
|
||||
#else
|
||||
return CFByteOrderUnknown;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint16_t CFSwapInt16(uint16_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapInt16(arg);
|
||||
#else
|
||||
uint16_t result;
|
||||
result = (uint16_t)(((arg << 8) & 0xFF00) | ((arg >> 8) & 0xFF));
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint32_t CFSwapInt32(uint32_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapInt32(arg);
|
||||
#else
|
||||
uint32_t result;
|
||||
result = ((arg & 0xFF) << 24) | ((arg & 0xFF00) << 8) | ((arg >> 8) & 0xFF00) | ((arg >> 24) & 0xFF);
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint64_t CFSwapInt64(uint64_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapInt64(arg);
|
||||
#else
|
||||
union CFSwap {
|
||||
uint64_t sv;
|
||||
uint32_t ul[2];
|
||||
} tmp, result;
|
||||
tmp.sv = arg;
|
||||
result.ul[0] = CFSwapInt32(tmp.ul[1]);
|
||||
result.ul[1] = CFSwapInt32(tmp.ul[0]);
|
||||
return result.sv;
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint16_t CFSwapInt16BigToHost(uint16_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapBigToHostInt16(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt16(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint32_t CFSwapInt32BigToHost(uint32_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapBigToHostInt32(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt32(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint64_t CFSwapInt64BigToHost(uint64_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapBigToHostInt64(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt64(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint16_t CFSwapInt16HostToBig(uint16_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToBigInt16(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt16(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint32_t CFSwapInt32HostToBig(uint32_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToBigInt32(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt32(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint64_t CFSwapInt64HostToBig(uint64_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToBigInt64(arg);
|
||||
#elif __BIG_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt64(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint16_t CFSwapInt16LittleToHost(uint16_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapLittleToHostInt16(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt16(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint32_t CFSwapInt32LittleToHost(uint32_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapLittleToHostInt32(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt32(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint64_t CFSwapInt64LittleToHost(uint64_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapLittleToHostInt64(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt64(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint16_t CFSwapInt16HostToLittle(uint16_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToLittleInt16(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt16(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint32_t CFSwapInt32HostToLittle(uint32_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToLittleInt32(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt32(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
CF_INLINE uint64_t CFSwapInt64HostToLittle(uint64_t arg) {
|
||||
#if CF_USE_OSBYTEORDER_H
|
||||
return OSSwapHostToLittleInt64(arg);
|
||||
#elif __LITTLE_ENDIAN__
|
||||
return arg;
|
||||
#else
|
||||
return CFSwapInt64(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct {uint32_t v;} CFSwappedFloat32;
|
||||
typedef struct {uint64_t v;} CFSwappedFloat64;
|
||||
|
||||
CF_INLINE CFSwappedFloat32 CFConvertFloat32HostToSwapped(Float32 arg) {
|
||||
union CFSwap {
|
||||
Float32 v;
|
||||
CFSwappedFloat32 sv;
|
||||
} result;
|
||||
result.v = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt32(result.sv.v);
|
||||
#endif
|
||||
return result.sv;
|
||||
}
|
||||
|
||||
CF_INLINE Float32 CFConvertFloat32SwappedToHost(CFSwappedFloat32 arg) {
|
||||
union CFSwap {
|
||||
Float32 v;
|
||||
CFSwappedFloat32 sv;
|
||||
} result;
|
||||
result.sv = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt32(result.sv.v);
|
||||
#endif
|
||||
return result.v;
|
||||
}
|
||||
|
||||
CF_INLINE CFSwappedFloat64 CFConvertFloat64HostToSwapped(Float64 arg) {
|
||||
union CFSwap {
|
||||
Float64 v;
|
||||
CFSwappedFloat64 sv;
|
||||
} result;
|
||||
result.v = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt64(result.sv.v);
|
||||
#endif
|
||||
return result.sv;
|
||||
}
|
||||
|
||||
CF_INLINE Float64 CFConvertFloat64SwappedToHost(CFSwappedFloat64 arg) {
|
||||
union CFSwap {
|
||||
Float64 v;
|
||||
CFSwappedFloat64 sv;
|
||||
} result;
|
||||
result.sv = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt64(result.sv.v);
|
||||
#endif
|
||||
return result.v;
|
||||
}
|
||||
|
||||
CF_INLINE CFSwappedFloat32 CFConvertFloatHostToSwapped(float arg) {
|
||||
union CFSwap {
|
||||
float v;
|
||||
CFSwappedFloat32 sv;
|
||||
} result;
|
||||
result.v = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt32(result.sv.v);
|
||||
#endif
|
||||
return result.sv;
|
||||
}
|
||||
|
||||
CF_INLINE float CFConvertFloatSwappedToHost(CFSwappedFloat32 arg) {
|
||||
union CFSwap {
|
||||
float v;
|
||||
CFSwappedFloat32 sv;
|
||||
} result;
|
||||
result.sv = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt32(result.sv.v);
|
||||
#endif
|
||||
return result.v;
|
||||
}
|
||||
|
||||
CF_INLINE CFSwappedFloat64 CFConvertDoubleHostToSwapped(double arg) {
|
||||
union CFSwap {
|
||||
double v;
|
||||
CFSwappedFloat64 sv;
|
||||
} result;
|
||||
result.v = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt64(result.sv.v);
|
||||
#endif
|
||||
return result.sv;
|
||||
}
|
||||
|
||||
CF_INLINE double CFConvertDoubleSwappedToHost(CFSwappedFloat64 arg) {
|
||||
union CFSwap {
|
||||
double v;
|
||||
CFSwappedFloat64 sv;
|
||||
} result;
|
||||
result.sv = arg;
|
||||
#if __LITTLE_ENDIAN__
|
||||
result.sv.v = CFSwapInt64(result.sv.v);
|
||||
#endif
|
||||
return result.v;
|
||||
}
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFBYTEORDER__ */
|
||||
|
1
CFByteOrder.h
Symbolic link
1
CFByteOrder.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFByteOrder.h
|
135
CFCalendar.h
135
CFCalendar.h
@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFCalendar.h
|
||||
Copyright (c) 2004-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFCALENDAR__)
|
||||
#define __COREFOUNDATION_CFCALENDAR__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFLocale.h>
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFTimeZone.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSCalendar) __CFCalendar * CFCalendarRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFCalendarGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFCalendarRef CFCalendarCopyCurrent(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFCalendarRef CFCalendarCreateWithIdentifier(CFAllocatorRef allocator, CFStringRef identifier);
|
||||
// Create a calendar. The identifiers are the kCF*Calendar
|
||||
// constants in CFLocale.h.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFCalendarGetIdentifier(CFCalendarRef calendar);
|
||||
// Returns the calendar's identifier.
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFCalendarCopyLocale(CFCalendarRef calendar);
|
||||
|
||||
CF_EXPORT
|
||||
void CFCalendarSetLocale(CFCalendarRef calendar, CFLocaleRef locale);
|
||||
|
||||
CF_EXPORT
|
||||
CFTimeZoneRef CFCalendarCopyTimeZone(CFCalendarRef calendar);
|
||||
|
||||
CF_EXPORT
|
||||
void CFCalendarSetTimeZone(CFCalendarRef calendar, CFTimeZoneRef tz);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFCalendarGetFirstWeekday(CFCalendarRef calendar);
|
||||
|
||||
CF_EXPORT
|
||||
void CFCalendarSetFirstWeekday(CFCalendarRef calendar, CFIndex wkdy);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFCalendarGetMinimumDaysInFirstWeek(CFCalendarRef calendar);
|
||||
|
||||
CF_EXPORT
|
||||
void CFCalendarSetMinimumDaysInFirstWeek(CFCalendarRef calendar, CFIndex mwd);
|
||||
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFCalendarUnit) {
|
||||
kCFCalendarUnitEra = (1UL << 1),
|
||||
kCFCalendarUnitYear = (1UL << 2),
|
||||
kCFCalendarUnitMonth = (1UL << 3),
|
||||
kCFCalendarUnitDay = (1UL << 4),
|
||||
kCFCalendarUnitHour = (1UL << 5),
|
||||
kCFCalendarUnitMinute = (1UL << 6),
|
||||
kCFCalendarUnitSecond = (1UL << 7),
|
||||
kCFCalendarUnitWeek CF_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0) = (1UL << 8),
|
||||
kCFCalendarUnitWeekday = (1UL << 9),
|
||||
kCFCalendarUnitWeekdayOrdinal = (1UL << 10),
|
||||
kCFCalendarUnitQuarter CF_ENUM_AVAILABLE(10_6, 4_0) = (1UL << 11),
|
||||
kCFCalendarUnitWeekOfMonth CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 12),
|
||||
kCFCalendarUnitWeekOfYear CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 13),
|
||||
kCFCalendarUnitYearForWeekOfYear CF_ENUM_AVAILABLE(10_7, 5_0) = (1UL << 14),
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit);
|
||||
|
||||
CF_EXPORT
|
||||
CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit);
|
||||
|
||||
CF_EXPORT
|
||||
CFRange CFCalendarGetRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFCalendarGetOrdinalityOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFCalendarGetTimeRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at, CFAbsoluteTime *startp, CFTimeInterval *tip) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, /* out */ CFAbsoluteTime *at, const char *componentDesc, ...);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, ...);
|
||||
|
||||
|
||||
enum {
|
||||
kCFCalendarComponentsWrap = (1UL << 0) // option for adding
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFCalendarAddComponents(CFCalendarRef calendar, /* inout */ CFAbsoluteTime *at, CFOptionFlags options, const char *componentDesc, ...);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, ...);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFCALENDAR__ */
|
||||
|
1
CFCalendar.h
Symbolic link
1
CFCalendar.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFCalendar.h
|
405
CFCharacterSet.h
405
CFCharacterSet.h
@ -1,405 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFCharacterSet.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@header CFCharacterSet
|
||||
CFCharacterSet represents a set, or a bag, of Unicode characters.
|
||||
The API consists of 3 groups:
|
||||
1) creation/manipulation of CFCharacterSet instances,
|
||||
2) query of a single Unicode character membership,
|
||||
and 3) bitmap representation related (reading/writing).
|
||||
Conceptually, CFCharacterSet is a 136K byte bitmap array of
|
||||
which each bit represents a Unicode code point. It could
|
||||
contain the Unicode characters in ISO 10646 Basic Multilingual
|
||||
Plane (BMP) and characters in Plane 1 through Plane 16
|
||||
accessible via surrogate paris in the Unicode Transformation
|
||||
Format, 16-bit encoding form (UTF-16). In other words, it can
|
||||
store values from 0x00000 to 0x10FFFF in the Unicode
|
||||
Transformation Format, 32-bit encoding form (UTF-32). However,
|
||||
in general, how CFCharacterSet stores the information is an
|
||||
implementation detail. Note even CFData used for the external
|
||||
bitmap representation rarely has 136K byte. For detailed
|
||||
discussion of the external bitmap representation, refer to the
|
||||
comments for CFCharacterSetCreateWithBitmapRepresentation below.
|
||||
Note that the existance of non-BMP characters in a character set
|
||||
does not imply the membership of the corresponding surrogate
|
||||
characters. For example, a character set with U+10000 does not
|
||||
match with U+D800.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFCHARACTERSET__)
|
||||
#define __COREFOUNDATION_CFCHARACTERSET__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFData.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFCharacterSetRef
|
||||
This is the type of a reference to immutable CFCharacterSets.
|
||||
*/
|
||||
typedef const struct CF_BRIDGED_TYPE(NSCharacterSet) __CFCharacterSet * CFCharacterSetRef;
|
||||
|
||||
/*!
|
||||
@typedef CFMutableCharacterSetRef
|
||||
This is the type of a reference to mutable CFMutableCharacterSets.
|
||||
*/
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableCharacterSet) __CFCharacterSet * CFMutableCharacterSetRef;
|
||||
|
||||
/*!
|
||||
@typedef CFCharacterSetPredefinedSet
|
||||
Type of the predefined CFCharacterSet selector values.
|
||||
*/
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFCharacterSetPredefinedSet) {
|
||||
kCFCharacterSetControl = 1, /* Control character set (Unicode General Category Cc and Cf) */
|
||||
kCFCharacterSetWhitespace, /* Whitespace character set (Unicode General Category Zs and U0009 CHARACTER TABULATION) */
|
||||
kCFCharacterSetWhitespaceAndNewline, /* Whitespace and Newline character set (Unicode General Category Z*, U000A ~ U000D, and U0085) */
|
||||
kCFCharacterSetDecimalDigit, /* Decimal digit character set */
|
||||
kCFCharacterSetLetter, /* Letter character set (Unicode General Category L* & M*) */
|
||||
kCFCharacterSetLowercaseLetter, /* Lowercase character set (Unicode General Category Ll) */
|
||||
kCFCharacterSetUppercaseLetter, /* Uppercase character set (Unicode General Category Lu and Lt) */
|
||||
kCFCharacterSetNonBase, /* Non-base character set (Unicode General Category M*) */
|
||||
kCFCharacterSetDecomposable, /* Canonically decomposable character set */
|
||||
kCFCharacterSetAlphaNumeric, /* Alpha Numeric character set (Unicode General Category L*, M*, & N*) */
|
||||
kCFCharacterSetPunctuation, /* Punctuation character set (Unicode General Category P*) */
|
||||
kCFCharacterSetCapitalizedLetter = 13, /* Titlecase character set (Unicode General Category Lt) */
|
||||
kCFCharacterSetSymbol = 14, /* Symbol character set (Unicode General Category S*) */
|
||||
kCFCharacterSetNewline CF_ENUM_AVAILABLE(10_5, 2_0) = 15, /* Newline character set (U000A ~ U000D, U0085, U2028, and U2029) */
|
||||
kCFCharacterSetIllegal = 12/* Illegal character set */
|
||||
};
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetGetTypeID
|
||||
Returns the type identifier of all CFCharacterSet instances.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFTypeID CFCharacterSetGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetGetPredefined
|
||||
Returns a predefined CFCharacterSet instance.
|
||||
@param theSetIdentifier The CFCharacterSetPredefinedSet selector
|
||||
which specifies the predefined character set. If the
|
||||
value is not in CFCharacterSetPredefinedSet, the behavior
|
||||
is undefined.
|
||||
@result A reference to the predefined immutable CFCharacterSet.
|
||||
This instance is owned by CF.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateWithCharactersInRange
|
||||
Creates a new immutable character set with the values from the given range.
|
||||
@param alloc The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theRange The CFRange which should be used to specify the
|
||||
Unicode range the character set is filled with. It
|
||||
accepts the range in 32-bit in the UTF-32 format. The
|
||||
valid character point range is from 0x00000 to 0x10FFFF.
|
||||
If the range is outside of the valid Unicode character
|
||||
point, the behavior is undefined.
|
||||
@result A reference to the new immutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef alloc, CFRange theRange);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateWithCharactersInString
|
||||
Creates a new immutable character set with the values in the given string.
|
||||
@param alloc The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theString The CFString which should be used to specify
|
||||
the Unicode characters the character set is filled with.
|
||||
If this parameter is not a valid CFString, the behavior
|
||||
is undefined.
|
||||
@result A reference to the new immutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFCharacterSetRef CFCharacterSetCreateWithCharactersInString(CFAllocatorRef alloc, CFStringRef theString);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateWithBitmapRepresentation
|
||||
Creates a new immutable character set with the bitmap representtion in the given data.
|
||||
@param alloc The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theData The CFData which should be used to specify the
|
||||
bitmap representation of the Unicode character points
|
||||
the character set is filled with. The bitmap
|
||||
representation could contain all the Unicode character
|
||||
range starting from BMP to Plane 16. The first 8192 bytes
|
||||
of the data represent the BMP range. The BMP range 8192
|
||||
bytes can be followed by zero to sixteen 8192 byte
|
||||
bitmaps, each one with the plane index byte prepended.
|
||||
For example, the bitmap representing the BMP and Plane 2
|
||||
has the size of 16385 bytes (8192 bytes for BMP, 1 byte
|
||||
index + 8192 bytes bitmap for Plane 2). The plane index
|
||||
byte, in this case, contains the integer value two. If
|
||||
this parameter is not a valid CFData or it contains a
|
||||
Plane index byte outside of the valid Plane range
|
||||
(1 to 16), the behavior is undefined.
|
||||
@result A reference to the new immutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef alloc, CFDataRef theData);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateInvertedSet
|
||||
Creates a new immutable character set that is the invert of the specified character set.
|
||||
@param alloc The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theSet The CFCharacterSet which is to be inverted. If this
|
||||
parameter is not a valid CFCharacterSet, the behavior is
|
||||
undefined.
|
||||
@result A reference to the new immutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIsSupersetOfSet
|
||||
Reports whether or not the character set is a superset of the character set specified as the second parameter.
|
||||
@param theSet The character set to be checked for the membership of theOtherSet.
|
||||
If this parameter is not a valid CFCharacterSet, the behavior is undefined.
|
||||
@param theOtherset The character set to be checked whether or not it is a subset of theSet.
|
||||
If this parameter is not a valid CFCharacterSet, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT Boolean CFCharacterSetIsSupersetOfSet(CFCharacterSetRef theSet, CFCharacterSetRef theOtherset);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetHasMemberInPlane
|
||||
Reports whether or not the character set contains at least one member character in the specified plane.
|
||||
@param theSet The character set to be checked for the membership. If this
|
||||
parameter is not a valid CFCharacterSet, the behavior is undefined.
|
||||
@param thePlane The plane number to be checked for the membership.
|
||||
The valid value range is from 0 to 16. If the value is outside of the valid
|
||||
plane number range, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlane);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateMutable
|
||||
Creates a new empty mutable character set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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.
|
||||
@result A reference to the new mutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableCharacterSetRef CFCharacterSetCreateMutable(CFAllocatorRef alloc);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateCopy
|
||||
Creates a new character set with the values from the given character set. This function tries to compact the backing store where applicable.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theSet The CFCharacterSet which is to be copied. If this
|
||||
parameter is not a valid CFCharacterSet, the behavior is
|
||||
undefined.
|
||||
@result A reference to the new CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFCharacterSetRef CFCharacterSetCreateCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateMutableCopy
|
||||
Creates a new mutable character set with the values from the given character set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theSet The CFCharacterSet which is to be copied. If this
|
||||
parameter is not a valid CFCharacterSet, the behavior is
|
||||
undefined.
|
||||
@result A reference to the new mutable CFCharacterSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIsCharacterMember
|
||||
Reports whether or not the Unicode character is in the character set.
|
||||
@param theSet The character set to be searched. If this parameter
|
||||
is not a valid CFCharacterSet, the behavior is undefined.
|
||||
@param theChar The Unicode character for which to test against the
|
||||
character set. Note that this function takes 16-bit Unicode
|
||||
character value; hence, it does not support access to the
|
||||
non-BMP planes.
|
||||
@result true, if the value is in the character set, otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFCharacterSetIsCharacterMember(CFCharacterSetRef theSet, UniChar theChar);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIsLongCharacterMember
|
||||
Reports whether or not the UTF-32 character is in the character set.
|
||||
@param theSet The character set to be searched. If this parameter
|
||||
is not a valid CFCharacterSet, the behavior is undefined.
|
||||
@param theChar The UTF-32 character for which to test against the
|
||||
character set.
|
||||
@result true, if the value is in the character set, otherwise false.
|
||||
*/
|
||||
CF_EXPORT Boolean CFCharacterSetIsLongCharacterMember(CFCharacterSetRef theSet, UTF32Char theChar);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetCreateBitmapRepresentation
|
||||
Creates a new immutable data with the bitmap representation from the given character set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the array and its storage for values. 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 theSet The CFCharacterSet which is to be used create the
|
||||
bitmap representation from. Refer to the comments for
|
||||
CFCharacterSetCreateWithBitmapRepresentation for the
|
||||
detailed discussion of the bitmap representation format.
|
||||
If this parameter is not a valid CFCharacterSet, the
|
||||
behavior is undefined.
|
||||
@result A reference to the new immutable CFData.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetAddCharactersInRange
|
||||
Adds the given range to the charaacter set.
|
||||
@param theSet The character set to which the range is to be added.
|
||||
If this parameter is not a valid mutable CFCharacterSet,
|
||||
the behavior is undefined.
|
||||
@param theRange The range to add to the character set. It accepts
|
||||
the range in 32-bit in the UTF-32 format. The valid
|
||||
character point range is from 0x00000 to 0x10FFFF. If the
|
||||
range is outside of the valid Unicode character point,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetRemoveCharactersInRange
|
||||
Removes the given range from the charaacter set.
|
||||
@param theSet The character set from which the range is to be
|
||||
removed. If this parameter is not a valid mutable
|
||||
CFCharacterSet, the behavior is undefined.
|
||||
@param theRange The range to remove from the character set.
|
||||
It accepts the range in 32-bit in the UTF-32 format.
|
||||
The valid character point range is from 0x00000 to 0x10FFFF.
|
||||
If the range is outside of the valid Unicode character point,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetAddCharactersInString
|
||||
Adds the characters in the given string to the charaacter set.
|
||||
@param theSet The character set to which the characters in the
|
||||
string are to be added. If this parameter is not a
|
||||
valid mutable CFCharacterSet, the behavior is undefined.
|
||||
@param theString The string to add to the character set.
|
||||
If this parameter is not a valid CFString, the behavior
|
||||
is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetRemoveCharactersInString
|
||||
Removes the characters in the given string from the charaacter set.
|
||||
@param theSet The character set from which the characters in the
|
||||
string are to be remove. If this parameter is not a
|
||||
valid mutable CFCharacterSet, the behavior is undefined.
|
||||
@param theString The string to remove from the character set.
|
||||
If this parameter is not a valid CFString, the behavior
|
||||
is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetUnion
|
||||
Forms the union with the given character set.
|
||||
@param theSet The destination character set into which the
|
||||
union of the two character sets is stored. If this
|
||||
parameter is not a valid mutable CFCharacterSet, the
|
||||
behavior is undefined.
|
||||
@param theOtherSet The character set with which the union is
|
||||
formed. If this parameter is not a valid CFCharacterSet,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIntersect
|
||||
Forms the intersection with the given character set.
|
||||
@param theSet The destination character set into which the
|
||||
intersection of the two character sets is stored.
|
||||
If this parameter is not a valid mutable CFCharacterSet,
|
||||
the behavior is undefined.
|
||||
@param theOtherSet The character set with which the intersection
|
||||
is formed. If this parameter is not a valid CFCharacterSet,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetInvert
|
||||
Inverts the content of the given character set.
|
||||
@param theSet The character set to be inverted.
|
||||
If this parameter is not a valid mutable CFCharacterSet,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetInvert(CFMutableCharacterSetRef theSet);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFCHARACTERSET__ */
|
||||
|
1
CFCharacterSet.h
Symbolic link
1
CFCharacterSet.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFCharacterSet.h
|
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFCharacterSetPriv.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFCHARACTERSETPRIV__)
|
||||
#define __COREFOUNDATION_CFCHARACTERSETPRIV__ 1
|
||||
|
||||
#include <CoreFoundation/CFCharacterSet.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIsSurrogateHighCharacter
|
||||
Reports whether or not the character is a high surrogate.
|
||||
@param character The character to be checked.
|
||||
@result true, if character is a high surrogate, otherwise false.
|
||||
*/
|
||||
CF_INLINE Boolean CFCharacterSetIsSurrogateHighCharacter(UniChar character) {
|
||||
return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetIsSurrogateLowCharacter
|
||||
Reports whether or not the character is a low surrogate.
|
||||
@param character The character to be checked.
|
||||
@result true, if character is a low surrogate, otherwise false.
|
||||
*/
|
||||
CF_INLINE Boolean CFCharacterSetIsSurrogateLowCharacter(UniChar character) {
|
||||
return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetGetLongCharacterForSurrogatePair
|
||||
Returns the UTF-32 value corresponding to the surrogate pair passed in.
|
||||
@param surrogateHigh The high surrogate character. If this parameter
|
||||
is not a valid high surrogate character, the behavior is undefined.
|
||||
@param surrogateLow The low surrogate character. If this parameter
|
||||
is not a valid low surrogate character, the behavior is undefined.
|
||||
@result The UTF-32 value for the surrogate pair.
|
||||
*/
|
||||
CF_INLINE UTF32Char CFCharacterSetGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) {
|
||||
return (UTF32Char)(((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL);
|
||||
}
|
||||
|
||||
/* Check to see if the character represented by the surrogate pair surrogateHigh & surrogateLow is in the chraracter set */
|
||||
CF_EXPORT Boolean CFCharacterSetIsSurrogatePairMember(CFCharacterSetRef theSet, UniChar surrogateHigh, UniChar surrogateLow) ;
|
||||
|
||||
/* Keyed-coding support
|
||||
*/
|
||||
typedef CF_ENUM(CFIndex, CFCharacterSetKeyedCodingType) {
|
||||
kCFCharacterSetKeyedCodingTypeBitmap = 1,
|
||||
kCFCharacterSetKeyedCodingTypeBuiltin = 2,
|
||||
kCFCharacterSetKeyedCodingTypeRange = 3,
|
||||
kCFCharacterSetKeyedCodingTypeString = 4,
|
||||
kCFCharacterSetKeyedCodingTypeBuiltinAndBitmap = 5
|
||||
};
|
||||
|
||||
CF_EXPORT CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRef cset);
|
||||
CF_EXPORT CFCharacterSetPredefinedSet _CFCharacterSetGetKeyedCodingBuiltinType(CFCharacterSetRef cset);
|
||||
CF_EXPORT CFRange _CFCharacterSetGetKeyedCodingRange(CFCharacterSetRef cset);
|
||||
CF_EXPORT CFStringRef _CFCharacterSetCreateKeyedCodingString(CFCharacterSetRef cset);
|
||||
CF_EXPORT bool _CFCharacterSetIsInverted(CFCharacterSetRef cset);
|
||||
CF_EXPORT void _CFCharacterSetSetIsInverted(CFCharacterSetRef cset, bool flag);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFCHARACTERSETPRIV__ */
|
||||
|
1
CFCharacterSetPriv.h
Symbolic link
1
CFCharacterSetPriv.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFCharacterSetPriv.h
|
97
CFData.h
97
CFData.h
@ -1,97 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFData.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFDATA__)
|
||||
#define __COREFOUNDATION_CFDATA__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSData) __CFData * CFDataRef;
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableData) __CFData * CFMutableDataRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFDataGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
|
||||
|
||||
CF_EXPORT
|
||||
CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
|
||||
/* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */
|
||||
|
||||
CF_EXPORT
|
||||
CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData);
|
||||
|
||||
CF_EXPORT
|
||||
CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
|
||||
|
||||
CF_EXPORT
|
||||
CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData);
|
||||
|
||||
CF_EXPORT
|
||||
CFIndex CFDataGetLength(CFDataRef theData);
|
||||
|
||||
CF_EXPORT
|
||||
const UInt8 *CFDataGetBytePtr(CFDataRef theData);
|
||||
|
||||
CF_EXPORT
|
||||
UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataSetLength(CFMutableDataRef theData, CFIndex length);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range);
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFDataSearchFlags) {
|
||||
kCFDataSearchBackwards = 1UL << 0,
|
||||
kCFDataSearchAnchored = 1UL << 1
|
||||
} CF_ENUM_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFRange CFDataFind(CFDataRef theData, CFDataRef dataToFind, CFRange searchRange, CFDataSearchFlags compareOptions) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFDATA__ */
|
||||
|
131
CFDate.h
131
CFDate.h
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFDate.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFDATE__)
|
||||
#define __COREFOUNDATION_CFDATE__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef double CFTimeInterval;
|
||||
typedef CFTimeInterval CFAbsoluteTime;
|
||||
/* absolute time is the time interval since the reference date */
|
||||
/* the reference date (epoch) is 00:00:00 1 January 2001. */
|
||||
|
||||
CF_EXPORT
|
||||
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
|
||||
|
||||
CF_EXPORT
|
||||
const CFTimeInterval kCFAbsoluteTimeIntervalSince1970;
|
||||
CF_EXPORT
|
||||
const CFTimeInterval kCFAbsoluteTimeIntervalSince1904;
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSDate) __CFDate * CFDateRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFDateGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
|
||||
|
||||
CF_EXPORT
|
||||
CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
|
||||
|
||||
CF_EXPORT
|
||||
CFTimeInterval CFDateGetTimeIntervalSinceDate(CFDateRef theDate, CFDateRef otherDate);
|
||||
|
||||
CF_EXPORT
|
||||
CFComparisonResult CFDateCompare(CFDateRef theDate, CFDateRef otherDate, void *context);
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSTimeZone) __CFTimeZone * CFTimeZoneRef;
|
||||
|
||||
|
||||
#if !defined(CF_CALENDAR_ENUM_DEPRECATED)
|
||||
#define CF_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) CF_ENUM_DEPRECATED(A, B, C, D, __VA_ARGS__)
|
||||
#define CF_CALENDAR_DEPRECATED(A, B, C, D, ...) CF_DEPRECATED(A, B, C, D, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
SInt32 year;
|
||||
SInt8 month;
|
||||
SInt8 day;
|
||||
SInt8 hour;
|
||||
SInt8 minute;
|
||||
double second;
|
||||
} CFGregorianDate CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
typedef struct {
|
||||
SInt32 years;
|
||||
SInt32 months;
|
||||
SInt32 days;
|
||||
SInt32 hours;
|
||||
SInt32 minutes;
|
||||
double seconds;
|
||||
} CFGregorianUnits CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFGregorianUnitFlags) {
|
||||
kCFGregorianUnitsYears CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 0),
|
||||
kCFGregorianUnitsMonths CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 1),
|
||||
kCFGregorianUnitsDays CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 2),
|
||||
kCFGregorianUnitsHours CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 3),
|
||||
kCFGregorianUnitsMinutes CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 4),
|
||||
kCFGregorianUnitsSeconds CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = (1UL << 5),
|
||||
kCFGregorianAllUnits CF_CALENDAR_ENUM_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead") = 0x00FFFFFF
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
CFGregorianDate CFAbsoluteTimeGetGregorianDate(CFAbsoluteTime at, CFTimeZoneRef tz) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
CFAbsoluteTime CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTime at, CFTimeZoneRef tz, CFGregorianUnits units) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits(CFAbsoluteTime at1, CFAbsoluteTime at2, CFTimeZoneRef tz, CFOptionFlags unitFlags) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
SInt32 CFAbsoluteTimeGetDayOfWeek(CFAbsoluteTime at, CFTimeZoneRef tz) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
SInt32 CFAbsoluteTimeGetDayOfYear(CFAbsoluteTime at, CFTimeZoneRef tz) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXPORT
|
||||
SInt32 CFAbsoluteTimeGetWeekOfYear(CFAbsoluteTime at, CFTimeZoneRef tz) CF_CALENDAR_DEPRECATED(10_4, 10_10, 2_0, 8_0, "Use CFCalendar or NSCalendar API instead");
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFDATE__ */
|
||||
|
@ -1,174 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFDateFormatter.h
|
||||
Copyright (c) 2003-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFDATEFORMATTER__)
|
||||
#define __COREFOUNDATION_CFDATEFORMATTER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFLocale.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFDateFormatter *CFDateFormatterRef;
|
||||
|
||||
// CFDateFormatters are not thread-safe. Do not use one from multiple threads!
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFDateFormatterCreateDateFormatFromTemplate(CFAllocatorRef allocator, CFStringRef tmplate, CFOptionFlags options, CFLocaleRef locale) CF_AVAILABLE(10_6, 4_0);
|
||||
// no options defined, pass 0 for now
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFDateFormatterGetTypeID(void);
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFDateFormatterStyle) { // date and time format styles
|
||||
kCFDateFormatterNoStyle = 0,
|
||||
kCFDateFormatterShortStyle = 1,
|
||||
kCFDateFormatterMediumStyle = 2,
|
||||
kCFDateFormatterLongStyle = 3,
|
||||
kCFDateFormatterFullStyle = 4
|
||||
};
|
||||
|
||||
// The exact formatted result for these date and time styles depends on the
|
||||
// locale, but generally:
|
||||
// Short is completely numeric, such as "12/13/52" or "3:30pm"
|
||||
// Medium is longer, such as "Jan 12, 1952"
|
||||
// Long is longer, such as "January 12, 1952" or "3:30:32pm"
|
||||
// Full is pretty complete; e.g. "Tuesday, April 12, 1952 AD" or "3:30:42pm PST"
|
||||
// The specifications though are left fuzzy, in part simply because a user's
|
||||
// preference choices may affect the output, and also the results may change
|
||||
// from one OS release to another. To produce an exactly formatted date you
|
||||
// should not rely on styles and localization, but set the format string and
|
||||
// use nothing but numbers.
|
||||
|
||||
CF_EXPORT
|
||||
CFDateFormatterRef CFDateFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFDateFormatterStyle dateStyle, CFDateFormatterStyle timeStyle);
|
||||
// Returns a CFDateFormatter, localized to the given locale, which
|
||||
// will format dates to the given date and time styles.
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFDateFormatterGetLocale(CFDateFormatterRef formatter);
|
||||
|
||||
CF_EXPORT
|
||||
CFDateFormatterStyle CFDateFormatterGetDateStyle(CFDateFormatterRef formatter);
|
||||
|
||||
CF_EXPORT
|
||||
CFDateFormatterStyle CFDateFormatterGetTimeStyle(CFDateFormatterRef formatter);
|
||||
// Get the properties with which the date formatter was created.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFDateFormatterGetFormat(CFDateFormatterRef formatter);
|
||||
|
||||
CF_EXPORT
|
||||
void CFDateFormatterSetFormat(CFDateFormatterRef formatter, CFStringRef formatString);
|
||||
// Set the format description string of the date formatter. This
|
||||
// overrides the style settings. The format of the format string
|
||||
// is as defined by the ICU library. The date formatter starts with a
|
||||
// default format string defined by the style arguments with
|
||||
// which it was created.
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFDateFormatterCreateStringWithDate(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFDateRef date);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFDateFormatterCreateStringWithAbsoluteTime(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFAbsoluteTime at);
|
||||
// Create a string representation of the given date or CFAbsoluteTime
|
||||
// using the current state of the date formatter.
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
CFDateRef CFDateFormatterCreateDateFromString(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFDateFormatterGetAbsoluteTimeFromString(CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep, CFAbsoluteTime *atp);
|
||||
// Parse a string representation of a date using the current state
|
||||
// of the date formatter. The range parameter specifies the range
|
||||
// of the string in which the parsing should occur in input, and on
|
||||
// output indicates the extent that was used; this parameter can
|
||||
// be NULL, in which case the whole string may be used. The
|
||||
// return value indicates whether some date was computed and
|
||||
// (if atp is not NULL) stored at the location specified by atp.
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
void CFDateFormatterSetProperty(CFDateFormatterRef formatter, CFStringRef key, CFTypeRef value);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFDateFormatterCopyProperty(CFDateFormatterRef formatter, CFStringRef key);
|
||||
// Set and get various properties of the date formatter, the set of
|
||||
// which may be expanded in the future.
|
||||
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterIsLenient; // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterTimeZone; // CFTimeZone
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterCalendarName; // CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterDefaultFormat; // CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterTwoDigitStartDate; // CFDate
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterDefaultDate; // CFDate
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterCalendar; // CFCalendar
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterEraSymbols; // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterMonthSymbols; // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortMonthSymbols; // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterWeekdaySymbols; // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortWeekdaySymbols; // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterAMSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterPMSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterLongEraSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterVeryShortMonthSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterStandaloneMonthSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneMonthSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneMonthSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterVeryShortWeekdaySymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterStandaloneWeekdaySymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneWeekdaySymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneWeekdaySymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterQuarterSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortQuarterSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterStandaloneQuarterSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneQuarterSymbols CF_AVAILABLE(10_5, 2_0); // CFArray of CFString
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterGregorianStartDate CF_AVAILABLE(10_5, 2_0); // CFDate
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterDoesRelativeDateFormattingKey CF_AVAILABLE(10_6, 4_0); // CFBoolean
|
||||
|
||||
// See CFLocale.h for these calendar constants:
|
||||
// const CFStringRef kCFGregorianCalendar;
|
||||
// const CFStringRef kCFBuddhistCalendar;
|
||||
// const CFStringRef kCFJapaneseCalendar;
|
||||
// const CFStringRef kCFIslamicCalendar;
|
||||
// const CFStringRef kCFIslamicCivilCalendar;
|
||||
// const CFStringRef kCFHebrewCalendar;
|
||||
// const CFStringRef kCFChineseCalendar;
|
||||
// const CFStringRef kCFRepublicOfChinaCalendar;
|
||||
// const CFStringRef kCFPersianCalendar;
|
||||
// const CFStringRef kCFIndianCalendar;
|
||||
// const CFStringRef kCFISO8601Calendar;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFDATEFORMATTER__ */
|
||||
|
1
CFDateFormatter.h
Symbolic link
1
CFDateFormatter.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFDateFormatter.h
|
692
CFDictionary.h
692
CFDictionary.h
@ -1,692 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFDictionary.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@header CFDictionary
|
||||
CFDictionary implements a container which pairs pointer-sized keys
|
||||
with pointer-sized values. Values are accessed via arbitrary
|
||||
user-defined keys. A CFDictionary differs from a CFArray in that
|
||||
the key used to access a particular value in the dictionary remains
|
||||
the same as values are added to or removed from the dictionary,
|
||||
unless a value associated with its particular key is replaced or
|
||||
removed. In a CFArray, the key (or index) used to retrieve a
|
||||
particular value can change over time as values are added to or
|
||||
deleted from the array. Also unlike an array, there is no ordering
|
||||
among values in a dictionary. To enable later retrieval of a value,
|
||||
the key of the key-value pair should be constant (or treated as
|
||||
constant); if the key changes after being used to put a value in
|
||||
the dictionary, the value may not be retrievable. The keys of a
|
||||
dictionary form a set; that is, no two keys which are equal to
|
||||
one another are present in the dictionary at any time.
|
||||
|
||||
Dictionaries come in two flavors, immutable, which cannot have
|
||||
values added to them or removed from them after the dictionary is
|
||||
created, and mutable, to which you can add values or from which
|
||||
remove values. Mutable dictionaries can have an unlimited number
|
||||
of values (or rather, limited only by constraints external to
|
||||
CFDictionary, like the amount of available memory).
|
||||
|
||||
As with all CoreFoundation collection types, dictionaries maintain
|
||||
hard references on the values you put in them, but the retaining and
|
||||
releasing functions are user-defined callbacks that can actually do
|
||||
whatever the user wants (for example, nothing).
|
||||
|
||||
Although a particular implementation of CFDictionary may not use
|
||||
hashing and a hash table for storage of the values, the keys have
|
||||
a hash-code generating function defined for them, and a function
|
||||
to test for equality of two keys. These two functions together
|
||||
must maintain the invariant that if equal(X, Y), then hash(X) ==
|
||||
hash(Y). Note that the converse will not generally be true (but
|
||||
the contrapositive, if hash(X) != hash(Y), then !equal(X, Y),
|
||||
will be as required by Boolean logic). If the hash() and equal()
|
||||
key callbacks are NULL, the key is used as a pointer-sized integer,
|
||||
and pointer equality is used. Care should be taken to provide a
|
||||
hash() callback which will compute sufficiently dispersed hash
|
||||
codes for the key set for best performance.
|
||||
|
||||
Computational Complexity
|
||||
The access time for a value in the dictionary is guaranteed to be at
|
||||
worst O(N) for any implementation, current and future, but will
|
||||
often be O(1) (constant time). Insertion or deletion operations
|
||||
will typically be constant time as well, but are O(N*N) in the
|
||||
worst case in some implementations. Access of values through a key
|
||||
is faster than accessing values directly (if there are any such
|
||||
operations). Dictionaries will tend to use significantly more memory
|
||||
than a array with the same number of values.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFDICTIONARY__)
|
||||
#define __COREFOUNDATION_CFDICTIONARY__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFDictionaryKeyCallBacks
|
||||
Structure containing the callbacks for keys of a CFDictionary.
|
||||
@field version The version number of the structure type being passed
|
||||
in as a parameter to the CFDictionary creation functions.
|
||||
This structure is version 0.
|
||||
@field retain The callback used to add a retain for the dictionary
|
||||
on keys as they are used to put values into the dictionary.
|
||||
This callback returns the value to use as the key in the
|
||||
dictionary, which is usually the value parameter passed to
|
||||
this callback, but may be a different value if a different
|
||||
value should be used as the key. The dictionary's allocator
|
||||
is passed as the first argument.
|
||||
@field release The callback used to remove a retain previously added
|
||||
for the dictionary from keys as their values are removed from
|
||||
the dictionary. The dictionary's allocator is passed as the
|
||||
first argument.
|
||||
@field copyDescription The callback used to create a descriptive
|
||||
string representation of each key in the dictionary. This
|
||||
is used by the CFCopyDescription() function.
|
||||
@field equal The callback used to compare keys in the dictionary for
|
||||
equality.
|
||||
@field hash The callback used to compute a hash code for keys as they
|
||||
are used to access, add, or remove values in the dictionary.
|
||||
*/
|
||||
typedef const void * (*CFDictionaryRetainCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef void (*CFDictionaryReleaseCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack)(const void *value);
|
||||
typedef Boolean (*CFDictionaryEqualCallBack)(const void *value1, const void *value2);
|
||||
typedef CFHashCode (*CFDictionaryHashCallBack)(const void *value);
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CFDictionaryRetainCallBack retain;
|
||||
CFDictionaryReleaseCallBack release;
|
||||
CFDictionaryCopyDescriptionCallBack copyDescription;
|
||||
CFDictionaryEqualCallBack equal;
|
||||
CFDictionaryHashCallBack hash;
|
||||
} CFDictionaryKeyCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFTypeDictionaryKeyCallBacks
|
||||
Predefined CFDictionaryKeyCallBacks structure containing a
|
||||
set of callbacks appropriate for use when the keys of a
|
||||
CFDictionary are all CFTypes.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFCopyStringDictionaryKeyCallBacks
|
||||
Predefined CFDictionaryKeyCallBacks structure containing a
|
||||
set of callbacks appropriate for use when the keys of a
|
||||
CFDictionary are all CFStrings, which may be mutable and
|
||||
need to be copied in order to serve as constant keys for
|
||||
the values in the dictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
|
||||
|
||||
/*!
|
||||
@typedef CFDictionaryValueCallBacks
|
||||
Structure containing the callbacks for values of a CFDictionary.
|
||||
@field version The version number of the structure type being passed
|
||||
in as a parameter to the CFDictionary creation functions.
|
||||
This structure is version 0.
|
||||
@field retain The callback used to add a retain for the dictionary
|
||||
on values as they are put into the dictionary.
|
||||
This callback returns the value to use as the value in the
|
||||
dictionary, which is usually the value parameter passed to
|
||||
this callback, but may be a different value if a different
|
||||
value should be added to the dictionary. The dictionary's
|
||||
allocator is passed as the first argument.
|
||||
@field release The callback used to remove a retain previously added
|
||||
for the dictionary from values as they are removed from
|
||||
the dictionary. The dictionary's allocator is passed as the
|
||||
first argument.
|
||||
@field copyDescription The callback used to create a descriptive
|
||||
string representation of each value in the dictionary. This
|
||||
is used by the CFCopyDescription() function.
|
||||
@field equal The callback used to compare values in the dictionary for
|
||||
equality in some operations.
|
||||
*/
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CFDictionaryRetainCallBack retain;
|
||||
CFDictionaryReleaseCallBack release;
|
||||
CFDictionaryCopyDescriptionCallBack copyDescription;
|
||||
CFDictionaryEqualCallBack equal;
|
||||
} CFDictionaryValueCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFTypeDictionaryValueCallBacks
|
||||
Predefined CFDictionaryValueCallBacks structure containing a set
|
||||
of callbacks appropriate for use when the values in a CFDictionary
|
||||
are all CFTypes.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
|
||||
|
||||
/*!
|
||||
@typedef CFDictionaryApplierFunction
|
||||
Type of the callback function used by the apply functions of
|
||||
CFDictionarys.
|
||||
@param key The current key for the value.
|
||||
@param value The current value from the dictionary.
|
||||
@param context The user-defined context parameter given to the apply
|
||||
function.
|
||||
*/
|
||||
typedef void (*CFDictionaryApplierFunction)(const void *key, const void *value, void *context);
|
||||
|
||||
/*!
|
||||
@typedef CFDictionaryRef
|
||||
This is the type of a reference to immutable CFDictionarys.
|
||||
*/
|
||||
typedef const struct CF_BRIDGED_TYPE(NSDictionary) __CFDictionary * CFDictionaryRef;
|
||||
|
||||
/*!
|
||||
@typedef CFMutableDictionaryRef
|
||||
This is the type of a reference to mutable CFDictionarys.
|
||||
*/
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableDictionary) __CFDictionary * CFMutableDictionaryRef;
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetTypeID
|
||||
Returns the type identifier of all CFDictionary instances.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFTypeID CFDictionaryGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryCreate
|
||||
Creates a new immutable dictionary with the given values.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the dictionary and its storage for values. 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 keys A C array of the pointer-sized keys to be used for
|
||||
the parallel C array of values to be put into the dictionary.
|
||||
This parameter may be NULL if the numValues parameter is 0.
|
||||
This C array is not changed or freed by this function. If
|
||||
this parameter is not a valid pointer to a C array of at
|
||||
least numValues pointers, the behavior is undefined.
|
||||
@param values A C array of the pointer-sized values to be in the
|
||||
dictionary. This parameter may be NULL if the numValues
|
||||
parameter is 0. This C array is not changed or freed by
|
||||
this function. If this parameter is not a valid pointer to
|
||||
a C array of at least numValues pointers, the behavior is
|
||||
undefined.
|
||||
@param numValues The number of values to copy from the keys and
|
||||
values C arrays into the CFDictionary. This number will be
|
||||
the count of the dictionary. If this parameter is
|
||||
negative, or greater than the number of values actually
|
||||
in the keys or values C arrays, the behavior is undefined.
|
||||
@param keyCallBacks A pointer to a CFDictionaryKeyCallBacks structure
|
||||
initialized with the callbacks for the dictionary to use on
|
||||
each key in the dictionary. The retain callback will be used
|
||||
within this function, for example, to retain all of the new
|
||||
keys from the keys C array. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a structure
|
||||
on the stack can be passed in, or can be reused for multiple
|
||||
dictionary creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFDictionary, the behavior is undefined. The retain field may
|
||||
be NULL, in which case the CFDictionary will do nothing to add
|
||||
a retain to the keys of the contained values. The release field
|
||||
may be NULL, in which case the CFDictionary will do nothing
|
||||
to remove the dictionary's retain (if any) on the keys when the
|
||||
dictionary is destroyed or a key-value pair is removed. If the
|
||||
copyDescription field is NULL, the dictionary will create a
|
||||
simple description for a key. If the equal field is NULL, the
|
||||
dictionary will use pointer equality to test for equality of
|
||||
keys. If the hash field is NULL, a key will be converted from
|
||||
a pointer to an integer to compute the hash code. This callbacks
|
||||
parameter itself may be NULL, which is treated as if a valid
|
||||
structure of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFDictionaryKeyCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the keys put into the
|
||||
dictionary is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is undefined.
|
||||
@param valueCallBacks A pointer to a CFDictionaryValueCallBacks structure
|
||||
initialized with the callbacks for the dictionary to use on
|
||||
each value in the dictionary. The retain callback will be used
|
||||
within this function, for example, to retain all of the new
|
||||
values from the values C array. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a structure
|
||||
on the stack can be passed in, or can be reused for multiple
|
||||
dictionary creations. If the version field of this callbacks
|
||||
structure is not one of the defined ones for CFDictionary, the
|
||||
behavior is undefined. The retain field may be NULL, in which
|
||||
case the CFDictionary will do nothing to add a retain to values
|
||||
as they are put into the dictionary. The release field may be
|
||||
NULL, in which case the CFDictionary will do nothing to remove
|
||||
the dictionary's retain (if any) on the values when the
|
||||
dictionary is destroyed or a key-value pair is removed. If the
|
||||
copyDescription field is NULL, the dictionary will create a
|
||||
simple description for a value. If the equal field is NULL, the
|
||||
dictionary will use pointer equality to test for equality of
|
||||
values. This callbacks parameter itself may be NULL, which is
|
||||
treated as if a valid structure of version 0 with all fields
|
||||
NULL had been passed in. Otherwise,
|
||||
if any of the fields are not valid pointers to functions
|
||||
of the correct type, or this parameter is not a valid
|
||||
pointer to a CFDictionaryValueCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
dictionary is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is undefined.
|
||||
@result A reference to the new immutable CFDictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFDictionaryCreate(CFAllocatorRef allocator, const void **keys, const void **values, CFIndex numValues, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryCreateCopy
|
||||
Creates a new immutable dictionary with the key-value pairs from
|
||||
the given dictionary.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the dictionary and its storage for values. 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 theDict The dictionary which is to be copied. The keys and values
|
||||
from the dictionary are copied as pointers into the new
|
||||
dictionary (that is, the values themselves are copied, not
|
||||
that which the values point to, if anything). However, the
|
||||
keys and values are also retained by the new dictionary using
|
||||
the retain function of the original dictionary.
|
||||
The count of the new dictionary will be the same as the
|
||||
given dictionary. The new dictionary uses the same callbacks
|
||||
as the dictionary to be copied. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@result A reference to the new immutable CFDictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef theDict);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryCreateMutable
|
||||
Creates a new mutable dictionary.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the dictionary and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFDictionary. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A dictionary's actual capacity is only limited by
|
||||
address space and available memory constraints). If this
|
||||
parameter is negative, the behavior is undefined.
|
||||
@param keyCallBacks A pointer to a CFDictionaryKeyCallBacks structure
|
||||
initialized with the callbacks for the dictionary to use on
|
||||
each key in the dictionary. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a structure
|
||||
on the stack can be passed in, or can be reused for multiple
|
||||
dictionary creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFDictionary, the behavior is undefined. The retain field may
|
||||
be NULL, in which case the CFDictionary will do nothing to add
|
||||
a retain to the keys of the contained values. The release field
|
||||
may be NULL, in which case the CFDictionary will do nothing
|
||||
to remove the dictionary's retain (if any) on the keys when the
|
||||
dictionary is destroyed or a key-value pair is removed. If the
|
||||
copyDescription field is NULL, the dictionary will create a
|
||||
simple description for a key. If the equal field is NULL, the
|
||||
dictionary will use pointer equality to test for equality of
|
||||
keys. If the hash field is NULL, a key will be converted from
|
||||
a pointer to an integer to compute the hash code. This callbacks
|
||||
parameter itself may be NULL, which is treated as if a valid
|
||||
structure of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFDictionaryKeyCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the keys put into the
|
||||
dictionary is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is undefined.
|
||||
@param valueCallBacks A pointer to a CFDictionaryValueCallBacks structure
|
||||
initialized with the callbacks for the dictionary to use on
|
||||
each value in the dictionary. The retain callback will be used
|
||||
within this function, for example, to retain all of the new
|
||||
values from the values C array. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a structure
|
||||
on the stack can be passed in, or can be reused for multiple
|
||||
dictionary creations. If the version field of this callbacks
|
||||
structure is not one of the defined ones for CFDictionary, the
|
||||
behavior is undefined. The retain field may be NULL, in which
|
||||
case the CFDictionary will do nothing to add a retain to values
|
||||
as they are put into the dictionary. The release field may be
|
||||
NULL, in which case the CFDictionary will do nothing to remove
|
||||
the dictionary's retain (if any) on the values when the
|
||||
dictionary is destroyed or a key-value pair is removed. If the
|
||||
copyDescription field is NULL, the dictionary will create a
|
||||
simple description for a value. If the equal field is NULL, the
|
||||
dictionary will use pointer equality to test for equality of
|
||||
values. This callbacks parameter itself may be NULL, which is
|
||||
treated as if a valid structure of version 0 with all fields
|
||||
NULL had been passed in. Otherwise,
|
||||
if any of the fields are not valid pointers to functions
|
||||
of the correct type, or this parameter is not a valid
|
||||
pointer to a CFDictionaryValueCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
dictionary is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is undefined.
|
||||
@result A reference to the new mutable CFDictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryCreateMutableCopy
|
||||
Creates a new mutable dictionary with the key-value pairs from
|
||||
the given dictionary.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the dictionary and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFDictionary. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A dictionary's actual capacity is only limited by
|
||||
address space and available memory constraints).
|
||||
This parameter must be greater than or equal
|
||||
to the count of the dictionary which is to be copied, or the
|
||||
behavior is undefined. If this parameter is negative, the
|
||||
behavior is undefined.
|
||||
@param theDict The dictionary which is to be copied. The keys and values
|
||||
from the dictionary are copied as pointers into the new
|
||||
dictionary (that is, the values themselves are copied, not
|
||||
that which the values point to, if anything). However, the
|
||||
keys and values are also retained by the new dictionary using
|
||||
the retain function of the original dictionary.
|
||||
The count of the new dictionary will be the same as the
|
||||
given dictionary. The new dictionary uses the same callbacks
|
||||
as the dictionary to be copied. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@result A reference to the new mutable CFDictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetCount
|
||||
Returns the number of values currently in the dictionary.
|
||||
@param theDict The dictionary to be queried. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@result The number of values in the dictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFDictionaryGetCount(CFDictionaryRef theDict);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetCountOfKey
|
||||
Counts the number of times the given key occurs in the dictionary.
|
||||
@param theDict The dictionary to be searched. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param key The key for which to find matches in the dictionary. The
|
||||
hash() and equal() key callbacks provided when the dictionary
|
||||
was created are used to compare. If the hash() key callback
|
||||
was NULL, the key is treated as a pointer and converted to
|
||||
an integer. If the equal() key callback was NULL, pointer
|
||||
equality (in C, ==) is used. If key, or any of the keys in
|
||||
the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result Returns 1 if a matching key is used by the dictionary,
|
||||
0 otherwise.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFDictionaryGetCountOfKey(CFDictionaryRef theDict, const void *key);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetCountOfValue
|
||||
Counts the number of times the given value occurs in the dictionary.
|
||||
@param theDict The dictionary to be searched. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param value The value for which to find matches in the dictionary. The
|
||||
equal() callback provided when the dictionary was created is
|
||||
used to compare. If the equal() value callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values in
|
||||
the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The number of times the given value occurs in the dictionary.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFDictionaryGetCountOfValue(CFDictionaryRef theDict, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryContainsKey
|
||||
Reports whether or not the key is in the dictionary.
|
||||
@param theDict The dictionary to be searched. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param key The key for which to find matches in the dictionary. The
|
||||
hash() and equal() key callbacks provided when the dictionary
|
||||
was created are used to compare. If the hash() key callback
|
||||
was NULL, the key is treated as a pointer and converted to
|
||||
an integer. If the equal() key callback was NULL, pointer
|
||||
equality (in C, ==) is used. If key, or any of the keys in
|
||||
the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result true, if the key is in the dictionary, otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryContainsValue
|
||||
Reports whether or not the value is in the dictionary.
|
||||
@param theDict The dictionary to be searched. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param value The value for which to find matches in the dictionary. The
|
||||
equal() callback provided when the dictionary was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result true, if the value is in the dictionary, otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetValue
|
||||
Retrieves the value associated with the given key.
|
||||
@param theDict The dictionary to be queried. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param key The key for which to find a match in the dictionary. The
|
||||
hash() and equal() key callbacks provided when the dictionary
|
||||
was created are used to compare. If the hash() key callback
|
||||
was NULL, the key is treated as a pointer and converted to
|
||||
an integer. If the equal() key callback was NULL, pointer
|
||||
equality (in C, ==) is used. If key, or any of the keys in
|
||||
the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The value with the given key in the dictionary, or NULL if
|
||||
no key-value pair with a matching key exists. Since NULL
|
||||
can be a valid value in some dictionaries, the function
|
||||
CFDictionaryGetValueIfPresent() must be used to distinguish
|
||||
NULL-no-found from NULL-is-the-value.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetValueIfPresent
|
||||
Retrieves the value associated with the given key.
|
||||
@param theDict The dictionary to be queried. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param key The key for which to find a match in the dictionary. The
|
||||
hash() and equal() key callbacks provided when the dictionary
|
||||
was created are used to compare. If the hash() key callback
|
||||
was NULL, the key is treated as a pointer and converted to
|
||||
an integer. If the equal() key callback was NULL, pointer
|
||||
equality (in C, ==) is used. If key, or any of the keys in
|
||||
the dictionary, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@param value A pointer to memory which should be filled with the
|
||||
pointer-sized value if a matching key is found. If no key
|
||||
match is found, the contents of the storage pointed to by
|
||||
this parameter are undefined. This parameter may be NULL,
|
||||
in which case the value from the dictionary is not returned
|
||||
(but the return value of this function still indicates
|
||||
whether or not the key-value pair was present).
|
||||
@result true, if a matching key was found, false otherwise.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryGetKeysAndValues
|
||||
Fills the two buffers with the keys and values from the dictionary.
|
||||
@param theDict The dictionary to be queried. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param keys A C array of pointer-sized values to be filled with keys
|
||||
from the dictionary. The keys and values C arrays are parallel
|
||||
to each other (that is, the items at the same indices form a
|
||||
key-value pair from the dictionary). This parameter may be NULL
|
||||
if the keys are not desired. If this parameter is not a valid
|
||||
pointer to a C array of at least CFDictionaryGetCount() pointers,
|
||||
or NULL, the behavior is undefined.
|
||||
@param values A C array of pointer-sized values to be filled with values
|
||||
from the dictionary. The keys and values C arrays are parallel
|
||||
to each other (that is, the items at the same indices form a
|
||||
key-value pair from the dictionary). This parameter may be NULL
|
||||
if the values are not desired. If this parameter is not a valid
|
||||
pointer to a C array of at least CFDictionaryGetCount() pointers,
|
||||
or NULL, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryGetKeysAndValues(CFDictionaryRef theDict, const void **keys, const void **values);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryApplyFunction
|
||||
Calls a function once for each value in the dictionary.
|
||||
@param theDict The dictionary to be queried. If this parameter is
|
||||
not a valid CFDictionary, the behavior is undefined.
|
||||
@param applier The callback function to call once for each value in
|
||||
the dictionary. If this parameter is not a
|
||||
pointer to a function of the correct prototype, the behavior
|
||||
is undefined. If there are keys or values which the
|
||||
applier function does not expect or cannot properly apply
|
||||
to, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the third parameter to the applier function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the applier function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryApplyFunction(CFDictionaryRef theDict, CFDictionaryApplierFunction applier, void *context);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryAddValue
|
||||
Adds the key-value pair to the dictionary if no such key already exists.
|
||||
@param theDict The dictionary to which the value is to be added. If this
|
||||
parameter is not a valid mutable CFDictionary, the behavior is
|
||||
undefined.
|
||||
@param key The key of the value to add to the dictionary. The key is
|
||||
retained by the dictionary using the retain callback provided
|
||||
when the dictionary was created. If the key is not of the sort
|
||||
expected by the retain callback, the behavior is undefined. If
|
||||
a key which matches this key is already present in the dictionary,
|
||||
this function does nothing ("add if absent").
|
||||
@param value The value to add to the dictionary. The value is retained
|
||||
by the dictionary using the retain callback provided when the
|
||||
dictionary was created. If the value is not of the sort expected
|
||||
by the retain callback, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFDictionarySetValue
|
||||
Sets the value of the key in the dictionary.
|
||||
@param theDict The dictionary to which the value is to be set. If this
|
||||
parameter is not a valid mutable CFDictionary, the behavior is
|
||||
undefined.
|
||||
@param key The key of the value to set into the dictionary. If a key
|
||||
which matches this key is already present in the dictionary, only
|
||||
the value is changed ("add if absent, replace if present"). If
|
||||
no key matches the given key, the key-value pair is added to the
|
||||
dictionary. If added, the key is retained by the dictionary,
|
||||
using the retain callback provided
|
||||
when the dictionary was created. If the key is not of the sort
|
||||
expected by the key retain callback, the behavior is undefined.
|
||||
@param value The value to add to or replace into the dictionary. The value
|
||||
is retained by the dictionary using the retain callback provided
|
||||
when the dictionary was created, and the previous value if any is
|
||||
released. If the value is not of the sort expected by the
|
||||
retain or release callbacks, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionarySetValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryReplaceValue
|
||||
Replaces the value of the key in the dictionary.
|
||||
@param theDict The dictionary to which the value is to be replaced. If this
|
||||
parameter is not a valid mutable CFDictionary, the behavior is
|
||||
undefined.
|
||||
@param key The key of the value to replace in the dictionary. If a key
|
||||
which matches this key is present in the dictionary, the value
|
||||
is changed to the given value, otherwise this function does
|
||||
nothing ("replace if present").
|
||||
@param value The value to replace into the dictionary. The value
|
||||
is retained by the dictionary using the retain callback provided
|
||||
when the dictionary was created, and the previous value is
|
||||
released. If the value is not of the sort expected by the
|
||||
retain or release callbacks, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryReplaceValue(CFMutableDictionaryRef theDict, const void *key, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryRemoveValue
|
||||
Removes the value of the key from the dictionary.
|
||||
@param theDict The dictionary from which the value is to be removed. If this
|
||||
parameter is not a valid mutable CFDictionary, the behavior is
|
||||
undefined.
|
||||
@param key The key of the value to remove from the dictionary. If a key
|
||||
which matches this key is present in the dictionary, the key-value
|
||||
pair is removed from the dictionary, otherwise this function does
|
||||
nothing ("remove if present").
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryRemoveValue(CFMutableDictionaryRef theDict, const void *key);
|
||||
|
||||
/*!
|
||||
@function CFDictionaryRemoveAllValues
|
||||
Removes all the values from the dictionary, making it empty.
|
||||
@param theDict The dictionary from which all of the values are to be
|
||||
removed. If this parameter is not a valid mutable
|
||||
CFDictionary, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFDictionaryRemoveAllValues(CFMutableDictionaryRef theDict);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFDICTIONARY__ */
|
||||
|
1
CFDictionary.h
Symbolic link
1
CFDictionary.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFDictionary.h
|
197
CFError.h
197
CFError.h
@ -1,197 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFError.h
|
||||
Copyright (c) 2006-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFERROR__)
|
||||
#define __COREFOUNDATION_CFERROR__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFErrorRef
|
||||
This is the type of a reference to CFErrors. CFErrorRef is toll-free bridged with NSError.
|
||||
*/
|
||||
typedef struct CF_BRIDGED_TYPE(NSError) __CFError * CFErrorRef;
|
||||
|
||||
/*!
|
||||
@function CFErrorGetTypeID
|
||||
Returns the type identifier of all CFError instances.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFTypeID CFErrorGetTypeID(void) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
|
||||
// Predefined domains; value of "code" will correspond to preexisting values in these domains.
|
||||
CF_EXPORT const CFStringRef kCFErrorDomainPOSIX CF_AVAILABLE(10_5, 2_0);
|
||||
CF_EXPORT const CFStringRef kCFErrorDomainOSStatus CF_AVAILABLE(10_5, 2_0);
|
||||
CF_EXPORT const CFStringRef kCFErrorDomainMach CF_AVAILABLE(10_5, 2_0);
|
||||
CF_EXPORT const CFStringRef kCFErrorDomainCocoa CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
// Keys in userInfo for localizable, end-user presentable error messages. At minimum provide one of first two; ideally provide all three.
|
||||
CF_EXPORT const CFStringRef kCFErrorLocalizedDescriptionKey CF_AVAILABLE(10_5, 2_0); // Key to identify the end user-presentable description in userInfo.
|
||||
CF_EXPORT const CFStringRef kCFErrorLocalizedFailureReasonKey CF_AVAILABLE(10_5, 2_0); // Key to identify the end user-presentable failure reason in userInfo.
|
||||
CF_EXPORT const CFStringRef kCFErrorLocalizedRecoverySuggestionKey CF_AVAILABLE(10_5, 2_0); // 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.
|
||||
CF_EXPORT const CFStringRef kCFErrorDescriptionKey CF_AVAILABLE(10_5, 2_0); // 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.
|
||||
CF_EXPORT const CFStringRef kCFErrorUnderlyingErrorKey CF_AVAILABLE(10_5, 2_0); // Key to identify the underlying error in userInfo.
|
||||
CF_EXPORT const CFStringRef kCFErrorURLKey CF_AVAILABLE(10_7, 5_0); // Key to identify associated URL in userInfo. Typically one of this or kCFErrorFilePathKey is provided.
|
||||
CF_EXPORT const CFStringRef kCFErrorFilePathKey CF_AVAILABLE(10_7, 5_0); // Key to identify associated file path in userInfo. Typically one of this or kCFErrorURLKey is provided.
|
||||
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFErrorRef CFErrorCreate(CFAllocatorRef allocator, CFStringRef domain, CFIndex code, CFDictionaryRef userInfo) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFErrorRef CFErrorCreateWithUserInfoKeysAndValues(CFAllocatorRef allocator, CFStringRef domain, CFIndex code, const void *const *userInfoKeys, const void *const *userInfoValues, CFIndex numUserInfoValues) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFStringRef CFErrorGetDomain(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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).
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFErrorGetCode(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFStringRef CFErrorCopyDescription(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFStringRef CFErrorCopyFailureReason(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFStringRef CFErrorCopyRecoverySuggestion(CFErrorRef err) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFERROR__ */
|
||||
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFError_Private.h
|
||||
Copyright (c) 2006-2014, Apple Inc. All rights reserved.
|
||||
|
||||
This is Apple-internal SPI for CFError.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFERRORPRIVATE__)
|
||||
#define __COREFOUNDATION_CFERRORPRIVATE__ 1
|
||||
|
||||
#include <CoreFoundation/CFError.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/* This callback function is consulted if a key is not present in the userInfo dictionary. Note that setting a callback for the same domain again simply replaces the previous callback. Set NULL as the callback to remove it.
|
||||
*/
|
||||
typedef CFTypeRef (*CFErrorUserInfoKeyCallBack)(CFErrorRef err, CFStringRef key);
|
||||
CF_EXPORT void CFErrorSetCallBackForDomain(CFStringRef domainName, CFErrorUserInfoKeyCallBack callBack) CF_AVAILABLE(10_5, 2_0);
|
||||
CF_EXPORT CFErrorUserInfoKeyCallBack CFErrorGetCallBackForDomain(CFStringRef domainName) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
|
||||
/* A key for "true" debugging descriptions which should never be shown to the user. It's only used when the CFError is shown to the console, and nothing else is available. For instance the rather terse and techie OSStatus descriptions are in this boat.
|
||||
*/
|
||||
CF_EXPORT const CFStringRef kCFErrorDebugDescriptionKey CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFERRORPRIVATE__ */
|
||||
|
1
CFError_Private.h
Symbolic link
1
CFError_Private.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFError_Private.h
|
@ -1,39 +0,0 @@
|
||||
#if !defined(__COREFOUNDATION_CFFILEDESCRIPTOR__)
|
||||
#define __COREFOUNDATION_CFFILEDESCRIPTOR__ 1
|
||||
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef int CFFileDescriptorNativeDescriptor;
|
||||
|
||||
typedef struct __CFFileDescriptor * CFFileDescriptorRef;
|
||||
|
||||
enum {
|
||||
kCFFileDescriptorReadCallBack = 1UL << 0,
|
||||
kCFFileDescriptorWriteCallBack = 1UL << 1
|
||||
};
|
||||
|
||||
typedef void (*CFFileDescriptorCallBack)(CFFileDescriptorRef f, CFOptionFlags callBackTypes, void *info);
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void *info;
|
||||
void *(*retain)(void *info);
|
||||
void (*release)(void *info);
|
||||
CFStringRef (*copyDescription)(void *info);
|
||||
} CFFileDescriptorContext;
|
||||
|
||||
CF_EXPORT CFTypeID CFFileDescriptorGetTypeID(void);
|
||||
CF_EXPORT CFFileDescriptorRef CFFileDescriptorCreate(CFAllocatorRef allocator, CFFileDescriptorNativeDescriptor fd, Boolean closeOnInvalidate, CFFileDescriptorCallBack callout, const CFFileDescriptorContext *context);
|
||||
CF_EXPORT CFFileDescriptorNativeDescriptor CFFileDescriptorGetNativeDescriptor(CFFileDescriptorRef f);
|
||||
CF_EXPORT void CFFileDescriptorGetContext(CFFileDescriptorRef f, CFFileDescriptorContext *context);
|
||||
CF_EXPORT void CFFileDescriptorEnableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes);
|
||||
CF_EXPORT void CFFileDescriptorDisableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes);
|
||||
CF_EXPORT void CFFileDescriptorInvalidate(CFFileDescriptorRef f);
|
||||
CF_EXPORT Boolean CFFileDescriptorIsValid(CFFileDescriptorRef f);
|
||||
CF_EXPORT CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource(CFAllocatorRef allocator, CFFileDescriptorRef f, CFIndex order);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif
|
1
CFFileDescriptor.h
Symbolic link
1
CFFileDescriptor.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFFileDescriptor.h
|
@ -1,47 +0,0 @@
|
||||
#if (TARGET_OS_MAC || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || CF_BUILDING_CF || NSBUILDINGFOUNDATION
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFFILESECURITY__)
|
||||
#define __COREFOUNDATION_CFFILESECURITY__ 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <CoreFoundation/CFUUID.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#define kCFFileSecurityRemoveACL(acl_t) _FILESEC_REMOVE_ACL
|
||||
|
||||
enum {
|
||||
kCFFileSecurityClearOwner = 1UL << 0,
|
||||
kCFFileSecurityClearGroup = 1UL << 1,
|
||||
kCFFileSecurityClearMode = 1UL << 2,
|
||||
kCFFileSecurityClearOwnerUUID = 1UL << 3,
|
||||
kCFFileSecurityClearGroupUUID = 1UL << 4,
|
||||
kCFFileSecurityClearAccessControlList = 1UL << 5
|
||||
};
|
||||
|
||||
typedef struct __CFFileSecurity* CFFileSecurityRef;
|
||||
|
||||
CF_EXPORT CFTypeID CFFileSecurityGetTypeID(void);
|
||||
CF_EXPORT CFFileSecurityRef CFFileSecurityCreate(CFAllocatorRef allocator);
|
||||
CF_EXPORT CFFileSecurityRef CFFileSecurityCreateCopy(CFAllocatorRef allocator, CFFileSecurityRef fileSec);
|
||||
CF_EXPORT Boolean CFFileSecurityCopyOwnerUUID(CFFileSecurityRef fileSec, CFUUIDRef *ownerUUID);
|
||||
CF_EXPORT Boolean CFFileSecuritySetOwnerUUID(CFFileSecurityRef fileSec, CFUUIDRef ownerUUID);
|
||||
CF_EXPORT Boolean CFFileSecurityCopyGroupUUID(CFFileSecurityRef fileSec, CFUUIDRef *groupUUID);
|
||||
CF_EXPORT Boolean CFFileSecuritySetGroupUUID(CFFileSecurityRef fileSec, CFUUIDRef groupUUID);
|
||||
CF_EXPORT Boolean CFFileSecurityCopyAccessControlList(CFFileSecurityRef fileSec, acl_t *accessControlList);
|
||||
CF_EXPORT Boolean CFFileSecuritySetAccessControlList(CFFileSecurityRef fileSec, acl_t accessControlList);
|
||||
CF_EXPORT Boolean CFFileSecurityGetOwner(CFFileSecurityRef fileSec, uid_t *owner);
|
||||
CF_EXPORT Boolean CFFileSecuritySetOwner(CFFileSecurityRef fileSec, uid_t owner);
|
||||
CF_EXPORT Boolean CFFileSecurityGetGroup(CFFileSecurityRef fileSec, gid_t *group);
|
||||
CF_EXPORT Boolean CFFileSecuritySetGroup(CFFileSecurityRef fileSec, gid_t group);
|
||||
CF_EXPORT Boolean CFFileSecurityGetMode(CFFileSecurityRef fileSec, mode_t *mode);
|
||||
CF_EXPORT Boolean CFFileSecuritySetMode(CFFileSecurityRef fileSec, mode_t mode);
|
||||
CF_EXPORT Boolean CFFileSecurityClearProperties(CFFileSecurityRef fileSec, CFOptionFlags clearPropertyMask);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
1
CFFileSecurity.h
Symbolic link
1
CFFileSecurity.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFFileSecurity.h
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
* CFICUConverters.h
|
||||
* CoreFoundation
|
||||
*
|
||||
* Created by Aki Inoue on 07/12/04.
|
||||
* Copyright (c) 2007-2014, Apple Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
|
||||
CF_PRIVATE const char *__CFStringEncodingGetICUName(CFStringEncoding encoding);
|
||||
|
||||
CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromICUName(const char *icuName);
|
||||
|
||||
|
||||
CF_PRIVATE CFIndex __CFStringEncodingICUToBytes(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen);
|
||||
CF_PRIVATE CFIndex __CFStringEncodingICUToUnicode(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen);
|
||||
CF_PRIVATE CFIndex __CFStringEncodingICUCharLength(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes);
|
||||
CF_PRIVATE CFIndex __CFStringEncodingICUByteLength(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars);
|
||||
|
||||
// The caller is responsible for freeing the memory (use CFAllocatorDeallocate)
|
||||
CF_PRIVATE CFStringEncoding *__CFStringEncodingCreateICUEncodings(CFAllocatorRef allocator, CFIndex *numberOfIndex);
|
||||
|
||||
|
1
CFICUConverters.h
Symbolic link
1
CFICUConverters.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFICUConverters.h
|
118
CFICULogging.h
118
CFICULogging.h
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
CFICULogging.h
|
||||
Copyright (c) 2008-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
This file is for the use of the CoreFoundation project only.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFICULOGGING__)
|
||||
#define __COREFOUNDATION_CFICULOGGING__ 1
|
||||
|
||||
#include <unicode/ucal.h>
|
||||
#include <unicode/udatpg.h>
|
||||
#include <unicode/udat.h>
|
||||
#include <unicode/unum.h>
|
||||
#include <unicode/ucurr.h>
|
||||
#include <unicode/ustring.h>
|
||||
|
||||
// ucal
|
||||
|
||||
|
||||
// ucal
|
||||
#define __cficu_ucal_open ucal_open
|
||||
#define __cficu_ucal_close ucal_close
|
||||
#define __cficu_ucal_clone ucal_clone
|
||||
#define __cficu_ucal_setAttribute ucal_setAttribute
|
||||
#define __cficu_ucal_getAttribute ucal_getAttribute
|
||||
#define __cficu_ucal_setGregorianChange ucal_setGregorianChange
|
||||
#define __cficu_ucal_getGregorianChange ucal_getGregorianChange
|
||||
#define __cficu_ucal_getMillis ucal_getMillis
|
||||
#define __cficu_ucal_setMillis ucal_setMillis
|
||||
#define __cficu_ucal_set ucal_set
|
||||
#define __cficu_ucal_get ucal_get
|
||||
#define __cficu_ucal_getDayOfWeekType ucal_getDayOfWeekType
|
||||
#define __cficu_ucal_getWeekendTransition ucal_getWeekendTransition
|
||||
#define __cficu_ucal_isWeekend ucal_isWeekend
|
||||
#define __cficu_ucal_clear ucal_clear
|
||||
#define __cficu_ucal_getLimit ucal_getLimit
|
||||
#define __cficu_ucal_add ucal_add
|
||||
#define __cficu_ucal_roll ucal_roll
|
||||
#define __cficu_ucal_getFieldDifference ucal_getFieldDifference
|
||||
#define __cficu_ucal_getNow ucal_getNow
|
||||
#define __cficu_ucal_setTimeZone ucal_setTimeZone
|
||||
// udatpg
|
||||
#define __cficu_udatpg_open udatpg_open
|
||||
#define __cficu_udatpg_close udatpg_close
|
||||
#define __cficu_udatpg_getSkeleton udatpg_getSkeleton
|
||||
#define __cficu_udatpg_getBestPattern udatpg_getBestPattern
|
||||
// udat
|
||||
#define __cficu_udat_applyPattern udat_applyPattern
|
||||
#define __cficu_udat_applyPatternRelative udat_applyPatternRelative
|
||||
#define __cficu_udat_clone udat_clone
|
||||
#define __cficu_udat_close udat_close
|
||||
#define __cficu_udat_countSymbols udat_countSymbols
|
||||
#define __cficu_udat_format udat_format
|
||||
#define __cficu_udat_get2DigitYearStart udat_get2DigitYearStart
|
||||
#define __cficu_udat_getCalendar udat_getCalendar
|
||||
#define __cficu_udat_getSymbols udat_getSymbols
|
||||
#define __cficu_udat_isLenient udat_isLenient
|
||||
#define __cficu_udat_open udat_open
|
||||
#define __cficu_udat_parseCalendar udat_parseCalendar
|
||||
#define __cficu_udat_set2DigitYearStart udat_set2DigitYearStart
|
||||
#define __cficu_udat_setCalendar udat_setCalendar
|
||||
#define __cficu_udat_setLenient udat_setLenient
|
||||
#define __cficu_udat_setSymbols udat_setSymbols
|
||||
#define __cficu_udat_toPattern udat_toPattern
|
||||
#define __cficu_udat_toPatternRelativeDate udat_toPatternRelativeDate
|
||||
#define __cficu_udat_toPatternRelativeTime udat_toPatternRelativeTime
|
||||
#define __cficu_unum_applyPattern unum_applyPattern
|
||||
#define __cficu_unum_close unum_close
|
||||
#define __cficu_unum_formatDecimal unum_formatDecimal
|
||||
#define __cficu_unum_formatDouble unum_formatDouble
|
||||
#define __cficu_unum_getAttribute unum_getAttribute
|
||||
#define __cficu_unum_getDoubleAttribute unum_getDoubleAttribute
|
||||
#define __cficu_unum_getSymbol unum_getSymbol
|
||||
#define __cficu_unum_getTextAttribute unum_getTextAttribute
|
||||
#define __cficu_unum_open unum_open
|
||||
#define __cficu_unum_parse unum_parse
|
||||
#define __cficu_unum_parseDecimal unum_parseDecimal
|
||||
#define __cficu_unum_setAttribute unum_setAttribute
|
||||
#define __cficu_unum_setDoubleAttribute unum_setDoubleAttribute
|
||||
#define __cficu_unum_setSymbol unum_setSymbol
|
||||
#define __cficu_unum_setTextAttribute unum_setTextAttribute
|
||||
#define __cficu_unum_toPattern unum_toPattern
|
||||
#define __cficu_udat_setContext udat_setContext
|
||||
#define __cficu_udat_getContext udat_getContext
|
||||
// ucurr
|
||||
#define __cficu_ucurr_getDefaultFractionDigits ucurr_getDefaultFractionDigits
|
||||
#define __cficu_ucurr_getRoundingIncrement ucurr_getRoundingIncrement
|
||||
// unum
|
||||
#define __cficu_unum_setContext unum_setContext
|
||||
#define __cficu_unum_getContext unum_getContext
|
||||
|
||||
#endif
|
1
CFICULogging.h
Symbolic link
1
CFICULogging.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFICULogging.h
|
805
CFInternal.h
805
CFInternal.h
@ -1,805 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFInternal.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
NOT TO BE USED OUTSIDE CF!
|
||||
*/
|
||||
|
||||
#if !CF_BUILDING_CF
|
||||
#error The header file CFInternal.h is for the exclusive use of CoreFoundation. No other project should include it.
|
||||
#endif
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFINTERNAL__)
|
||||
#define __COREFOUNDATION_CFINTERNAL__ 1
|
||||
|
||||
|
||||
#define __CF_COMPILE_YEAR__ (__DATE__[7] * 1000 + __DATE__[8] * 100 + __DATE__[9] * 10 + __DATE__[10] - 53328)
|
||||
#define __CF_COMPILE_MONTH__ ((__DATE__[1] + __DATE__[2] == 207) ? 1 : \
|
||||
(__DATE__[1] + __DATE__[2] == 199) ? 2 : \
|
||||
(__DATE__[1] + __DATE__[2] == 211) ? 3 : \
|
||||
(__DATE__[1] + __DATE__[2] == 226) ? 4 : \
|
||||
(__DATE__[1] + __DATE__[2] == 218) ? 5 : \
|
||||
(__DATE__[1] + __DATE__[2] == 227) ? 6 : \
|
||||
(__DATE__[1] + __DATE__[2] == 225) ? 7 : \
|
||||
(__DATE__[1] + __DATE__[2] == 220) ? 8 : \
|
||||
(__DATE__[1] + __DATE__[2] == 213) ? 9 : \
|
||||
(__DATE__[1] + __DATE__[2] == 215) ? 10 : \
|
||||
(__DATE__[1] + __DATE__[2] == 229) ? 11 : \
|
||||
(__DATE__[1] + __DATE__[2] == 200) ? 12 : 0)
|
||||
#define __CF_COMPILE_DAY__ (__DATE__[4] * 10 + __DATE__[5] - (__DATE__[4] == ' ' ? 368 : 528))
|
||||
#define __CF_COMPILE_DATE__ (__CF_COMPILE_YEAR__ * 10000 + __CF_COMPILE_MONTH__ * 100 + __CF_COMPILE_DAY__)
|
||||
|
||||
#define __CF_COMPILE_HOUR__ (__TIME__[0] * 10 + __TIME__[1] - 528)
|
||||
#define __CF_COMPILE_MINUTE__ (__TIME__[3] * 10 + __TIME__[4] - 528)
|
||||
#define __CF_COMPILE_SECOND__ (__TIME__[6] * 10 + __TIME__[7] - 528)
|
||||
#define __CF_COMPILE_TIME__ (__CF_COMPILE_HOUR__ * 10000 + __CF_COMPILE_MINUTE__ * 100 + __CF_COMPILE_SECOND__)
|
||||
|
||||
#define __CF_COMPILE_SECOND_OF_DAY__ (__CF_COMPILE_HOUR__ * 3600 + __CF_COMPILE_MINUTE__ * 60 + __CF_COMPILE_SECOND__)
|
||||
|
||||
// __CF_COMPILE_DAY_OF_EPOCH__ works within Gregorian years 2001 - 2099; the epoch is of course CF's epoch
|
||||
#define __CF_COMPILE_DAY_OF_EPOCH__ ((__CF_COMPILE_YEAR__ - 2001) * 365 + (__CF_COMPILE_YEAR__ - 2001) / 4 \
|
||||
+ ((__DATE__[1] + __DATE__[2] == 207) ? 0 : \
|
||||
(__DATE__[1] + __DATE__[2] == 199) ? 31 : \
|
||||
(__DATE__[1] + __DATE__[2] == 211) ? 59 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 226) ? 90 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 218) ? 120 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 227) ? 151 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 225) ? 181 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 220) ? 212 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 213) ? 243 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 215) ? 273 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 229) ? 304 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
(__DATE__[1] + __DATE__[2] == 200) ? 334 + (__CF_COMPILE_YEAR__ % 4 == 0) : \
|
||||
365 + (__CF_COMPILE_YEAR__ % 4 == 0)) \
|
||||
+ __CF_COMPILE_DAY__)
|
||||
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFLogUtilities.h>
|
||||
#include <CoreFoundation/CFRuntime.h>
|
||||
#include <limits.h>
|
||||
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI || DEPLOYMENT_TARGET_LINUX
|
||||
#include <xlocale.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
#if defined(__BIG_ENDIAN__)
|
||||
#define __CF_BIG_ENDIAN__ 1
|
||||
#define __CF_LITTLE_ENDIAN__ 0
|
||||
#endif
|
||||
|
||||
#if defined(__LITTLE_ENDIAN__)
|
||||
#define __CF_LITTLE_ENDIAN__ 1
|
||||
#define __CF_BIG_ENDIAN__ 0
|
||||
#endif
|
||||
|
||||
|
||||
#include <CoreFoundation/ForFoundationOnly.h>
|
||||
|
||||
CF_EXPORT const char *_CFProcessName(void);
|
||||
CF_EXPORT CFStringRef _CFProcessNameString(void);
|
||||
|
||||
CF_EXPORT Boolean _CFGetCurrentDirectory(char *path, int maxlen);
|
||||
|
||||
CF_EXPORT CFArrayRef _CFGetWindowsBinaryDirectories(void);
|
||||
|
||||
CF_EXPORT CFStringRef _CFStringCreateHostName(void);
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
CF_EXPORT void _CFMachPortInstallNotifyPort(CFRunLoopRef rl, CFStringRef mode);
|
||||
#endif
|
||||
|
||||
|
||||
CF_PRIVATE CFIndex __CFActiveProcessorCount();
|
||||
|
||||
#ifndef CLANG_ANALYZER_NORETURN
|
||||
#if __has_feature(attribute_analyzer_noreturn)
|
||||
#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
|
||||
#else
|
||||
#define CLANG_ANALYZER_NORETURN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define __builtin_unreachable() do { } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#if defined(__GNUC__)
|
||||
#define HALT do {asm __volatile__("int3"); kill(getpid(), 9); __builtin_unreachable(); } while (0)
|
||||
#elif defined(_MSC_VER)
|
||||
#define HALT do { DebugBreak(); abort(); __builtin_unreachable(); } while (0)
|
||||
#else
|
||||
#error Compiler not supported
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define __CFAssert(cond, prio, desc, a1, a2, a3, a4, a5) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
CFLog(prio, CFSTR(desc), a1, a2, a3, a4, a5); \
|
||||
/* HALT; */ \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define __CFAssert(cond, prio, desc, a1, a2, a3, a4, a5) \
|
||||
do {} while (0)
|
||||
#endif
|
||||
|
||||
#define CFAssert(condition, priority, description) \
|
||||
__CFAssert((condition), (priority), description, 0, 0, 0, 0, 0)
|
||||
#define CFAssert1(condition, priority, description, a1) \
|
||||
__CFAssert((condition), (priority), description, (a1), 0, 0, 0, 0)
|
||||
#define CFAssert2(condition, priority, description, a1, a2) \
|
||||
__CFAssert((condition), (priority), description, (a1), (a2), 0, 0, 0)
|
||||
#define CFAssert3(condition, priority, description, a1, a2, a3) \
|
||||
__CFAssert((condition), (priority), description, (a1), (a2), (a3), 0, 0)
|
||||
#define CFAssert4(condition, priority, description, a1, a2, a3, a4) \
|
||||
__CFAssert((condition), (priority), description, (a1), (a2), (a3), (a4), 0)
|
||||
|
||||
#define __kCFLogAssertion 3
|
||||
|
||||
// This CF-only log function uses no CF functionality, so it may be called anywhere within CF - including thread teardown or prior to full CF setup
|
||||
CF_PRIVATE void _CFLogSimple(int32_t lev, char *format, ...);
|
||||
|
||||
#if defined(DEBUG)
|
||||
extern void __CFGenericValidateType_(CFTypeRef cf, CFTypeID type, const char *func);
|
||||
#define __CFGenericValidateType(cf, type) __CFGenericValidateType_(cf, type, __PRETTY_FUNCTION__)
|
||||
#else
|
||||
#define __CFGenericValidateType(cf, type) ((void)0)
|
||||
#endif
|
||||
|
||||
#define CF_INFO_BITS (!!(__CF_BIG_ENDIAN__) * 3)
|
||||
#define CF_RC_BITS (!!(__CF_LITTLE_ENDIAN__) * 3)
|
||||
|
||||
/* Bit manipulation macros */
|
||||
/* Bits are numbered from 31 on left to 0 on right */
|
||||
/* May or may not work if you use them on bitfields in types other than UInt32, bitfields the full width of a UInt32, or anything else for which they were not designed. */
|
||||
/* In the following, N1 and N2 specify an inclusive range N2..N1 with N1 >= N2 */
|
||||
#define __CFBitfieldMask(N1, N2) ((((UInt32)~0UL) << (31UL - (N1) + (N2))) >> (31UL - N1))
|
||||
#define __CFBitfieldGetValue(V, N1, N2) (((V) & __CFBitfieldMask(N1, N2)) >> (N2))
|
||||
#define __CFBitfieldSetValue(V, N1, N2, X) ((V) = ((V) & ~__CFBitfieldMask(N1, N2)) | (((X) << (N2)) & __CFBitfieldMask(N1, N2)))
|
||||
#define __CFBitfieldMaxValue(N1, N2) __CFBitfieldGetValue(0xFFFFFFFFUL, (N1), (N2))
|
||||
|
||||
#define __CFBitIsSet(V, N) (((V) & (1UL << (N))) != 0)
|
||||
#define __CFBitSet(V, N) ((V) |= (1UL << (N)))
|
||||
#define __CFBitClear(V, N) ((V) &= ~(1UL << (N)))
|
||||
|
||||
// Foundation uses 20-40
|
||||
// Foundation knows about the value of __CFTSDKeyAutoreleaseData1
|
||||
enum {
|
||||
__CFTSDKeyAllocator = 1,
|
||||
__CFTSDKeyIsInCFLog = 2,
|
||||
__CFTSDKeyIsInNSCache = 3,
|
||||
__CFTSDKeyIsInGCDMainQ = 4,
|
||||
__CFTSDKeyICUConverter = 7,
|
||||
__CFTSDKeyCollatorLocale = 8,
|
||||
__CFTSDKeyCollatorUCollator = 9,
|
||||
__CFTSDKeyRunLoop = 10,
|
||||
__CFTSDKeyRunLoopCntr = 11,
|
||||
__CFTSDKeyMachMessageBoost = 12, // valid only in the context of a CFMachPort callout
|
||||
__CFTSDKeyMachMessageHasVoucher = 13,
|
||||
// autorelease pool stuff must be higher than run loop constants
|
||||
__CFTSDKeyAutoreleaseData2 = 61,
|
||||
__CFTSDKeyAutoreleaseData1 = 62,
|
||||
__CFTSDKeyExceptionData = 63,
|
||||
};
|
||||
|
||||
#define __kCFAllocatorTypeID_CONST 2
|
||||
|
||||
CF_INLINE CFAllocatorRef __CFGetDefaultAllocator(void) {
|
||||
CFAllocatorRef allocator = (CFAllocatorRef)_CFGetTSD(__CFTSDKeyAllocator);
|
||||
if (NULL == allocator) {
|
||||
allocator = kCFAllocatorSystemDefault;
|
||||
}
|
||||
return allocator;
|
||||
}
|
||||
|
||||
|
||||
#if !defined(LLONG_MAX)
|
||||
#if defined(_I64_MAX)
|
||||
#define LLONG_MAX _I64_MAX
|
||||
#else
|
||||
#warning Arbitrarily defining LLONG_MAX
|
||||
#define LLONG_MAX (int64_t)9223372036854775807
|
||||
#endif
|
||||
#endif /* !defined(LLONG_MAX) */
|
||||
|
||||
#if !defined(LLONG_MIN)
|
||||
#if defined(_I64_MIN)
|
||||
#define LLONG_MIN _I64_MIN
|
||||
#else
|
||||
#warning Arbitrarily defining LLONG_MIN
|
||||
#define LLONG_MIN (-LLONG_MAX - (int64_t)1)
|
||||
#endif
|
||||
#endif /* !defined(LLONG_MIN) */
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#define __CFMin(A,B) ({__typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
|
||||
#define __CFMax(A,B) ({__typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
|
||||
#else /* __GNUC__ */
|
||||
#define __CFMin(A,B) ((A) < (B) ? (A) : (B))
|
||||
#define __CFMax(A,B) ((A) > (B) ? (A) : (B))
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/* Secret CFAllocator hint bits */
|
||||
#define __kCFAllocatorTempMemory 0x2
|
||||
#define __kCFAllocatorNoPointers 0x10
|
||||
#define __kCFAllocatorDoNotRecordEvent 0x100
|
||||
#define __kCFAllocatorGCScannedMemory 0x200 /* GC: memory should be scanned. */
|
||||
#define __kCFAllocatorGCObjectMemory 0x400 /* GC: memory needs to be finalized. */
|
||||
|
||||
CF_INLINE auto_memory_type_t CF_GET_GC_MEMORY_TYPE(CFOptionFlags flags) {
|
||||
auto_memory_type_t type = (flags & __kCFAllocatorGCScannedMemory ? 0 : AUTO_UNSCANNED) | (flags & __kCFAllocatorGCObjectMemory ? AUTO_OBJECT : 0);
|
||||
return type;
|
||||
}
|
||||
|
||||
CF_INLINE void __CFAssignWithWriteBarrier(void **location, void *value) {
|
||||
if (kCFUseCollectableAllocator) {
|
||||
objc_assign_strongCast((id)value, (id *)location);
|
||||
} else {
|
||||
*location = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Zero-retain count CFAllocator functions, i.e. memory that will be collected, no dealloc necessary
|
||||
CF_EXPORT void *_CFAllocatorAllocateGC(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint);
|
||||
CF_EXPORT void *_CFAllocatorReallocateGC(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint);
|
||||
CF_EXPORT void _CFAllocatorDeallocateGC(CFAllocatorRef allocator, void *ptr);
|
||||
|
||||
CF_EXPORT CFAllocatorRef _CFTemporaryMemoryAllocator(void);
|
||||
|
||||
extern uint64_t __CFTimeIntervalToTSR(CFTimeInterval ti);
|
||||
extern CFTimeInterval __CFTSRToTimeInterval(uint64_t tsr);
|
||||
// use this instead of attempting to subtract mach_absolute_time() directly, because that can underflow and give an unexpected answer
|
||||
CF_PRIVATE CFTimeInterval __CFTimeIntervalUntilTSR(uint64_t tsr);
|
||||
CF_PRIVATE dispatch_time_t __CFTSRToDispatchTime(uint64_t tsr);
|
||||
CF_PRIVATE uint64_t __CFTSRToNanoseconds(uint64_t tsr);
|
||||
|
||||
extern CFStringRef __CFCopyFormattingDescription(CFTypeRef cf, CFDictionaryRef formatOptions);
|
||||
|
||||
/* Enhanced string formatting support
|
||||
*/
|
||||
CF_PRIVATE CFDictionaryRef _CFStringGetFormatSpecifierConfiguration(CFStringRef aFormatString);
|
||||
CF_PRIVATE CFStringRef _CFStringCopyWithFomatStringConfiguration(CFStringRef aFormatString, CFDictionaryRef formatConfiguration);
|
||||
CF_PRIVATE CFStringRef _CFCopyResolvedFormatStringWithConfiguration(CFTypeRef anObject, CFDictionaryRef aConfiguration, CFDictionaryRef formatOptions);
|
||||
|
||||
/* result is long long or int, depending on doLonglong
|
||||
*/
|
||||
extern Boolean __CFStringScanInteger(CFStringInlineBuffer *buf, CFTypeRef locale, SInt32 *indexPtr, Boolean doLonglong, void *result);
|
||||
extern Boolean __CFStringScanDouble(CFStringInlineBuffer *buf, CFTypeRef locale, SInt32 *indexPtr, double *resultPtr);
|
||||
extern Boolean __CFStringScanHex(CFStringInlineBuffer *buf, SInt32 *indexPtr, unsigned *result);
|
||||
|
||||
extern const char *__CFgetenv(const char *n);
|
||||
|
||||
CF_PRIVATE Boolean __CFProcessIsRestricted();
|
||||
|
||||
// This is really about the availability of C99. We don't have that on Windows, but we should everywhere else.
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define STACK_BUFFER_DECL(T, N, C) T *N = (T *)_alloca((C) * sizeof(T))
|
||||
#else
|
||||
#define STACK_BUFFER_DECL(T, N, C) T N[C]
|
||||
#endif
|
||||
|
||||
|
||||
CF_EXPORT void * __CFConstantStringClassReferencePtr;
|
||||
|
||||
#ifdef __CONSTANT_CFSTRINGS__
|
||||
|
||||
#define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V);
|
||||
#define PE_CONST_STRING_DECL(S, V) CF_PRIVATE const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V);
|
||||
|
||||
#else
|
||||
|
||||
struct CF_CONST_STRING {
|
||||
CFRuntimeBase _base;
|
||||
uint8_t *_ptr;
|
||||
uint32_t _length;
|
||||
};
|
||||
|
||||
CF_EXPORT int __CFConstantStringClassReference[];
|
||||
|
||||
/* CFNetwork also has a copy of the CONST_STRING_DECL macro (for use on platforms without constant string support in cc); please warn cfnetwork-core@group.apple.com of any necessary changes to this macro. -- REW, 1/28/2002 */
|
||||
|
||||
#if __CF_BIG_ENDIAN__
|
||||
|
||||
#define CONST_STRING_DECL(S, V) \
|
||||
static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
|
||||
const CFStringRef S = (CFStringRef) & __ ## S ## __;
|
||||
#define PE_CONST_STRING_DECL(S, V) \
|
||||
static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0x00, 0x00, 0x07, 0xc8}}, (uint8_t *)V, sizeof(V) - 1}; \
|
||||
CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
|
||||
|
||||
#elif __CF_LITTLE_ENDIAN__
|
||||
|
||||
#define CONST_STRING_DECL(S, V) \
|
||||
static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00}}, (uint8_t *)(V), sizeof(V) - 1}; \
|
||||
const CFStringRef S = (CFStringRef) & __ ## S ## __;
|
||||
#define PE_CONST_STRING_DECL(S, V) \
|
||||
static struct CF_CONST_STRING __ ## S ## __ = {{(uintptr_t)&__CFConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00}}, (uint8_t *)(V), sizeof(V) - 1}; \
|
||||
CF_PRIVATE const CFStringRef S = (CFStringRef) & __ ## S ## __;
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __CONSTANT_CFSTRINGS__
|
||||
|
||||
CF_EXPORT bool __CFOASafe;
|
||||
CF_EXPORT void __CFSetLastAllocationEventName(void *ptr, const char *classname);
|
||||
|
||||
|
||||
|
||||
/* Comparators are passed the address of the values; this is somewhat different than CFComparatorFunction is used in public API usually. */
|
||||
CF_EXPORT CFIndex CFBSearch(const void *element, CFIndex elementSize, const void *list, CFIndex count, CFComparatorFunction comparator, void *context);
|
||||
|
||||
CF_EXPORT CFHashCode CFHashBytes(UInt8 *bytes, CFIndex length);
|
||||
|
||||
CF_EXPORT CFStringEncoding CFStringFileSystemEncoding(void);
|
||||
|
||||
CF_PRIVATE CFStringRef __CFStringCreateImmutableFunnel3(CFAllocatorRef alloc, const void *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean possiblyExternalFormat, Boolean tryToReduceUnicode, Boolean hasLengthByte, Boolean hasNullByte, Boolean noCopy, CFAllocatorRef contentsDeallocator, UInt32 converterFlags);
|
||||
|
||||
extern const void *__CFStringCollectionCopy(CFAllocatorRef allocator, const void *ptr);
|
||||
extern const void *__CFTypeCollectionRetain(CFAllocatorRef allocator, const void *ptr);
|
||||
extern void __CFTypeCollectionRelease(CFAllocatorRef allocator, const void *ptr);
|
||||
|
||||
extern CFTypeRef CFMakeUncollectable(CFTypeRef cf);
|
||||
|
||||
CF_PRIVATE void _CFRaiseMemoryException(CFStringRef reason);
|
||||
|
||||
CF_PRIVATE Boolean __CFProphylacticAutofsAccess;
|
||||
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX
|
||||
|
||||
typedef pthread_mutex_t CFLock_t;
|
||||
|
||||
#define CFLockInit ((pthread_mutex_t)PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)
|
||||
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
|
||||
|
||||
#define __CFLock(LP) ({ \
|
||||
(void)pthread_mutex_lock(LP); })
|
||||
|
||||
#define __CFUnlock(LP) ({ \
|
||||
(void)pthread_mutex_unlock(LP); })
|
||||
|
||||
#define __CFLockTry(LP) ({ \
|
||||
pthread_mutex_trylock(LP) == 0; })
|
||||
|
||||
#elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
|
||||
typedef pthread_mutex_t CFLock_t;
|
||||
|
||||
#define CFLockInit ((pthread_mutex_t)PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)
|
||||
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
|
||||
|
||||
#define __CFLock(LP) ({ \
|
||||
(void)pthread_mutex_lock(LP); })
|
||||
|
||||
#define __CFUnlock(LP) ({ \
|
||||
(void)pthread_mutex_unlock(LP); })
|
||||
|
||||
#define __CFLockTry(LP) ({ \
|
||||
pthread_mutex_trylock(LP) == 0; })
|
||||
|
||||
#elif DEPLOYMENT_TARGET_WINDOWS
|
||||
|
||||
typedef int32_t CFLock_t;
|
||||
#define CFLockInit 0
|
||||
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
|
||||
|
||||
CF_INLINE void __CFLock(volatile CFLock_t *lock) {
|
||||
while (InterlockedCompareExchange((LONG volatile *)lock, ~0, 0) != 0) {
|
||||
Sleep(0);
|
||||
}
|
||||
}
|
||||
|
||||
CF_INLINE void __CFUnlock(volatile CFLock_t *lock) {
|
||||
MemoryBarrier();
|
||||
*lock = 0;
|
||||
}
|
||||
|
||||
CF_INLINE Boolean __CFLockTry(volatile CFLock_t *lock) {
|
||||
return (InterlockedCompareExchange((LONG volatile *)lock, ~0, 0) == 0);
|
||||
}
|
||||
|
||||
#elif DEPLOYMENT_TARGET_LINUX
|
||||
|
||||
typedef int32_t CFLock_t;
|
||||
#define CFLockInit 0
|
||||
#define CF_LOCK_INIT_FOR_STRUCTS(X) (X = CFLockInit)
|
||||
|
||||
CF_INLINE void __CFLock(volatile CFLock_t *lock) {
|
||||
while (__sync_val_compare_and_swap(lock, 0, ~0) != 0) {
|
||||
sleep(0);
|
||||
}
|
||||
}
|
||||
|
||||
CF_INLINE void __CFUnlock(volatile CFLock_t *lock) {
|
||||
__sync_synchronize();
|
||||
*lock = 0;
|
||||
}
|
||||
|
||||
CF_INLINE Boolean __CFLockTry(volatile CFLock_t *lock) {
|
||||
return (__sync_val_compare_and_swap(lock, 0, ~0) == 0);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#warning CF locks not defined for this platform -- CF is not thread-safe
|
||||
#define __CFLock(A) do {} while (0)
|
||||
#define __CFUnlock(A) do {} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
|
||||
extern uint8_t __CF120293;
|
||||
extern uint8_t __CF120290;
|
||||
extern void __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__(void);
|
||||
#define CHECK_FOR_FORK() do { __CF120290 = true; if (__CF120293) __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__(); } while (0)
|
||||
#define CHECK_FOR_FORK_RET(...) do { CHECK_FOR_FORK(); if (__CF120293) return __VA_ARGS__; } while (0)
|
||||
#define HAS_FORKED() (__CF120293)
|
||||
#endif
|
||||
|
||||
#if !defined(CHECK_FOR_FORK)
|
||||
#define CHECK_FOR_FORK() do { } while (0)
|
||||
#endif
|
||||
|
||||
#if !defined(CHECK_FOR_FORK_RET)
|
||||
#define CHECK_FOR_FORK_RET(...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#if !defined(HAS_FORKED)
|
||||
#define HAS_FORKED() 0
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#define thread_errno() errno
|
||||
#define thread_set_errno(V) do {errno = (V);} while (0)
|
||||
|
||||
extern void *__CFStartSimpleThread(void *func, void *arg);
|
||||
|
||||
/* ==================== Simple file access ==================== */
|
||||
/* For dealing with abstract types. MF:!!! These ought to be somewhere else and public. */
|
||||
|
||||
CF_EXPORT CFStringRef _CFCopyExtensionForAbstractType(CFStringRef abstractType);
|
||||
|
||||
/* ==================== Simple file access ==================== */
|
||||
/* These functions all act on a c-strings which must be in the file system encoding. */
|
||||
|
||||
CF_PRIVATE Boolean _CFCreateDirectory(const char *path);
|
||||
CF_PRIVATE Boolean _CFRemoveDirectory(const char *path);
|
||||
CF_PRIVATE Boolean _CFDeleteFile(const char *path);
|
||||
|
||||
CF_PRIVATE Boolean _CFReadBytesFromFile(CFAllocatorRef alloc, CFURLRef url, void **bytes, CFIndex *length, CFIndex maxLength, int extraOpenFlags);
|
||||
/* resulting bytes are allocated from alloc which MUST be non-NULL. */
|
||||
/* maxLength of zero means the whole file. Otherwise it sets a limit on the number of bytes read. */
|
||||
|
||||
CF_EXPORT Boolean _CFWriteBytesToFile(CFURLRef url, const void *bytes, CFIndex length);
|
||||
|
||||
CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc, char *dirPath, void *dirSpec, CFURLRef dirURL, CFStringRef matchingAbstractType);
|
||||
/* On Mac OS 8/9, one of dirSpec, dirPath and dirURL must be non-NULL */
|
||||
/* On all other platforms, one of path and dirURL must be non-NULL */
|
||||
/* If both are present, they are assumed to be in-synch; that is, they both refer to the same directory. */
|
||||
/* alloc may be NULL */
|
||||
/* return value is CFArray of CFURLs */
|
||||
|
||||
CF_PRIVATE SInt32 _CFGetPathProperties(CFAllocatorRef alloc, char *path, Boolean *exists, SInt32 *posixMode, SInt64 *size, CFDateRef *modTime, SInt32 *ownerID, CFArrayRef *dirContents);
|
||||
/* alloc may be NULL */
|
||||
/* any of exists, posixMode, size, modTime, and dirContents can be NULL. Usually it is not a good idea to pass NULL for exists, since interpretting the other values sometimes requires that you know whether the file existed or not. Except for dirContents, it is pretty cheap to compute any of these things as loing as one of them must be computed. */
|
||||
|
||||
CF_PRIVATE SInt32 _CFGetFileProperties(CFAllocatorRef alloc, CFURLRef pathURL, Boolean *exists, SInt32 *posixMode, SInt64 *size, CFDateRef *modTime, SInt32 *ownerID, CFArrayRef *dirContents);
|
||||
/* alloc may be NULL */
|
||||
/* any of exists, posixMode, size, modTime, and dirContents can be NULL. Usually it is not a good idea to pass NULL for exists, since interpretting the other values sometimes requires that you know whether the file existed or not. Except for dirContents, it is pretty cheap to compute any of these things as loing as one of them must be computed. */
|
||||
|
||||
|
||||
/* ==================== Simple path manipulation ==================== */
|
||||
|
||||
CF_EXPORT UniChar _CFGetSlash();
|
||||
CF_PRIVATE CFStringRef _CFGetSlashStr();
|
||||
CF_EXPORT Boolean _CFIsAbsolutePath(UniChar *unichars, CFIndex length);
|
||||
CF_PRIVATE void _CFAppendTrailingPathSlash2(CFMutableStringRef path);
|
||||
CF_PRIVATE void _CFAppendConditionalTrailingPathSlash2(CFMutableStringRef path);
|
||||
CF_EXPORT Boolean _CFAppendPathComponent(UniChar *unichars, CFIndex *length, CFIndex maxLength, UniChar *component, CFIndex componentLength);
|
||||
CF_PRIVATE void _CFAppendPathComponent2(CFMutableStringRef path, CFStringRef component);
|
||||
CF_PRIVATE Boolean _CFAppendPathExtension2(CFMutableStringRef path, CFStringRef extension);
|
||||
CF_EXPORT Boolean _CFAppendPathExtension(UniChar *unichars, CFIndex *length, CFIndex maxLength, UniChar *extension, CFIndex extensionLength);
|
||||
CF_EXPORT Boolean _CFTransmutePathSlashes(UniChar *unichars, CFIndex *length, UniChar replSlash);
|
||||
CF_PRIVATE CFStringRef _CFCreateLastPathComponent(CFAllocatorRef alloc, CFStringRef path, CFIndex *slashIndex);
|
||||
CF_EXPORT CFIndex _CFStartOfLastPathComponent(UniChar *unichars, CFIndex length);
|
||||
CF_PRIVATE CFIndex _CFStartOfLastPathComponent2(CFStringRef path);
|
||||
CF_EXPORT CFIndex _CFLengthAfterDeletingLastPathComponent(UniChar *unichars, CFIndex length);
|
||||
CF_PRIVATE CFIndex _CFLengthAfterDeletingPathExtension2(CFStringRef path);
|
||||
CF_EXPORT CFIndex _CFStartOfPathExtension(UniChar *unichars, CFIndex length);
|
||||
CF_PRIVATE CFIndex _CFStartOfPathExtension2(CFStringRef path);
|
||||
CF_EXPORT CFIndex _CFLengthAfterDeletingPathExtension(UniChar *unichars, CFIndex length);
|
||||
|
||||
#if __BLOCKS__
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define DT_DIR 4
|
||||
#define DT_REG 8
|
||||
#define DT_LNK 10
|
||||
#endif
|
||||
|
||||
// This function automatically skips '.' and '..', and '._' files
|
||||
CF_PRIVATE void _CFIterateDirectory(CFStringRef directoryPath, Boolean (^fileHandler)(CFStringRef fileName, uint8_t fileType));
|
||||
#endif
|
||||
|
||||
#define __CFMaxRuntimeTypes 65535
|
||||
#define __CFRuntimeClassTableSize 1024
|
||||
|
||||
extern void _CFRuntimeSetInstanceTypeIDAndIsa(CFTypeRef cf, CFTypeID newTypeID);
|
||||
|
||||
#define CF_OBJC_FUNCDISPATCHV(typeID, obj, ...) do { } while (0)
|
||||
#define CF_OBJC_CALLV(obj, ...) (0)
|
||||
#define CF_IS_OBJC(typeID, obj) (0)
|
||||
#define __CFISAForTypeID(t) (0)
|
||||
|
||||
/* See comments in CFBase.c
|
||||
*/
|
||||
#define FAULT_CALLBACK(V)
|
||||
#define INVOKE_CALLBACK1(P, A) (P)(A)
|
||||
#define INVOKE_CALLBACK2(P, A, B) (P)(A, B)
|
||||
#define INVOKE_CALLBACK3(P, A, B, C) (P)(A, B, C)
|
||||
#define INVOKE_CALLBACK4(P, A, B, C, D) (P)(A, B, C, D)
|
||||
#define INVOKE_CALLBACK5(P, A, B, C, D, E) (P)(A, B, C, D, E)
|
||||
#define UNFAULT_CALLBACK(V) do { } while (0)
|
||||
|
||||
/* For the support of functionality which needs CarbonCore or other frameworks */
|
||||
// These macros define an upcall or weak "symbol-lookup" wrapper function.
|
||||
// The parameters are:
|
||||
// R : the return type of the function
|
||||
// N : the name of the function (in the other library)
|
||||
// P : the parenthesized parameter list of the function
|
||||
// A : the parenthesized actual argument list to be passed
|
||||
// FAILACTION: (only for the _FAIL macros) additional code to be
|
||||
// run when the function cannot be found.
|
||||
// opt: a fifth optional argument can be passed in which is the
|
||||
// return value of the wrapper when the function cannot be
|
||||
// found; should be of type R, & can be a function call
|
||||
// The name of the resulting wrapper function is:
|
||||
// __CFCarbonCore_N (where N is the second parameter)
|
||||
// __CFNetwork_N (where N is the second parameter)
|
||||
//
|
||||
// Example:
|
||||
// DEFINE_WEAK_CARBONCORE_FUNC(void, DisposeHandle, (Handle h), (h))
|
||||
//
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
|
||||
|
||||
extern void *__CFLookupCFNetworkFunction(const char *name);
|
||||
|
||||
#define DEFINE_WEAK_CFNETWORK_FUNC(R, N, P, A, ...) \
|
||||
typedef R (*dyfuncptr)P; \
|
||||
static dyfuncptr dyfunc = (dyfuncptr)(~(uintptr_t)0); \
|
||||
if ((dyfuncptr)(~(uintptr_t)0) == dyfunc) { \
|
||||
dyfunc = (dyfuncptr)__CFLookupCFNetworkFunction(#N); } \
|
||||
if (dyfunc) { return dyfunc A ; } \
|
||||
return __VA_ARGS__ ; \
|
||||
}
|
||||
|
||||
#define DEFINE_WEAK_CFNETWORK_FUNC_FAIL(R, N, P, A, FAILACTION, ...) \
|
||||
static R __CFNetwork_ ## N P { \
|
||||
typedef R (*dyfuncptr)P; \
|
||||
static dyfuncptr dyfunc = (dyfuncptr)(~(uintptr_t)0); \
|
||||
if ((dyfuncptr)(~(uintptr_t)0) == dyfunc) { \
|
||||
dyfunc = (dyfuncptr)__CFLookupCFNetworkFunction(#N); } \
|
||||
if (dyfunc) { return dyfunc A ; } \
|
||||
FAILACTION ; \
|
||||
return __VA_ARGS__ ; \
|
||||
}
|
||||
|
||||
#else
|
||||
#define DEFINE_WEAK_CFNETWORK_FUNC(R, N, P, A, ...)
|
||||
#define DEFINE_WEAK_CFNETWORK_FUNC_FAIL(R, N, P, A, ...)
|
||||
#endif
|
||||
|
||||
#define DEFINE_WEAK_CARBONCORE_FUNC(R, N, P, A, ...)
|
||||
|
||||
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
|
||||
|
||||
extern void *__CFLookupCoreServicesInternalFunction(const char *name);
|
||||
|
||||
#define DEFINE_WEAK_CORESERVICESINTERNAL_FUNC(R, N, P, A, ...) \
|
||||
static R __CFCoreServicesInternal_ ## N P { \
|
||||
typedef R (*dyfuncptr)P; \
|
||||
static dyfuncptr dyfunc = (dyfuncptr)(~(uintptr_t)0); \
|
||||
if ((dyfuncptr)(~(uintptr_t)0) == dyfunc) { \
|
||||
dyfunc = (dyfuncptr)__CFLookupCoreServicesInternalFunction(#N); \
|
||||
} \
|
||||
if (dyfunc) { \
|
||||
return dyfunc A ; \
|
||||
} \
|
||||
return __VA_ARGS__ ; \
|
||||
}
|
||||
|
||||
#else
|
||||
#define DEFINE_WEAK_CORESERVICESINTERNAL_FUNC(R, N, P, A, ...)
|
||||
#endif
|
||||
|
||||
CF_PRIVATE CFComparisonResult _CFCompareStringsWithLocale(CFStringInlineBuffer *str1, CFRange str1Range, CFStringInlineBuffer *str2, CFRange str2Range, CFOptionFlags options, const void *compareLocale);
|
||||
|
||||
|
||||
CF_PRIVATE CFArrayRef _CFBundleCopyUserLanguages();
|
||||
|
||||
|
||||
// This should only be used in CF types, not toll-free bridged objects!
|
||||
// It should not be used with CFAllocator arguments!
|
||||
// Use CFGetAllocator() in the general case, and this inline function in a few limited (but often called) situations.
|
||||
CF_INLINE CFAllocatorRef __CFGetAllocator(CFTypeRef cf) { // !!! Use with CF types only, and NOT WITH CFAllocator!
|
||||
#if OBJC_HAVE_TAGGED_POINTERS
|
||||
if (_objc_isTaggedPointer(cf)) {
|
||||
return kCFAllocatorSystemDefault;
|
||||
}
|
||||
#endif
|
||||
if (__builtin_expect(__CFBitfieldGetValue(((const CFRuntimeBase *)cf)->_cfinfo[CF_INFO_BITS], 7, 7), 1)) {
|
||||
return kCFAllocatorSystemDefault;
|
||||
}
|
||||
return *(CFAllocatorRef *)((char *)cf - sizeof(CFAllocatorRef));
|
||||
}
|
||||
|
||||
/* !!! Avoid #importing objc.h; e.g. converting this to a .m file */
|
||||
struct __objcFastEnumerationStateEquivalent {
|
||||
unsigned long state;
|
||||
unsigned long *itemsPtr;
|
||||
unsigned long *mutationsPtr;
|
||||
unsigned long extra[5];
|
||||
};
|
||||
|
||||
#if 0
|
||||
#pragma mark -
|
||||
#pragma mark Windows Compatability
|
||||
#endif
|
||||
|
||||
// Need to use the _O_BINARY flag on Windows to get the correct behavior
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define CF_OPENFLGS (_O_BINARY|_O_NOINHERIT)
|
||||
#else
|
||||
#define CF_OPENFLGS (0)
|
||||
#endif
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
|
||||
// These are replacements for pthread calls on Windows
|
||||
CF_EXPORT int _NS_pthread_main_np();
|
||||
CF_EXPORT int _NS_pthread_setspecific(pthread_key_t key, const void *val);
|
||||
CF_EXPORT void* _NS_pthread_getspecific(pthread_key_t key);
|
||||
CF_EXPORT int _NS_pthread_key_init_np(int key, void (*destructor)(void *));
|
||||
CF_EXPORT void _NS_pthread_setname_np(const char *name);
|
||||
|
||||
// map use of pthread_set/getspecific to internal API
|
||||
#define pthread_setspecific _NS_pthread_setspecific
|
||||
#define pthread_getspecific _NS_pthread_getspecific
|
||||
#define pthread_key_init_np _NS_pthread_key_init_np
|
||||
#define pthread_main_np _NS_pthread_main_np
|
||||
#define pthread_setname_np _NS_pthread_setname_np
|
||||
#endif
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
// replacement for DISPATCH_QUEUE_OVERCOMMIT until we get a bug fix in dispatch on Windows
|
||||
// <rdar://problem/7923891> dispatch on Windows: Need queue_private.h
|
||||
#define DISPATCH_QUEUE_OVERCOMMIT 2
|
||||
#endif
|
||||
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
CF_PRIVATE const wchar_t *_CFDLLPath(void);
|
||||
#endif
|
||||
|
||||
/* Buffer size for file pathname */
|
||||
#if DEPLOYMENT_TARGET_WINDOWS
|
||||
#define CFMaxPathSize ((CFIndex)262)
|
||||
#define CFMaxPathLength ((CFIndex)260)
|
||||
#define PATH_SEP '\\'
|
||||
#define PATH_SEP_STR CFSTR("\\")
|
||||
#define PATH_MAX MAX_PATH
|
||||
#else
|
||||
#define CFMaxPathSize ((CFIndex)1026)
|
||||
#define CFMaxPathLength ((CFIndex)1024)
|
||||
#define PATH_SEP '/'
|
||||
#define PATH_SEP_STR CFSTR("/")
|
||||
#endif
|
||||
|
||||
CF_INLINE const char *CFPathRelativeToAppleFrameworksRoot(const char *path, Boolean *allocated) {
|
||||
if (path) {
|
||||
const char *platformRoot = __CFgetenv("APPLE_FRAMEWORKS_ROOT");
|
||||
if (platformRoot) {
|
||||
char *newPath = NULL;
|
||||
asprintf(&newPath, "%s%s", platformRoot, path);
|
||||
if (allocated && newPath) {
|
||||
*allocated = true;
|
||||
}
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
if (allocated) {
|
||||
*allocated = false;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <dispatch/private.h>
|
||||
|
||||
#if (DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED)
|
||||
|
||||
// Returns a generic dispatch queue for when you want to just throw some work
|
||||
// into the concurrent pile to execute, and don't care about specifics except
|
||||
// to match the QOS of the main thread.
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericMatchingMain(void) {
|
||||
return dispatch_get_global_queue(qos_class_main(), DISPATCH_QUEUE_OVERCOMMIT);
|
||||
}
|
||||
|
||||
// Returns a generic dispatch queue for when you want to just throw some work
|
||||
// into the concurrent pile to execute, and don't care about specifics except
|
||||
// to match the QOS of the current thread.
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericMatchingCurrent(void) {
|
||||
return dispatch_get_global_queue(qos_class_self(), 0); // DISPATCH_QUEUE_OVERCOMMIT left out intentionally at this point
|
||||
}
|
||||
|
||||
// Returns a generic dispatch queue for when you want to just throw some work
|
||||
// into the concurrent pile to execute, and don't care about specifics except
|
||||
// that it should be in background QOS.
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericBackground(void) {
|
||||
// Don't ACTUALLY use BACKGROUND, because of unknowable and unfavorable interactions like (<rdar://problem/16319229>)
|
||||
return dispatch_get_global_queue(QOS_CLASS_UTILITY, DISPATCH_QUEUE_OVERCOMMIT);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericMatchingMain(void) {
|
||||
return dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, DISPATCH_QUEUE_OVERCOMMIT);
|
||||
}
|
||||
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericMatchingCurrent(void) {
|
||||
return dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0); // DISPATCH_QUEUE_OVERCOMMIT left out intentionally at this point
|
||||
}
|
||||
|
||||
CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericBackground(void) {
|
||||
return dispatch_get_global_queue(QOS_CLASS_UTILITY, DISPATCH_QUEUE_OVERCOMMIT);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFINTERNAL__ */
|
||||
|
1
CFInternal.h
Symbolic link
1
CFInternal.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFInternal.h
|
216
CFLocale.h
216
CFLocale.h
@ -1,216 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFLocale.h
|
||||
Copyright (c) 2002-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFLOCALE__)
|
||||
#define __COREFOUNDATION_CFLOCALE__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSLocale) __CFLocale *CFLocaleRef;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFLocaleGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFLocaleGetSystem(void);
|
||||
// Returns the "root", canonical locale. Contains fixed "backstop" settings.
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFLocaleCopyCurrent(void);
|
||||
// Returns the logical "user" locale for the current user.
|
||||
// [This is Copy in the sense that you get a retain you have to release,
|
||||
// but we may return the same cached object over and over.] Settings
|
||||
// you get from this locale do not change under you as CFPreferences
|
||||
// are changed (for safety and correctness). Generally you would not
|
||||
// grab this and hold onto it forever, but use it to do the operations
|
||||
// you need to do at the moment, then throw it away. (The non-changing
|
||||
// ensures that all the results of your operations are consistent.)
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void);
|
||||
// Returns an array of CFStrings that represents all locales for
|
||||
// which locale data is available.
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyISOLanguageCodes(void);
|
||||
// Returns an array of CFStrings that represents all known legal ISO
|
||||
// language codes. Note: many of these will not have any supporting
|
||||
// locale data in Mac OS X.
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyISOCountryCodes(void);
|
||||
// Returns an array of CFStrings that represents all known legal ISO
|
||||
// country codes. Note: many of these will not have any supporting
|
||||
// locale data in Mac OS X.
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyISOCurrencyCodes(void);
|
||||
// Returns an array of CFStrings that represents all known legal ISO
|
||||
// currency codes. Note: some of these currencies may be obsolete, or
|
||||
// represent other financial instruments.
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyCommonISOCurrencyCodes(void) CF_AVAILABLE(10_5, 2_0);
|
||||
// Returns an array of CFStrings that represents ISO currency codes for
|
||||
// currencies in common use.
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFLocaleCopyPreferredLanguages(void) CF_AVAILABLE(10_5, 2_0);
|
||||
// Returns the array of canonicalized CFString locale IDs that the user prefers.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCreateCanonicalLanguageIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier);
|
||||
// Map an arbitrary language identification string (something close at
|
||||
// least) to a canonical language identifier.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier);
|
||||
// Map an arbitrary locale identification string (something close at
|
||||
// least) to the canonical identifier.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(CFAllocatorRef allocator, LangCode lcode, RegionCode rcode);
|
||||
// Map a Mac OS LangCode and RegionCode to the canonical locale identifier.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(CFAllocatorRef allocator, uint32_t lcid) CF_AVAILABLE(10_6, 4_0);
|
||||
// Map a Windows LCID to the canonical locale identifier.
|
||||
|
||||
CF_EXPORT
|
||||
uint32_t CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(CFStringRef localeIdentifier) CF_AVAILABLE(10_6, 4_0);
|
||||
// Map a locale identifier to a Windows LCID.
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFLocaleLanguageDirection) {
|
||||
kCFLocaleLanguageDirectionUnknown = 0,
|
||||
kCFLocaleLanguageDirectionLeftToRight = 1,
|
||||
kCFLocaleLanguageDirectionRightToLeft = 2,
|
||||
kCFLocaleLanguageDirectionTopToBottom = 3,
|
||||
kCFLocaleLanguageDirectionBottomToTop = 4
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleLanguageDirection CFLocaleGetLanguageCharacterDirection(CFStringRef isoLangCode) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleLanguageDirection CFLocaleGetLanguageLineDirection(CFStringRef isoLangCode) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier(CFAllocatorRef allocator, CFStringRef localeID);
|
||||
// Parses a locale ID consisting of language, script, country, variant,
|
||||
// and keyword/value pairs into a dictionary. The keys are the constant
|
||||
// CFStrings corresponding to the locale ID components, and the values
|
||||
// will correspond to constants where available.
|
||||
// Example: "en_US@calendar=japanese" yields a dictionary with three
|
||||
// entries: kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US, and
|
||||
// kCFLocaleCalendarIdentifier=kCFJapaneseCalendar.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCreateLocaleIdentifierFromComponents(CFAllocatorRef allocator, CFDictionaryRef dictionary);
|
||||
// Reverses the actions of CFLocaleCreateDictionaryFromLocaleIdentifier,
|
||||
// creating a single string from the data in the dictionary. The
|
||||
// dictionary {kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US,
|
||||
// kCFLocaleCalendarIdentifier=kCFJapaneseCalendar} becomes
|
||||
// "en_US@calendar=japanese".
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFLocaleCreate(CFAllocatorRef allocator, CFStringRef localeIdentifier);
|
||||
// Returns a CFLocaleRef for the locale named by the "arbitrary" locale identifier.
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFLocaleCreateCopy(CFAllocatorRef allocator, CFLocaleRef locale);
|
||||
// Having gotten a CFLocale from somebody, code should make a copy
|
||||
// if it is going to use it for several operations
|
||||
// or hold onto it. In the future, there may be mutable locales.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleGetIdentifier(CFLocaleRef locale);
|
||||
// Returns the locale's identifier. This may not be the same string
|
||||
// that the locale was created with (CFLocale may canonicalize it).
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFLocaleGetValue(CFLocaleRef locale, CFStringRef key);
|
||||
// Returns the value for the given key. This is how settings and state
|
||||
// are accessed via a CFLocale. Values might be of any CF type.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFLocaleCopyDisplayNameForPropertyValue(CFLocaleRef displayLocale, CFStringRef key, CFStringRef value);
|
||||
// Returns the display name for the given value. The key tells what
|
||||
// the value is, and is one of the usual locale property keys, though
|
||||
// not all locale property keys have values with display name values.
|
||||
|
||||
|
||||
CF_EXPORT const CFStringRef kCFLocaleCurrentLocaleDidChangeNotification CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
|
||||
// Locale Keys
|
||||
CF_EXPORT const CFStringRef kCFLocaleIdentifier;
|
||||
CF_EXPORT const CFStringRef kCFLocaleLanguageCode;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCountryCode;
|
||||
CF_EXPORT const CFStringRef kCFLocaleScriptCode;
|
||||
CF_EXPORT const CFStringRef kCFLocaleVariantCode;
|
||||
|
||||
CF_EXPORT const CFStringRef kCFLocaleExemplarCharacterSet;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCalendarIdentifier;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCalendar;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCollationIdentifier;
|
||||
CF_EXPORT const CFStringRef kCFLocaleUsesMetricSystem;
|
||||
CF_EXPORT const CFStringRef kCFLocaleMeasurementSystem; // "Metric" or "U.S."
|
||||
CF_EXPORT const CFStringRef kCFLocaleDecimalSeparator;
|
||||
CF_EXPORT const CFStringRef kCFLocaleGroupingSeparator;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCurrencySymbol;
|
||||
CF_EXPORT const CFStringRef kCFLocaleCurrencyCode; // ISO 3-letter currency code
|
||||
CF_EXPORT const CFStringRef kCFLocaleCollatorIdentifier CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFLocaleQuotationBeginDelimiterKey CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFLocaleQuotationEndDelimiterKey CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationBeginDelimiterKey CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationEndDelimiterKey CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
// Values for kCFLocaleCalendarIdentifier
|
||||
CF_EXPORT const CFStringRef kCFGregorianCalendar;
|
||||
CF_EXPORT const CFStringRef kCFBuddhistCalendar;
|
||||
CF_EXPORT const CFStringRef kCFChineseCalendar;
|
||||
CF_EXPORT const CFStringRef kCFHebrewCalendar;
|
||||
CF_EXPORT const CFStringRef kCFIslamicCalendar;
|
||||
CF_EXPORT const CFStringRef kCFIslamicCivilCalendar;
|
||||
CF_EXPORT const CFStringRef kCFJapaneseCalendar;
|
||||
CF_EXPORT const CFStringRef kCFRepublicOfChinaCalendar CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFPersianCalendar CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFIndianCalendar CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFISO8601Calendar CF_AVAILABLE(10_6, 4_0);
|
||||
CF_EXPORT const CFStringRef kCFIslamicTabularCalendar CF_AVAILABLE(10_10, 8_0);
|
||||
CF_EXPORT const CFStringRef kCFIslamicUmmAlQuraCalendar CF_AVAILABLE(10_10, 8_0);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFLOCALE__ */
|
||||
|
1
CFLocale.h
Symbolic link
1
CFLocale.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFLocale.h
|
@ -1,145 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
CFLocaleInternal.h
|
||||
Copyright (c) 2008-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
This file is for the use of the CoreFoundation project only.
|
||||
*/
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
|
||||
CF_EXPORT CFStringRef const kCFLocaleAlternateQuotationBeginDelimiterKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleAlternateQuotationEndDelimiterKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleQuotationBeginDelimiterKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleQuotationEndDelimiterKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleCalendarIdentifierKey; // ***
|
||||
CF_EXPORT CFStringRef const kCFLocaleCalendarKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleCollationIdentifierKey; // ***
|
||||
CF_EXPORT CFStringRef const kCFLocaleCollatorIdentifierKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleCountryCodeKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleCurrencyCodeKey; // ***
|
||||
CF_EXPORT CFStringRef const kCFLocaleCurrencySymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleDecimalSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleExemplarCharacterSetKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleGroupingSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleIdentifierKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleLanguageCodeKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleMeasurementSystemKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleScriptCodeKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleUsesMetricSystemKey;
|
||||
CF_EXPORT CFStringRef const kCFLocaleVariantCodeKey;
|
||||
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterAMSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterCalendarKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterCalendarIdentifierKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterDefaultDateKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterDefaultFormatKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterDoesRelativeDateFormattingKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterEraSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterGregorianStartDateKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterIsLenientKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterLongEraSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterPMSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterAmbiguousYearStrategyKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterQuarterSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortQuarterSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortStandaloneMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortStandaloneQuarterSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortStandaloneWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterShortWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterStandaloneMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterStandaloneQuarterSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterStandaloneWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterTimeZoneKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterTwoDigitStartDateKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterVeryShortMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterVeryShortStandaloneMonthSymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterVeryShortStandaloneWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterVeryShortWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterWeekdaySymbolsKey;
|
||||
CF_EXPORT CFStringRef const kCFDateFormatterUsesCharacterDirectionKey;
|
||||
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterAlwaysShowDecimalSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterCurrencyCodeKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterCurrencyDecimalSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterCurrencyGroupingSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterCurrencySymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterDecimalSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterDefaultFormatKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterExponentSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterFormatWidthKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterGroupingSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterGroupingSizeKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterInfinitySymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterInternationalCurrencySymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterIsLenientKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMaxFractionDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMaxIntegerDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMaxSignificantDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMinFractionDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMinIntegerDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMinSignificantDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMinusSignKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterMultiplierKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterNaNSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterNegativePrefixKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterNegativeSuffixKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPaddingCharacterKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPaddingPositionKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPerMillSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPercentSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPlusSignKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPositivePrefixKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterPositiveSuffixKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterRoundingIncrementKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterRoundingModeKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterSecondaryGroupingSizeKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterUseGroupingSeparatorKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterUseSignificantDigitsKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterZeroSymbolKey;
|
||||
CF_EXPORT CFStringRef const kCFNumberFormatterUsesCharacterDirectionKey;
|
||||
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierGregorian;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierBuddhist;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierJapanese;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierIslamic;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierIslamicCivil;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierIslamicTabular;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierIslamicUmmAlQura;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierHebrew;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierChinese;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierRepublicOfChina;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierPersian;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierIndian;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierISO8601;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierCoptic;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierEthiopicAmeteMihret;
|
||||
CF_EXPORT CFStringRef const kCFCalendarIdentifierEthiopicAmeteAlem;
|
||||
|
||||
|
1
CFLocaleInternal.h
Symbolic link
1
CFLocaleInternal.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFLocaleInternal.h
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFLogUtilities.h
|
||||
Copyright (c) 2004-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
APPLE SPI: NOT TO BE USED OUTSIDE APPLE!
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFLOGUTILITIES__)
|
||||
#define __COREFOUNDATION_CFLOGUTILITIES__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
|
||||
enum { // Legal level values for CFLog()
|
||||
kCFLogLevelEmergency = 0,
|
||||
kCFLogLevelAlert = 1,
|
||||
kCFLogLevelCritical = 2,
|
||||
kCFLogLevelError = 3,
|
||||
kCFLogLevelWarning = 4,
|
||||
kCFLogLevelNotice = 5,
|
||||
kCFLogLevelInfo = 6,
|
||||
kCFLogLevelDebug = 7,
|
||||
};
|
||||
|
||||
CF_EXPORT void CFLog(int32_t level, CFStringRef format, ...);
|
||||
/* Passing in a level value which is outside the range of 0-7 will cause the the call to do nothing.
|
||||
CFLog() logs the message using the asl.h API, and uses the level parameter as the log level.
|
||||
Note that the asl subsystem ignores some log levels by default.
|
||||
CFLog() is not fast, and is not going to be guaranteed to be fast.
|
||||
Even "no-op" CFLogs are not necessarily fast.
|
||||
If you care about performance, you shouldn't be logging.
|
||||
*/
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFLOGUTILITIES__ */
|
||||
|
1
CFLogUtilities.h
Symbolic link
1
CFLogUtilities.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFLogUtilities.h
|
68
CFMachPort.h
68
CFMachPort.h
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFMachPort.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFMACHPORT__)
|
||||
#define __COREFOUNDATION_CFMACHPORT__ 1
|
||||
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#include <mach/port.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMachPort) __CFMachPort * CFMachPortRef;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFMachPortContext;
|
||||
|
||||
typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info);
|
||||
typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info);
|
||||
|
||||
CF_EXPORT CFTypeID CFMachPortGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
|
||||
CF_EXPORT CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
|
||||
|
||||
CF_EXPORT mach_port_t CFMachPortGetPort(CFMachPortRef port);
|
||||
CF_EXPORT void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context);
|
||||
CF_EXPORT void CFMachPortInvalidate(CFMachPortRef port);
|
||||
CF_EXPORT Boolean CFMachPortIsValid(CFMachPortRef port);
|
||||
CF_EXPORT CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port);
|
||||
CF_EXPORT void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout);
|
||||
|
||||
CF_EXPORT CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFMACHPORT__ */
|
||||
|
1
CFMachPort.h
Symbolic link
1
CFMachPort.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFMachPort.h
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFMessagePort.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFMESSAGEPORT__)
|
||||
#define __COREFOUNDATION_CFMESSAGEPORT__ 1
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#include <CoreFoundation/CFData.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMessagePort) __CFMessagePort * CFMessagePortRef;
|
||||
|
||||
enum {
|
||||
kCFMessagePortSuccess = 0,
|
||||
kCFMessagePortSendTimeout = -1,
|
||||
kCFMessagePortReceiveTimeout = -2,
|
||||
kCFMessagePortIsInvalid = -3,
|
||||
kCFMessagePortTransportError = -4,
|
||||
kCFMessagePortBecameInvalidError = -5
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFMessagePortContext;
|
||||
|
||||
typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info);
|
||||
/* If callout wants to keep a hold of the data past the return of the callout, it must COPY the data. This includes the case where the data is given to some routine which _might_ keep a hold of it; System will release returned CFData. */
|
||||
typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info);
|
||||
|
||||
CF_EXPORT CFTypeID CFMessagePortGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo);
|
||||
CF_EXPORT CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name);
|
||||
|
||||
CF_EXPORT Boolean CFMessagePortIsRemote(CFMessagePortRef ms);
|
||||
CF_EXPORT CFStringRef CFMessagePortGetName(CFMessagePortRef ms);
|
||||
CF_EXPORT Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName);
|
||||
CF_EXPORT void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context);
|
||||
CF_EXPORT void CFMessagePortInvalidate(CFMessagePortRef ms);
|
||||
CF_EXPORT Boolean CFMessagePortIsValid(CFMessagePortRef ms);
|
||||
CF_EXPORT CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms);
|
||||
CF_EXPORT void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout);
|
||||
|
||||
/* NULL replyMode argument means no return value expected, dont wait for it */
|
||||
CF_EXPORT SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData);
|
||||
|
||||
CF_EXPORT CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order);
|
||||
|
||||
CF_EXPORT void CFMessagePortSetDispatchQueue(CFMessagePortRef ms, dispatch_queue_t queue) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFMESSAGEPORT__ */
|
||||
|
1
CFMessagePort.h
Symbolic link
1
CFMessagePort.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFMessagePort.h
|
@ -1,37 +0,0 @@
|
||||
#if !defined(__COREFOUNDATION_CFNOTIFICATIONCENTER__)
|
||||
#define __COREFOUNDATION_CFNOTIFICATIONCENTER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFNotificationCenter * CFNotificationCenterRef;
|
||||
|
||||
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo);
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFNotificationSuspensionBehavior) {
|
||||
CFNotificationSuspensionBehaviorDrop = 1,
|
||||
CFNotificationSuspensionBehaviorCoalesce = 2,
|
||||
CFNotificationSuspensionBehaviorHold = 3,
|
||||
CFNotificationSuspensionBehaviorDeliverImmediately = 4
|
||||
};
|
||||
|
||||
enum {
|
||||
kCFNotificationDeliverImmediately = (1UL << 0),
|
||||
kCFNotificationPostToAllSessions = (1UL << 1)
|
||||
};
|
||||
|
||||
CF_EXPORT CFTypeID CFNotificationCenterGetTypeID(void);
|
||||
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void);
|
||||
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void);
|
||||
CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
|
||||
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFStringRef name, const void *object);
|
||||
CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
|
||||
CF_EXPORT void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately);
|
||||
CF_EXPORT void CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, CFOptionFlags options);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFNOTIFICATIONCENTER__ */
|
||||
|
1
CFNotificationCenter.h
Symbolic link
1
CFNotificationCenter.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFNotificationCenter.h
|
147
CFNumber.h
147
CFNumber.h
@ -1,147 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFNumber.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFNUMBER__)
|
||||
#define __COREFOUNDATION_CFNUMBER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSNumber) __CFBoolean * CFBooleanRef;
|
||||
|
||||
CF_EXPORT
|
||||
const CFBooleanRef kCFBooleanTrue;
|
||||
CF_EXPORT
|
||||
const CFBooleanRef kCFBooleanFalse;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFBooleanGetTypeID(void);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFBooleanGetValue(CFBooleanRef boolean);
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFNumberType) {
|
||||
/* Fixed-width types */
|
||||
kCFNumberSInt8Type = 1,
|
||||
kCFNumberSInt16Type = 2,
|
||||
kCFNumberSInt32Type = 3,
|
||||
kCFNumberSInt64Type = 4,
|
||||
kCFNumberFloat32Type = 5,
|
||||
kCFNumberFloat64Type = 6, /* 64-bit IEEE 754 */
|
||||
/* Basic C types */
|
||||
kCFNumberCharType = 7,
|
||||
kCFNumberShortType = 8,
|
||||
kCFNumberIntType = 9,
|
||||
kCFNumberLongType = 10,
|
||||
kCFNumberLongLongType = 11,
|
||||
kCFNumberFloatType = 12,
|
||||
kCFNumberDoubleType = 13,
|
||||
/* Other */
|
||||
kCFNumberCFIndexType = 14,
|
||||
kCFNumberNSIntegerType CF_ENUM_AVAILABLE(10_5, 2_0) = 15,
|
||||
kCFNumberCGFloatType CF_ENUM_AVAILABLE(10_5, 2_0) = 16,
|
||||
kCFNumberMaxType = 16
|
||||
};
|
||||
|
||||
typedef const struct CF_BRIDGED_TYPE(NSNumber) __CFNumber * CFNumberRef;
|
||||
|
||||
CF_EXPORT
|
||||
const CFNumberRef kCFNumberPositiveInfinity;
|
||||
CF_EXPORT
|
||||
const CFNumberRef kCFNumberNegativeInfinity;
|
||||
CF_EXPORT
|
||||
const CFNumberRef kCFNumberNaN;
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFNumberGetTypeID(void);
|
||||
|
||||
/*
|
||||
Creates a CFNumber with the given value. The type of number pointed
|
||||
to by the valuePtr is specified by type. If type is a floating point
|
||||
type and the value represents one of the infinities or NaN, the
|
||||
well-defined CFNumber for that value is returned. If either of
|
||||
valuePtr or type is an invalid value, the result is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
|
||||
|
||||
/*
|
||||
Returns the storage format of the CFNumber's value. Note that
|
||||
this is not necessarily the type provided in CFNumberCreate().
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFNumberType CFNumberGetType(CFNumberRef number);
|
||||
|
||||
/*
|
||||
Returns the size in bytes of the type of the number.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFNumberGetByteSize(CFNumberRef number);
|
||||
|
||||
/*
|
||||
Returns true if the type of the CFNumber's value is one of
|
||||
the defined floating point types.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFNumberIsFloatType(CFNumberRef number);
|
||||
|
||||
/*
|
||||
Copies the CFNumber's value into the space pointed to by
|
||||
valuePtr, as the specified type. If conversion needs to take
|
||||
place, the conversion rules follow human expectation and not
|
||||
C's promotion and truncation rules. If the conversion is
|
||||
lossy, or the value is out of range, false is returned. Best
|
||||
attempt at conversion will still be in *valuePtr.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
|
||||
|
||||
/*
|
||||
Compares the two CFNumber instances. If conversion of the
|
||||
types of the values is needed, the conversion and comparison
|
||||
follow human expectations and not C's promotion and comparison
|
||||
rules. Negative zero compares less than positive zero.
|
||||
Positive infinity compares greater than everything except
|
||||
itself, to which it compares equal. Negative infinity compares
|
||||
less than everything except itself, to which it compares equal.
|
||||
Unlike standard practice, if both numbers are NaN, then they
|
||||
compare equal; if only one of the numbers is NaN, then the NaN
|
||||
compares greater than the other number if it is negative, and
|
||||
smaller than the other number if it is positive. (Note that in
|
||||
CFEqual() with two CFNumbers, if either or both of the numbers
|
||||
is NaN, true is returned.)
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFNUMBER__ */
|
||||
|
1
CFNumber.h
Symbolic link
1
CFNumber.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFNumber.h
|
@ -1,186 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFNumberFormatter.h
|
||||
Copyright (c) 2003-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFNUMBERFORMATTER__)
|
||||
#define __COREFOUNDATION_CFNUMBERFORMATTER__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFNumber.h>
|
||||
#include <CoreFoundation/CFLocale.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFNumberFormatter *CFNumberFormatterRef;
|
||||
|
||||
// CFNumberFormatters are not thread-safe. Do not use one from multiple threads!
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFNumberFormatterGetTypeID(void);
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFNumberFormatterStyle) { // number format styles
|
||||
kCFNumberFormatterNoStyle = 0,
|
||||
kCFNumberFormatterDecimalStyle = 1,
|
||||
kCFNumberFormatterCurrencyStyle = 2,
|
||||
kCFNumberFormatterPercentStyle = 3,
|
||||
kCFNumberFormatterScientificStyle = 4,
|
||||
kCFNumberFormatterSpellOutStyle = 5
|
||||
};
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
CFNumberFormatterRef CFNumberFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFNumberFormatterStyle style);
|
||||
// Returns a CFNumberFormatter, localized to the given locale, which
|
||||
// will format numbers to the given style.
|
||||
|
||||
CF_EXPORT
|
||||
CFLocaleRef CFNumberFormatterGetLocale(CFNumberFormatterRef formatter);
|
||||
|
||||
CF_EXPORT
|
||||
CFNumberFormatterStyle CFNumberFormatterGetStyle(CFNumberFormatterRef formatter);
|
||||
// Get the properties with which the number formatter was created.
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFNumberFormatterGetFormat(CFNumberFormatterRef formatter);
|
||||
|
||||
CF_EXPORT
|
||||
void CFNumberFormatterSetFormat(CFNumberFormatterRef formatter, CFStringRef formatString);
|
||||
// Set the format description string of the number formatter. This
|
||||
// overrides the style settings. The format of the format string
|
||||
// is as defined by the ICU library, and is similar to that found
|
||||
// in Microsoft Excel and NSNumberFormatter.
|
||||
// The number formatter starts with a default format string defined
|
||||
// by the style argument with which it was created.
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFNumberFormatterCreateStringWithNumber(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberRef number);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFNumberFormatterCreateStringWithValue(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberType numberType, const void *valuePtr);
|
||||
// Create a string representation of the given number or value
|
||||
// using the current state of the number formatter.
|
||||
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFNumberFormatterOptionFlags) {
|
||||
kCFNumberFormatterParseIntegersOnly = 1 /* only parse integers */
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
CFNumberRef CFNumberFormatterCreateNumberFromString(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFOptionFlags options);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFNumberFormatterGetValueFromString(CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFNumberType numberType, void *valuePtr);
|
||||
// Parse a string representation of a number using the current state
|
||||
// of the number formatter. The range parameter specifies the range
|
||||
// of the string in which the parsing should occur in input, and on
|
||||
// output indicates the extent that was used; this parameter can
|
||||
// be NULL, in which case the whole string may be used. The
|
||||
// return value indicates whether some number was computed and
|
||||
// (if valuePtr is not NULL) stored at the location specified by
|
||||
// valuePtr. The numberType indicates the type of value pointed
|
||||
// to by valuePtr.
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
void CFNumberFormatterSetProperty(CFNumberFormatterRef formatter, CFStringRef key, CFTypeRef value);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeRef CFNumberFormatterCopyProperty(CFNumberFormatterRef formatter, CFStringRef key);
|
||||
// Set and get various properties of the number formatter, the set of
|
||||
// which may be expanded in the future.
|
||||
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyCode; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterDecimalSeparator; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyDecimalSeparator; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterAlwaysShowDecimalSeparator; // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSeparator; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterUseGroupingSeparator; // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPercentSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterZeroSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterNaNSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterInfinitySymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMinusSign; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPlusSign; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterCurrencySymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterExponentSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMinIntegerDigits; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMaxIntegerDigits; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMinFractionDigits; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMaxFractionDigits; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSize; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterSecondaryGroupingSize; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterRoundingMode; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterRoundingIncrement; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterFormatWidth; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPaddingPosition; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPaddingCharacter; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterDefaultFormat; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMultiplier; // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPositivePrefix; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPositiveSuffix; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterNegativePrefix; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterNegativeSuffix; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterPerMillSymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterInternationalCurrencySymbol; // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyGroupingSeparator CF_AVAILABLE(10_5, 2_0); // CFString
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterIsLenient CF_AVAILABLE(10_5, 2_0); // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterUseSignificantDigits CF_AVAILABLE(10_5, 2_0); // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMinSignificantDigits CF_AVAILABLE(10_5, 2_0); // CFNumber
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterMaxSignificantDigits CF_AVAILABLE(10_5, 2_0); // CFNumber
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFNumberFormatterRoundingMode) {
|
||||
kCFNumberFormatterRoundCeiling = 0,
|
||||
kCFNumberFormatterRoundFloor = 1,
|
||||
kCFNumberFormatterRoundDown = 2,
|
||||
kCFNumberFormatterRoundUp = 3,
|
||||
kCFNumberFormatterRoundHalfEven = 4,
|
||||
kCFNumberFormatterRoundHalfDown = 5,
|
||||
kCFNumberFormatterRoundHalfUp = 6
|
||||
};
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFNumberFormatterPadPosition) {
|
||||
kCFNumberFormatterPadBeforePrefix = 0,
|
||||
kCFNumberFormatterPadAfterPrefix = 1,
|
||||
kCFNumberFormatterPadBeforeSuffix = 2,
|
||||
kCFNumberFormatterPadAfterSuffix = 3
|
||||
};
|
||||
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFNumberFormatterGetDecimalInfoForCurrencyCode(CFStringRef currencyCode, int32_t *defaultFractionDigits, double *roundingIncrement);
|
||||
// Returns the number of fraction digits that should be displayed, and
|
||||
// the rounding increment (or 0.0 if no rounding is done by the currency)
|
||||
// for the given currency. Returns false if the currency code is unknown
|
||||
// or the information is not available.
|
||||
// Not localized because these are properties of the currency.
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFNUMBERFORMATTER__ */
|
||||
|
1
CFNumberFormatter.h
Symbolic link
1
CFNumberFormatter.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFNumberFormatter.h
|
142
CFPlugIn.h
142
CFPlugIn.h
@ -1,142 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPlugIn.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPLUGIN__)
|
||||
#define __COREFOUNDATION_CFPLUGIN__ 1
|
||||
|
||||
#if !defined(COREFOUNDATION_CFPLUGINCOM_SEPARATE)
|
||||
#define COREFOUNDATION_CFPLUGINCOM_SEPARATE 1
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFBundle.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
#include <CoreFoundation/CFUUID.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/* ================ Standard Info.plist keys for plugIns ================ */
|
||||
|
||||
CF_EXPORT const CFStringRef kCFPlugInDynamicRegistrationKey;
|
||||
CF_EXPORT const CFStringRef kCFPlugInDynamicRegisterFunctionKey;
|
||||
CF_EXPORT const CFStringRef kCFPlugInUnloadFunctionKey;
|
||||
CF_EXPORT const CFStringRef kCFPlugInFactoriesKey;
|
||||
CF_EXPORT const CFStringRef kCFPlugInTypesKey;
|
||||
|
||||
/* ================= Function prototypes for various callbacks ================= */
|
||||
/* Function types that plugIn authors can implement for various purposes. */
|
||||
|
||||
typedef void (*CFPlugInDynamicRegisterFunction)(CFPlugInRef plugIn);
|
||||
typedef void (*CFPlugInUnloadFunction)(CFPlugInRef plugIn);
|
||||
typedef void *(*CFPlugInFactoryFunction)(CFAllocatorRef allocator, CFUUIDRef typeUUID);
|
||||
|
||||
/* ================= Creating PlugIns ================= */
|
||||
|
||||
CF_EXPORT CFTypeID CFPlugInGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFPlugInRef CFPlugInCreate(CFAllocatorRef allocator, CFURLRef plugInURL);
|
||||
/* Might return an existing instance with the ref-count bumped. */
|
||||
|
||||
CF_EXPORT CFBundleRef CFPlugInGetBundle(CFPlugInRef plugIn);
|
||||
|
||||
/* ================= Controlling load on demand ================= */
|
||||
/* For plugIns. */
|
||||
/* PlugIns that do static registration are load on demand by default. */
|
||||
/* PlugIns that do dynamic registration are not load on demand by default. */
|
||||
/* A dynamic registration function can call CFPlugInSetLoadOnDemand(). */
|
||||
|
||||
CF_EXPORT void CFPlugInSetLoadOnDemand(CFPlugInRef plugIn, Boolean flag);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInIsLoadOnDemand(CFPlugInRef plugIn);
|
||||
|
||||
/* ================= Finding factories and creating instances ================= */
|
||||
/* For plugIn hosts. */
|
||||
/* Functions for finding factories to create specific types and actually creating instances of a type. */
|
||||
|
||||
/* This function finds all the factories from any plugin for the given type. Returns an array that the caller must release. */
|
||||
CF_EXPORT CFArrayRef CFPlugInFindFactoriesForPlugInType(CFUUIDRef typeUUID) CF_RETURNS_RETAINED;
|
||||
|
||||
|
||||
/* This function restricts the result to factories from the given plug-in that can create the given type. Returns an array that the caller must release. */
|
||||
CF_EXPORT CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn(CFUUIDRef typeUUID, CFPlugInRef plugIn) CF_RETURNS_RETAINED;
|
||||
|
||||
/* This function returns the IUnknown interface for the new instance. */
|
||||
CF_EXPORT void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
|
||||
|
||||
/* ================= Registering factories and types ================= */
|
||||
/* For plugIn writers who must dynamically register things. */
|
||||
/* Functions to register factory functions and to associate factories with types. */
|
||||
|
||||
CF_EXPORT Boolean CFPlugInRegisterFactoryFunction(CFUUIDRef factoryUUID, CFPlugInFactoryFunction func);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInRegisterFactoryFunctionByName(CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInUnregisterFactory(CFUUIDRef factoryUUID);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInRegisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInUnregisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
|
||||
|
||||
/* ================= Registering instances ================= */
|
||||
/* When a new instance of a type is created, the instance is responsible for registering itself with the factory that created it and unregistering when it deallocates. */
|
||||
/* This means that an instance must keep track of the CFUUIDRef of the factory that created it so it can unregister when it goes away. */
|
||||
|
||||
CF_EXPORT void CFPlugInAddInstanceForFactory(CFUUIDRef factoryID);
|
||||
|
||||
CF_EXPORT void CFPlugInRemoveInstanceForFactory(CFUUIDRef factoryID);
|
||||
|
||||
|
||||
/* Obsolete API */
|
||||
|
||||
typedef struct __CFPlugInInstance *CFPlugInInstanceRef;
|
||||
|
||||
typedef Boolean (*CFPlugInInstanceGetInterfaceFunction)(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
|
||||
typedef void (*CFPlugInInstanceDeallocateInstanceDataFunction)(void *instanceData);
|
||||
|
||||
CF_EXPORT Boolean CFPlugInInstanceGetInterfaceFunctionTable(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl);
|
||||
|
||||
/* This function returns a retained object on 10.8 or later. */
|
||||
CF_EXPORT CFStringRef CFPlugInInstanceGetFactoryName(CFPlugInInstanceRef instance) CF_RETURNS_RETAINED;
|
||||
|
||||
CF_EXPORT void *CFPlugInInstanceGetInstanceData(CFPlugInInstanceRef instance);
|
||||
|
||||
CF_EXPORT CFTypeID CFPlugInInstanceGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize(CFAllocatorRef allocator, CFIndex instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction getInterfaceFunction);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#if !COREFOUNDATION_CFPLUGINCOM_SEPARATE
|
||||
#include <CoreFoundation/CFPlugInCOM.h>
|
||||
#endif /* !COREFOUNDATION_CFPLUGINCOM_SEPARATE */
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPLUGIN__ */
|
||||
|
1
CFPlugIn.h
Symbolic link
1
CFPlugIn.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFPlugIn.h
|
118
CFPlugInCOM.h
118
CFPlugInCOM.h
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPlugInCOM.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPLUGINCOM__)
|
||||
#define __COREFOUNDATION_CFPLUGINCOM__ 1
|
||||
|
||||
#include <CoreFoundation/CFPlugIn.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/* ================= IUnknown definition (C struct) ================= */
|
||||
|
||||
/* All interface structs must have an IUnknownStruct at the beginning. */
|
||||
/* The _reserved field is part of the Microsoft COM binary standard on Macintosh. */
|
||||
/* You can declare new C struct interfaces by defining a new struct that includes "IUNKNOWN_C_GUTS;" before the first field of the struct. */
|
||||
|
||||
typedef SInt32 HRESULT;
|
||||
typedef UInt32 ULONG;
|
||||
typedef void *LPVOID;
|
||||
typedef CFUUIDBytes REFIID;
|
||||
|
||||
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
|
||||
#define FAILED(Status) ((HRESULT)(Status)<0)
|
||||
|
||||
/* Macros for more detailed HRESULT analysis */
|
||||
#define IS_ERROR(Status) ((unsigned long)(Status) >> 31 == SEVERITY_ERROR)
|
||||
#define HRESULT_CODE(hr) ((hr) & 0xFFFF)
|
||||
#define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1fff)
|
||||
#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)
|
||||
#define SEVERITY_SUCCESS 0
|
||||
#define SEVERITY_ERROR 1
|
||||
|
||||
/* Creating an HRESULT from its component pieces */
|
||||
#define MAKE_HRESULT(sev,fac,code) ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
|
||||
|
||||
/* Pre-defined success HRESULTS */
|
||||
#define S_OK ((HRESULT)0x00000000L)
|
||||
#define S_FALSE ((HRESULT)0x00000001L)
|
||||
|
||||
/* Common error HRESULTS */
|
||||
#define E_UNEXPECTED ((HRESULT)0x8000FFFFL)
|
||||
#define E_NOTIMPL ((HRESULT)0x80000001L)
|
||||
#define E_OUTOFMEMORY ((HRESULT)0x80000002L)
|
||||
#define E_INVALIDARG ((HRESULT)0x80000003L)
|
||||
#define E_NOINTERFACE ((HRESULT)0x80000004L)
|
||||
#define E_POINTER ((HRESULT)0x80000005L)
|
||||
#define E_HANDLE ((HRESULT)0x80000006L)
|
||||
#define E_ABORT ((HRESULT)0x80000007L)
|
||||
#define E_FAIL ((HRESULT)0x80000008L)
|
||||
#define E_ACCESSDENIED ((HRESULT)0x80000009L)
|
||||
|
||||
/* This macro should be used when defining all interface functions (as it is for the IUnknown functions below). */
|
||||
#define STDMETHODCALLTYPE
|
||||
|
||||
/* The __RPC_FAR macro is for COM source compatibility only. This macro is used a lot in COM interface definitions. If your CFPlugIn interfaces need to be COM interfaces as well, you can use this macro to get better source compatibility. It is not used in the IUnknown definition below, because when doing COM, you will be using the Microsoft supplied IUnknown interface anyway. */
|
||||
#define __RPC_FAR
|
||||
|
||||
/* The IUnknown interface */
|
||||
#define IUnknownUUID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)
|
||||
|
||||
#define IUNKNOWN_C_GUTS \
|
||||
void *_reserved; \
|
||||
HRESULT (STDMETHODCALLTYPE *QueryInterface)(void *thisPointer, REFIID iid, LPVOID *ppv); \
|
||||
ULONG (STDMETHODCALLTYPE *AddRef)(void *thisPointer); \
|
||||
ULONG (STDMETHODCALLTYPE *Release)(void *thisPointer)
|
||||
|
||||
typedef struct IUnknownVTbl {
|
||||
IUNKNOWN_C_GUTS;
|
||||
} IUnknownVTbl;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
|
||||
/* C++ specific stuff */
|
||||
#if defined(__cplusplus)
|
||||
/* ================= IUnknown definition (C++ class) ================= */
|
||||
|
||||
/* This is a definition of IUnknown as a pure abstract virtual C++ class. This class will work only with compilers that can produce COM-compatible object layouts for C++ classes. egcs can not do this. MetroWerks can do this (if you subclass from __comobject) */
|
||||
|
||||
class IUnknown
|
||||
#if defined(__MWERKS__) && TARGET_OS_WIN32
|
||||
: __comobject
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0;
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0;
|
||||
virtual ULONG STDMETHODCALLTYPE Release(void) = 0;
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPLUGINCOM__ */
|
||||
|
1
CFPlugInCOM.h
Symbolic link
1
CFPlugInCOM.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFPlugInCOM.h
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPlugIn_Factory.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__)
|
||||
#define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1
|
||||
|
||||
#include "CFBundle_Internal.h"
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFPFactory *_CFPFactoryRef;
|
||||
|
||||
extern _CFPFactoryRef _CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func);
|
||||
extern _CFPFactoryRef _CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName);
|
||||
|
||||
extern _CFPFactoryRef _CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled);
|
||||
|
||||
extern CFUUIDRef _CFPFactoryCopyFactoryID(_CFPFactoryRef factory);
|
||||
extern CFPlugInRef _CFPFactoryCopyPlugIn(_CFPFactoryRef factory);
|
||||
|
||||
extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactoryRef factory, CFUUIDRef typeID);
|
||||
extern void _CFPFactoryDisable(_CFPFactoryRef factory);
|
||||
|
||||
extern void _CFPFactoryFlushFunctionCache(_CFPFactoryRef factory);
|
||||
|
||||
extern void _CFPFactoryAddType(_CFPFactoryRef factory, CFUUIDRef typeID);
|
||||
extern void _CFPFactoryRemoveType(_CFPFactoryRef factory, CFUUIDRef typeID);
|
||||
|
||||
extern Boolean _CFPFactorySupportsType(_CFPFactoryRef factory, CFUUIDRef typeID);
|
||||
extern CFArrayRef _CFPFactoryFindCopyForType(CFUUIDRef typeID);
|
||||
|
||||
/* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */
|
||||
extern void _CFPFactoryAddInstance(_CFPFactoryRef factory);
|
||||
extern void _CFPFactoryRemoveInstance(_CFPFactoryRef factory);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */
|
||||
|
1
CFPlugIn_Factory.h
Symbolic link
1
CFPlugIn_Factory.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFPlugIn_Factory.h
|
146
CFPreferences.h
146
CFPreferences.h
@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPreferences.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPREFERENCES__)
|
||||
#define __COREFOUNDATION_CFPREFERENCES__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesAnyApplication;
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesCurrentApplication;
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesAnyHost;
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesCurrentHost;
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesAnyUser;
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFPreferencesCurrentUser;
|
||||
|
||||
/* NOTE: All CFPropertyListRef values returned from
|
||||
CFPreferences API should be assumed to be immutable.
|
||||
*/
|
||||
|
||||
/* The "App" functions search the various sources of defaults that
|
||||
apply to the given application, and should never be called with
|
||||
kCFPreferencesAnyApplication - only kCFPreferencesCurrentApplication
|
||||
or an application's ID (its bundle identifier).
|
||||
*/
|
||||
|
||||
/* Searches the various sources of application defaults to find the
|
||||
value for the given key. key must not be NULL. If a value is found,
|
||||
it returns it; otherwise returns NULL. Caller must release the
|
||||
returned value */
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key, CFStringRef applicationID);
|
||||
|
||||
/* Convenience to interpret a preferences value as a boolean directly.
|
||||
Returns false if the key doesn't exist, or has an improper format; under
|
||||
those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false */
|
||||
CF_EXPORT
|
||||
Boolean CFPreferencesGetAppBooleanValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
|
||||
|
||||
/* Convenience to interpret a preferences value as an integer directly.
|
||||
Returns 0 if the key doesn't exist, or has an improper format; under
|
||||
those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false */
|
||||
CF_EXPORT
|
||||
CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat);
|
||||
|
||||
/* Sets the given value for the given key in the "normal" place for
|
||||
application preferences. key must not be NULL. If value is NULL,
|
||||
key is removed instead. */
|
||||
CF_EXPORT
|
||||
void CFPreferencesSetAppValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID);
|
||||
|
||||
/* Adds the preferences for the given suite to the app preferences for
|
||||
the specified application. To write to the suite domain, use
|
||||
CFPreferencesSetValue(), below, using the suiteName in place
|
||||
of the appName */
|
||||
CF_EXPORT
|
||||
void CFPreferencesAddSuitePreferencesToApp(CFStringRef applicationID, CFStringRef suiteID);
|
||||
|
||||
CF_EXPORT
|
||||
void CFPreferencesRemoveSuitePreferencesFromApp(CFStringRef applicationID, CFStringRef suiteID);
|
||||
|
||||
/* Writes all changes in all sources of application defaults.
|
||||
Returns success or failure. */
|
||||
CF_EXPORT
|
||||
Boolean CFPreferencesAppSynchronize(CFStringRef applicationID);
|
||||
|
||||
/* The primitive get mechanism; all arguments must be non-NULL
|
||||
(use the constants above for common values). Only the exact
|
||||
location specified by app-user-host is searched. The returned
|
||||
CFType must be released by the caller when it is finished with it. */
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
/* Convenience to fetch multiple keys at once. Keys in
|
||||
keysToFetch that are not present in the returned dictionary
|
||||
are not present in the domain. If keysToFetch is NULL, all
|
||||
keys are fetched. */
|
||||
CF_EXPORT
|
||||
CFDictionaryRef CFPreferencesCopyMultiple(CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
/* The primitive set function; all arguments except value must be
|
||||
non-NULL. If value is NULL, the given key is removed */
|
||||
CF_EXPORT
|
||||
void CFPreferencesSetValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
/* Convenience to set multiple values at once. Behavior is undefined
|
||||
if a key is in both keysToSet and keysToRemove */
|
||||
CF_EXPORT
|
||||
void CFPreferencesSetMultiple(CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
/* Constructs and returns the list of the name of all applications
|
||||
which have preferences in the scope of the given user and host.
|
||||
The returned value must be released by the caller; neither argument
|
||||
may be NULL. */
|
||||
CF_EXPORT
|
||||
CFArrayRef CFPreferencesCopyApplicationList(CFStringRef userName, CFStringRef hostName) CF_DEPRECATED(10_0, 10_9, 2_0, 7_0);
|
||||
|
||||
/* Constructs and returns the list of all keys set in the given
|
||||
location. The returned value must be released by the caller;
|
||||
all arguments must be non-NULL */
|
||||
CF_EXPORT
|
||||
CFArrayRef CFPreferencesCopyKeyList(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPREFERENCES__ */
|
||||
|
1
CFPreferences.h
Symbolic link
1
CFPreferences.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFPreferences.h
|
660
CFPriv.h
660
CFPriv.h
@ -1,660 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPriv.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
APPLE SPI: NOT TO BE USED OUTSIDE APPLE!
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPRIV__)
|
||||
#define __COREFOUNDATION_CFPRIV__ 1
|
||||
|
||||
#include <string.h>
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
#include <CoreFoundation/CFLocale.h>
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFSet.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_LINUX)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#include <CoreFoundation/CFMachPort.h>
|
||||
#include <CoreFoundation/CFMessagePort.h>
|
||||
#endif
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || TARGET_OS_WIN32
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#include <CoreFoundation/CFSocket.h>
|
||||
#include <CoreFoundation/CFBundlePriv.h>
|
||||
#endif
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
CF_EXPORT intptr_t _CFDoOperation(intptr_t code, intptr_t subcode1, intptr_t subcode2);
|
||||
|
||||
CF_EXPORT void _CFRuntimeSetCFMPresent(void *a);
|
||||
|
||||
CF_EXPORT const char *_CFProcessPath(void);
|
||||
CF_EXPORT const char **_CFGetProcessPath(void);
|
||||
CF_EXPORT const char **_CFGetProgname(void);
|
||||
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_LINUX))
|
||||
CF_EXPORT void _CFRunLoopSetCurrent(CFRunLoopRef rl);
|
||||
#endif
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_LINUX)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
CF_EXPORT CFRunLoopRef CFRunLoopGetMain(void);
|
||||
CF_EXPORT SInt32 CFRunLoopRunSpecific(CFRunLoopRef rl, CFStringRef modeName, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
|
||||
|
||||
|
||||
CF_EXPORT void _CFRunLoopStopMode(CFRunLoopRef rl, CFStringRef modeName);
|
||||
|
||||
CF_EXPORT CFIndex CFMachPortGetQueuedMessageCount(CFMachPortRef mp);
|
||||
|
||||
CF_EXPORT CFPropertyListRef _CFURLCopyPropertyListRepresentation(CFURLRef url);
|
||||
#endif
|
||||
CF_EXPORT CFPropertyListRef _CFURLCopyPropertyListRepresentation(CFURLRef url);
|
||||
CF_EXPORT CFURLRef _CFURLCreateFromPropertyListRepresentation(CFAllocatorRef alloc, CFPropertyListRef pListRepresentation);
|
||||
|
||||
CF_EXPORT void CFPreferencesFlushCaches(void);
|
||||
|
||||
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
CF_EXPORT Boolean _CFURLGetWideFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, wchar_t *buffer, CFIndex bufferLength);
|
||||
#endif
|
||||
|
||||
#if !__LP64__
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
struct FSSpec;
|
||||
CF_EXPORT
|
||||
Boolean _CFGetFSSpecFromURL(CFAllocatorRef alloc, CFURLRef url, struct FSSpec *spec);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef _CFCreateURLFromFSSpec(CFAllocatorRef alloc, const struct FSSpec *voidspec, Boolean isDirectory);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFURLComponentDecomposition) {
|
||||
kCFURLComponentDecompositionNonHierarchical,
|
||||
kCFURLComponentDecompositionRFC1808, /* use this for RFC 1738 decompositions as well */
|
||||
kCFURLComponentDecompositionRFC2396
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CFStringRef scheme;
|
||||
CFStringRef schemeSpecific;
|
||||
} CFURLComponentsNonHierarchical;
|
||||
|
||||
typedef struct {
|
||||
CFStringRef scheme;
|
||||
CFStringRef user;
|
||||
CFStringRef password;
|
||||
CFStringRef host;
|
||||
CFIndex port; /* kCFNotFound means ignore/omit */
|
||||
CFArrayRef pathComponents;
|
||||
CFStringRef parameterString;
|
||||
CFStringRef query;
|
||||
CFStringRef fragment;
|
||||
CFURLRef baseURL;
|
||||
} CFURLComponentsRFC1808;
|
||||
|
||||
typedef struct {
|
||||
CFStringRef scheme;
|
||||
|
||||
/* if the registered name form of the net location is used, userinfo is NULL, port is kCFNotFound, and host is the entire registered name. */
|
||||
CFStringRef userinfo;
|
||||
CFStringRef host;
|
||||
CFIndex port;
|
||||
|
||||
CFArrayRef pathComponents;
|
||||
CFStringRef query;
|
||||
CFStringRef fragment;
|
||||
CFURLRef baseURL;
|
||||
} CFURLComponentsRFC2396;
|
||||
|
||||
/* Fills components and returns TRUE if the URL can be decomposed according to decompositionType; FALSE (leaving components unchanged) otherwise. components should be a pointer to the CFURLComponents struct defined above that matches decompositionStyle */
|
||||
CF_EXPORT
|
||||
Boolean _CFURLCopyComponents(CFURLRef url, CFURLComponentDecomposition decompositionType, void *components);
|
||||
|
||||
/* Creates and returns the URL described by components; components should point to the CFURLComponents struct defined above that matches decompositionType. */
|
||||
CF_EXPORT
|
||||
CFURLRef _CFURLCreateFromComponents(CFAllocatorRef alloc, CFURLComponentDecomposition decompositionType, const void *components);
|
||||
#define CFURLCopyComponents _CFURLCopyComponents
|
||||
#define CFURLCreateFromComponents _CFURLCreateFromComponents
|
||||
|
||||
|
||||
|
||||
CF_EXPORT Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *buffer, CFIndex maxBufLen);
|
||||
|
||||
/* If this is publicized, we might need to create a GetBytesPtr type function as well. */
|
||||
CF_EXPORT CFStringRef _CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean externalFormat, CFAllocatorRef contentsDeallocator);
|
||||
|
||||
/* These return NULL on MacOS 8 */
|
||||
// This one leaks the returned string in order to be thread-safe.
|
||||
// CF cannot help you in this matter if you continue to use this SPI.
|
||||
CF_EXPORT
|
||||
CFStringRef CFGetUserName(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFStringRef CFCopyUserName(void);
|
||||
|
||||
CF_EXPORT
|
||||
CFURLRef CFCopyHomeDirectoryURLForUser(CFStringRef uName); /* Pass NULL for the current user's home directory */
|
||||
|
||||
|
||||
/*
|
||||
CFCopySearchPathForDirectoriesInDomains returns the various
|
||||
standard system directories where apps, resources, etc get
|
||||
installed. Because queries can return multiple directories,
|
||||
you get back a CFArray (which you should free when done) of
|
||||
CFURLs. The directories are returned in search path order;
|
||||
that is, the first place to look is returned first. This API
|
||||
may return directories that do not exist yet. If NSUserDomain
|
||||
is included in a query, then the results will contain "~" to
|
||||
refer to the user's directory. Specify expandTilde to expand
|
||||
this to the current user's home. Some calls might return no
|
||||
directories!
|
||||
??? On MacOS 8 this function currently returns an empty array.
|
||||
*/
|
||||
typedef CF_ENUM(CFIndex, CFSearchPathDirectory) {
|
||||
kCFApplicationDirectory = 1, /* supported applications (Applications) */
|
||||
kCFDemoApplicationDirectory, /* unsupported applications, demonstration versions (Demos) */
|
||||
kCFDeveloperApplicationDirectory, /* developer applications (Developer/Applications) */
|
||||
kCFAdminApplicationDirectory, /* system and network administration applications (Administration) */
|
||||
kCFLibraryDirectory, /* various user-visible documentation, support, and configuration files, resources (Library) */
|
||||
kCFDeveloperDirectory, /* developer resources (Developer) */
|
||||
kCFUserDirectory, /* user home directories (Users) */
|
||||
kCFDocumentationDirectory, /* documentation (Documentation) */
|
||||
kCFDocumentDirectory, /* documents (Library/Documents) */
|
||||
|
||||
kCFCoreServiceDirectory = 10, // location of CoreServices directory (System/Library/CoreServices)
|
||||
kCFAutosavedInformationDirectory = 11, // location of autosaved documents (Documents/Autosaved)
|
||||
kCFDesktopDirectory = 12, // location of user's desktop
|
||||
kCFCachesDirectory = 13, // location of discardable cache files (Library/Caches)
|
||||
kCFApplicationSupportDirectory = 14, // location of application support files (plug-ins, etc) (Library/Application Support)
|
||||
kCFDownloadsDirectory = 15, // location of the user's "Downloads" directory
|
||||
kCFInputMethodsDirectory = 16, // input methods (Library/Input Methods)
|
||||
kCFMoviesDirectory = 17, // location of user's Movies directory (~/Movies)
|
||||
kCFMusicDirectory = 18, // location of user's Music directory (~/Music)
|
||||
kCFPicturesDirectory = 19, // location of user's Pictures directory (~/Pictures)
|
||||
kCFPrinterDescriptionDirectory = 20, // location of system's PPDs directory (Library/Printers/PPDs)
|
||||
kCFSharedPublicDirectory = 21, // location of user's Public sharing directory (~/Public)
|
||||
kCFPreferencePanesDirectory = 22, // location of the PreferencePanes directory for use with System Preferences (Library/PreferencePanes)
|
||||
|
||||
kCFAllApplicationsDirectory = 100, /* all directories where applications can occur (ie Applications, Demos, Administration, Developer/Applications) */
|
||||
kCFAllLibrariesDirectory = 101 /* all directories where resources can occur (Library, Developer) */
|
||||
};
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFSearchPathDomainMask) {
|
||||
kCFUserDomainMask = 1, /* user's home directory --- place to install user's personal items (~) */
|
||||
kCFLocalDomainMask = 2, /* local to the current machine --- place to install items available to everyone on this machine (/Local) */
|
||||
kCFNetworkDomainMask = 4, /* publically available location in the local area network --- place to install items available on the network (/Network) */
|
||||
kCFSystemDomainMask = 8, /* provided by Apple, unmodifiable (/System) */
|
||||
kCFAllDomainsMask = 0x0ffff /* all domains: all of the above and more, future items */
|
||||
};
|
||||
|
||||
CF_EXPORT
|
||||
CFArrayRef CFCopySearchPathForDirectoriesInDomains(CFSearchPathDirectory directory, CFSearchPathDomainMask domainMask, Boolean expandTilde);
|
||||
|
||||
|
||||
/* Obsolete keys */
|
||||
CF_EXPORT const CFStringRef kCFFileURLExists;
|
||||
CF_EXPORT const CFStringRef kCFFileURLPOSIXMode;
|
||||
CF_EXPORT const CFStringRef kCFFileURLSize;
|
||||
CF_EXPORT const CFStringRef kCFFileURLDirectoryContents;
|
||||
CF_EXPORT const CFStringRef kCFFileURLLastModificationTime;
|
||||
CF_EXPORT const CFStringRef kCFHTTPURLStatusCode;
|
||||
CF_EXPORT const CFStringRef kCFHTTPURLStatusLine;
|
||||
|
||||
|
||||
/* System Version file access */
|
||||
CF_EXPORT CFStringRef CFCopySystemVersionString(void); // Human-readable string containing both marketing and build version
|
||||
CF_EXPORT CFDictionaryRef _CFCopySystemVersionDictionary(void);
|
||||
CF_EXPORT CFDictionaryRef _CFCopyServerVersionDictionary(void);
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductNameKey;
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductCopyrightKey;
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionKey;
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionExtraKey;
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductUserVisibleVersionKey; // For loginwindow; see 2987512
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionBuildVersionKey;
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionStringKey; // Localized string for the string "Version"
|
||||
CF_EXPORT const CFStringRef _kCFSystemVersionBuildStringKey; // Localized string for the string "Build"
|
||||
|
||||
|
||||
CF_EXPORT void CFMergeSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context);
|
||||
CF_EXPORT void CFQSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context);
|
||||
|
||||
/* _CFExecutableLinkedOnOrAfter(releaseVersionName) will return YES if the current executable seems to be linked on or after the specified release. Example: If you specify CFSystemVersionPuma (10.1), you will get back true for executables linked on Puma or Jaguar(10.2), but false for those linked on Cheetah (10.0) or any of its software updates (10.0.x). You will also get back false for any app whose version info could not be figured out.
|
||||
This function caches its results, so no need to cache at call sites.
|
||||
|
||||
Note that for non-MACH this function always returns true.
|
||||
*/
|
||||
typedef CF_ENUM(CFIndex, CFSystemVersion) {
|
||||
CFSystemVersionCheetah = 0, /* 10.0 */
|
||||
CFSystemVersionPuma = 1, /* 10.1 */
|
||||
CFSystemVersionJaguar = 2, /* 10.2 */
|
||||
CFSystemVersionPanther = 3, /* 10.3 */
|
||||
CFSystemVersionTiger = 4, /* 10.4 */
|
||||
CFSystemVersionLeopard = 5, /* 10.5 */
|
||||
CFSystemVersionSnowLeopard = 6, /* 10.6 */
|
||||
CFSystemVersionLion = 7, /* 10.7 */
|
||||
CFSystemVersionMountainLion = 8, /* 10.8 */
|
||||
CFSystemVersionMax, /* This should bump up when new entries are added */
|
||||
|
||||
};
|
||||
|
||||
CF_EXPORT Boolean _CFExecutableLinkedOnOrAfter(CFSystemVersion version);
|
||||
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFStringCharacterClusterType) {
|
||||
kCFStringGraphemeCluster = 1, /* Unicode Grapheme Cluster */
|
||||
kCFStringComposedCharacterCluster = 2, /* Compose all non-base (including spacing marks) */
|
||||
kCFStringCursorMovementCluster = 3, /* Cluster suitable for cursor movements */
|
||||
kCFStringBackwardDeletionCluster = 4 /* Cluster suitable for backward deletion */
|
||||
};
|
||||
|
||||
CF_EXPORT CFRange CFStringGetRangeOfCharacterClusterAtIndex(CFStringRef string, CFIndex charIndex, CFStringCharacterClusterType type);
|
||||
|
||||
// Compatibility kCFCompare flags. Use the new public kCFCompareDiacriticInsensitive
|
||||
enum {
|
||||
kCFCompareDiacriticsInsensitive = 128 /* Use kCFCompareDiacriticInsensitive */
|
||||
};
|
||||
|
||||
/* kCFCompare flags planned to be publicized (Aki 10/20/2008 Does not work with kCFCompareForceOrdering/CFStringFold). see <rdar://problem/6305147>)
|
||||
*/
|
||||
enum {
|
||||
kCFCompareIgnoreNonAlphanumeric = (1UL << 16), // Ignores characters NOT in kCFCharacterSetAlphaNumeric
|
||||
};
|
||||
|
||||
|
||||
/* CFStringEncoding SPI */
|
||||
/* When set, CF encoding conversion engine keeps ASCII compatibility. (i.e. ASCII backslash <-> Unicode backslash in MacJapanese */
|
||||
CF_EXPORT void _CFStringEncodingSetForceASCIICompatibility(Boolean flag);
|
||||
|
||||
extern void __CFSetCharToUniCharFunc(Boolean (*func)(UInt32 flags, UInt8 ch, UniChar *unicodeChar));
|
||||
extern UniChar __CFCharToUniCharTable[256];
|
||||
|
||||
|
||||
#if defined(CF_INLINE)
|
||||
CF_INLINE const UniChar *CFStringGetCharactersPtrFromInlineBuffer(CFStringInlineBuffer *buf, CFRange desiredRange) {
|
||||
if ((desiredRange.location < 0) || ((desiredRange.location + desiredRange.length) > buf->rangeToBuffer.length)) return NULL;
|
||||
|
||||
if (buf->directUniCharBuffer) {
|
||||
return buf->directUniCharBuffer + buf->rangeToBuffer.location + desiredRange.location;
|
||||
} else {
|
||||
if (desiredRange.length > __kCFStringInlineBufferLength) return NULL;
|
||||
|
||||
if (((desiredRange.location + desiredRange.length) > buf->bufferedRangeEnd) || (desiredRange.location < buf->bufferedRangeStart)) {
|
||||
buf->bufferedRangeStart = desiredRange.location;
|
||||
buf->bufferedRangeEnd = buf->bufferedRangeStart + __kCFStringInlineBufferLength;
|
||||
if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length;
|
||||
CFIndex location = buf->rangeToBuffer.location + buf->bufferedRangeStart;
|
||||
CFIndex length = buf->bufferedRangeEnd - buf->bufferedRangeStart;
|
||||
if (buf->directCStringBuffer) {
|
||||
UniChar *bufPtr = buf->buffer;
|
||||
while (length--) *bufPtr++ = (UniChar)buf->directCStringBuffer[location++];
|
||||
} else {
|
||||
CFStringGetCharacters(buf->theString, CFRangeMake(location, length), buf->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
return buf->buffer + (desiredRange.location - buf->bufferedRangeStart);
|
||||
}
|
||||
}
|
||||
|
||||
CF_INLINE void CFStringGetCharactersFromInlineBuffer(CFStringInlineBuffer *buf, CFRange desiredRange, UniChar *outBuf) {
|
||||
if (buf->directUniCharBuffer) {
|
||||
memmove(outBuf, buf->directUniCharBuffer + buf->rangeToBuffer.location + desiredRange.location, desiredRange.length * sizeof(UniChar));
|
||||
} else {
|
||||
if ((desiredRange.location >= buf->bufferedRangeStart) && (desiredRange.location < buf->bufferedRangeEnd)) {
|
||||
CFIndex bufLen = desiredRange.length;
|
||||
|
||||
if (bufLen > (buf->bufferedRangeEnd - desiredRange.location)) bufLen = (buf->bufferedRangeEnd - desiredRange.location);
|
||||
|
||||
memmove(outBuf, buf->buffer + (desiredRange.location - buf->bufferedRangeStart), bufLen * sizeof(UniChar));
|
||||
outBuf += bufLen; desiredRange.location += bufLen; desiredRange.length -= bufLen;
|
||||
} else {
|
||||
CFIndex desiredRangeMax = (desiredRange.location + desiredRange.length);
|
||||
|
||||
if ((desiredRangeMax > buf->bufferedRangeStart) && (desiredRangeMax < buf->bufferedRangeEnd)) {
|
||||
desiredRange.length = (buf->bufferedRangeStart - desiredRange.location);
|
||||
memmove(outBuf + desiredRange.length, buf->buffer, (desiredRangeMax - buf->bufferedRangeStart) * sizeof(UniChar));
|
||||
}
|
||||
}
|
||||
|
||||
if (desiredRange.length > 0) {
|
||||
CFIndex location = buf->rangeToBuffer.location + desiredRange.location;
|
||||
CFIndex length = desiredRange.length;
|
||||
if (buf->directCStringBuffer) {
|
||||
UniChar *bufPtr = outBuf;
|
||||
while (length--) *bufPtr++ = (UniChar)buf->directCStringBuffer[location++];
|
||||
} else {
|
||||
CFStringGetCharacters(buf->theString, CFRangeMake(location, length), outBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define CFStringGetCharactersPtrFromInlineBuffer(buf, desiredRange) ((buf)->directUniCharBuffer ? (buf)->directUniCharBuffer + (buf)->rangeToBuffer.location + desiredRange.location : NULL)
|
||||
|
||||
#define CFStringGetCharactersFromInlineBuffer(buf, desiredRange, outBuf) \
|
||||
if (buf->directUniCharBuffer) memmove(outBuf, (buf)->directUniCharBuffer + (buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length * sizeof(UniChar)); \
|
||||
else CFStringGetCharacters((buf)->theString, CFRangeMake((buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length), outBuf);
|
||||
|
||||
#endif /* CF_INLINE */
|
||||
|
||||
|
||||
#if defined(CF_INLINE)
|
||||
|
||||
#ifndef __kCFStringAppendBufferLength
|
||||
#define __kCFStringAppendBufferLength 1024
|
||||
#endif
|
||||
typedef struct {
|
||||
UniChar buffer[__kCFStringAppendBufferLength];
|
||||
CFIndex bufferIndex;
|
||||
CFMutableStringRef theString;
|
||||
} CFStringAppendBuffer;
|
||||
|
||||
|
||||
// Initializes CFStringAppendBuffer with new mutable string.
|
||||
CF_INLINE void CFStringInitAppendBuffer(CFAllocatorRef alloc, CFStringAppendBuffer *buf)
|
||||
{
|
||||
buf->bufferIndex = 0;
|
||||
buf->theString = CFStringCreateMutable(alloc, 0);
|
||||
}
|
||||
|
||||
// Appends the characters of a string to the CFStringAppendBuffer.
|
||||
CF_INLINE void CFStringAppendStringToAppendBuffer(CFStringAppendBuffer *buf, CFStringRef appendedString)
|
||||
{
|
||||
CFIndex numChars = CFStringGetLength(appendedString);
|
||||
if ( numChars > __kCFStringAppendBufferLength ) {
|
||||
if ( buf->bufferIndex ) {
|
||||
CFStringAppendCharacters(buf->theString, buf->buffer, buf->bufferIndex);
|
||||
buf->bufferIndex = 0;
|
||||
}
|
||||
CFStringAppend(buf->theString, appendedString);
|
||||
}
|
||||
else {
|
||||
if ( (buf->bufferIndex + numChars) > __kCFStringAppendBufferLength ) {
|
||||
CFStringAppendCharacters(buf->theString, buf->buffer, buf->bufferIndex);
|
||||
buf->bufferIndex = 0;
|
||||
}
|
||||
CFStringGetCharacters(appendedString, CFRangeMake(0, numChars), &buf->buffer[buf->bufferIndex]);
|
||||
buf->bufferIndex += numChars;
|
||||
}
|
||||
}
|
||||
|
||||
// Appends a buffer of Unicode characters to the CFStringAppendBuffer.
|
||||
CF_INLINE void CFStringAppendCharactersToAppendBuffer(CFStringAppendBuffer *buf, const UniChar *chars, CFIndex numChars)
|
||||
{
|
||||
if ( numChars > __kCFStringAppendBufferLength ) {
|
||||
if ( buf->bufferIndex ) {
|
||||
CFStringAppendCharacters(buf->theString, buf->buffer, buf->bufferIndex);
|
||||
buf->bufferIndex = 0;
|
||||
}
|
||||
CFStringAppendCharacters(buf->theString, chars, numChars);
|
||||
}
|
||||
else {
|
||||
if ( (buf->bufferIndex + numChars) > __kCFStringAppendBufferLength ) {
|
||||
CFStringAppendCharacters(buf->theString, buf->buffer, buf->bufferIndex);
|
||||
buf->bufferIndex = 0;
|
||||
}
|
||||
memcpy(&buf->buffer[buf->bufferIndex], chars, numChars * sizeof(UniChar));
|
||||
buf->bufferIndex += numChars;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a mutable string from the CFStringAppendBuffer.
|
||||
CF_INLINE CFMutableStringRef CFStringCreateMutableWithAppendBuffer(CFStringAppendBuffer *buf)
|
||||
{
|
||||
if ( buf->bufferIndex ) {
|
||||
CFStringAppendCharacters(buf->theString, buf->buffer, buf->bufferIndex);
|
||||
buf->bufferIndex = 0;
|
||||
}
|
||||
CFMutableStringRef result = buf->theString;
|
||||
buf->theString = NULL;
|
||||
return ( result );
|
||||
}
|
||||
|
||||
#endif /* CF_INLINE */
|
||||
|
||||
/*
|
||||
CFCharacterSetInlineBuffer related declarations
|
||||
*/
|
||||
/*!
|
||||
@typedef CFCharacterSetInlineBuffer
|
||||
@field cset The character set this inline buffer is initialized with.
|
||||
The object is not retained by the structure.
|
||||
@field flags The field is a bit mask that carries various settings.
|
||||
@field rangeStart The beginning of the character range that contains all members.
|
||||
It is guaranteed that there is no member below this value.
|
||||
@field rangeLimit The end of the character range that contains all members.
|
||||
It is guaranteed that there is no member above and equal to this value.
|
||||
@field bitmap The bitmap data representing the membership of the Basic Multilingual Plane characters.
|
||||
If NULL, all BMP characters inside the range are members of the character set.
|
||||
*/
|
||||
typedef struct {
|
||||
CFCharacterSetRef cset;
|
||||
uint32_t flags;
|
||||
uint32_t rangeStart;
|
||||
uint32_t rangeLimit;
|
||||
const uint8_t *bitmap;
|
||||
} CFCharacterSetInlineBuffer;
|
||||
|
||||
// Bits for flags field
|
||||
enum {
|
||||
kCFCharacterSetIsCompactBitmap = (1UL << 0),
|
||||
kCFCharacterSetNoBitmapAvailable = (1UL << 1),
|
||||
kCFCharacterSetIsInverted = (1UL << 2)
|
||||
};
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetInitInlineBuffer
|
||||
Initializes buffer with cset.
|
||||
@param cset The character set used to initialized the buffer.
|
||||
If this parameter is not a valid CFCharacterSet, the behavior is undefined.
|
||||
@param buffer The reference to the inline buffer to be initialized.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFCharacterSetInitInlineBuffer(CFCharacterSetRef cset, CFCharacterSetInlineBuffer *buffer);
|
||||
|
||||
/*!
|
||||
@function CFCharacterSetInlineBufferIsLongCharacterMember
|
||||
Reports whether or not the UTF-32 character is in the character set.
|
||||
@param buffer The reference to the inline buffer to be searched.
|
||||
@param character The UTF-32 character for which to test against the
|
||||
character set.
|
||||
@result true, if the value is in the character set, otherwise false.
|
||||
*/
|
||||
#if defined(CF_INLINE)
|
||||
CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(const CFCharacterSetInlineBuffer *buffer, UTF32Char character) {
|
||||
bool isInverted = ((0 == (buffer->flags & kCFCharacterSetIsInverted)) ? false : true);
|
||||
|
||||
if ((character >= buffer->rangeStart) && (character < buffer->rangeLimit)) {
|
||||
if ((character > 0xFFFF) || (0 != (buffer->flags & kCFCharacterSetNoBitmapAvailable))) return (CFCharacterSetIsLongCharacterMember(buffer->cset, character) != 0);
|
||||
if (NULL == buffer->bitmap) {
|
||||
if (0 == (buffer->flags & kCFCharacterSetIsCompactBitmap)) isInverted = !isInverted;
|
||||
} else if (0 == (buffer->flags & kCFCharacterSetIsCompactBitmap)) {
|
||||
if (buffer->bitmap[character >> 3] & (1UL << (character & 7))) isInverted = !isInverted;
|
||||
} else {
|
||||
uint8_t value = buffer->bitmap[character >> 8];
|
||||
|
||||
if (value == 0xFF) {
|
||||
isInverted = !isInverted;
|
||||
} else if (value > 0) {
|
||||
const uint8_t *segment = buffer->bitmap + (256 + (32 * (value - 1)));
|
||||
character &= 0xFF;
|
||||
if (segment[character >> 3] & (1UL << (character % 8))) isInverted = !isInverted;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isInverted;
|
||||
}
|
||||
#else /* CF_INLINE */
|
||||
#define CFCharacterSetInlineBufferIsLongCharacterMember(buffer, character) (CFCharacterSetIsLongCharacterMember(buffer->cset, character))
|
||||
#endif /* CF_INLINE */
|
||||
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
CF_EXPORT CFMutableStringRef _CFCreateApplicationRepositoryPath(CFAllocatorRef alloc, int nFolder);
|
||||
#endif
|
||||
|
||||
CF_EXPORT CFTypeRef _CFTryRetain(CFTypeRef cf);
|
||||
CF_EXPORT Boolean _CFIsDeallocating(CFTypeRef cf);
|
||||
|
||||
/*
|
||||
CFLocaleGetLanguageRegionEncodingForLocaleIdentifier gets the appropriate language and region codes,
|
||||
and the default legacy script code and encoding, for the specified locale (or language) string.
|
||||
Returns false if CFLocale has no information about the given locale; otherwise may set
|
||||
*langCode and/or *regCode to -1 if there is no appropriate legacy value for the locale.
|
||||
This is a replacement for the CFBundle SPI CFBundleGetLocalizationInfoForLocalization (which was intended to be temporary and transitional);
|
||||
this function is more up-to-date in its handling of locale strings, and is in CFLocale where this functionality should belong. Compared
|
||||
to CFBundleGetLocalizationInfoForLocalization, this function does not spcially interpret a NULL localeIdentifier to mean use the single most
|
||||
preferred localization in the current context (this function returns NO for a NULL localeIdentifier); and in this function
|
||||
langCode, regCode, and scriptCode are all SInt16* (not SInt32* like the equivalent parameters in CFBundleGetLocalizationInfoForLocalization).
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFLocaleGetLanguageRegionEncodingForLocaleIdentifier(CFStringRef localeIdentifier, LangCode *langCode, RegionCode *regCode, ScriptCode *scriptCode, CFStringEncoding *stringEncoding);
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
CF_EXPORT CFMutableStringRef _CFCreateApplicationRepositoryPath(CFAllocatorRef alloc, int nFolder);
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
#include <CoreFoundation/CFMessagePort.h>
|
||||
|
||||
#define CF_MESSAGE_PORT_CLONE_MESSAGE_ID -1209
|
||||
CF_EXPORT CFMessagePortRef CFMessagePortCreateUber(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo, Boolean isRemote);
|
||||
CF_EXPORT void CFMessagePortSetCloneCallout(CFMessagePortRef ms, CFMessagePortCallBack cloneCallout);
|
||||
#endif
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_LINUX)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#include <CoreFoundation/CFMessagePort.h>
|
||||
|
||||
CF_EXPORT CFMessagePortRef CFMessagePortCreatePerProcessLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo);
|
||||
CF_EXPORT CFMessagePortRef CFMessagePortCreatePerProcessRemote(CFAllocatorRef allocator, CFStringRef name, CFIndex pid);
|
||||
|
||||
|
||||
typedef CFDataRef (*CFMessagePortCallBackEx)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info, void *trailer, uintptr_t);
|
||||
|
||||
CF_EXPORT CFMessagePortRef _CFMessagePortCreateLocalEx(CFAllocatorRef allocator, CFStringRef name, Boolean perPID, uintptr_t unused, CFMessagePortCallBackEx callout2, CFMessagePortContext *context, Boolean *shouldFreeInfo);
|
||||
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_MAC || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_LINUX
|
||||
#include <pthread.h>
|
||||
#else
|
||||
// Avoid including the pthread header
|
||||
#ifndef HAVE_STRUCT_TIMESPEC
|
||||
#define HAVE_STRUCT_TIMESPEC 1
|
||||
struct timespec { long tv_sec; long tv_nsec; };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CF_INLINE CFAbsoluteTime _CFAbsoluteTimeFromFileTimeSpec(struct timespec ts) {
|
||||
return (CFAbsoluteTime)((CFTimeInterval)ts.tv_sec - kCFAbsoluteTimeIntervalSince1970) + (1.0e-9 * (CFTimeInterval)ts.tv_nsec);
|
||||
}
|
||||
|
||||
CF_INLINE struct timespec _CFFileTimeSpecFromAbsoluteTime(CFAbsoluteTime at) {
|
||||
struct timespec ts;
|
||||
double sec = 0.0;
|
||||
double frac = modf(at, &sec);
|
||||
if (frac < 0.0) {
|
||||
frac += 1.0;
|
||||
sec -= 1.0;
|
||||
}
|
||||
#if TARGET_OS_WIN32
|
||||
ts.tv_sec = (long)(sec + kCFAbsoluteTimeIntervalSince1970);
|
||||
#else
|
||||
ts.tv_sec = (time_t)(sec + kCFAbsoluteTimeIntervalSince1970);
|
||||
#endif
|
||||
ts.tv_nsec = (long)(1000000000UL * frac + 0.5);
|
||||
return ts;
|
||||
}
|
||||
|
||||
// The 'filtered' function below is preferred to this older one
|
||||
CF_EXPORT bool _CFPropertyListCreateSingleValue(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFStringRef keyPath, CFPropertyListRef *value, CFErrorRef *error);
|
||||
|
||||
// Returns a subset of the property list, only including the keyPaths in the CFSet. If the top level object is not a dictionary, you will get back an empty dictionary as the result.
|
||||
CF_EXPORT bool _CFPropertyListCreateFiltered(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags option, CFSetRef keyPaths, CFPropertyListRef *value, CFErrorRef *error) CF_AVAILABLE(10_8, 6_0);
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || TARGET_OS_WIN32
|
||||
|
||||
// Returns a subset of a bundle's Info.plist. The keyPaths follow the same rules as above CFPropertyList function. This function takes platform and product keys into account.
|
||||
typedef CF_OPTIONS(CFOptionFlags, _CFBundleFilteredPlistOptions) {
|
||||
_CFBundleFilteredPlistMemoryMapped = 1
|
||||
} CF_ENUM_AVAILABLE(10_8, 6_0);
|
||||
|
||||
CF_EXPORT CFPropertyListRef _CFBundleCreateFilteredInfoPlist(CFBundleRef bundle, CFSetRef keyPaths, _CFBundleFilteredPlistOptions options) CF_AVAILABLE(10_8, 6_0);
|
||||
CF_EXPORT CFPropertyListRef _CFBundleCreateFilteredLocalizedInfoPlist(CFBundleRef bundle, CFSetRef keyPaths, CFStringRef localizationName, _CFBundleFilteredPlistOptions options) CF_AVAILABLE(10_8, 6_0);
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
#include <CoreFoundation/CFNotificationCenter.h>
|
||||
|
||||
CF_EXPORT CFStringRef _CFGetWindowsAppleAppDataDirectory(void);
|
||||
CF_EXPORT CFArrayRef _CFGetWindowsBinaryDirectories(void);
|
||||
CF_EXPORT CFStringRef _CFGetWindowsAppleSystemLibraryDirectory(void);
|
||||
|
||||
// If your Windows application does not use a CFRunLoop on the main thread (perhaps because it is reserved for handling UI events via Windows API), then call this function to make distributed notifications arrive using a different run loop.
|
||||
CF_EXPORT void _CFNotificationCenterSetRunLoop(CFNotificationCenterRef nc, CFRunLoopRef rl);
|
||||
|
||||
CF_EXPORT uint32_t /*DWORD*/ _CFRunLoopGetWindowsMessageQueueMask(CFRunLoopRef rl, CFStringRef modeName);
|
||||
CF_EXPORT void _CFRunLoopSetWindowsMessageQueueMask(CFRunLoopRef rl, uint32_t /*DWORD*/ mask, CFStringRef modeName);
|
||||
|
||||
CF_EXPORT uint32_t /*DWORD*/ _CFRunLoopGetWindowsThreadID(CFRunLoopRef rl);
|
||||
|
||||
typedef void (*CFWindowsMessageQueueHandler)(void);
|
||||
|
||||
// Run Loop parameter must be the current thread's run loop for the next two functions; you cannot use another thread's run loop
|
||||
CF_EXPORT CFWindowsMessageQueueHandler _CFRunLoopGetWindowsMessageQueueHandler(CFRunLoopRef rl, CFStringRef modeName);
|
||||
CF_EXPORT void _CFRunLoopSetWindowsMessageQueueHandler(CFRunLoopRef rl, CFStringRef modeName, CFWindowsMessageQueueHandler func);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
CF_EXPORT CFArrayRef CFDateFormatterCreateDateFormatsFromTemplates(CFAllocatorRef allocator, CFArrayRef tmplates, CFOptionFlags options, CFLocaleRef locale);
|
||||
|
||||
#if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
// Available for internal use on embedded
|
||||
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);
|
||||
#endif
|
||||
|
||||
CF_EXPORT const CFStringRef kCFNumberFormatterUsesCharacterDirection CF_AVAILABLE(10_9, 6_0); // CFBoolean
|
||||
CF_EXPORT const CFStringRef kCFDateFormatterUsesCharacterDirection CF_AVAILABLE(10_9, 6_0); // CFBoolean
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPRIV__ */
|
||||
|
176
CFPropertyList.h
176
CFPropertyList.h
@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFPropertyList.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFPROPERTYLIST__)
|
||||
#define __COREFOUNDATION_CFPROPERTYLIST__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFData.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFError.h>
|
||||
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_EMBEDDED
|
||||
#include <CoreFoundation/CFStream.h>
|
||||
#endif
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFPropertyListMutabilityOptions) {
|
||||
kCFPropertyListImmutable = 0,
|
||||
kCFPropertyListMutableContainers,
|
||||
kCFPropertyListMutableContainersAndLeaves
|
||||
};
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
/*
|
||||
Creates a property list object from its XML description; xmlData should
|
||||
be the raw bytes of that description, possibly the contents of an XML
|
||||
file. Returns NULL if the data cannot be parsed; if the parse fails
|
||||
and errorString is non-NULL, a human-readable description of the failure
|
||||
is returned in errorString. It is the caller's responsibility to release
|
||||
either the returned object or the error string, whichever is applicable.
|
||||
|
||||
This function is deprecated. See CFPropertyListCreateWithData() for a replacement.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString) CF_DEPRECATED(10_0, 10_10, 2_0, 8_0, "Use CFPropertyListCreateWithData instead.");
|
||||
|
||||
/*
|
||||
Returns the XML description of the given object; propertyList must
|
||||
be one of the supported property list types, and (for composite types
|
||||
like CFArray and CFDictionary) must not contain any elements that
|
||||
are not themselves of a property list type. If a non-property list
|
||||
type is encountered, NULL is returned. The returned data is
|
||||
appropriate for writing out to an XML file. Note that a data, not a
|
||||
string, is returned because the bytes contain in them a description
|
||||
of the string encoding used.
|
||||
|
||||
This function is deprecated. See CFPropertyListCreateData() for a replacement.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList) CF_DEPRECATED(10_0, 10_10, 2_0, 8_0, "Use CFPropertyListCreateData instead.");
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
/*
|
||||
Recursively creates a copy of the given property list (so nested arrays
|
||||
and dictionaries are copied as well as the top-most container). The
|
||||
resulting property list has the mutability characteristics determined
|
||||
by mutabilityOption.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption);
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFPropertyListFormat) {
|
||||
kCFPropertyListOpenStepFormat = 1,
|
||||
kCFPropertyListXMLFormat_v1_0 = 100,
|
||||
kCFPropertyListBinaryFormat_v1_0 = 200
|
||||
};
|
||||
|
||||
/* Returns true if the object graph rooted at plist is a valid property list
|
||||
* graph -- that is, no cycles, containing only plist objects, and dictionary
|
||||
* keys are strings. The debugging library version spits out some messages
|
||||
* to be helpful. The plist structure which is to be allowed is given by
|
||||
* the format parameter. */
|
||||
CF_EXPORT
|
||||
Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format);
|
||||
|
||||
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_EMBEDDED
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
/* Writes the bytes of a plist serialization out to the stream. The
|
||||
* stream must be opened and configured -- the function simply writes
|
||||
* a bunch of bytes to the stream. The output plist format can be chosen.
|
||||
* Leaves the stream open, but note that reading a plist expects the
|
||||
* reading stream to end wherever the writing ended, so that the
|
||||
* end of the plist data can be identified. Returns the number of bytes
|
||||
* written, or 0 on error. Error messages are not currently localized, but
|
||||
* may be in the future, so they are not suitable for comparison.
|
||||
*
|
||||
* This function is deprecated. See CFPropertyListWrite() for a replacement. */
|
||||
CF_EXPORT
|
||||
CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString) CF_DEPRECATED(10_2, 10_10, 2_0, 8_0, "Use CFPropertyListWrite instead.");
|
||||
|
||||
|
||||
/* Same as current function CFPropertyListCreateFromXMLData()
|
||||
* but takes a stream instead of data, and works on any plist file format.
|
||||
* CFPropertyListCreateFromXMLData() also works on any plist file format.
|
||||
* The stream must be open and configured -- the function simply reads a bunch
|
||||
* of bytes from it starting at the current location in the stream, to the END
|
||||
* of the stream, which is expected to be the end of the plist, or up to the
|
||||
* number of bytes given by the length parameter if it is not 0. Error messages
|
||||
* are not currently localized, but may be in the future, so they are not
|
||||
* suitable for comparison.
|
||||
*
|
||||
* This function is deprecated. See CFPropertyListCreateWithStream() for a replacement. */
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString) CF_DEPRECATED(10_2, 10_10, 2_0, 8_0, "Use CFPropertyListCreateWithStream instead.");
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
#endif
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
enum {
|
||||
kCFPropertyListReadCorruptError = 3840, // Error parsing a property list
|
||||
kCFPropertyListReadUnknownVersionError = 3841, // The version number in the property list is unknown
|
||||
kCFPropertyListReadStreamError = 3842, // Stream error reading a property list
|
||||
kCFPropertyListWriteStreamError = 3851, // Stream error writing a property list
|
||||
} CF_ENUM_AVAILABLE(10_6, 4_0);
|
||||
|
||||
/* Create a property list with a CFData input. If the format parameter is non-NULL, it will be set to the format of the data after parsing is complete. The options parameter is used to specify CFPropertyListMutabilityOptions. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the parse succeeds, the returned value is a reference to the new property list. It is the responsibility of the caller to release this value.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPropertyListCreateWithData(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_EMBEDDED
|
||||
|
||||
/* Create and return a property list with a CFReadStream input. If the format parameter is non-NULL, it will be set to the format of the data after parsing is complete. The options parameter is used to specify CFPropertyListMutabilityOptions. The streamLength parameter specifies the number of bytes to read from the stream. Set streamLength to 0 to read until the end of the stream is detected. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the parse succeeds, the returned value is a reference to the new property list. It is the responsibility of the caller to release this value.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFPropertyListRef CFPropertyListCreateWithStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
/* Write the bytes of a serialized property list out to a stream. The stream must be opened and configured. The format of the property list can be chosen with the format parameter. The options parameter is currently unused and should be set to 0. The return value is the number of bytes written or 0 in the case of an error. If an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFPropertyListWrite(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
#endif
|
||||
|
||||
/* Create a CFData with the bytes of a serialized property list. The format of the property list can be chosen with the format parameter. The options parameter is currently unused and should be set to 0. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the conversion succeeds, the returned value is a reference to the created data. It is the responsibility of the caller to release this value.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFDataRef CFPropertyListCreateData(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFPROPERTYLIST__ */
|
||||
|
1
CFPropertyList.h
Symbolic link
1
CFPropertyList.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFPropertyList.h
|
206
CFRunLoop.h
206
CFRunLoop.h
@ -1,206 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFRunLoop.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFRUNLOOP__)
|
||||
#define __COREFOUNDATION_CFRUNLOOP__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#include <CoreFoundation/CFDate.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#include <mach/port.h>
|
||||
#endif
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFRunLoop * CFRunLoopRef;
|
||||
|
||||
typedef struct __CFRunLoopSource * CFRunLoopSourceRef;
|
||||
|
||||
typedef struct __CFRunLoopObserver * CFRunLoopObserverRef;
|
||||
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSTimer) __CFRunLoopTimer * CFRunLoopTimerRef;
|
||||
|
||||
/* Reasons for CFRunLoopRunInMode() to Return */
|
||||
enum {
|
||||
kCFRunLoopRunFinished = 1,
|
||||
kCFRunLoopRunStopped = 2,
|
||||
kCFRunLoopRunTimedOut = 3,
|
||||
kCFRunLoopRunHandledSource = 4
|
||||
};
|
||||
|
||||
/* Run Loop Observer Activities */
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFRunLoopActivity) {
|
||||
kCFRunLoopEntry = (1UL << 0),
|
||||
kCFRunLoopBeforeTimers = (1UL << 1),
|
||||
kCFRunLoopBeforeSources = (1UL << 2),
|
||||
kCFRunLoopBeforeWaiting = (1UL << 5),
|
||||
kCFRunLoopAfterWaiting = (1UL << 6),
|
||||
kCFRunLoopExit = (1UL << 7),
|
||||
kCFRunLoopAllActivities = 0x0FFFFFFFU
|
||||
};
|
||||
|
||||
CF_EXPORT const CFStringRef kCFRunLoopDefaultMode;
|
||||
CF_EXPORT const CFStringRef kCFRunLoopCommonModes;
|
||||
|
||||
CF_EXPORT CFTypeID CFRunLoopGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFRunLoopRef CFRunLoopGetCurrent(void);
|
||||
CF_EXPORT CFRunLoopRef CFRunLoopGetMain(void);
|
||||
|
||||
CF_EXPORT CFStringRef CFRunLoopCopyCurrentMode(CFRunLoopRef rl);
|
||||
|
||||
CF_EXPORT CFArrayRef CFRunLoopCopyAllModes(CFRunLoopRef rl);
|
||||
|
||||
CF_EXPORT void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFStringRef mode);
|
||||
|
||||
CF_EXPORT CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef rl, CFStringRef mode);
|
||||
|
||||
CF_EXPORT void CFRunLoopRun(void);
|
||||
CF_EXPORT SInt32 CFRunLoopRunInMode(CFStringRef mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
|
||||
CF_EXPORT Boolean CFRunLoopIsWaiting(CFRunLoopRef rl);
|
||||
CF_EXPORT void CFRunLoopWakeUp(CFRunLoopRef rl);
|
||||
CF_EXPORT void CFRunLoopStop(CFRunLoopRef rl);
|
||||
|
||||
#if __BLOCKS__
|
||||
CF_EXPORT void CFRunLoopPerformBlock(CFRunLoopRef rl, CFTypeRef mode, void (^block)(void)) CF_AVAILABLE(10_6, 4_0);
|
||||
#endif
|
||||
|
||||
CF_EXPORT Boolean CFRunLoopContainsSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
|
||||
|
||||
CF_EXPORT Boolean CFRunLoopContainsObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopAddObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopRemoveObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode);
|
||||
|
||||
CF_EXPORT Boolean CFRunLoopContainsTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopAddTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
|
||||
CF_EXPORT void CFRunLoopRemoveTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode);
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
Boolean (*equal)(const void *info1, const void *info2);
|
||||
CFHashCode (*hash)(const void *info);
|
||||
void (*schedule)(void *info, CFRunLoopRef rl, CFStringRef mode);
|
||||
void (*cancel)(void *info, CFRunLoopRef rl, CFStringRef mode);
|
||||
void (*perform)(void *info);
|
||||
} CFRunLoopSourceContext;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
Boolean (*equal)(const void *info1, const void *info2);
|
||||
CFHashCode (*hash)(const void *info);
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
mach_port_t (*getPort)(void *info);
|
||||
void * (*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info);
|
||||
#else
|
||||
void * (*getPort)(void *info);
|
||||
void (*perform)(void *info);
|
||||
#endif
|
||||
} CFRunLoopSourceContext1;
|
||||
|
||||
CF_EXPORT CFTypeID CFRunLoopSourceGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFRunLoopSourceRef CFRunLoopSourceCreate(CFAllocatorRef allocator, CFIndex order, CFRunLoopSourceContext *context);
|
||||
|
||||
CF_EXPORT CFIndex CFRunLoopSourceGetOrder(CFRunLoopSourceRef source);
|
||||
CF_EXPORT void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source);
|
||||
CF_EXPORT Boolean CFRunLoopSourceIsValid(CFRunLoopSourceRef source);
|
||||
CF_EXPORT void CFRunLoopSourceGetContext(CFRunLoopSourceRef source, CFRunLoopSourceContext *context);
|
||||
CF_EXPORT void CFRunLoopSourceSignal(CFRunLoopSourceRef source);
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFRunLoopObserverContext;
|
||||
|
||||
typedef void (*CFRunLoopObserverCallBack)(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info);
|
||||
|
||||
CF_EXPORT CFTypeID CFRunLoopObserverGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFRunLoopObserverRef CFRunLoopObserverCreate(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, CFRunLoopObserverCallBack callout, CFRunLoopObserverContext *context);
|
||||
#if __BLOCKS__
|
||||
CF_EXPORT CFRunLoopObserverRef CFRunLoopObserverCreateWithHandler(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, void (^block) (CFRunLoopObserverRef observer, CFRunLoopActivity activity)) CF_AVAILABLE(10_7, 5_0);
|
||||
#endif
|
||||
|
||||
CF_EXPORT CFOptionFlags CFRunLoopObserverGetActivities(CFRunLoopObserverRef observer);
|
||||
CF_EXPORT Boolean CFRunLoopObserverDoesRepeat(CFRunLoopObserverRef observer);
|
||||
CF_EXPORT CFIndex CFRunLoopObserverGetOrder(CFRunLoopObserverRef observer);
|
||||
CF_EXPORT void CFRunLoopObserverInvalidate(CFRunLoopObserverRef observer);
|
||||
CF_EXPORT Boolean CFRunLoopObserverIsValid(CFRunLoopObserverRef observer);
|
||||
CF_EXPORT void CFRunLoopObserverGetContext(CFRunLoopObserverRef observer, CFRunLoopObserverContext *context);
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFRunLoopTimerContext;
|
||||
|
||||
typedef void (*CFRunLoopTimerCallBack)(CFRunLoopTimerRef timer, void *info);
|
||||
|
||||
CF_EXPORT CFTypeID CFRunLoopTimerGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFRunLoopTimerRef CFRunLoopTimerCreate(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, CFRunLoopTimerCallBack callout, CFRunLoopTimerContext *context);
|
||||
#if __BLOCKS__
|
||||
CF_EXPORT CFRunLoopTimerRef CFRunLoopTimerCreateWithHandler(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, void (^block) (CFRunLoopTimerRef timer)) CF_AVAILABLE(10_7, 5_0);
|
||||
#endif
|
||||
|
||||
CF_EXPORT CFAbsoluteTime CFRunLoopTimerGetNextFireDate(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT void CFRunLoopTimerSetNextFireDate(CFRunLoopTimerRef timer, CFAbsoluteTime fireDate);
|
||||
CF_EXPORT CFTimeInterval CFRunLoopTimerGetInterval(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT Boolean CFRunLoopTimerDoesRepeat(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT CFIndex CFRunLoopTimerGetOrder(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT void CFRunLoopTimerInvalidate(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT Boolean CFRunLoopTimerIsValid(CFRunLoopTimerRef timer);
|
||||
CF_EXPORT void CFRunLoopTimerGetContext(CFRunLoopTimerRef timer, CFRunLoopTimerContext *context);
|
||||
|
||||
// Setting a tolerance for a timer allows it to fire later than the scheduled fire date, improving the ability of the system to optimize for increased power savings and responsiveness. The timer may fire at any time between its scheduled fire date and the scheduled fire date plus the tolerance. The timer will not fire before the scheduled fire date. For repeating timers, the next fire date is calculated from the original fire date regardless of tolerance applied at individual fire times, to avoid drift. The default value is zero, which means no additional tolerance is applied. The system reserves the right to apply a small amount of tolerance to certain timers regardless of the value of this property.
|
||||
// As the user of the timer, you will have the best idea of what an appropriate tolerance for a timer may be. A general rule of thumb, though, is to set the tolerance to at least 10% of the interval, for a repeating timer. Even a small amount of tolerance will have a significant positive impact on the power usage of your application. The system may put a maximum value of the tolerance.
|
||||
CF_EXPORT CFTimeInterval CFRunLoopTimerGetTolerance(CFRunLoopTimerRef timer) CF_AVAILABLE(10_9, 7_0);
|
||||
CF_EXPORT void CFRunLoopTimerSetTolerance(CFRunLoopTimerRef timer, CFTimeInterval tolerance) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFRUNLOOP__ */
|
||||
|
1
CFRunLoop.h
Symbolic link
1
CFRunLoop.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFRunLoop.h
|
281
CFRuntime.h
281
CFRuntime.h
@ -1,281 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFRuntime.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFRUNTIME__)
|
||||
#define __COREFOUNDATION_CFRUNTIME__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <stddef.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
|
||||
// GC: until we link against ObjC must use indirect functions. Overridden in CFSetupFoundationBridging
|
||||
CF_EXPORT bool kCFUseCollectableAllocator;
|
||||
CF_EXPORT bool (*__CFObjCIsCollectable)(void *);
|
||||
|
||||
CF_INLINE Boolean _CFAllocatorIsSystemDefault(CFAllocatorRef allocator) {
|
||||
if (allocator == kCFAllocatorSystemDefault) return true;
|
||||
if (NULL == allocator || kCFAllocatorDefault == allocator) {
|
||||
return (kCFAllocatorSystemDefault == CFAllocatorGetDefault());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// is GC on?
|
||||
#define CF_USING_COLLECTABLE_MEMORY (kCFUseCollectableAllocator)
|
||||
// is GC on and is this the GC allocator?
|
||||
#define CF_IS_COLLECTABLE_ALLOCATOR(allocator) (kCFUseCollectableAllocator && (NULL == (allocator) || kCFAllocatorSystemDefault == (allocator) || 0))
|
||||
// is this allocated by the collector?
|
||||
#define CF_IS_COLLECTABLE(obj) (__CFObjCIsCollectable ? __CFObjCIsCollectable((void*)obj) : false)
|
||||
|
||||
#else
|
||||
|
||||
#define kCFUseCollectableAllocator 0
|
||||
#define __CFObjCIsCollectable 0
|
||||
|
||||
CF_INLINE Boolean _CFAllocatorIsSystemDefault(CFAllocatorRef allocator) {
|
||||
if (allocator == kCFAllocatorSystemDefault) return true;
|
||||
if (NULL == allocator || kCFAllocatorDefault == allocator) {
|
||||
return (kCFAllocatorSystemDefault == CFAllocatorGetDefault());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#define CF_USING_COLLECTABLE_MEMORY 0
|
||||
#define CF_IS_COLLECTABLE_ALLOCATOR(allocator) 0
|
||||
#define CF_IS_COLLECTABLE(obj) 0
|
||||
#endif
|
||||
|
||||
enum {
|
||||
_kCFRuntimeNotATypeID = 0
|
||||
};
|
||||
|
||||
enum { // Version field constants
|
||||
_kCFRuntimeScannedObject = (1UL << 0),
|
||||
_kCFRuntimeResourcefulObject = (1UL << 2), // tells CFRuntime to make use of the reclaim field
|
||||
_kCFRuntimeCustomRefCount = (1UL << 3), // tells CFRuntime to make use of the refcount field
|
||||
_kCFRuntimeRequiresAlignment = (1UL << 4), // tells CFRuntime to make use of the requiredAlignment field
|
||||
};
|
||||
|
||||
typedef struct __CFRuntimeClass {
|
||||
CFIndex version;
|
||||
const char *className; // must be a pure ASCII string, nul-terminated
|
||||
void (*init)(CFTypeRef cf);
|
||||
CFTypeRef (*copy)(CFAllocatorRef allocator, CFTypeRef cf);
|
||||
void (*finalize)(CFTypeRef cf);
|
||||
Boolean (*equal)(CFTypeRef cf1, CFTypeRef cf2);
|
||||
CFHashCode (*hash)(CFTypeRef cf);
|
||||
CFStringRef (*copyFormattingDesc)(CFTypeRef cf, CFDictionaryRef formatOptions); // return str with retain
|
||||
CFStringRef (*copyDebugDesc)(CFTypeRef cf); // return str with retain
|
||||
|
||||
#define CF_RECLAIM_AVAILABLE 1
|
||||
void (*reclaim)(CFTypeRef cf); // Or in _kCFRuntimeResourcefulObject in the .version to indicate this field should be used
|
||||
|
||||
#define CF_REFCOUNT_AVAILABLE 1
|
||||
uint32_t (*refcount)(intptr_t op, CFTypeRef cf); // Or in _kCFRuntimeCustomRefCount in the .version to indicate this field should be used
|
||||
// this field must be non-NULL when _kCFRuntimeCustomRefCount is in the .version field
|
||||
// - if the callback is passed 1 in 'op' it should increment the 'cf's reference count and return 0
|
||||
// - if the callback is passed 0 in 'op' it should return the 'cf's reference count, up to 32 bits
|
||||
// - if the callback is passed -1 in 'op' it should decrement the 'cf's reference count; if it is now zero, 'cf' should be cleaned up and deallocated (the finalize callback above will NOT be called unless the process is running under GC, and CF does not deallocate the memory for you; if running under GC, finalize should do the object tear-down and free the object memory); then return 0
|
||||
// remember to use saturation arithmetic logic and stop incrementing and decrementing when the ref count hits UINT32_MAX, or you will have a security bug
|
||||
// remember that reference count incrementing/decrementing must be done thread-safely/atomically
|
||||
// objects should be created/initialized with a custom ref-count of 1 by the class creation functions
|
||||
// do not attempt to use any bits within the CFRuntimeBase for your reference count; store that in some additional field in your CF object
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#define CF_REQUIRED_ALIGNMENT_AVAILABLE 1
|
||||
uintptr_t requiredAlignment; // Or in _kCFRuntimeRequiresAlignment in the .version field to indicate this field should be used; the allocator to _CFRuntimeCreateInstance() will be ignored in this case; if this is less than the minimum alignment the system supports, you'll get higher alignment; if this is not an alignment the system supports (e.g., most systems will only support powers of two, or if it is too high), the result (consequences) will be up to CF or the system to decide
|
||||
|
||||
} CFRuntimeClass;
|
||||
|
||||
#define RADAR_5115468_FIXED 1
|
||||
|
||||
/* Note that CF runtime class registration and unregistration is not currently
|
||||
* thread-safe, which should not currently be a problem, as long as unregistration
|
||||
* is done only when valid to do so.
|
||||
*/
|
||||
|
||||
CF_EXPORT CFTypeID _CFRuntimeRegisterClass(const CFRuntimeClass * const cls);
|
||||
/* Registers a new class with the CF runtime. Pass in a
|
||||
* pointer to a CFRuntimeClass structure. The pointer is
|
||||
* remembered by the CF runtime -- the structure is NOT
|
||||
* copied.
|
||||
*
|
||||
* - version field must be zero currently.
|
||||
* - className field points to a null-terminated C string
|
||||
* containing only ASCII (0 - 127) characters; this field
|
||||
* may NOT be NULL.
|
||||
* - init field points to a function which classes can use to
|
||||
* apply some generic initialization to instances as they
|
||||
* are created; this function is called by both
|
||||
* _CFRuntimeCreateInstance and _CFRuntimeInitInstance; if
|
||||
* this field is NULL, no function is called; the instance
|
||||
* has been initialized enough that the polymorphic funcs
|
||||
* CFGetTypeID(), CFRetain(), CFRelease(), CFGetRetainCount(),
|
||||
* and CFGetAllocator() are valid on it when the init
|
||||
* function if any is called.
|
||||
* - copy field should always be NULL. Generic copying of CF
|
||||
* objects has never been defined (and is unlikely).
|
||||
* - finalize field points to a function which destroys an
|
||||
* instance when the retain count has fallen to zero; if
|
||||
* this is NULL, finalization does nothing. Note that if
|
||||
* the class-specific functions which create or initialize
|
||||
* instances more fully decide that a half-initialized
|
||||
* instance must be destroyed, the finalize function for
|
||||
* that class has to be able to deal with half-initialized
|
||||
* instances. The finalize function should NOT destroy the
|
||||
* memory for the instance itself; that is done by the
|
||||
* CF runtime after this finalize callout returns.
|
||||
* - equal field points to an equality-testing function; this
|
||||
* field may be NULL, in which case only pointer/reference
|
||||
* equality is performed on instances of this class.
|
||||
* Pointer equality is tested, and the type IDs are checked
|
||||
* for equality, before this function is called (so, the
|
||||
* two instances are not pointer-equal but are of the same
|
||||
* class before this function is called).
|
||||
* NOTE: the equal function must implement an immutable
|
||||
* equality relation, satisfying the reflexive, symmetric,
|
||||
* and transitive properties, and remains the same across
|
||||
* time and immutable operations (that is, if equal(A,B) at
|
||||
* some point, then later equal(A,B) provided neither
|
||||
* A or B has been mutated).
|
||||
* - hash field points to a hash-code-computing function for
|
||||
* instances of this class; this field may be NULL in which
|
||||
* case the pointer value of an instance is converted into
|
||||
* a hash.
|
||||
* NOTE: the hash function and equal function must satisfy
|
||||
* the relationship "equal(A,B) implies hash(A) == hash(B)";
|
||||
* that is, if two instances are equal, their hash codes must
|
||||
* be equal too. (However, the converse is not true!)
|
||||
* - copyFormattingDesc field points to a function returning a
|
||||
* CFStringRef with a human-readable description of the
|
||||
* instance; if this is NULL, the type does not have special
|
||||
* human-readable string-formats.
|
||||
* - copyDebugDesc field points to a function returning a
|
||||
* CFStringRef with a debugging description of the instance;
|
||||
* if this is NULL, a simple description is generated.
|
||||
*
|
||||
* This function returns _kCFRuntimeNotATypeID on failure, or
|
||||
* on success, returns the CFTypeID for the new class. This
|
||||
* CFTypeID is what the class uses to allocate or initialize
|
||||
* instances of the class. It is also returned from the
|
||||
* conventional *GetTypeID() function, which returns the
|
||||
* class's CFTypeID so that clients can compare the
|
||||
* CFTypeID of instances with that of a class.
|
||||
*
|
||||
* The function to compute a human-readable string is very
|
||||
* optional, and is really only interesting for classes,
|
||||
* like strings or numbers, where it makes sense to format
|
||||
* the instance using just its contents.
|
||||
*/
|
||||
|
||||
CF_EXPORT const CFRuntimeClass * _CFRuntimeGetClassWithTypeID(CFTypeID typeID);
|
||||
/* Returns the pointer to the CFRuntimeClass which was
|
||||
* assigned the specified CFTypeID.
|
||||
*/
|
||||
|
||||
CF_EXPORT void _CFRuntimeUnregisterClassWithTypeID(CFTypeID typeID);
|
||||
/* Unregisters the class with the given type ID. It is
|
||||
* undefined whether type IDs are reused or not (expect
|
||||
* that they will be).
|
||||
*
|
||||
* Whether or not unregistering the class is a good idea or
|
||||
* not is not CF's responsibility. In particular you must
|
||||
* be quite sure all instances are gone, and there are no
|
||||
* valid weak refs to such in other threads.
|
||||
*/
|
||||
|
||||
/* All CF "instances" start with this structure. Never refer to
|
||||
* these fields directly -- they are for CF's use and may be added
|
||||
* to or removed or change format without warning. Binary
|
||||
* compatibility for uses of this struct is not guaranteed from
|
||||
* release to release.
|
||||
*/
|
||||
typedef struct __CFRuntimeBase {
|
||||
uintptr_t _cfisa;
|
||||
uint8_t _cfinfo[4];
|
||||
#if __LP64__
|
||||
uint32_t _rc;
|
||||
#endif
|
||||
} CFRuntimeBase;
|
||||
|
||||
#if __BIG_ENDIAN__
|
||||
#define INIT_CFRUNTIME_BASE(...) {0, {0, 0, 0, 0x80}}
|
||||
#else
|
||||
#define INIT_CFRUNTIME_BASE(...) {0, {0x80, 0, 0, 0}}
|
||||
#endif
|
||||
|
||||
CF_EXPORT CFTypeRef _CFRuntimeCreateInstance(CFAllocatorRef allocator, CFTypeID typeID, CFIndex extraBytes, unsigned char *category);
|
||||
/* Creates a new CF instance of the class specified by the
|
||||
* given CFTypeID, using the given allocator, and returns it.
|
||||
* If the allocator returns NULL, this function returns NULL.
|
||||
* A CFRuntimeBase structure is initialized at the beginning
|
||||
* of the returned instance. extraBytes is the additional
|
||||
* number of bytes to allocate for the instance (BEYOND that
|
||||
* needed for the CFRuntimeBase). If the specified CFTypeID
|
||||
* is unknown to the CF runtime, this function returns NULL.
|
||||
* No part of the new memory other than base header is
|
||||
* initialized (the extra bytes are not zeroed, for example).
|
||||
* All instances created with this function must be destroyed
|
||||
* only through use of the CFRelease() function -- instances
|
||||
* must not be destroyed by using CFAllocatorDeallocate()
|
||||
* directly, even in the initialization or creation functions
|
||||
* of a class. Pass NULL for the category parameter.
|
||||
*/
|
||||
|
||||
CF_EXPORT void _CFRuntimeSetInstanceTypeID(CFTypeRef cf, CFTypeID typeID);
|
||||
/* This function changes the typeID of the given instance.
|
||||
* If the specified CFTypeID is unknown to the CF runtime,
|
||||
* this function does nothing. This function CANNOT be used
|
||||
* to initialize an instance. It is for advanced usages such
|
||||
* as faulting. You cannot change the CFTypeID of an object
|
||||
* of a _kCFRuntimeCustomRefCount class, or to a
|
||||
* _kCFRuntimeCustomRefCount class.
|
||||
*/
|
||||
|
||||
CF_EXPORT void _CFRuntimeInitStaticInstance(void *memory, CFTypeID typeID);
|
||||
/* This function initializes a memory block to be a constant
|
||||
* (unreleaseable) CF object of the given typeID.
|
||||
* If the specified CFTypeID is unknown to the CF runtime,
|
||||
* this function does nothing. The memory block should
|
||||
* be a chunk of in-binary writeable static memory, and at
|
||||
* least as large as sizeof(CFRuntimeBase) on the platform
|
||||
* the code is being compiled for. The init function of the
|
||||
* CFRuntimeClass is invoked on the memory as well, if the
|
||||
* class has one. Static instances cannot be initialized to
|
||||
* _kCFRuntimeCustomRefCount classes.
|
||||
*/
|
||||
#define CF_HAS_INIT_STATIC_INSTANCE 1
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFRUNTIME__ */
|
||||
|
1
CFRuntime.h
Symbolic link
1
CFRuntime.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFRuntime.h
|
509
CFSet.h
509
CFSet.h
@ -1,509 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFSet.h
|
||||
Copyright (c) 1998-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
/*!
|
||||
@header CFSet
|
||||
CFSet implements a container which stores unique values.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFSET__)
|
||||
#define __COREFOUNDATION_CFSET__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFSetRetainCallBack
|
||||
Type of the callback function used by CFSets for retaining values.
|
||||
@param allocator The allocator of the CFSet.
|
||||
@param value The value to retain.
|
||||
@result The value to store in the set, which is usually the value
|
||||
parameter passed to this callback, but may be a different
|
||||
value if a different value should be stored in the set.
|
||||
*/
|
||||
typedef const void * (*CFSetRetainCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
|
||||
/*!
|
||||
@typedef CFSetReleaseCallBack
|
||||
Type of the callback function used by CFSets for releasing a retain on values.
|
||||
@param allocator The allocator of the CFSet.
|
||||
@param value The value to release.
|
||||
*/
|
||||
typedef void (*CFSetReleaseCallBack)(CFAllocatorRef allocator, const void *value);
|
||||
|
||||
/*!
|
||||
@typedef CFSetCopyDescriptionCallBack
|
||||
Type of the callback function used by CFSets for describing values.
|
||||
@param value The value to describe.
|
||||
@result A description of the specified value.
|
||||
*/
|
||||
typedef CFStringRef (*CFSetCopyDescriptionCallBack)(const void *value);
|
||||
|
||||
/*!
|
||||
@typedef CFSetEqualCallBack
|
||||
Type of the callback function used by CFSets for comparing values.
|
||||
@param value1 The first value to compare.
|
||||
@param value2 The second value to compare.
|
||||
@result True if the values are equal, otherwise false.
|
||||
*/
|
||||
typedef Boolean (*CFSetEqualCallBack)(const void *value1, const void *value2);
|
||||
|
||||
/*!
|
||||
@typedef CFSetHashCallBack
|
||||
Type of the callback function used by CFSets for hashing values.
|
||||
@param value The value to hash.
|
||||
@result The hash of the value.
|
||||
*/
|
||||
typedef CFHashCode (*CFSetHashCallBack)(const void *value);
|
||||
|
||||
/*!
|
||||
@typedef CFSetCallBacks
|
||||
Structure containing the callbacks of a CFSet.
|
||||
@field version The version number of the structure type being passed
|
||||
in as a parameter to the CFSet creation functions. This
|
||||
structure is version 0.
|
||||
@field retain The callback used to add a retain for the set on
|
||||
values as they are put into the set. This callback returns
|
||||
the value to store in the set, which is usually the value
|
||||
parameter passed to this callback, but may be a different
|
||||
value if a different value should be stored in the set.
|
||||
The set's allocator is passed as the first argument.
|
||||
@field release The callback used to remove a retain previously added
|
||||
for the set from values as they are removed from the
|
||||
set. The set's allocator is passed as the first
|
||||
argument.
|
||||
@field copyDescription The callback used to create a descriptive
|
||||
string representation of each value in the set. This is
|
||||
used by the CFCopyDescription() function.
|
||||
@field equal The callback used to compare values in the set for
|
||||
equality for some operations.
|
||||
@field hash The callback used to compare values in the set for
|
||||
uniqueness for some operations.
|
||||
*/
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CFSetRetainCallBack retain;
|
||||
CFSetReleaseCallBack release;
|
||||
CFSetCopyDescriptionCallBack copyDescription;
|
||||
CFSetEqualCallBack equal;
|
||||
CFSetHashCallBack hash;
|
||||
} CFSetCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFTypeSetCallBacks
|
||||
Predefined CFSetCallBacks structure containing a set of callbacks
|
||||
appropriate for use when the values in a CFSet are all CFTypes.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFSetCallBacks kCFTypeSetCallBacks;
|
||||
|
||||
/*!
|
||||
@constant kCFCopyStringSetCallBacks
|
||||
Predefined CFSetCallBacks structure containing a set of callbacks
|
||||
appropriate for use when the values in a CFSet should be copies
|
||||
of a CFString.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const CFSetCallBacks kCFCopyStringSetCallBacks;
|
||||
|
||||
/*!
|
||||
@typedef CFSetApplierFunction
|
||||
Type of the callback function used by the apply functions of
|
||||
CFSets.
|
||||
@param value The current value from the set.
|
||||
@param context The user-defined context parameter given to the apply
|
||||
function.
|
||||
*/
|
||||
typedef void (*CFSetApplierFunction)(const void *value, void *context);
|
||||
|
||||
/*!
|
||||
@typedef CFSetRef
|
||||
This is the type of a reference to immutable CFSets.
|
||||
*/
|
||||
typedef const struct CF_BRIDGED_TYPE(NSSet) __CFSet * CFSetRef;
|
||||
|
||||
/*!
|
||||
@typedef CFMutableSetRef
|
||||
This is the type of a reference to mutable CFSets.
|
||||
*/
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableSet) __CFSet * CFMutableSetRef;
|
||||
|
||||
/*!
|
||||
@function CFSetGetTypeID
|
||||
Returns the type identifier of all CFSet instances.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFTypeID CFSetGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFSetCreate
|
||||
Creates a new immutable set with the given values.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the set and its storage for values. 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 values A C array of the pointer-sized values to be in the
|
||||
set. This C array is not changed or freed by this function.
|
||||
If this parameter is not a valid pointer to a C array of at
|
||||
least numValues pointers, the behavior is undefined.
|
||||
@param numValues The number of values to copy from the values C
|
||||
array into the CFSet. This number will be the count of the
|
||||
set. If this parameter is zero, negative, or greater than
|
||||
the number of values actually in the values C array, the
|
||||
behavior is undefined.
|
||||
@param callBacks A C pointer to a CFSetCallBacks structure
|
||||
initialized with the callbacks for the set to use on each
|
||||
value in the set. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a
|
||||
structure on the stack can be passed in, or can be reused
|
||||
for multiple set creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFSet, the behavior is undefined. The retain field may be
|
||||
NULL, in which case the CFSet will do nothing to add a
|
||||
retain to the contained values for the set. The release
|
||||
field may be NULL, in which case the CFSet will do nothing
|
||||
to remove the set's retain (if any) on the values when the
|
||||
set is destroyed. If the copyDescription field is NULL,
|
||||
the set will create a simple description for the value. If
|
||||
the equal field is NULL, the set will use pointer equality
|
||||
to test for equality of values. The hash field may be NULL,
|
||||
in which case the CFSet will determine uniqueness by pointer
|
||||
equality. This callbacks parameter
|
||||
itself may be NULL, which is treated as if a valid structure
|
||||
of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFSetCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
set is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is
|
||||
undefined.
|
||||
@result A reference to the new immutable CFSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFSetRef CFSetCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFSetCallBacks *callBacks);
|
||||
|
||||
/*!
|
||||
@function CFSetCreateCopy
|
||||
Creates a new immutable set with the values from the given set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the set and its storage for values. 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 theSet The set which is to be copied. The values from the
|
||||
set are copied as pointers into the new set (that is,
|
||||
the values themselves are copied, not that which the values
|
||||
point to, if anything). However, the values are also
|
||||
retained by the new set. The count of the new set will
|
||||
be the same as the copied set. The new set uses the same
|
||||
callbacks as the set to be copied. If this parameter is
|
||||
not a valid CFSet, the behavior is undefined.
|
||||
@result A reference to the new immutable CFSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFSetRef CFSetCreateCopy(CFAllocatorRef allocator, CFSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFSetCreateMutable
|
||||
Creates a new empty mutable set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the set and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFSet. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A set's actual capacity is only limited by
|
||||
address space and available memory constraints). If this
|
||||
parameter is negative, the behavior is undefined.
|
||||
@param callBacks A C pointer to a CFSetCallBacks structure
|
||||
initialized with the callbacks for the set to use on each
|
||||
value in the set. A copy of the contents of the
|
||||
callbacks structure is made, so that a pointer to a
|
||||
structure on the stack can be passed in, or can be reused
|
||||
for multiple set creations. If the version field of this
|
||||
callbacks structure is not one of the defined ones for
|
||||
CFSet, the behavior is undefined. The retain field may be
|
||||
NULL, in which case the CFSet will do nothing to add a
|
||||
retain to the contained values for the set. The release
|
||||
field may be NULL, in which case the CFSet will do nothing
|
||||
to remove the set's retain (if any) on the values when the
|
||||
set is destroyed. If the copyDescription field is NULL,
|
||||
the set will create a simple description for the value. If
|
||||
the equal field is NULL, the set will use pointer equality
|
||||
to test for equality of values. The hash field may be NULL,
|
||||
in which case the CFSet will determine uniqueness by pointer
|
||||
equality. This callbacks parameter
|
||||
itself may be NULL, which is treated as if a valid structure
|
||||
of version 0 with all fields NULL had been passed in.
|
||||
Otherwise, if any of the fields are not valid pointers to
|
||||
functions of the correct type, or this parameter is not a
|
||||
valid pointer to a CFSetCallBacks callbacks structure,
|
||||
the behavior is undefined. If any of the values put into the
|
||||
set is not one understood by one of the callback functions
|
||||
the behavior when that callback function is used is
|
||||
undefined.
|
||||
@result A reference to the new mutable CFSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableSetRef CFSetCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFSetCallBacks *callBacks);
|
||||
|
||||
/*!
|
||||
@function CFSetCreateMutableCopy
|
||||
Creates a new immutable set with the values from the given set.
|
||||
@param allocator The CFAllocator which should be used to allocate
|
||||
memory for the set and its storage for values. 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 capacity A hint about the number of values that will be held
|
||||
by the CFSet. Pass 0 for no hint. The implementation may
|
||||
ignore this hint, or may use it to optimize various
|
||||
operations. A set's actual capacity is only limited by
|
||||
address space and available memory constraints).
|
||||
This parameter must be greater than or equal
|
||||
to the count of the set which is to be copied, or the
|
||||
behavior is undefined. If this parameter is negative, the
|
||||
behavior is undefined.
|
||||
@param theSet The set which is to be copied. The values from the
|
||||
set are copied as pointers into the new set (that is,
|
||||
the values themselves are copied, not that which the values
|
||||
point to, if anything). However, the values are also
|
||||
retained by the new set. The count of the new set will
|
||||
be the same as the copied set. The new set uses the same
|
||||
callbacks as the set to be copied. If this parameter is
|
||||
not a valid CFSet, the behavior is undefined.
|
||||
@result A reference to the new mutable CFSet.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFMutableSetRef CFSetCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFSetGetCount
|
||||
Returns the number of values currently in the set.
|
||||
@param theSet The set to be queried. If this parameter is not a valid
|
||||
CFSet, the behavior is undefined.
|
||||
@result The number of values in the set.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFSetGetCount(CFSetRef theSet);
|
||||
|
||||
/*!
|
||||
@function CFSetGetCountOfValue
|
||||
Counts the number of times the given value occurs in the set. Since
|
||||
sets by definition contain only one instance of a value, this function
|
||||
is synonymous to CFSetContainsValue.
|
||||
@param theSet The set to be searched. If this parameter is not a
|
||||
valid CFSet, the behavior is undefined.
|
||||
@param value The value for which to find matches in the set. The
|
||||
equal() callback provided when the set was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the set, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result The number of times the given value occurs in the set.
|
||||
*/
|
||||
CF_EXPORT
|
||||
CFIndex CFSetGetCountOfValue(CFSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetContainsValue
|
||||
Reports whether or not the value is in the set.
|
||||
@param theSet The set to be searched. If this parameter is not a
|
||||
valid CFSet, the behavior is undefined.
|
||||
@param value The value for which to find matches in the set. The
|
||||
equal() callback provided when the set was created is
|
||||
used to compare. If the equal() callback was NULL, pointer
|
||||
equality (in C, ==) is used. If value, or any of the values
|
||||
in the set, are not understood by the equal() callback,
|
||||
the behavior is undefined.
|
||||
@result true, if the value is in the set, otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFSetContainsValue(CFSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetGetValue
|
||||
Retrieves a value in the set which hashes the same as the specified value.
|
||||
@param theSet The set to be queried. If this parameter is not a
|
||||
valid CFSet, the behavior is undefined.
|
||||
@param value The value to retrieve. The equal() callback provided when
|
||||
the set was created is used to compare. If the equal() callback
|
||||
was NULL, pointer equality (in C, ==) is used. If a value, or
|
||||
any of the values in the set, are not understood by the equal()
|
||||
callback, the behavior is undefined.
|
||||
@result The value in the set with the given hash.
|
||||
*/
|
||||
CF_EXPORT
|
||||
const void *CFSetGetValue(CFSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetGetValueIfPresent
|
||||
Retrieves a value in the set which hashes the same as the specified value,
|
||||
if present.
|
||||
@param theSet The set to be queried. If this parameter is not a
|
||||
valid CFSet, the behavior is undefined.
|
||||
@param candidate This value is hashed and compared with values in the
|
||||
set to determine which value to retrieve. The equal() callback provided when
|
||||
the set was created is used to compare. If the equal() callback
|
||||
was NULL, pointer equality (in C, ==) is used. If a value, or
|
||||
any of the values in the set, are not understood by the equal()
|
||||
callback, the behavior is undefined.
|
||||
@param value A pointer to memory which should be filled with the
|
||||
pointer-sized value if a matching value is found. If no
|
||||
match is found, the contents of the storage pointed to by
|
||||
this parameter are undefined. This parameter may be NULL,
|
||||
in which case the value from the dictionary is not returned
|
||||
(but the return value of this function still indicates
|
||||
whether or not the value was present).
|
||||
@result True if the value was present in the set, otherwise false.
|
||||
*/
|
||||
CF_EXPORT
|
||||
Boolean CFSetGetValueIfPresent(CFSetRef theSet, const void *candidate, const void **value);
|
||||
|
||||
/*!
|
||||
@function CFSetGetValues
|
||||
Fills the buffer with values from the set.
|
||||
@param theSet The set to be queried. If this parameter is not a
|
||||
valid CFSet, the behavior is undefined.
|
||||
@param values A C array of pointer-sized values to be filled with
|
||||
values from the set. The values in the C array are ordered
|
||||
in the same order in which they appear in the set. If this
|
||||
parameter is not a valid pointer to a C array of at least
|
||||
CFSetGetCount() pointers, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetGetValues(CFSetRef theSet, const void **values);
|
||||
|
||||
/*!
|
||||
@function CFSetApplyFunction
|
||||
Calls a function once for each value in the set.
|
||||
@param theSet The set to be operated upon. If this parameter is not
|
||||
a valid CFSet, the behavior is undefined.
|
||||
@param applier The callback function to call once for each value in
|
||||
the given set. If this parameter is not a
|
||||
pointer to a function of the correct prototype, the behavior
|
||||
is undefined. If there are values in the set which the
|
||||
applier function does not expect or cannot properly apply
|
||||
to, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the second parameter to the applier function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the applier function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetApplyFunction(CFSetRef theSet, CFSetApplierFunction applier, void *context);
|
||||
|
||||
/*!
|
||||
@function CFSetAddValue
|
||||
Adds the value to the set if it is not already present.
|
||||
@param theSet The set to which the value is to be added. If this
|
||||
parameter is not a valid mutable CFSet, the behavior is
|
||||
undefined.
|
||||
@param value The value to add to the set. The value is retained by
|
||||
the set using the retain callback provided when the set
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The count of the
|
||||
set is increased by one.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetAddValue(CFMutableSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetReplaceValue
|
||||
Replaces the value in the set if it is present.
|
||||
@param theSet The set to which the value is to be replaced. If this
|
||||
parameter is not a valid mutable CFSet, the behavior is
|
||||
undefined.
|
||||
@param value The value to replace in the set. The equal() callback provided when
|
||||
the set was created is used to compare. If the equal() callback
|
||||
was NULL, pointer equality (in C, ==) is used. If a value, or
|
||||
any of the values in the set, are not understood by the equal()
|
||||
callback, the behavior is undefined. The value is retained by
|
||||
the set using the retain callback provided when the set
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The count of the
|
||||
set is increased by one.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetReplaceValue(CFMutableSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetSetValue
|
||||
Replaces the value in the set if it is present, or adds the value to
|
||||
the set if it is absent.
|
||||
@param theSet The set to which the value is to be replaced. If this
|
||||
parameter is not a valid mutable CFSet, the behavior is
|
||||
undefined.
|
||||
@param value The value to set in the CFSet. The equal() callback provided when
|
||||
the set was created is used to compare. If the equal() callback
|
||||
was NULL, pointer equality (in C, ==) is used. If a value, or
|
||||
any of the values in the set, are not understood by the equal()
|
||||
callback, the behavior is undefined. The value is retained by
|
||||
the set using the retain callback provided when the set
|
||||
was created. If the value is not of the sort expected by the
|
||||
retain callback, the behavior is undefined. The count of the
|
||||
set is increased by one.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetSetValue(CFMutableSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetRemoveValue
|
||||
Removes the specified value from the set.
|
||||
@param theSet The set from which the value is to be removed.
|
||||
If this parameter is not a valid mutable CFSet,
|
||||
the behavior is undefined.
|
||||
@param value The value to remove. The equal() callback provided when
|
||||
the set was created is used to compare. If the equal() callback
|
||||
was NULL, pointer equality (in C, ==) is used. If a value, or
|
||||
any of the values in the set, are not understood by the equal()
|
||||
callback, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetRemoveValue(CFMutableSetRef theSet, const void *value);
|
||||
|
||||
/*!
|
||||
@function CFSetRemoveAllValues
|
||||
Removes all the values from the set, making it empty.
|
||||
@param theSet The set from which all of the values are to be
|
||||
removed. If this parameter is not a valid mutable CFSet,
|
||||
the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFSetRemoveAllValues(CFMutableSetRef theSet);
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFSET__ */
|
||||
|
238
CFSocket.h
238
CFSocket.h
@ -1,238 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFSocket.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFSOCKET__)
|
||||
#define __COREFOUNDATION_CFSOCKET__ 1
|
||||
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#include <CoreFoundation/CFData.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __CFSocket * CFSocketRef;
|
||||
|
||||
/* A CFSocket contains a native socket within a structure that can
|
||||
be used to read from the socket in the background and make the data
|
||||
thus read available using a runloop source. The callback used for
|
||||
this may be of three types, as specified by the callBackTypes
|
||||
argument when creating the CFSocket.
|
||||
|
||||
If kCFSocketReadCallBack is used, then data will not be
|
||||
automatically read, but the callback will be called when data
|
||||
is available to be read, or a new child socket is waiting to be
|
||||
accepted.
|
||||
|
||||
If kCFSocketAcceptCallBack is used, then new child sockets will be
|
||||
accepted and passed to the callback, with the data argument being
|
||||
a pointer to a CFSocketNativeHandle. This is usable only with
|
||||
connection rendezvous sockets.
|
||||
|
||||
If kCFSocketDataCallBack is used, then data will be read in chunks
|
||||
in the background and passed to the callback, with the data argument
|
||||
being a CFDataRef.
|
||||
|
||||
These three types are mutually exclusive, but any one of them may
|
||||
have kCFSocketConnectCallBack added to it, if the socket will be
|
||||
used to connect in the background. Connect in the background occurs
|
||||
if CFSocketConnectToAddress is called with a negative timeout
|
||||
value, in which case the call returns immediately, and a
|
||||
kCFSocketConnectCallBack is generated when the connect finishes.
|
||||
In this case the data argument is either NULL, or a pointer to
|
||||
an SInt32 error code if the connect failed. kCFSocketConnectCallBack
|
||||
will never be sent more than once for a given socket.
|
||||
|
||||
The callback types may also have kCFSocketWriteCallBack added to
|
||||
them, if large amounts of data are to be sent rapidly over the
|
||||
socket and notification is desired when there is space in the
|
||||
kernel buffers so that the socket is writable again.
|
||||
|
||||
With a connection-oriented socket, if the connection is broken from the
|
||||
other end, then one final kCFSocketReadCallBack or kCFSocketDataCallBack
|
||||
will occur. In the case of kCFSocketReadCallBack, the underlying socket
|
||||
will have 0 bytes available to read. In the case of kCFSocketDataCallBack,
|
||||
the data argument will be a CFDataRef of length 0.
|
||||
|
||||
There are socket flags that may be set to control whether callbacks of
|
||||
a given type are automatically reenabled after they are triggered, and
|
||||
whether the underlying native socket will be closed when the CFSocket
|
||||
is invalidated. By default read, accept, and data callbacks are
|
||||
automatically reenabled; write callbacks are not, and connect callbacks
|
||||
may not be, since they are sent once only. Be careful about automatically
|
||||
reenabling read and write callbacks, since this implies that the
|
||||
callbacks will be sent repeatedly if the socket remains readable or
|
||||
writable respectively. Be sure to set these flags only for callbacks
|
||||
that your CFSocket actually possesses; the result of setting them for
|
||||
other callback types is undefined.
|
||||
|
||||
Individual callbacks may also be enabled and disabled manually, whether
|
||||
they are automatically reenabled or not. If they are not automatically
|
||||
reenabled, then they will need to be manually reenabled when the callback
|
||||
is ready to be received again (and not sooner). Even if they are
|
||||
automatically reenabled, there may be occasions when it will be useful
|
||||
to be able to manually disable them temporarily and then reenable them.
|
||||
Be sure to enable and disable only callbacks that your CFSocket actually
|
||||
possesses; the result of enabling and disabling other callback types is
|
||||
undefined.
|
||||
|
||||
By default the underlying native socket will be closed when the CFSocket
|
||||
is invalidated, but it will not be if kCFSocketCloseOnInvalidate is
|
||||
turned off. This can be useful in order to destroy a CFSocket but
|
||||
continue to use the underlying native socket. The CFSocket must
|
||||
still be invalidated when it will no longer be used. Do not in
|
||||
either case close the underlying native socket without invalidating
|
||||
the CFSocket.
|
||||
|
||||
Addresses are stored as CFDatas containing a struct sockaddr
|
||||
appropriate for the protocol family; make sure that all fields are
|
||||
filled in properly when passing in an address.
|
||||
|
||||
*/
|
||||
|
||||
/* Values for CFSocketError */
|
||||
typedef CF_ENUM(CFIndex, CFSocketError) {
|
||||
kCFSocketSuccess = 0,
|
||||
kCFSocketError = -1L,
|
||||
kCFSocketTimeout = -2L
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
SInt32 protocolFamily;
|
||||
SInt32 socketType;
|
||||
SInt32 protocol;
|
||||
CFDataRef address;
|
||||
} CFSocketSignature;
|
||||
|
||||
/* Values for CFSocketCallBackType */
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFSocketCallBackType) {
|
||||
kCFSocketNoCallBack = 0,
|
||||
kCFSocketReadCallBack = 1,
|
||||
kCFSocketAcceptCallBack = 2,
|
||||
kCFSocketDataCallBack = 3,
|
||||
kCFSocketConnectCallBack = 4,
|
||||
kCFSocketWriteCallBack = 8
|
||||
};
|
||||
|
||||
/* Socket flags */
|
||||
enum {
|
||||
kCFSocketAutomaticallyReenableReadCallBack = 1,
|
||||
kCFSocketAutomaticallyReenableAcceptCallBack = 2,
|
||||
kCFSocketAutomaticallyReenableDataCallBack = 3,
|
||||
kCFSocketAutomaticallyReenableWriteCallBack = 8,
|
||||
kCFSocketLeaveErrors CF_ENUM_AVAILABLE(10_5, 2_0) = 64,
|
||||
kCFSocketCloseOnInvalidate = 128
|
||||
};
|
||||
|
||||
typedef void (*CFSocketCallBack)(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info);
|
||||
/* If the callback wishes to keep hold of address or data after the point that it returns, then it must copy them. */
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void * info;
|
||||
const void *(*retain)(const void *info);
|
||||
void (*release)(const void *info);
|
||||
CFStringRef (*copyDescription)(const void *info);
|
||||
} CFSocketContext;
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
typedef uintptr_t CFSocketNativeHandle;
|
||||
#else
|
||||
typedef int CFSocketNativeHandle;
|
||||
#endif
|
||||
|
||||
CF_EXPORT CFTypeID CFSocketGetTypeID(void);
|
||||
|
||||
CF_EXPORT CFSocketRef CFSocketCreate(CFAllocatorRef allocator, SInt32 protocolFamily, SInt32 socketType, SInt32 protocol, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
|
||||
CF_EXPORT CFSocketRef CFSocketCreateWithNative(CFAllocatorRef allocator, CFSocketNativeHandle sock, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
|
||||
CF_EXPORT CFSocketRef CFSocketCreateWithSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context);
|
||||
/* CFSocketCreateWithSocketSignature() creates a socket of the requested type and binds its address (using CFSocketSetAddress()) to the requested address. If this fails, it returns NULL. */
|
||||
CF_EXPORT CFSocketRef CFSocketCreateConnectedToSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context, CFTimeInterval timeout);
|
||||
/* CFSocketCreateConnectedToSocketSignature() creates a socket suitable for connecting to the requested type and address, and connects it (using CFSocketConnectToAddress()). If this fails, it returns NULL. */
|
||||
|
||||
CF_EXPORT CFSocketError CFSocketSetAddress(CFSocketRef s, CFDataRef address);
|
||||
CF_EXPORT CFSocketError CFSocketConnectToAddress(CFSocketRef s, CFDataRef address, CFTimeInterval timeout);
|
||||
CF_EXPORT void CFSocketInvalidate(CFSocketRef s);
|
||||
|
||||
CF_EXPORT Boolean CFSocketIsValid(CFSocketRef s);
|
||||
CF_EXPORT CFDataRef CFSocketCopyAddress(CFSocketRef s);
|
||||
CF_EXPORT CFDataRef CFSocketCopyPeerAddress(CFSocketRef s);
|
||||
CF_EXPORT void CFSocketGetContext(CFSocketRef s, CFSocketContext *context);
|
||||
CF_EXPORT CFSocketNativeHandle CFSocketGetNative(CFSocketRef s);
|
||||
|
||||
CF_EXPORT CFRunLoopSourceRef CFSocketCreateRunLoopSource(CFAllocatorRef allocator, CFSocketRef s, CFIndex order);
|
||||
|
||||
CF_EXPORT CFOptionFlags CFSocketGetSocketFlags(CFSocketRef s);
|
||||
CF_EXPORT void CFSocketSetSocketFlags(CFSocketRef s, CFOptionFlags flags);
|
||||
CF_EXPORT void CFSocketDisableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
|
||||
CF_EXPORT void CFSocketEnableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes);
|
||||
|
||||
|
||||
/* For convenience, a function is provided to send data using the socket with a timeout. The timeout will be used only if the specified value is positive. The address should be left NULL if the socket is already connected. */
|
||||
CF_EXPORT CFSocketError CFSocketSendData(CFSocketRef s, CFDataRef address, CFDataRef data, CFTimeInterval timeout);
|
||||
|
||||
/* Generic name registry functionality (CFSocketRegisterValue,
|
||||
CFSocketCopyRegisteredValue) allows the registration of any property
|
||||
list type. Functions specific to CFSockets (CFSocketRegisterSocketData,
|
||||
CFSocketCopyRegisteredSocketData) register a CFData containing the
|
||||
components of a socket signature (protocol family, socket type,
|
||||
protocol, and address). In each function the nameServerSignature
|
||||
may be NULL, or any component of it may be 0, to use default values
|
||||
(TCP, INADDR_LOOPBACK, port as set). Name registration servers might
|
||||
not allow registration with other than TCP and INADDR_LOOPBACK.
|
||||
The actual address of the server responding to a query may be obtained
|
||||
by using the nameServerAddress argument. This address, the address
|
||||
returned by CFSocketCopyRegisteredSocketSignature, and the value
|
||||
returned by CFSocketCopyRegisteredValue must (if non-null) be released
|
||||
by the caller. CFSocketUnregister removes any registration associated
|
||||
with the specified name.
|
||||
*/
|
||||
|
||||
CF_EXPORT CFSocketError CFSocketRegisterValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef value);
|
||||
CF_EXPORT CFSocketError CFSocketCopyRegisteredValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef *value, CFDataRef *nameServerAddress);
|
||||
|
||||
CF_EXPORT CFSocketError CFSocketRegisterSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, const CFSocketSignature *signature);
|
||||
CF_EXPORT CFSocketError CFSocketCopyRegisteredSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFSocketSignature *signature, CFDataRef *nameServerAddress);
|
||||
|
||||
CF_EXPORT CFSocketError CFSocketUnregister(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name);
|
||||
|
||||
CF_EXPORT void CFSocketSetDefaultNameRegistryPortNumber(UInt16 port);
|
||||
CF_EXPORT UInt16 CFSocketGetDefaultNameRegistryPortNumber(void);
|
||||
|
||||
/* Constants used in name registry server communications */
|
||||
CF_EXPORT const CFStringRef kCFSocketCommandKey;
|
||||
CF_EXPORT const CFStringRef kCFSocketNameKey;
|
||||
CF_EXPORT const CFStringRef kCFSocketValueKey;
|
||||
CF_EXPORT const CFStringRef kCFSocketResultKey;
|
||||
CF_EXPORT const CFStringRef kCFSocketErrorKey;
|
||||
CF_EXPORT const CFStringRef kCFSocketRegisterCommand;
|
||||
CF_EXPORT const CFStringRef kCFSocketRetrieveCommand;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFSOCKET__ */
|
||||
|
1
CFSocket.h
Symbolic link
1
CFSocket.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFSocket.h
|
314
CFStorage.h
314
CFStorage.h
@ -1,314 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFStorage.h
|
||||
Copyright (c) 1999-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
/*!
|
||||
@header CFStorage
|
||||
CFStorage stores an array of arbitrary-sized values. There are no callbacks;
|
||||
all that is provided about the values is the size, and the appropriate number
|
||||
of bytes are copied in and out of the CFStorage.
|
||||
|
||||
CFStorage uses a balanced tree to store the values, and is most appropriate
|
||||
for situations where potentially a large number values (more than a hundred
|
||||
bytes' worth) will be stored and there will be a lot of editing (insertions and deletions).
|
||||
|
||||
Getting to an item is O(log n), although caching the last result often reduces this
|
||||
to a constant time.
|
||||
|
||||
The overhead of CFStorage is 48 bytes. There is no per item overhead; the
|
||||
non-leaf nodes in the tree cost 20 bytes each, and the worst case extra
|
||||
capacity (unused space in the leaves) is 12%, typically much less.
|
||||
|
||||
Because CFStorage does not necessarily use a single block of memory to store the values,
|
||||
when you ask for a value, you get back the pointer to the value and optionally
|
||||
the range of other values that are consecutive and thus reachable as if the
|
||||
storage was a single block.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFSTORAGE__)
|
||||
#define __COREFOUNDATION_CFSTORAGE__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFStorageEnumerationOptionFlags) {
|
||||
kCFStorageEnumerationConcurrent = (1UL << 0) /* Allow enumeration to proceed concurrently */
|
||||
};
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/*!
|
||||
@typedef CFStorageRef
|
||||
This is the type of a reference to a CFStorage instance.
|
||||
*/
|
||||
typedef struct __CFStorage *CFStorageRef;
|
||||
|
||||
/*!
|
||||
@typedef CFStorageApplierFunction
|
||||
Type of the callback function used by the apply functions of
|
||||
CFStorage.
|
||||
@param value The current value from the storage.
|
||||
@param context The user-defined context parameter given to the apply
|
||||
function.
|
||||
*/
|
||||
typedef void (*CFStorageApplierFunction)(const void *val, void *context);
|
||||
|
||||
/*!
|
||||
@typedef CFStorageRangeApplierBlock
|
||||
Type of the callback block used by the apply functions of
|
||||
CFStorage
|
||||
@param val A pointer to a range of values, numbering range.length
|
||||
@param range The range of values. This will always be a subrange of the range
|
||||
passed to the apply function. Do not try to modify the contents of the vals pointer, because
|
||||
there is no guarantee it points into the contents of the CFStorage object.
|
||||
@param stop An "out" parameter that, if set to true from within the block, indicates that the enumeration may stop.
|
||||
|
||||
*/
|
||||
#if __BLOCKS__
|
||||
typedef void (^CFStorageApplierBlock)(const void *vals, CFRange range, bool *stop);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@function CFStorageGetTypeID
|
||||
Returns the type identifier of all CFStorage instances.
|
||||
*/
|
||||
CF_EXPORT CFTypeID CFStorageGetTypeID(void);
|
||||
|
||||
/*!
|
||||
@function CFStorageCreate
|
||||
Creates a new mutable storage with elements of the given size.
|
||||
@param alloc The CFAllocator which should be used to allocate
|
||||
memory for the set and its storage for values. 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 valueSizeInBytes The size in bytes of each of the elements
|
||||
to be stored in the storage. If this value is zero or
|
||||
negative, the result is undefined.
|
||||
@result A reference to the new CFStorage instance.
|
||||
*/
|
||||
CF_EXPORT CFStorageRef CFStorageCreate(CFAllocatorRef alloc, CFIndex valueSizeInBytes);
|
||||
|
||||
/*!
|
||||
@function CFStorageInsertValues
|
||||
Allocates space for range.length values at location range.location. Use
|
||||
CFStorageReplaceValues() to set those values.
|
||||
@param storage The storage to which the values are to be inserted.
|
||||
If this parameter is not a valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to insert. The
|
||||
range location must be at least zero and not exceed the count of the storage.
|
||||
Values at indexes equal to or greater than the range location have their indexes
|
||||
increased by the length of the range. Thus this creates a gap in the storage
|
||||
equal to the length of the given range. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0),
|
||||
in which case there is no effect.
|
||||
|
||||
*/
|
||||
CF_EXPORT void CFStorageInsertValues(CFStorageRef storage, CFRange range);
|
||||
|
||||
/*!
|
||||
@function CFStorageDeleteValues
|
||||
Deletes the values of the storage in the specified range.
|
||||
@param storage The storage from which the values are to be deleted.
|
||||
If this parameter is not a valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to delete. If the
|
||||
range location or end point (defined by the location plus
|
||||
length minus 1) are outside the index space of the storage (0
|
||||
to N inclusive, where N is the count of the storage), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0),
|
||||
in which case no values are deleted.
|
||||
*/
|
||||
CF_EXPORT void CFStorageDeleteValues(CFStorageRef storage, CFRange range);
|
||||
|
||||
/*!
|
||||
@function CFStorageGetCount
|
||||
Returns the number of values currently in the storage.
|
||||
@param storage The storage to be queried. If this parameter is not a valid
|
||||
CFStorage, the behavior is undefined.
|
||||
@result The number of values in the storage.
|
||||
*/
|
||||
CF_EXPORT CFIndex CFStorageGetCount(CFStorageRef storage);
|
||||
|
||||
/*!
|
||||
@function CFStorageGetValueAtIndex
|
||||
Returns a pointer to the specified value. The pointer is mutable and may be used to
|
||||
get or set the value. This is considered to be a mutating function, and so calling this
|
||||
while accessing the CFStorage from another thread is undefined behavior,
|
||||
even if you do not set a value. To access the CFStorage in a non-mutating
|
||||
manner, use the more efficient CFStorageGetConstValueAtIndex().
|
||||
@param storage The storage to be queried. If this parameter is not a
|
||||
valid CFStorage, the behavior is undefined.
|
||||
@param idx The index of the value to retrieve. If the index is
|
||||
outside the index space of the storage (0 to N-1 inclusive,
|
||||
where N is the count of the storage), the behavior is
|
||||
undefined.
|
||||
@param validConsecutiveValueRange This parameter is a C pointer to a CFRange.
|
||||
If NULL is specified, this argument is ignored; otherwise, the range
|
||||
is set to the range of values that may be accessed via an offset from the result pointer.
|
||||
The range location is set to the index of the lowest consecutive
|
||||
value and the range length is set to the count of consecutive values.
|
||||
@result The value with the given index in the storage.
|
||||
*/
|
||||
CF_EXPORT void *CFStorageGetValueAtIndex(CFStorageRef storage, CFIndex idx, CFRange *validConsecutiveValueRange);
|
||||
|
||||
/*!
|
||||
@function CFStorageGetConstValueAtIndex
|
||||
Returns a pointer to the specified value. The pointer is immutable and may
|
||||
only be used to get the value. This is not considered to be a mutating function,
|
||||
so it is safe to call this concurrently with other non-mutating functions. Furthermore,
|
||||
this is often more efficient than CFStorageGetValueAtIndex(), so it should be used
|
||||
in preference to that function when possible.
|
||||
@param storage The storage to be queried. If this parameter is not a
|
||||
valid CFStorage, the behavior is undefined.
|
||||
@param idx The index of the value to retrieve. If the index is
|
||||
outside the index space of the storage (0 to N-1 inclusive,
|
||||
where N is the count of the storage), the behavior is
|
||||
undefined.
|
||||
@param validConsecutiveValueRange This parameter is a C pointer to a CFRange.
|
||||
If NULL is specified, this argument is ignored; otherwise, the range
|
||||
is set to the range of values that may be accessed via an offset from the result pointer.
|
||||
The range location is set to the index of the lowest consecutive
|
||||
value and the range length is set to the count of consecutive values.
|
||||
@result The value with the given index in the storage.
|
||||
*/
|
||||
CF_EXPORT const void *CFStorageGetConstValueAtIndex(CFStorageRef storage, CFIndex idx, CFRange *validConsecutiveValueRange);
|
||||
|
||||
/*!
|
||||
@function CFStorageGetValues
|
||||
Fills the buffer with values from the storage.
|
||||
@param storage The storage to be queried. If this parameter is not a
|
||||
valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to retrieve. If
|
||||
the range location or end point (defined by the location
|
||||
plus length minus 1) are outside the index space of the
|
||||
storage (0 to N-1 inclusive, where N is the count of the
|
||||
storage), the behavior is undefined. If the range length is
|
||||
negative, the behavior is undefined. The range may be empty
|
||||
(length 0), in which case no values are put into the buffer.
|
||||
@param values A C array of to be filled with values from the storage.
|
||||
The values in the C array are ordered
|
||||
in the same order in which they appear in the storage. If this
|
||||
parameter is not a valid pointer to a C array of at least
|
||||
range.length pointers, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFStorageGetValues(CFStorageRef storage, CFRange range, void *values);
|
||||
|
||||
/*!
|
||||
@function CFStorageApplyFunction
|
||||
Calls a function once for each value in the set.
|
||||
@param storage The storage to be operated upon. If this parameter is not
|
||||
a valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to operate on. If the
|
||||
range location or end point (defined by the location plus
|
||||
length minus 1) are outside the index space of the storage (0
|
||||
to N inclusive, where N is the count of the storage), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0),
|
||||
in which case the no values are operated on.
|
||||
@param applier The callback function to call once for each value in
|
||||
the given storage. If this parameter is not a
|
||||
pointer to a function of the correct prototype, the behavior
|
||||
is undefined. If there are values in the storage which the
|
||||
applier function does not expect or cannot properly apply
|
||||
to, the behavior is undefined.
|
||||
@param context A pointer-sized user-defined value, which is passed
|
||||
as the second parameter to the applier function, but is
|
||||
otherwise unused by this function. If the context is not
|
||||
what is expected by the applier function, the behavior is
|
||||
undefined.
|
||||
*/
|
||||
CF_EXPORT void CFStorageApplyFunction(CFStorageRef storage, CFRange range, CFStorageApplierFunction applier, void *context);
|
||||
|
||||
/*!
|
||||
@function CFStorageApplyBlock
|
||||
Enumerates ranges of stored objects with a block.
|
||||
@param storage The storage to be operated upon. If this parameter is not
|
||||
a valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to operate on. If the
|
||||
sum of the range location and length is larger than the
|
||||
count of the storage, the behavior is undefined. If the
|
||||
range location or length is negative, the behavior is undefined.
|
||||
@param options Options controlling how the enumeration may proceed.
|
||||
@param applier The callback block. The block is passed a pointer to
|
||||
a buffer of contiguous objects in the storage, and the range of stored
|
||||
values represented by the buffer. If the block modifies the
|
||||
contents of the buffer, the behavior is undefined. If the block modifies
|
||||
the contents of the CFStorage, the behavior is undefined.
|
||||
|
||||
*/
|
||||
#if __BLOCKS__
|
||||
CF_EXPORT void CFStorageApplyBlock(CFStorageRef storage, CFRange range, CFStorageEnumerationOptionFlags options, CFStorageApplierBlock applier);
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
@function CFStorageCreateWithSubrange
|
||||
Returns a new CFStorage that contains a portion of an existing CFStorage.
|
||||
@param storage The storage to be operated upon. If this parameter is not
|
||||
a valid CFStorage, the behavior is undefined.
|
||||
@param range The range of values within the storage to operate on. If the
|
||||
sum of the range location and length is larger than the
|
||||
count of the storage, the behavior is undefined. If the
|
||||
range location or length is negative, the behavior is undefined.
|
||||
@result A reference to a new CFStorage containing a byte-for-byte copy of
|
||||
the objects in the range. This may use copy-on-write techniques
|
||||
to allow efficient implementation.
|
||||
*/
|
||||
CF_EXPORT CFStorageRef CFStorageCreateWithSubrange(CFStorageRef storage, CFRange range);
|
||||
|
||||
/*!
|
||||
@function CFStorageReplaceValues
|
||||
Replaces a range of values in the storage.
|
||||
@param storage The storage from which the specified values are to be
|
||||
removed. If this parameter is not a valid CFStorage,
|
||||
the behavior is undefined.
|
||||
@param range The range of values within the storage to replace. If the
|
||||
range location or end point (defined by the location plus
|
||||
length minus 1) are outside the index space of the storage (0
|
||||
to N inclusive, where N is the count of the storage), the
|
||||
behavior is undefined. If the range length is negative, the
|
||||
behavior is undefined. The range may be empty (length 0),
|
||||
in which case the new values are merely inserted at the
|
||||
range location.
|
||||
@param values A C array of the values to be copied into the storage.
|
||||
The new values in the storage are ordered in the same order
|
||||
in which they appear in this C array. This parameter may be NULL
|
||||
if the range length is 0. This C array is not changed or freed by
|
||||
this function. If this parameter is not a valid pointer to a C array of at least
|
||||
range length pointers, the behavior is undefined.
|
||||
*/
|
||||
CF_EXPORT void CFStorageReplaceValues(CFStorageRef storage, CFRange range, const void *values);
|
||||
|
||||
/* Private stuff...
|
||||
*/
|
||||
CF_EXPORT CFIndex __CFStorageGetCapacity(CFStorageRef storage);
|
||||
CF_EXPORT CFIndex __CFStorageGetValueSize(CFStorageRef storage);
|
||||
CF_EXPORT void __CFStorageSetAlwaysFrozen(CFStorageRef storage, bool alwaysFrozen);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFSTORAGE__ */
|
||||
|
1
CFStorage.h
Symbolic link
1
CFStorage.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFStorage.h
|
308
CFStream.h
308
CFStream.h
@ -1,308 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFStream.h
|
||||
Copyright (c) 2000-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFSTREAM__)
|
||||
#define __COREFOUNDATION_CFSTREAM__ 1
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
#include <CoreFoundation/CFRunLoop.h>
|
||||
#include <CoreFoundation/CFSocket.h>
|
||||
#include <CoreFoundation/CFError.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
typedef CF_ENUM(CFIndex, CFStreamStatus) {
|
||||
kCFStreamStatusNotOpen = 0,
|
||||
kCFStreamStatusOpening, /* open is in-progress */
|
||||
kCFStreamStatusOpen,
|
||||
kCFStreamStatusReading,
|
||||
kCFStreamStatusWriting,
|
||||
kCFStreamStatusAtEnd, /* no further bytes can be read/written */
|
||||
kCFStreamStatusClosed,
|
||||
kCFStreamStatusError
|
||||
};
|
||||
|
||||
typedef CF_OPTIONS(CFOptionFlags, CFStreamEventType) {
|
||||
kCFStreamEventNone = 0,
|
||||
kCFStreamEventOpenCompleted = 1,
|
||||
kCFStreamEventHasBytesAvailable = 2,
|
||||
kCFStreamEventCanAcceptBytes = 4,
|
||||
kCFStreamEventErrorOccurred = 8,
|
||||
kCFStreamEventEndEncountered = 16
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
void *info;
|
||||
void *(*retain)(void *info);
|
||||
void (*release)(void *info);
|
||||
CFStringRef (*copyDescription)(void *info);
|
||||
} CFStreamClientContext;
|
||||
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSInputStream) __CFReadStream * CFReadStreamRef;
|
||||
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSOutputStream) __CFWriteStream * CFWriteStreamRef;
|
||||
|
||||
typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
|
||||
typedef void (*CFWriteStreamClientCallBack)(CFWriteStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);
|
||||
|
||||
CF_EXPORT
|
||||
CFTypeID CFReadStreamGetTypeID(void);
|
||||
CF_EXPORT
|
||||
CFTypeID CFWriteStreamGetTypeID(void);
|
||||
|
||||
/* Memory streams */
|
||||
|
||||
/* Value will be a CFData containing all bytes thusfar written; used to recover the data written to a memory write stream. */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertyDataWritten;
|
||||
|
||||
/* Pass kCFAllocatorNull for bytesDeallocator to prevent CFReadStream from deallocating bytes; otherwise, CFReadStream will deallocate bytes when the stream is destroyed */
|
||||
CF_EXPORT
|
||||
CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
|
||||
|
||||
/* The stream writes into the buffer given; when bufferCapacity is exhausted, the stream is exhausted (status becomes kCFStreamStatusAtEnd) */
|
||||
CF_EXPORT
|
||||
CFWriteStreamRef CFWriteStreamCreateWithBuffer(CFAllocatorRef alloc, UInt8 *buffer, CFIndex bufferCapacity);
|
||||
|
||||
/* New buffers are allocated from bufferAllocator as bytes are written to the stream. At any point, you can recover the bytes thusfar written by asking for the property kCFStreamPropertyDataWritten, above */
|
||||
CF_EXPORT
|
||||
CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator);
|
||||
|
||||
/* File streams */
|
||||
CF_EXPORT
|
||||
CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
|
||||
CF_EXPORT
|
||||
CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL);
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
CF_EXPORT
|
||||
void CFStreamCreateBoundPair(CFAllocatorRef alloc, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream, CFIndex transferBufferSize);
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
/* Property for file write streams; value should be a CFBoolean. Set to TRUE to append to a file, rather than to replace its contents */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertyAppendToFile;
|
||||
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertyFileCurrentOffset; // Value is a CFNumber
|
||||
|
||||
|
||||
/* Socket stream properties */
|
||||
|
||||
/* Value will be a CFData containing the native handle */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertySocketNativeHandle;
|
||||
|
||||
/* Value will be a CFString, or NULL if unknown */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertySocketRemoteHostName;
|
||||
|
||||
/* Value will be a CFNumber, or NULL if unknown */
|
||||
CF_EXPORT
|
||||
const CFStringRef kCFStreamPropertySocketRemotePortNumber;
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
/* Socket streams; the returned streams are paired such that they use the same socket; pass NULL if you want only the read stream or the write stream */
|
||||
CF_EXPORT
|
||||
void CFStreamCreatePairWithSocket(CFAllocatorRef alloc, CFSocketNativeHandle sock, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
|
||||
CF_EXPORT
|
||||
void CFStreamCreatePairWithSocketToHost(CFAllocatorRef alloc, CFStringRef host, UInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
|
||||
CF_EXPORT
|
||||
void CFStreamCreatePairWithPeerSocketSignature(CFAllocatorRef alloc, const CFSocketSignature *signature, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream);
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
|
||||
/* Returns the current state of the stream */
|
||||
CF_EXPORT
|
||||
CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef stream);
|
||||
CF_EXPORT
|
||||
CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef stream);
|
||||
|
||||
/* Returns NULL if no error has occurred; otherwise returns the error. */
|
||||
CF_EXPORT
|
||||
CFErrorRef CFReadStreamCopyError(CFReadStreamRef stream) CF_AVAILABLE(10_5, 2_0);
|
||||
CF_EXPORT
|
||||
CFErrorRef CFWriteStreamCopyError(CFWriteStreamRef stream) CF_AVAILABLE(10_5, 2_0);
|
||||
|
||||
/* 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
|
||||
return TRUE; listen to the run loop source to find out when the open completes
|
||||
and whether it was successful, or poll using CFRead/WriteStreamGetStatus(), waiting
|
||||
for a status of kCFStreamStatusOpen or kCFStreamStatusError. */
|
||||
CF_EXPORT
|
||||
Boolean CFReadStreamOpen(CFReadStreamRef stream);
|
||||
CF_EXPORT
|
||||
Boolean CFWriteStreamOpen(CFWriteStreamRef stream);
|
||||
|
||||
/* Terminates the flow of bytes; releases any system resources required by the
|
||||
stream. The stream may not fail to close. You may call CFStreamClose() to
|
||||
effectively abort a stream. */
|
||||
CF_EXPORT
|
||||
void CFReadStreamClose(CFReadStreamRef stream);
|
||||
CF_EXPORT
|
||||
void CFWriteStreamClose(CFWriteStreamRef stream);
|
||||
|
||||
/* Whether there is data currently available for reading; returns TRUE if it's
|
||||
impossible to tell without trying */
|
||||
CF_EXPORT
|
||||
Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef stream);
|
||||
|
||||
/* Returns the number of bytes read, or -1 if an error occurs preventing any
|
||||
bytes from being read, or 0 if the stream's end was encountered.
|
||||
It is an error to try and read from a stream that hasn't been opened first.
|
||||
This call will block until at least one byte is available; it will NOT block
|
||||
until the entire buffer can be filled. To avoid blocking, either poll using
|
||||
CFReadStreamHasBytesAvailable() or use the run loop and listen for the
|
||||
kCFStreamCanRead event for notification of data available. */
|
||||
CF_EXPORT
|
||||
CFIndex CFReadStreamRead(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength);
|
||||
|
||||
/* Returns a pointer to an internal buffer if possible (setting *numBytesRead
|
||||
to the length of the returned buffer), otherwise returns NULL; guaranteed
|
||||
to return in O(1). Bytes returned in the buffer are considered read from
|
||||
the stream; if maxBytesToRead is greater than 0, not more than maxBytesToRead
|
||||
will be returned. If maxBytesToRead is less than or equal to zero, as many bytes
|
||||
as are readily available will be returned. The returned buffer is good only
|
||||
until the next stream operation called on the stream. Caller should neither
|
||||
change the contents of the returned buffer nor attempt to deallocate the buffer;
|
||||
it is still owned by the stream. */
|
||||
CF_EXPORT
|
||||
const UInt8 *CFReadStreamGetBuffer(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead);
|
||||
|
||||
/* Whether the stream can currently be written to without blocking;
|
||||
returns TRUE if it's impossible to tell without trying */
|
||||
CF_EXPORT
|
||||
Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef stream);
|
||||
|
||||
/* Returns the number of bytes successfully written, -1 if an error has
|
||||
occurred, or 0 if the stream has been filled to capacity (for fixed-length
|
||||
streams). If the stream is not full, this call will block until at least
|
||||
one byte is written. To avoid blocking, either poll via CFWriteStreamCanAcceptBytes
|
||||
or use the run loop and listen for the kCFStreamCanWrite event. */
|
||||
CF_EXPORT
|
||||
CFIndex CFWriteStreamWrite(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength);
|
||||
|
||||
/* Particular streams can name properties and assign meanings to them; you
|
||||
access these properties through the following calls. A property is any interesting
|
||||
information about the stream other than the data being transmitted itself.
|
||||
Examples include the headers from an HTTP transmission, or the expected
|
||||
number of bytes, or permission information, etc. Properties that can be set
|
||||
configure the behavior of the stream, and may only be settable at particular times
|
||||
(like before the stream has been opened). See the documentation for particular
|
||||
properties to determine their get- and set-ability. */
|
||||
CF_EXPORT
|
||||
CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef stream, CFStringRef propertyName);
|
||||
CF_EXPORT
|
||||
CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef stream, CFStringRef propertyName);
|
||||
|
||||
/* Returns TRUE if the stream recognizes and accepts the given property-value pair;
|
||||
FALSE otherwise. */
|
||||
CF_EXPORT
|
||||
Boolean CFReadStreamSetProperty(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
|
||||
CF_EXPORT
|
||||
Boolean CFWriteStreamSetProperty(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue);
|
||||
|
||||
/* Asynchronous processing - If you wish to neither poll nor block, you may register
|
||||
a client to hear about interesting events that occur on a stream. Only one client
|
||||
per stream is allowed; registering a new client replaces the previous one.
|
||||
|
||||
Once you have set a client, the stream must be scheduled to provide the context in
|
||||
which the client will be called. Streams may be scheduled on a single dispatch queue
|
||||
or on one or more run loops. If scheduled on a run loop, it is the caller's responsibility
|
||||
to ensure that at least one of the scheduled run loops is being run.
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
CF_EXPORT
|
||||
Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
|
||||
CF_EXPORT
|
||||
Boolean CFWriteStreamSetClient(CFWriteStreamRef stream, CFOptionFlags streamEvents, CFWriteStreamClientCallBack clientCB, CFStreamClientContext *clientContext);
|
||||
|
||||
CF_EXPORT
|
||||
void CFReadStreamScheduleWithRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
|
||||
CF_EXPORT
|
||||
void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
|
||||
|
||||
CF_EXPORT
|
||||
void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
|
||||
CF_EXPORT
|
||||
void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode);
|
||||
|
||||
/*
|
||||
* Specify the dispatch queue upon which the client callbacks will be invoked.
|
||||
* Passing NULL for the queue will prevent future callbacks from being invoked.
|
||||
* Specifying a dispatch queue using this API will unschedule the stream from
|
||||
* any run loops it had previously been scheduled upon - similarly, scheduling
|
||||
* with a runloop will disassociate the stream from any existing dispatch queue.
|
||||
*/
|
||||
CF_EXPORT
|
||||
void CFReadStreamSetDispatchQueue(CFReadStreamRef stream, dispatch_queue_t q) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
CF_EXPORT
|
||||
void CFWriteStreamSetDispatchQueue(CFWriteStreamRef stream, dispatch_queue_t q) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
/*
|
||||
* Returns the previously set dispatch queue with an incremented retain count.
|
||||
* Note that the stream's queue may have been set to NULL if the stream was
|
||||
* scheduled on a runloop subsequent to it having had a dispatch queue set.
|
||||
*/
|
||||
CF_EXPORT
|
||||
dispatch_queue_t CFReadStreamCopyDispatchQueue(CFReadStreamRef stream) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
CF_EXPORT
|
||||
dispatch_queue_t CFWriteStreamCopyDispatchQueue(CFWriteStreamRef stream) CF_AVAILABLE(10_9, 7_0);
|
||||
|
||||
/* The following API is deprecated starting in 10.5; please use CFRead/WriteStreamCopyError(), above, instead */
|
||||
typedef CF_ENUM(CFIndex, CFStreamErrorDomain) {
|
||||
kCFStreamErrorDomainCustom = -1L, /* custom to the kind of stream in question */
|
||||
kCFStreamErrorDomainPOSIX = 1, /* POSIX errno; interpret using <sys/errno.h> */
|
||||
kCFStreamErrorDomainMacOSStatus /* OSStatus type from Carbon APIs; interpret using <MacTypes.h> */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
CFIndex domain;
|
||||
SInt32 error;
|
||||
} CFStreamError;
|
||||
CF_EXPORT
|
||||
CFStreamError CFReadStreamGetError(CFReadStreamRef stream);
|
||||
CF_EXPORT
|
||||
CFStreamError CFWriteStreamGetError(CFWriteStreamRef stream);
|
||||
|
||||
|
||||
CF_EXTERN_C_END
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFSTREAM__ */
|
1
CFStream.h
Symbolic link
1
CFStream.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFStream.h
|
@ -1,212 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/* CFStreamAbstract.h
|
||||
Copyright (c) 2000-2014, Apple Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#if !defined(__COREFOUNDATION_CFSTREAMABSTRACT__)
|
||||
#define __COREFOUNDATION_CFSTREAMABSTRACT__ 1
|
||||
|
||||
#include <CoreFoundation/CFStream.h>
|
||||
|
||||
CF_EXTERN_C_BEGIN
|
||||
|
||||
/* During a stream's lifetime, the open callback will be called once, followed by any number of openCompleted calls (until openCompleted returns TRUE). Then any number of read/canRead or write/canWrite calls, then a single close call. copyProperty can be called at any time. prepareAsynch will be called exactly once when the stream's client is first configured.
|
||||
|
||||
Expected semantics:
|
||||
- open reserves any system resources that are needed. The stream may start the process of opening, returning TRUE immediately and setting openComplete to FALSE. When the open completes, _CFStreamSignalEvent should be called passing kCFStreamOpenCompletedEvent. openComplete should be set to TRUE only if the open operation completed in its entirety.
|
||||
- openCompleted will only be called after open has been called, but before any kCFStreamOpenCompletedEvent has been received. Return TRUE, setting error.code to 0, if the open operation has completed. Return TRUE, setting error to the correct error code and domain if the open operation completed, but failed. Return FALSE if the open operation is still in-progress. If your open ever fails to complete (i.e. sets openComplete to FALSE), you must be implement the openCompleted callback.
|
||||
- read should read into the given buffer, returning the number of bytes successfully read. read must block until at least one byte is available, but should not block until the entire buffer is filled; zero should only be returned if end-of-stream is encountered. atEOF should be set to true if the EOF is encountered, false otherwise. error.code should be set to zero if no error occurs; otherwise, error should be set to the appropriate values.
|
||||
- getBuffer is an optimization to return an internal buffer of bytes read from the stream, and may return NULL. getBuffer itself may be NULL if the concrete implementation does not wish to provide an internal buffer. If implemented, it should set numBytesRead to the number of bytes available in the internal buffer (but should not exceed maxBytesToRead) and return a pointer to the base of the bytes.
|
||||
- canRead will only be called once openCompleted reports that the stream has been successfully opened (or the initial open call succeeded). It should return whether there are bytes that can be read without blocking.
|
||||
- write should write the bytes in the given buffer to the device, returning the number of bytes successfully written. write must block until at least one byte is written. error.code should be set to zero if no error occurs; otherwise, error should be set to the appropriate values.
|
||||
- close should close the device, releasing any reserved system resources. close cannot fail (it may be called to abort the stream), and may be called at any time after open has been called. It will only be called once.
|
||||
- copyProperty should return the value for the given property, or NULL if none exists. Composite streams (streams built on top of other streams) should take care to call CFStreamCopyProperty on the base stream if they do not recognize the property given, to give the underlying stream a chance to respond.
|
||||
|
||||
In all cases, errors returned by reference will be initialized to NULL by the caller, and if they are set to non-NULL, will
|
||||
be released by the caller
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
CFIndex version; /* == 2 */
|
||||
|
||||
void *(*create)(CFReadStreamRef stream, void *info);
|
||||
void (*finalize)(CFReadStreamRef stream, void *info);
|
||||
CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info);
|
||||
|
||||
Boolean (*open)(CFReadStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFReadStreamRef stream, CFErrorRef *error, void *info);
|
||||
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, Boolean *atEOF, void *info);
|
||||
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFErrorRef *error, Boolean *atEOF, void *info);
|
||||
Boolean (*canRead)(CFReadStreamRef stream, CFErrorRef *error, void *info);
|
||||
void (*close)(CFReadStreamRef stream, void *info);
|
||||
|
||||
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
|
||||
Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
|
||||
|
||||
void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info);
|
||||
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFReadStreamCallBacks;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version; /* == 2 */
|
||||
|
||||
void *(*create)(CFWriteStreamRef stream, void *info);
|
||||
void (*finalize)(CFWriteStreamRef stream, void *info);
|
||||
CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info);
|
||||
|
||||
Boolean (*open)(CFWriteStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFWriteStreamRef stream, CFErrorRef *error, void *info);
|
||||
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, void *info);
|
||||
Boolean (*canWrite)(CFWriteStreamRef stream, CFErrorRef *error, void *info);
|
||||
void (*close)(CFWriteStreamRef stream, void *info);
|
||||
|
||||
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
|
||||
Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
|
||||
|
||||
void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info);
|
||||
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFWriteStreamCallBacks;
|
||||
|
||||
// Primitive creation mechanisms.
|
||||
CF_EXPORT
|
||||
CFReadStreamRef CFReadStreamCreate(CFAllocatorRef alloc, const CFReadStreamCallBacks *callbacks, void *info);
|
||||
CF_EXPORT
|
||||
CFWriteStreamRef CFWriteStreamCreate(CFAllocatorRef alloc, const CFWriteStreamCallBacks *callbacks, void *info);
|
||||
|
||||
/* All the functions below can only be called when you are sure the stream in question was created via
|
||||
CFReadStreamCreate() or CFWriteStreamCreate(), above. They are NOT safe for toll-free bridged objects,
|
||||
so the caller must be sure the argument passed is not such an object. */
|
||||
|
||||
// To be called by the concrete stream implementation (the callbacks) when an event occurs. error may be NULL if event != kCFStreamEventErrorOccurred
|
||||
// error should be a CFErrorRef if the callbacks are version 2 or later; otherwise it should be a (CFStreamError *).
|
||||
CF_EXPORT
|
||||
void CFReadStreamSignalEvent(CFReadStreamRef stream, CFStreamEventType event, const void *error);
|
||||
CF_EXPORT
|
||||
void CFWriteStreamSignalEvent(CFWriteStreamRef stream, CFStreamEventType event, const void *error);
|
||||
|
||||
// These require that the stream allow the run loop to run once before delivering the event to its client.
|
||||
// See the comment above CFRead/WriteStreamSignalEvent for interpretation of the error argument.
|
||||
CF_EXPORT
|
||||
void _CFReadStreamSignalEventDelayed(CFReadStreamRef stream, CFStreamEventType event, const void *error);
|
||||
CF_EXPORT
|
||||
void _CFWriteStreamSignalEventDelayed(CFWriteStreamRef stream, CFStreamEventType event, const void *error);
|
||||
|
||||
CF_EXPORT
|
||||
void _CFReadStreamClearEvent(CFReadStreamRef stream, CFStreamEventType event);
|
||||
// Write variant not currently needed
|
||||
//CF_EXPORT
|
||||
//void _CFWriteStreamClearEvent(CFWriteStreamRef stream, CFStreamEventType event);
|
||||
|
||||
// Convenience for concrete implementations to extract the info pointer given the stream.
|
||||
CF_EXPORT
|
||||
void *CFReadStreamGetInfoPointer(CFReadStreamRef stream);
|
||||
CF_EXPORT
|
||||
void *CFWriteStreamGetInfoPointer(CFWriteStreamRef stream);
|
||||
|
||||
// Returns the client info pointer currently set on the stream. These should probably be made public one day.
|
||||
CF_EXPORT
|
||||
void *_CFReadStreamGetClient(CFReadStreamRef readStream);
|
||||
CF_EXPORT
|
||||
void *_CFWriteStreamGetClient(CFWriteStreamRef writeStream);
|
||||
|
||||
// Returns an array of the runloops and modes on which the stream is currently scheduled
|
||||
// Note that these are unretained mutable arrays - use the copy variant instead.
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFReadStreamGetRunLoopsAndModes(CFReadStreamRef readStream);
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFWriteStreamGetRunLoopsAndModes(CFWriteStreamRef writeStream);
|
||||
|
||||
// Returns an array of the runloops and modes on which the stream is currently scheduled
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFReadStreamCopyRunLoopsAndModes(CFReadStreamRef readStream);
|
||||
CF_EXPORT
|
||||
CFArrayRef _CFWriteStreamCopyRunLoopsAndModes(CFWriteStreamRef writeStream);
|
||||
|
||||
/* Deprecated versions; here for backwards compatibility. */
|
||||
typedef struct {
|
||||
CFIndex version; /* == 1 */
|
||||
void *(*create)(CFReadStreamRef stream, void *info);
|
||||
void (*finalize)(CFReadStreamRef stream, void *info);
|
||||
CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info);
|
||||
Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info);
|
||||
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info);
|
||||
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info);
|
||||
Boolean (*canRead)(CFReadStreamRef stream, void *info);
|
||||
void (*close)(CFReadStreamRef stream, void *info);
|
||||
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
|
||||
Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
|
||||
void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info);
|
||||
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFReadStreamCallBacksV1;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version; /* == 1 */
|
||||
void *(*create)(CFWriteStreamRef stream, void *info);
|
||||
void (*finalize)(CFWriteStreamRef stream, void *info);
|
||||
CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info);
|
||||
Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info);
|
||||
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info);
|
||||
Boolean (*canWrite)(CFWriteStreamRef stream, void *info);
|
||||
void (*close)(CFWriteStreamRef stream, void *info);
|
||||
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
|
||||
Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
|
||||
void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info);
|
||||
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFWriteStreamCallBacksV1;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version; /* == 0 */
|
||||
Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info);
|
||||
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info);
|
||||
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info);
|
||||
Boolean (*canRead)(CFReadStreamRef stream, void *info);
|
||||
void (*close)(CFReadStreamRef stream, void *info);
|
||||
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
|
||||
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFReadStreamCallBacksV0;
|
||||
|
||||
typedef struct {
|
||||
CFIndex version; /* == 0 */
|
||||
Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
|
||||
Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info);
|
||||
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info);
|
||||
Boolean (*canWrite)(CFWriteStreamRef stream, void *info);
|
||||
void (*close)(CFWriteStreamRef stream, void *info);
|
||||
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
|
||||
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
|
||||
} CFWriteStreamCallBacksV0;
|
||||
|
||||
CF_EXTERN_C_END
|
||||
|
||||
#endif /* ! __COREFOUNDATION_CFSTREAMABSTRACT__ */
|
1
CFStreamAbstract.h
Symbolic link
1
CFStreamAbstract.h
Symbolic link
@ -0,0 +1 @@
|
||||
include/CoreFoundation/./CFStreamAbstract.h
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user