// Automatically generated by clay-bindgen
// language: c

import libc.*;
import unix.*;

private alias OpaquePointer = RawPointer;
private alias UnknownType = Int;
private alias AUnionType = Int;


external kCFCoreFoundationVersionNumber : Double;

alias CFTypeID = CULong;

alias CFOptionFlags = CULong;

alias CFHashCode = CULong;

alias CFIndex = CLong;

alias CFTypeRef = RawPointer;

alias CFStringRef = OpaquePointer;

alias CFMutableStringRef = OpaquePointer;

alias CFPropertyListRef = CFTypeRef;

alias kCFCompareLessThan = 4294967295;
alias kCFCompareEqualTo = 0;
alias kCFCompareGreaterThan = 1;

alias CFComparisonResult = CLong;

alias CFComparatorFunction = CCodePointer[[RawPointer,RawPointer,RawPointer],[CLong]];

alias kCFNotFound = 4294967295;

record UnnamedStruct9 (
    location : CLong,
    length : CLong,
);

alias CFRange = UnnamedStruct9;

external __CFRangeMake(
    loc : CLong,
    len : CLong) : CFRange;

alias CFNullRef = OpaquePointer;

external CFNullGetTypeID() : CULong;

external kCFNull : CFNullRef;

alias CFAllocatorRef = OpaquePointer;

external kCFAllocatorDefault : CFAllocatorRef;

external kCFAllocatorSystemDefault : CFAllocatorRef;

external kCFAllocatorMalloc : CFAllocatorRef;

external kCFAllocatorMallocZone : CFAllocatorRef;

external kCFAllocatorNull : CFAllocatorRef;

external kCFAllocatorUseContext : CFAllocatorRef;

alias CFAllocatorRetainCallBack = CCodePointer[[RawPointer],[RawPointer]];

alias CFAllocatorReleaseCallBack = CCodePointer[[RawPointer],[]];

alias CFAllocatorCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

alias CFAllocatorAllocateCallBack = CCodePointer[[CLong,CULong,RawPointer],[RawPointer]];

alias CFAllocatorReallocateCallBack = CCodePointer[[RawPointer,CLong,CULong,RawPointer],[RawPointer]];

alias CFAllocatorDeallocateCallBack = CCodePointer[[RawPointer,RawPointer],[]];

alias CFAllocatorPreferredSizeCallBack = CCodePointer[[CLong,CULong,RawPointer],[CLong]];

record UnnamedStruct10 (
    version : CLong,
    info : RawPointer,
    retain : CFAllocatorRetainCallBack,
    release : CFAllocatorReleaseCallBack,
    copyDescription : CFAllocatorCopyDescriptionCallBack,
    allocate : CFAllocatorAllocateCallBack,
    reallocate : CFAllocatorReallocateCallBack,
    deallocate : CFAllocatorDeallocateCallBack,
    preferredSize : CFAllocatorPreferredSizeCallBack,
);

alias CFAllocatorContext = UnnamedStruct10;

external CFAllocatorGetTypeID() : CULong;

external CFAllocatorSetDefault(
    allocator : CFAllocatorRef);

external CFAllocatorGetDefault() : CFAllocatorRef;

external CFAllocatorCreate(
    allocator : CFAllocatorRef,
    context : Pointer[CFAllocatorContext]) : CFAllocatorRef;

external CFAllocatorAllocate(
    allocator : CFAllocatorRef,
    size : CLong,
    hint : CULong) : RawPointer;

external CFAllocatorReallocate(
    allocator : CFAllocatorRef,
    ptr : RawPointer,
    newsize : CLong,
    hint : CULong) : RawPointer;

external CFAllocatorDeallocate(
    allocator : CFAllocatorRef,
    ptr : RawPointer);

external CFAllocatorGetPreferredSizeForSize(
    allocator : CFAllocatorRef,
    size : CLong,
    hint : CULong) : CLong;

external CFAllocatorGetContext(
    allocator : CFAllocatorRef,
    context : Pointer[CFAllocatorContext]);

external CFGetTypeID(
    cf : CFTypeRef) : CULong;

external CFCopyTypeIDDescription(
    type_id : CULong) : CFStringRef;

external CFRetain(
    cf : CFTypeRef) : CFTypeRef;

external CFRelease(
    cf : CFTypeRef);

external CFGetRetainCount(
    cf : CFTypeRef) : CLong;

external CFMakeCollectable(
    cf : CFTypeRef) : CFTypeRef;

external CFEqual(
    cf1 : CFTypeRef,
    cf2 : CFTypeRef) : CUChar;

external CFHash(
    cf : CFTypeRef) : CULong;

external CFCopyDescription(
    cf : CFTypeRef) : CFStringRef;

external CFGetAllocator(
    cf : CFTypeRef) : CFAllocatorRef;

alias CFArrayRetainCallBack = CCodePointer[[OpaquePointer,RawPointer],[RawPointer]];

alias CFArrayReleaseCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

alias CFArrayCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

alias CFArrayEqualCallBack = CCodePointer[[RawPointer,RawPointer],[CUChar]];

record UnnamedStruct11 (
    version : CLong,
    retain : CFArrayRetainCallBack,
    release : CFArrayReleaseCallBack,
    copyDescription : CFArrayCopyDescriptionCallBack,
    equal : CFArrayEqualCallBack,
);

alias CFArrayCallBacks = UnnamedStruct11;

external kCFTypeArrayCallBacks : CFArrayCallBacks;

alias CFArrayApplierFunction = CCodePointer[[RawPointer,RawPointer],[]];

alias CFArrayRef = OpaquePointer;

alias CFMutableArrayRef = OpaquePointer;

external CFArrayGetTypeID() : CULong;

external CFArrayCreate(
    allocator : CFAllocatorRef,
    values : Pointer[RawPointer],
    numValues : CLong,
    callBacks : Pointer[CFArrayCallBacks]) : CFArrayRef;

external CFArrayCreateCopy(
    allocator : CFAllocatorRef,
    theArray : CFArrayRef) : CFArrayRef;

external CFArrayCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong,
    callBacks : Pointer[CFArrayCallBacks]) : CFMutableArrayRef;

external CFArrayCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    theArray : CFArrayRef) : CFMutableArrayRef;

external CFArrayGetCount(
    theArray : CFArrayRef) : CLong;

external CFArrayGetCountOfValue(
    theArray : CFArrayRef,
    range : CFRange,
    value : RawPointer) : CLong;

external CFArrayContainsValue(
    theArray : CFArrayRef,
    range : CFRange,
    value : RawPointer) : CUChar;

external CFArrayGetValueAtIndex(
    theArray : CFArrayRef,
    idx : CLong) : RawPointer;

external CFArrayGetValues(
    theArray : CFArrayRef,
    range : CFRange,
    values : Pointer[RawPointer]);

external CFArrayApplyFunction(
    theArray : CFArrayRef,
    range : CFRange,
    applier : CFArrayApplierFunction,
    context : RawPointer);

external CFArrayGetFirstIndexOfValue(
    theArray : CFArrayRef,
    range : CFRange,
    value : RawPointer) : CLong;

external CFArrayGetLastIndexOfValue(
    theArray : CFArrayRef,
    range : CFRange,
    value : RawPointer) : CLong;

external CFArrayBSearchValues(
    theArray : CFArrayRef,
    range : CFRange,
    value : RawPointer,
    comparator : CFComparatorFunction,
    context : RawPointer) : CLong;

external CFArrayAppendValue(
    theArray : CFMutableArrayRef,
    value : RawPointer);

external CFArrayInsertValueAtIndex(
    theArray : CFMutableArrayRef,
    idx : CLong,
    value : RawPointer);

external CFArraySetValueAtIndex(
    theArray : CFMutableArrayRef,
    idx : CLong,
    value : RawPointer);

external CFArrayRemoveValueAtIndex(
    theArray : CFMutableArrayRef,
    idx : CLong);

external CFArrayRemoveAllValues(
    theArray : CFMutableArrayRef);

external CFArrayReplaceValues(
    theArray : CFMutableArrayRef,
    range : CFRange,
    newValues : Pointer[RawPointer],
    newCount : CLong);

external CFArrayExchangeValuesAtIndices(
    theArray : CFMutableArrayRef,
    idx1 : CLong,
    idx2 : CLong);

external CFArraySortValues(
    theArray : CFMutableArrayRef,
    range : CFRange,
    comparator : CFComparatorFunction,
    context : RawPointer);

external CFArrayAppendArray(
    theArray : CFMutableArrayRef,
    otherArray : CFArrayRef,
    otherRange : CFRange);

alias CFBagRetainCallBack = CCodePointer[[OpaquePointer,RawPointer],[RawPointer]];

alias CFBagReleaseCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

alias CFBagCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

alias CFBagEqualCallBack = CCodePointer[[RawPointer,RawPointer],[CUChar]];

alias CFBagHashCallBack = CCodePointer[[RawPointer],[CULong]];

record UnnamedStruct12 (
    version : CLong,
    retain : CFBagRetainCallBack,
    release : CFBagReleaseCallBack,
    copyDescription : CFBagCopyDescriptionCallBack,
    equal : CFBagEqualCallBack,
    hash : CFBagHashCallBack,
);

alias CFBagCallBacks = UnnamedStruct12;

external kCFTypeBagCallBacks : CFBagCallBacks;

external kCFCopyStringBagCallBacks : CFBagCallBacks;

alias CFBagApplierFunction = CCodePointer[[RawPointer,RawPointer],[]];

alias CFBagRef = OpaquePointer;

alias CFMutableBagRef = OpaquePointer;

external CFBagGetTypeID() : CULong;

external CFBagCreate(
    allocator : CFAllocatorRef,
    values : Pointer[RawPointer],
    numValues : CLong,
    callBacks : Pointer[CFBagCallBacks]) : CFBagRef;

external CFBagCreateCopy(
    allocator : CFAllocatorRef,
    theBag : CFBagRef) : CFBagRef;

external CFBagCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong,
    callBacks : Pointer[CFBagCallBacks]) : CFMutableBagRef;

external CFBagCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    theBag : CFBagRef) : CFMutableBagRef;

external CFBagGetCount(
    theBag : CFBagRef) : CLong;

external CFBagGetCountOfValue(
    theBag : CFBagRef,
    value : RawPointer) : CLong;

external CFBagContainsValue(
    theBag : CFBagRef,
    value : RawPointer) : CUChar;

external CFBagGetValue(
    theBag : CFBagRef,
    value : RawPointer) : RawPointer;

external CFBagGetValueIfPresent(
    theBag : CFBagRef,
    candidate : RawPointer,
    value : Pointer[RawPointer]) : CUChar;

external CFBagGetValues(
    theBag : CFBagRef,
    values : Pointer[RawPointer]);

external CFBagApplyFunction(
    theBag : CFBagRef,
    applier : CFBagApplierFunction,
    context : RawPointer);

external CFBagAddValue(
    theBag : CFMutableBagRef,
    value : RawPointer);

external CFBagReplaceValue(
    theBag : CFMutableBagRef,
    value : RawPointer);

external CFBagSetValue(
    theBag : CFMutableBagRef,
    value : RawPointer);

external CFBagRemoveValue(
    theBag : CFMutableBagRef,
    value : RawPointer);

external CFBagRemoveAllValues(
    theBag : CFMutableBagRef);

record UnnamedStruct13 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFBinaryHeapCompareContext = UnnamedStruct13;

record UnnamedStruct14 (
    version : CLong,
    retain : CCodePointer[[OpaquePointer,RawPointer],[RawPointer]],
    release : CCodePointer[[OpaquePointer,RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
    compare : CCodePointer[[RawPointer,RawPointer,RawPointer],[CLong]],
);

alias CFBinaryHeapCallBacks = UnnamedStruct14;

external kCFStringBinaryHeapCallBacks : CFBinaryHeapCallBacks;

alias CFBinaryHeapApplierFunction = CCodePointer[[RawPointer,RawPointer],[]];

alias CFBinaryHeapRef = OpaquePointer;

external CFBinaryHeapGetTypeID() : CULong;

external CFBinaryHeapCreate(
    allocator : CFAllocatorRef,
    capacity : CLong,
    callBacks : Pointer[CFBinaryHeapCallBacks],
    compareContext : Pointer[CFBinaryHeapCompareContext]) : CFBinaryHeapRef;

external CFBinaryHeapCreateCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    heap : CFBinaryHeapRef) : CFBinaryHeapRef;

external CFBinaryHeapGetCount(
    heap : CFBinaryHeapRef) : CLong;

external CFBinaryHeapGetCountOfValue(
    heap : CFBinaryHeapRef,
    value : RawPointer) : CLong;

external CFBinaryHeapContainsValue(
    heap : CFBinaryHeapRef,
    value : RawPointer) : CUChar;

external CFBinaryHeapGetMinimum(
    heap : CFBinaryHeapRef) : RawPointer;

external CFBinaryHeapGetMinimumIfPresent(
    heap : CFBinaryHeapRef,
    value : Pointer[RawPointer]) : CUChar;

external CFBinaryHeapGetValues(
    heap : CFBinaryHeapRef,
    values : Pointer[RawPointer]);

external CFBinaryHeapApplyFunction(
    heap : CFBinaryHeapRef,
    applier : CFBinaryHeapApplierFunction,
    context : RawPointer);

external CFBinaryHeapAddValue(
    heap : CFBinaryHeapRef,
    value : RawPointer);

external CFBinaryHeapRemoveMinimumValue(
    heap : CFBinaryHeapRef);

external CFBinaryHeapRemoveAllValues(
    heap : CFBinaryHeapRef);

alias CFBit = CULong;

alias CFBitVectorRef = OpaquePointer;

alias CFMutableBitVectorRef = OpaquePointer;

external CFBitVectorGetTypeID() : CULong;

external CFBitVectorCreate(
    allocator : CFAllocatorRef,
    bytes : Pointer[CUChar],
    numBits : CLong) : CFBitVectorRef;

external CFBitVectorCreateCopy(
    allocator : CFAllocatorRef,
    bv : CFBitVectorRef) : CFBitVectorRef;

external CFBitVectorCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong) : CFMutableBitVectorRef;

external CFBitVectorCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    bv : CFBitVectorRef) : CFMutableBitVectorRef;

external CFBitVectorGetCount(
    bv : CFBitVectorRef) : CLong;

external CFBitVectorGetCountOfBit(
    bv : CFBitVectorRef,
    range : CFRange,
    value : CULong) : CLong;

external CFBitVectorContainsBit(
    bv : CFBitVectorRef,
    range : CFRange,
    value : CULong) : CUChar;

external CFBitVectorGetBitAtIndex(
    bv : CFBitVectorRef,
    idx : CLong) : CULong;

external CFBitVectorGetBits(
    bv : CFBitVectorRef,
    range : CFRange,
    bytes : Pointer[CUChar]);

external CFBitVectorGetFirstIndexOfBit(
    bv : CFBitVectorRef,
    range : CFRange,
    value : CULong) : CLong;

external CFBitVectorGetLastIndexOfBit(
    bv : CFBitVectorRef,
    range : CFRange,
    value : CULong) : CLong;

external CFBitVectorSetCount(
    bv : CFMutableBitVectorRef,
    count : CLong);

external CFBitVectorFlipBitAtIndex(
    bv : CFMutableBitVectorRef,
    idx : CLong);

external CFBitVectorFlipBits(
    bv : CFMutableBitVectorRef,
    range : CFRange);

external CFBitVectorSetBitAtIndex(
    bv : CFMutableBitVectorRef,
    idx : CLong,
    value : CULong);

external CFBitVectorSetBits(
    bv : CFMutableBitVectorRef,
    range : CFRange,
    value : CULong);

external CFBitVectorSetAllBits(
    bv : CFMutableBitVectorRef,
    value : CULong);

alias CFDictionaryRetainCallBack = CCodePointer[[OpaquePointer,RawPointer],[RawPointer]];

alias CFDictionaryReleaseCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

alias CFDictionaryCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

alias CFDictionaryEqualCallBack = CCodePointer[[RawPointer,RawPointer],[CUChar]];

alias CFDictionaryHashCallBack = CCodePointer[[RawPointer],[CULong]];

record UnnamedStruct15 (
    version : CLong,
    retain : CFDictionaryRetainCallBack,
    release : CFDictionaryReleaseCallBack,
    copyDescription : CFDictionaryCopyDescriptionCallBack,
    equal : CFDictionaryEqualCallBack,
    hash : CFDictionaryHashCallBack,
);

alias CFDictionaryKeyCallBacks = UnnamedStruct15;

external kCFTypeDictionaryKeyCallBacks : CFDictionaryKeyCallBacks;

external kCFCopyStringDictionaryKeyCallBacks : CFDictionaryKeyCallBacks;

record UnnamedStruct16 (
    version : CLong,
    retain : CFDictionaryRetainCallBack,
    release : CFDictionaryReleaseCallBack,
    copyDescription : CFDictionaryCopyDescriptionCallBack,
    equal : CFDictionaryEqualCallBack,
);

alias CFDictionaryValueCallBacks = UnnamedStruct16;

external kCFTypeDictionaryValueCallBacks : CFDictionaryValueCallBacks;

alias CFDictionaryApplierFunction = CCodePointer[[RawPointer,RawPointer,RawPointer],[]];

alias CFDictionaryRef = OpaquePointer;

alias CFMutableDictionaryRef = OpaquePointer;

external CFDictionaryGetTypeID() : CULong;

external CFDictionaryCreate(
    allocator : CFAllocatorRef,
    keys : Pointer[RawPointer],
    values : Pointer[RawPointer],
    numValues : CLong,
    keyCallBacks : Pointer[CFDictionaryKeyCallBacks],
    valueCallBacks : Pointer[CFDictionaryValueCallBacks]) : CFDictionaryRef;

external CFDictionaryCreateCopy(
    allocator : CFAllocatorRef,
    theDict : CFDictionaryRef) : CFDictionaryRef;

external CFDictionaryCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong,
    keyCallBacks : Pointer[CFDictionaryKeyCallBacks],
    valueCallBacks : Pointer[CFDictionaryValueCallBacks]) : CFMutableDictionaryRef;

external CFDictionaryCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    theDict : CFDictionaryRef) : CFMutableDictionaryRef;

external CFDictionaryGetCount(
    theDict : CFDictionaryRef) : CLong;

external CFDictionaryGetCountOfKey(
    theDict : CFDictionaryRef,
    key : RawPointer) : CLong;

external CFDictionaryGetCountOfValue(
    theDict : CFDictionaryRef,
    value : RawPointer) : CLong;

external CFDictionaryContainsKey(
    theDict : CFDictionaryRef,
    key : RawPointer) : CUChar;

external CFDictionaryContainsValue(
    theDict : CFDictionaryRef,
    value : RawPointer) : CUChar;

external CFDictionaryGetValue(
    theDict : CFDictionaryRef,
    key : RawPointer) : RawPointer;

external CFDictionaryGetValueIfPresent(
    theDict : CFDictionaryRef,
    key : RawPointer,
    value : Pointer[RawPointer]) : CUChar;

external CFDictionaryGetKeysAndValues(
    theDict : CFDictionaryRef,
    keys : Pointer[RawPointer],
    values : Pointer[RawPointer]);

external CFDictionaryApplyFunction(
    theDict : CFDictionaryRef,
    applier : CFDictionaryApplierFunction,
    context : RawPointer);

external CFDictionaryAddValue(
    theDict : CFMutableDictionaryRef,
    key : RawPointer,
    value : RawPointer);

external CFDictionarySetValue(
    theDict : CFMutableDictionaryRef,
    key : RawPointer,
    value : RawPointer);

external CFDictionaryReplaceValue(
    theDict : CFMutableDictionaryRef,
    key : RawPointer,
    value : RawPointer);

external CFDictionaryRemoveValue(
    theDict : CFMutableDictionaryRef,
    key : RawPointer);

external CFDictionaryRemoveAllValues(
    theDict : CFMutableDictionaryRef);

alias CFDataRef = OpaquePointer;

alias CFMutableDataRef = OpaquePointer;

external CFDataGetTypeID() : CULong;

external CFDataCreate(
    allocator : CFAllocatorRef,
    bytes : Pointer[CUChar],
    length : CLong) : CFDataRef;

external CFDataCreateWithBytesNoCopy(
    allocator : CFAllocatorRef,
    bytes : Pointer[CUChar],
    length : CLong,
    bytesDeallocator : CFAllocatorRef) : CFDataRef;

external CFDataCreateCopy(
    allocator : CFAllocatorRef,
    theData : CFDataRef) : CFDataRef;

external CFDataCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong) : CFMutableDataRef;

external CFDataCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    theData : CFDataRef) : CFMutableDataRef;

external CFDataGetLength(
    theData : CFDataRef) : CLong;

external CFDataGetBytePtr(
    theData : CFDataRef) : Pointer[CUChar];

external CFDataGetMutableBytePtr(
    theData : CFMutableDataRef) : Pointer[CUChar];

external CFDataGetBytes(
    theData : CFDataRef,
    range : CFRange,
    buffer : Pointer[CUChar]);

external CFDataSetLength(
    theData : CFMutableDataRef,
    length : CLong);

external CFDataIncreaseLength(
    theData : CFMutableDataRef,
    extraLength : CLong);

external CFDataAppendBytes(
    theData : CFMutableDataRef,
    bytes : Pointer[CUChar],
    length : CLong);

external CFDataReplaceBytes(
    theData : CFMutableDataRef,
    range : CFRange,
    newBytes : Pointer[CUChar],
    newLength : CLong);

external CFDataDeleteBytes(
    theData : CFMutableDataRef,
    range : CFRange);

alias kCFDataSearchBackwards = 1;
alias kCFDataSearchAnchored = 2;

alias CFDataSearchFlags = CULong;

external CFDataFind(
    theData : CFDataRef,
    dataToFind : CFDataRef,
    searchRange : CFRange,
    compareOptions : CULong) : CFRange;

alias CFCharacterSetRef = OpaquePointer;

alias CFMutableCharacterSetRef = OpaquePointer;

alias kCFCharacterSetControl = 1;
alias kCFCharacterSetWhitespace = 2;
alias kCFCharacterSetWhitespaceAndNewline = 3;
alias kCFCharacterSetDecimalDigit = 4;
alias kCFCharacterSetLetter = 5;
alias kCFCharacterSetLowercaseLetter = 6;
alias kCFCharacterSetUppercaseLetter = 7;
alias kCFCharacterSetNonBase = 8;
alias kCFCharacterSetDecomposable = 9;
alias kCFCharacterSetAlphaNumeric = 10;
alias kCFCharacterSetPunctuation = 11;
alias kCFCharacterSetCapitalizedLetter = 13;
alias kCFCharacterSetSymbol = 14;
alias kCFCharacterSetNewline = 15;
alias kCFCharacterSetIllegal = 12;

alias CFCharacterSetPredefinedSet = CLong;

external CFCharacterSetGetTypeID() : CULong;

external CFCharacterSetGetPredefined(
    theSetIdentifier : CLong) : CFCharacterSetRef;

external CFCharacterSetCreateWithCharactersInRange(
    alloc : CFAllocatorRef,
    theRange : CFRange) : CFCharacterSetRef;

external CFCharacterSetCreateWithCharactersInString(
    alloc : CFAllocatorRef,
    theString : CFStringRef) : CFCharacterSetRef;

external CFCharacterSetCreateWithBitmapRepresentation(
    alloc : CFAllocatorRef,
    theData : CFDataRef) : CFCharacterSetRef;

external CFCharacterSetCreateInvertedSet(
    alloc : CFAllocatorRef,
    theSet : CFCharacterSetRef) : CFCharacterSetRef;

external CFCharacterSetIsSupersetOfSet(
    theSet : CFCharacterSetRef,
    theOtherset : CFCharacterSetRef) : CUChar;

external CFCharacterSetHasMemberInPlane(
    theSet : CFCharacterSetRef,
    thePlane : CLong) : CUChar;

external CFCharacterSetCreateMutable(
    alloc : CFAllocatorRef) : CFMutableCharacterSetRef;

external CFCharacterSetCreateCopy(
    alloc : CFAllocatorRef,
    theSet : CFCharacterSetRef) : CFCharacterSetRef;

external CFCharacterSetCreateMutableCopy(
    alloc : CFAllocatorRef,
    theSet : CFCharacterSetRef) : CFMutableCharacterSetRef;

external CFCharacterSetIsCharacterMember(
    theSet : CFCharacterSetRef,
    theChar : UShort) : CUChar;

external CFCharacterSetIsLongCharacterMember(
    theSet : CFCharacterSetRef,
    theChar : CULong) : CUChar;

external CFCharacterSetCreateBitmapRepresentation(
    alloc : CFAllocatorRef,
    theSet : CFCharacterSetRef) : CFDataRef;

external CFCharacterSetAddCharactersInRange(
    theSet : CFMutableCharacterSetRef,
    theRange : CFRange);

external CFCharacterSetRemoveCharactersInRange(
    theSet : CFMutableCharacterSetRef,
    theRange : CFRange);

external CFCharacterSetAddCharactersInString(
    theSet : CFMutableCharacterSetRef,
    theString : CFStringRef);

external CFCharacterSetRemoveCharactersInString(
    theSet : CFMutableCharacterSetRef,
    theString : CFStringRef);

external CFCharacterSetUnion(
    theSet : CFMutableCharacterSetRef,
    theOtherSet : CFCharacterSetRef);

external CFCharacterSetIntersect(
    theSet : CFMutableCharacterSetRef,
    theOtherSet : CFCharacterSetRef);

external CFCharacterSetInvert(
    theSet : CFMutableCharacterSetRef);

alias CFLocaleRef = OpaquePointer;

external CFLocaleGetTypeID() : CULong;

external CFLocaleGetSystem() : CFLocaleRef;

external CFLocaleCopyCurrent() : CFLocaleRef;

external CFLocaleCopyAvailableLocaleIdentifiers() : CFArrayRef;

external CFLocaleCopyISOLanguageCodes() : CFArrayRef;

external CFLocaleCopyISOCountryCodes() : CFArrayRef;

external CFLocaleCopyISOCurrencyCodes() : CFArrayRef;

external CFLocaleCopyCommonISOCurrencyCodes() : CFArrayRef;

external CFLocaleCopyPreferredLanguages() : CFArrayRef;

external CFLocaleCreateCanonicalLanguageIdentifierFromString(
    allocator : CFAllocatorRef,
    localeIdentifier : CFStringRef) : CFStringRef;

external CFLocaleCreateCanonicalLocaleIdentifierFromString(
    allocator : CFAllocatorRef,
    localeIdentifier : CFStringRef) : CFStringRef;

external CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
    allocator : CFAllocatorRef,
    lcode : Short,
    rcode : Short) : CFStringRef;

external CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
    allocator : CFAllocatorRef,
    lcid : UInt) : CFStringRef;

external CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
    localeIdentifier : CFStringRef) : UInt;

alias kCFLocaleLanguageDirectionUnknown = 0;
alias kCFLocaleLanguageDirectionLeftToRight = 1;
alias kCFLocaleLanguageDirectionRightToLeft = 2;
alias kCFLocaleLanguageDirectionTopToBottom = 3;
alias kCFLocaleLanguageDirectionBottomToTop = 4;

alias CFLocaleLanguageDirection = CLong;

external CFLocaleGetLanguageCharacterDirection(
    isoLangCode : CFStringRef) : CLong;

external CFLocaleGetLanguageLineDirection(
    isoLangCode : CFStringRef) : CLong;

external CFLocaleCreateComponentsFromLocaleIdentifier(
    allocator : CFAllocatorRef,
    localeID : CFStringRef) : CFDictionaryRef;

external CFLocaleCreateLocaleIdentifierFromComponents(
    allocator : CFAllocatorRef,
    dictionary : CFDictionaryRef) : CFStringRef;

external CFLocaleCreate(
    allocator : CFAllocatorRef,
    localeIdentifier : CFStringRef) : CFLocaleRef;

external CFLocaleCreateCopy(
    allocator : CFAllocatorRef,
    locale : CFLocaleRef) : CFLocaleRef;

external CFLocaleGetIdentifier(
    locale : CFLocaleRef) : CFStringRef;

external CFLocaleGetValue(
    locale : CFLocaleRef,
    key : CFStringRef) : CFTypeRef;

external CFLocaleCopyDisplayNameForPropertyValue(
    displayLocale : CFLocaleRef,
    key : CFStringRef,
    value : CFStringRef) : CFStringRef;

external kCFLocaleCurrentLocaleDidChangeNotification : CFStringRef;

external kCFLocaleIdentifier : CFStringRef;

external kCFLocaleLanguageCode : CFStringRef;

external kCFLocaleCountryCode : CFStringRef;

external kCFLocaleScriptCode : CFStringRef;

external kCFLocaleVariantCode : CFStringRef;

external kCFLocaleExemplarCharacterSet : CFStringRef;

external kCFLocaleCalendarIdentifier : CFStringRef;

external kCFLocaleCalendar : CFStringRef;

external kCFLocaleCollationIdentifier : CFStringRef;

external kCFLocaleUsesMetricSystem : CFStringRef;

external kCFLocaleMeasurementSystem : CFStringRef;

external kCFLocaleDecimalSeparator : CFStringRef;

external kCFLocaleGroupingSeparator : CFStringRef;

external kCFLocaleCurrencySymbol : CFStringRef;

external kCFLocaleCurrencyCode : CFStringRef;

external kCFLocaleCollatorIdentifier : CFStringRef;

external kCFLocaleQuotationBeginDelimiterKey : CFStringRef;

external kCFLocaleQuotationEndDelimiterKey : CFStringRef;

external kCFLocaleAlternateQuotationBeginDelimiterKey : CFStringRef;

external kCFLocaleAlternateQuotationEndDelimiterKey : CFStringRef;

external kCFGregorianCalendar : CFStringRef;

external kCFBuddhistCalendar : CFStringRef;

external kCFChineseCalendar : CFStringRef;

external kCFHebrewCalendar : CFStringRef;

external kCFIslamicCalendar : CFStringRef;

external kCFIslamicCivilCalendar : CFStringRef;

external kCFJapaneseCalendar : CFStringRef;

external kCFRepublicOfChinaCalendar : CFStringRef;

external kCFPersianCalendar : CFStringRef;

external kCFIndianCalendar : CFStringRef;

external kCFISO8601Calendar : CFStringRef;

alias CFStringEncoding = CULong;

alias kCFStringEncodingMacRoman = 0;
alias kCFStringEncodingWindowsLatin1 = 1280;
alias kCFStringEncodingISOLatin1 = 513;
alias kCFStringEncodingNextStepLatin = 2817;
alias kCFStringEncodingASCII = 1536;
alias kCFStringEncodingUnicode = 256;
alias kCFStringEncodingUTF8 = 134217984;
alias kCFStringEncodingNonLossyASCII = 3071;
alias kCFStringEncodingUTF16 = 256;
alias kCFStringEncodingUTF16BE = 268435712;
alias kCFStringEncodingUTF16LE = 335544576;
alias kCFStringEncodingUTF32 = 201326848;
alias kCFStringEncodingUTF32BE = 402653440;
alias kCFStringEncodingUTF32LE = 469762304;

alias CFStringBuiltInEncodings = CULong;

external CFStringGetTypeID() : CULong;

external CFStringCreateWithPascalString(
    alloc : CFAllocatorRef,
    pStr : ConstStr255Param,
    encoding : CULong) : CFStringRef;

external CFStringCreateWithCString(
    alloc : CFAllocatorRef,
    cStr : Pointer[CChar],
    encoding : CULong) : CFStringRef;

external CFStringCreateWithBytes(
    alloc : CFAllocatorRef,
    bytes : Pointer[CUChar],
    numBytes : CLong,
    encoding : CULong,
    isExternalRepresentation : CUChar) : CFStringRef;

external CFStringCreateWithCharacters(
    alloc : CFAllocatorRef,
    chars : Pointer[UShort],
    numChars : CLong) : CFStringRef;

external CFStringCreateWithPascalStringNoCopy(
    alloc : CFAllocatorRef,
    pStr : ConstStr255Param,
    encoding : CULong,
    contentsDeallocator : CFAllocatorRef) : CFStringRef;

external CFStringCreateWithCStringNoCopy(
    alloc : CFAllocatorRef,
    cStr : Pointer[CChar],
    encoding : CULong,
    contentsDeallocator : CFAllocatorRef) : CFStringRef;

external CFStringCreateWithBytesNoCopy(
    alloc : CFAllocatorRef,
    bytes : Pointer[CUChar],
    numBytes : CLong,
    encoding : CULong,
    isExternalRepresentation : CUChar,
    contentsDeallocator : CFAllocatorRef) : CFStringRef;

external CFStringCreateWithCharactersNoCopy(
    alloc : CFAllocatorRef,
    chars : Pointer[UShort],
    numChars : CLong,
    contentsDeallocator : CFAllocatorRef) : CFStringRef;

external CFStringCreateWithSubstring(
    alloc : CFAllocatorRef,
    str : CFStringRef,
    range : CFRange) : CFStringRef;

external CFStringCreateCopy(
    alloc : CFAllocatorRef,
    theString : CFStringRef) : CFStringRef;

external CFStringCreateWithFormat(
    alloc : CFAllocatorRef,
    formatOptions : CFDictionaryRef,
    format : CFStringRef,
    ..) : CFStringRef;

external CFStringCreateWithFormatAndArguments(
    alloc : CFAllocatorRef,
    formatOptions : CFDictionaryRef,
    format : CFStringRef,
    arguments : va_list) : CFStringRef;

external CFStringCreateMutable(
    alloc : CFAllocatorRef,
    maxLength : CLong) : CFMutableStringRef;

external CFStringCreateMutableCopy(
    alloc : CFAllocatorRef,
    maxLength : CLong,
    theString : CFStringRef) : CFMutableStringRef;

external CFStringCreateMutableWithExternalCharactersNoCopy(
    alloc : CFAllocatorRef,
    chars : Pointer[UShort],
    numChars : CLong,
    capacity : CLong,
    externalCharactersAllocator : CFAllocatorRef) : CFMutableStringRef;

external CFStringGetLength(
    theString : CFStringRef) : CLong;

external CFStringGetCharacterAtIndex(
    theString : CFStringRef,
    idx : CLong) : UShort;

external CFStringGetCharacters(
    theString : CFStringRef,
    range : CFRange,
    buffer : Pointer[UShort]);

external CFStringGetPascalString(
    theString : CFStringRef,
    buffer : StringPtr,
    bufferSize : CLong,
    encoding : CULong) : CUChar;

external CFStringGetCString(
    theString : CFStringRef,
    buffer : Pointer[CChar],
    bufferSize : CLong,
    encoding : CULong) : CUChar;

external CFStringGetPascalStringPtr(
    theString : CFStringRef,
    encoding : CULong) : ConstStringPtr;

external CFStringGetCStringPtr(
    theString : CFStringRef,
    encoding : CULong) : Pointer[CChar];

external CFStringGetCharactersPtr(
    theString : CFStringRef) : Pointer[UShort];

external CFStringGetBytes(
    theString : CFStringRef,
    range : CFRange,
    encoding : CULong,
    lossByte : CUChar,
    isExternalRepresentation : CUChar,
    buffer : Pointer[CUChar],
    maxBufLen : CLong,
    usedBufLen : Pointer[CLong]) : CLong;

external CFStringCreateFromExternalRepresentation(
    alloc : CFAllocatorRef,
    data : CFDataRef,
    encoding : CULong) : CFStringRef;

external CFStringCreateExternalRepresentation(
    alloc : CFAllocatorRef,
    theString : CFStringRef,
    encoding : CULong,
    lossByte : CUChar) : CFDataRef;

external CFStringGetSmallestEncoding(
    theString : CFStringRef) : CULong;

external CFStringGetFastestEncoding(
    theString : CFStringRef) : CULong;

external CFStringGetSystemEncoding() : CULong;

external CFStringGetMaximumSizeForEncoding(
    length : CLong,
    encoding : CULong) : CLong;

external CFStringGetFileSystemRepresentation(
    string : CFStringRef,
    buffer : Pointer[CChar],
    maxBufLen : CLong) : CUChar;

external CFStringGetMaximumSizeOfFileSystemRepresentation(
    string : CFStringRef) : CLong;

external CFStringCreateWithFileSystemRepresentation(
    alloc : CFAllocatorRef,
    buffer : Pointer[CChar]) : CFStringRef;

alias kCFCompareCaseInsensitive = 1;
alias kCFCompareBackwards = 4;
alias kCFCompareAnchored = 8;
alias kCFCompareNonliteral = 16;
alias kCFCompareLocalized = 32;
alias kCFCompareNumerically = 64;
alias kCFCompareDiacriticInsensitive = 128;
alias kCFCompareWidthInsensitive = 256;
alias kCFCompareForcedOrdering = 512;

alias CFStringCompareFlags = CULong;

external CFStringCompareWithOptionsAndLocale(
    theString1 : CFStringRef,
    theString2 : CFStringRef,
    rangeToCompare : CFRange,
    compareOptions : CULong,
    locale : CFLocaleRef) : CLong;

external CFStringCompareWithOptions(
    theString1 : CFStringRef,
    theString2 : CFStringRef,
    rangeToCompare : CFRange,
    compareOptions : CULong) : CLong;

external CFStringCompare(
    theString1 : CFStringRef,
    theString2 : CFStringRef,
    compareOptions : CULong) : CLong;

external CFStringFindWithOptionsAndLocale(
    theString : CFStringRef,
    stringToFind : CFStringRef,
    rangeToSearch : CFRange,
    searchOptions : CULong,
    locale : CFLocaleRef,
    result : Pointer[CFRange]) : CUChar;

external CFStringFindWithOptions(
    theString : CFStringRef,
    stringToFind : CFStringRef,
    rangeToSearch : CFRange,
    searchOptions : CULong,
    result : Pointer[CFRange]) : CUChar;

external CFStringCreateArrayWithFindResults(
    alloc : CFAllocatorRef,
    theString : CFStringRef,
    stringToFind : CFStringRef,
    rangeToSearch : CFRange,
    compareOptions : CULong) : CFArrayRef;

external CFStringFind(
    theString : CFStringRef,
    stringToFind : CFStringRef,
    compareOptions : CULong) : CFRange;

external CFStringHasPrefix(
    theString : CFStringRef,
    prefix : CFStringRef) : CUChar;

external CFStringHasSuffix(
    theString : CFStringRef,
    suffix : CFStringRef) : CUChar;

external CFStringGetRangeOfComposedCharactersAtIndex(
    theString : CFStringRef,
    theIndex : CLong) : CFRange;

external CFStringFindCharacterFromSet(
    theString : CFStringRef,
    theSet : CFCharacterSetRef,
    rangeToSearch : CFRange,
    searchOptions : CULong,
    result : Pointer[CFRange]) : CUChar;

external CFStringGetLineBounds(
    theString : CFStringRef,
    range : CFRange,
    lineBeginIndex : Pointer[CLong],
    lineEndIndex : Pointer[CLong],
    contentsEndIndex : Pointer[CLong]);

external CFStringGetParagraphBounds(
    string : CFStringRef,
    range : CFRange,
    parBeginIndex : Pointer[CLong],
    parEndIndex : Pointer[CLong],
    contentsEndIndex : Pointer[CLong]);

external CFStringCreateByCombiningStrings(
    alloc : CFAllocatorRef,
    theArray : CFArrayRef,
    separatorString : CFStringRef) : CFStringRef;

external CFStringCreateArrayBySeparatingStrings(
    alloc : CFAllocatorRef,
    theString : CFStringRef,
    separatorString : CFStringRef) : CFArrayRef;

external CFStringGetIntValue(
    str : CFStringRef) : CLong;

external CFStringGetDoubleValue(
    str : CFStringRef) : Double;

external CFStringAppend(
    theString : CFMutableStringRef,
    appendedString : CFStringRef);

external CFStringAppendCharacters(
    theString : CFMutableStringRef,
    chars : Pointer[UShort],
    numChars : CLong);

external CFStringAppendPascalString(
    theString : CFMutableStringRef,
    pStr : ConstStr255Param,
    encoding : CULong);

external CFStringAppendCString(
    theString : CFMutableStringRef,
    cStr : Pointer[CChar],
    encoding : CULong);

external CFStringAppendFormat(
    theString : CFMutableStringRef,
    formatOptions : CFDictionaryRef,
    format : CFStringRef,
    ..);

external CFStringAppendFormatAndArguments(
    theString : CFMutableStringRef,
    formatOptions : CFDictionaryRef,
    format : CFStringRef,
    arguments : va_list);

external CFStringInsert(
    str : CFMutableStringRef,
    idx : CLong,
    insertedStr : CFStringRef);

external CFStringDelete(
    theString : CFMutableStringRef,
    range : CFRange);

external CFStringReplace(
    theString : CFMutableStringRef,
    range : CFRange,
    replacement : CFStringRef);

external CFStringReplaceAll(
    theString : CFMutableStringRef,
    replacement : CFStringRef);

external CFStringFindAndReplace(
    theString : CFMutableStringRef,
    stringToFind : CFStringRef,
    replacementString : CFStringRef,
    rangeToSearch : CFRange,
    compareOptions : CULong) : CLong;

external CFStringSetExternalCharactersNoCopy(
    theString : CFMutableStringRef,
    chars : Pointer[UShort],
    length : CLong,
    capacity : CLong);

external CFStringPad(
    theString : CFMutableStringRef,
    padString : CFStringRef,
    length : CLong,
    indexIntoPad : CLong);

external CFStringTrim(
    theString : CFMutableStringRef,
    trimString : CFStringRef);

external CFStringTrimWhitespace(
    theString : CFMutableStringRef);

external CFStringLowercase(
    theString : CFMutableStringRef,
    locale : CFLocaleRef);

external CFStringUppercase(
    theString : CFMutableStringRef,
    locale : CFLocaleRef);

external CFStringCapitalize(
    theString : CFMutableStringRef,
    locale : CFLocaleRef);

alias kCFStringNormalizationFormD = 0;
alias kCFStringNormalizationFormKD = 1;
alias kCFStringNormalizationFormC = 2;
alias kCFStringNormalizationFormKC = 3;

alias CFStringNormalizationForm = CLong;

external CFStringNormalize(
    theString : CFMutableStringRef,
    theForm : CLong);

external CFStringFold(
    theString : CFMutableStringRef,
    theFlags : CULong,
    theLocale : CFLocaleRef);

external CFStringTransform(
    string : CFMutableStringRef,
    range : Pointer[CFRange],
    transform : CFStringRef,
    reverse : CUChar) : CUChar;

external kCFStringTransformStripCombiningMarks : CFStringRef;

external kCFStringTransformToLatin : CFStringRef;

external kCFStringTransformFullwidthHalfwidth : CFStringRef;

external kCFStringTransformLatinKatakana : CFStringRef;

external kCFStringTransformLatinHiragana : CFStringRef;

external kCFStringTransformHiraganaKatakana : CFStringRef;

external kCFStringTransformMandarinLatin : CFStringRef;

external kCFStringTransformLatinHangul : CFStringRef;

external kCFStringTransformLatinArabic : CFStringRef;

external kCFStringTransformLatinHebrew : CFStringRef;

external kCFStringTransformLatinThai : CFStringRef;

external kCFStringTransformLatinCyrillic : CFStringRef;

external kCFStringTransformLatinGreek : CFStringRef;

external kCFStringTransformToXMLHex : CFStringRef;

external kCFStringTransformToUnicodeName : CFStringRef;

external kCFStringTransformStripDiacritics : CFStringRef;

external CFStringIsEncodingAvailable(
    encoding : CULong) : CUChar;

external CFStringGetListOfAvailableEncodings() : Pointer[CULong];

external CFStringGetNameOfEncoding(
    encoding : CULong) : CFStringRef;

external CFStringConvertEncodingToNSStringEncoding(
    encoding : CULong) : CULong;

external CFStringConvertNSStringEncodingToEncoding(
    encoding : CULong) : CULong;

external CFStringConvertEncodingToWindowsCodepage(
    encoding : CULong) : CULong;

external CFStringConvertWindowsCodepageToEncoding(
    codepage : CULong) : CULong;

external CFStringConvertIANACharSetNameToEncoding(
    theString : CFStringRef) : CULong;

external CFStringConvertEncodingToIANACharSetName(
    encoding : CULong) : CFStringRef;

external CFStringGetMostCompatibleMacStringEncoding(
    encoding : CULong) : CULong;

record UnnamedStruct17 (
    buffer : Array[UShort,64],
    theString : CFStringRef,
    directBuffer : Pointer[UShort],
    rangeToBuffer : CFRange,
    bufferedRangeStart : CLong,
    bufferedRangeEnd : CLong,
);

alias CFStringInlineBuffer = UnnamedStruct17;

external CFShow(
    obj : CFTypeRef);

external CFShowStr(
    str : CFStringRef);

external __CFStringMakeConstantString(
    cStr : Pointer[CChar]) : CFStringRef;

alias CFErrorRef = OpaquePointer;

external CFErrorGetTypeID() : CULong;

external kCFErrorDomainPOSIX : CFStringRef;

external kCFErrorDomainOSStatus : CFStringRef;

external kCFErrorDomainMach : CFStringRef;

external kCFErrorDomainCocoa : CFStringRef;

external kCFErrorLocalizedDescriptionKey : CFStringRef;

external kCFErrorLocalizedFailureReasonKey : CFStringRef;

external kCFErrorLocalizedRecoverySuggestionKey : CFStringRef;

external kCFErrorDescriptionKey : CFStringRef;

external kCFErrorUnderlyingErrorKey : CFStringRef;

external CFErrorCreate(
    allocator : CFAllocatorRef,
    domain : CFStringRef,
    code : CLong,
    userInfo : CFDictionaryRef) : CFErrorRef;

external CFErrorCreateWithUserInfoKeysAndValues(
    allocator : CFAllocatorRef,
    domain : CFStringRef,
    code : CLong,
    userInfoKeys : Pointer[RawPointer],
    userInfoValues : Pointer[RawPointer],
    numUserInfoValues : CLong) : CFErrorRef;

external CFErrorGetDomain(
    err : CFErrorRef) : CFStringRef;

external CFErrorGetCode(
    err : CFErrorRef) : CLong;

external CFErrorCopyUserInfo(
    err : CFErrorRef) : CFDictionaryRef;

external CFErrorCopyDescription(
    err : CFErrorRef) : CFStringRef;

external CFErrorCopyFailureReason(
    err : CFErrorRef) : CFStringRef;

external CFErrorCopyRecoverySuggestion(
    err : CFErrorRef) : CFStringRef;

alias kCFURLPOSIXPathStyle = 0;
alias kCFURLHFSPathStyle = 1;
alias kCFURLWindowsPathStyle = 2;

alias CFURLPathStyle = CLong;

alias CFURLRef = OpaquePointer;

external CFURLGetTypeID() : CULong;

external CFURLCreateWithBytes(
    allocator : CFAllocatorRef,
    URLBytes : Pointer[CUChar],
    length : CLong,
    encoding : CULong,
    baseURL : CFURLRef) : CFURLRef;

external CFURLCreateData(
    allocator : CFAllocatorRef,
    url : CFURLRef,
    encoding : CULong,
    escapeWhitespace : CUChar) : CFDataRef;

external CFURLCreateWithString(
    allocator : CFAllocatorRef,
    URLString : CFStringRef,
    baseURL : CFURLRef) : CFURLRef;

external CFURLCreateAbsoluteURLWithBytes(
    alloc : CFAllocatorRef,
    relativeURLBytes : Pointer[CUChar],
    length : CLong,
    encoding : CULong,
    baseURL : CFURLRef,
    useCompatibilityMode : CUChar) : CFURLRef;

external CFURLCreateWithFileSystemPath(
    allocator : CFAllocatorRef,
    filePath : CFStringRef,
    pathStyle : CLong,
    isDirectory : CUChar) : CFURLRef;

external CFURLCreateFromFileSystemRepresentation(
    allocator : CFAllocatorRef,
    buffer : Pointer[CUChar],
    bufLen : CLong,
    isDirectory : CUChar) : CFURLRef;

external CFURLCreateWithFileSystemPathRelativeToBase(
    allocator : CFAllocatorRef,
    filePath : CFStringRef,
    pathStyle : CLong,
    isDirectory : CUChar,
    baseURL : CFURLRef) : CFURLRef;

external CFURLCreateFromFileSystemRepresentationRelativeToBase(
    allocator : CFAllocatorRef,
    buffer : Pointer[CUChar],
    bufLen : CLong,
    isDirectory : CUChar,
    baseURL : CFURLRef) : CFURLRef;

external CFURLGetFileSystemRepresentation(
    url : CFURLRef,
    resolveAgainstBase : CUChar,
    buffer : Pointer[CUChar],
    maxBufLen : CLong) : CUChar;

external CFURLCopyAbsoluteURL(
    relativeURL : CFURLRef) : CFURLRef;

external CFURLGetString(
    anURL : CFURLRef) : CFStringRef;

external CFURLGetBaseURL(
    anURL : CFURLRef) : CFURLRef;

external CFURLCanBeDecomposed(
    anURL : CFURLRef) : CUChar;

external CFURLCopyScheme(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyNetLocation(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyPath(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyStrictPath(
    anURL : CFURLRef,
    isAbsolute : Pointer[CUChar]) : CFStringRef;

external CFURLCopyFileSystemPath(
    anURL : CFURLRef,
    pathStyle : CLong) : CFStringRef;

external CFURLHasDirectoryPath(
    anURL : CFURLRef) : CUChar;

external CFURLCopyResourceSpecifier(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyHostName(
    anURL : CFURLRef) : CFStringRef;

external CFURLGetPortNumber(
    anURL : CFURLRef) : CLong;

external CFURLCopyUserName(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyPassword(
    anURL : CFURLRef) : CFStringRef;

external CFURLCopyParameterString(
    anURL : CFURLRef,
    charactersToLeaveEscaped : CFStringRef) : CFStringRef;

external CFURLCopyQueryString(
    anURL : CFURLRef,
    charactersToLeaveEscaped : CFStringRef) : CFStringRef;

external CFURLCopyFragment(
    anURL : CFURLRef,
    charactersToLeaveEscaped : CFStringRef) : CFStringRef;

external CFURLCopyLastPathComponent(
    url : CFURLRef) : CFStringRef;

external CFURLCopyPathExtension(
    url : CFURLRef) : CFStringRef;

external CFURLCreateCopyAppendingPathComponent(
    allocator : CFAllocatorRef,
    url : CFURLRef,
    pathComponent : CFStringRef,
    isDirectory : CUChar) : CFURLRef;

external CFURLCreateCopyDeletingLastPathComponent(
    allocator : CFAllocatorRef,
    url : CFURLRef) : CFURLRef;

external CFURLCreateCopyAppendingPathExtension(
    allocator : CFAllocatorRef,
    url : CFURLRef,
    extension : CFStringRef) : CFURLRef;

external CFURLCreateCopyDeletingPathExtension(
    allocator : CFAllocatorRef,
    url : CFURLRef) : CFURLRef;

external CFURLGetBytes(
    url : CFURLRef,
    buffer : Pointer[CUChar],
    bufferLength : CLong) : CLong;

alias kCFURLComponentScheme = 1;
alias kCFURLComponentNetLocation = 2;
alias kCFURLComponentPath = 3;
alias kCFURLComponentResourceSpecifier = 4;
alias kCFURLComponentUser = 5;
alias kCFURLComponentPassword = 6;
alias kCFURLComponentUserInfo = 7;
alias kCFURLComponentHost = 8;
alias kCFURLComponentPort = 9;
alias kCFURLComponentParameterString = 10;
alias kCFURLComponentQuery = 11;
alias kCFURLComponentFragment = 12;

alias CFURLComponentType = CLong;

external CFURLGetByteRangeForComponent(
    url : CFURLRef,
    component : CLong,
    rangeIncludingSeparators : Pointer[CFRange]) : CFRange;

external CFURLCreateStringByReplacingPercentEscapes(
    allocator : CFAllocatorRef,
    originalString : CFStringRef,
    charactersToLeaveEscaped : CFStringRef) : CFStringRef;

external CFURLCreateStringByReplacingPercentEscapesUsingEncoding(
    allocator : CFAllocatorRef,
    origString : CFStringRef,
    charsToLeaveEscaped : CFStringRef,
    encoding : CULong) : CFStringRef;

external CFURLCreateStringByAddingPercentEscapes(
    allocator : CFAllocatorRef,
    originalString : CFStringRef,
    charactersToLeaveUnescaped : CFStringRef,
    legalURLCharactersToBeEscaped : CFStringRef,
    encoding : CULong) : CFStringRef;

external CFURLCreateFromFSRef(
    allocator : CFAllocatorRef,
    fsRef : OpaquePointer) : CFURLRef;

external CFURLGetFSRef(
    url : CFURLRef,
    fsRef : OpaquePointer) : CUChar;

alias CFBundleRef = OpaquePointer;

alias CFPlugInRef = OpaquePointer;

external kCFBundleInfoDictionaryVersionKey : CFStringRef;

external kCFBundleExecutableKey : CFStringRef;

external kCFBundleIdentifierKey : CFStringRef;

external kCFBundleVersionKey : CFStringRef;

external kCFBundleDevelopmentRegionKey : CFStringRef;

external kCFBundleNameKey : CFStringRef;

external kCFBundleLocalizationsKey : CFStringRef;

external CFBundleGetMainBundle() : CFBundleRef;

external CFBundleGetBundleWithIdentifier(
    bundleID : CFStringRef) : CFBundleRef;

external CFBundleGetAllBundles() : CFArrayRef;

external CFBundleGetTypeID() : CULong;

external CFBundleCreate(
    allocator : CFAllocatorRef,
    bundleURL : CFURLRef) : CFBundleRef;

external CFBundleCreateBundlesFromDirectory(
    allocator : CFAllocatorRef,
    directoryURL : CFURLRef,
    bundleType : CFStringRef) : CFArrayRef;

external CFBundleCopyBundleURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleGetValueForInfoDictionaryKey(
    bundle : CFBundleRef,
    key : CFStringRef) : CFTypeRef;

external CFBundleGetInfoDictionary(
    bundle : CFBundleRef) : CFDictionaryRef;

external CFBundleGetLocalInfoDictionary(
    bundle : CFBundleRef) : CFDictionaryRef;

external CFBundleGetPackageInfo(
    bundle : CFBundleRef,
    packageType : Pointer[CULong],
    packageCreator : Pointer[CULong]);

external CFBundleGetIdentifier(
    bundle : CFBundleRef) : CFStringRef;

external CFBundleGetVersionNumber(
    bundle : CFBundleRef) : CULong;

external CFBundleGetDevelopmentRegion(
    bundle : CFBundleRef) : CFStringRef;

external CFBundleCopySupportFilesDirectoryURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopyResourcesDirectoryURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopyPrivateFrameworksURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopySharedFrameworksURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopySharedSupportURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopyBuiltInPlugInsURL(
    bundle : CFBundleRef) : CFURLRef;

external CFBundleCopyInfoDictionaryInDirectory(
    bundleURL : CFURLRef) : CFDictionaryRef;

external CFBundleGetPackageInfoInDirectory(
    url : CFURLRef,
    packageType : Pointer[CULong],
    packageCreator : Pointer[CULong]) : CUChar;

external CFBundleCopyResourceURL(
    bundle : CFBundleRef,
    resourceName : CFStringRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef) : CFURLRef;

external CFBundleCopyResourceURLsOfType(
    bundle : CFBundleRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef) : CFArrayRef;

external CFBundleCopyLocalizedString(
    bundle : CFBundleRef,
    key : CFStringRef,
    value : CFStringRef,
    tableName : CFStringRef) : CFStringRef;

external CFBundleCopyResourceURLInDirectory(
    bundleURL : CFURLRef,
    resourceName : CFStringRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef) : CFURLRef;

external CFBundleCopyResourceURLsOfTypeInDirectory(
    bundleURL : CFURLRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef) : CFArrayRef;

external CFBundleCopyBundleLocalizations(
    bundle : CFBundleRef) : CFArrayRef;

external CFBundleCopyPreferredLocalizationsFromArray(
    locArray : CFArrayRef) : CFArrayRef;

external CFBundleCopyLocalizationsForPreferences(
    locArray : CFArrayRef,
    prefArray : CFArrayRef) : CFArrayRef;

external CFBundleCopyResourceURLForLocalization(
    bundle : CFBundleRef,
    resourceName : CFStringRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef,
    localizationName : CFStringRef) : CFURLRef;

external CFBundleCopyResourceURLsOfTypeForLocalization(
    bundle : CFBundleRef,
    resourceType : CFStringRef,
    subDirName : CFStringRef,
    localizationName : CFStringRef) : CFArrayRef;

external CFBundleCopyInfoDictionaryForURL(
    url : CFURLRef) : CFDictionaryRef;

external CFBundleCopyLocalizationsForURL(
    url : CFURLRef) : CFArrayRef;

external CFBundleCopyExecutableArchitecturesForURL(
    url : CFURLRef) : CFArrayRef;

external CFBundleCopyExecutableURL(
    bundle : CFBundleRef) : CFURLRef;

alias kCFBundleExecutableArchitectureI386 = 7;
alias kCFBundleExecutableArchitecturePPC = 18;
alias kCFBundleExecutableArchitectureX86_64 = 16777223;
alias kCFBundleExecutableArchitecturePPC64 = 16777234;

external CFBundleCopyExecutableArchitectures(
    bundle : CFBundleRef) : CFArrayRef;

external CFBundlePreflightExecutable(
    bundle : CFBundleRef,
    error : Pointer[CFErrorRef]) : CUChar;

external CFBundleLoadExecutableAndReturnError(
    bundle : CFBundleRef,
    error : Pointer[CFErrorRef]) : CUChar;

external CFBundleLoadExecutable(
    bundle : CFBundleRef) : CUChar;

external CFBundleIsExecutableLoaded(
    bundle : CFBundleRef) : CUChar;

external CFBundleUnloadExecutable(
    bundle : CFBundleRef);

external CFBundleGetFunctionPointerForName(
    bundle : CFBundleRef,
    functionName : CFStringRef) : RawPointer;

external CFBundleGetFunctionPointersForNames(
    bundle : CFBundleRef,
    functionNames : CFArrayRef,
    ftbl : Pointer[RawPointer]);

external CFBundleGetDataPointerForName(
    bundle : CFBundleRef,
    symbolName : CFStringRef) : RawPointer;

external CFBundleGetDataPointersForNames(
    bundle : CFBundleRef,
    symbolNames : CFArrayRef,
    stbl : Pointer[RawPointer]);

external CFBundleCopyAuxiliaryExecutableURL(
    bundle : CFBundleRef,
    executableName : CFStringRef) : CFURLRef;

external CFBundleGetPlugIn(
    bundle : CFBundleRef) : CFPlugInRef;

alias CFBundleRefNum = Short;

external CFBundleOpenBundleResourceMap(
    bundle : CFBundleRef) : Short;

external CFBundleOpenBundleResourceFiles(
    bundle : CFBundleRef,
    refNum : Pointer[Short],
    localizedRefNum : Pointer[Short]) : CLong;

external CFBundleCloseBundleResourceMap(
    bundle : CFBundleRef,
    refNum : Short);

alias CFByteOrderUnknown = 0;
alias CFByteOrderLittleEndian = 1;
alias CFByteOrderBigEndian = 2;

alias CFByteOrder = CLong;

record UnnamedStruct18 (
    v : UInt,
);

alias CFSwappedFloat32 = UnnamedStruct18;

record UnnamedStruct19 (
    v : UInt64,
);

alias CFSwappedFloat64 = UnnamedStruct19;

alias CFTimeInterval = Double;

alias CFAbsoluteTime = Double;

external CFAbsoluteTimeGetCurrent() : Double;

external kCFAbsoluteTimeIntervalSince1970 : Double;

external kCFAbsoluteTimeIntervalSince1904 : Double;

alias CFDateRef = OpaquePointer;

external CFDateGetTypeID() : CULong;

external CFDateCreate(
    allocator : CFAllocatorRef,
    at : Double) : CFDateRef;

external CFDateGetAbsoluteTime(
    theDate : CFDateRef) : Double;

external CFDateGetTimeIntervalSinceDate(
    theDate : CFDateRef,
    otherDate : CFDateRef) : Double;

external CFDateCompare(
    theDate : CFDateRef,
    otherDate : CFDateRef,
    context : RawPointer) : CLong;

alias CFTimeZoneRef = OpaquePointer;

record UnnamedStruct20 (
    year : CLong,
    month : CChar,
    day : CChar,
    hour : CChar,
    minute : CChar,
    second : Double,
);

alias CFGregorianDate = UnnamedStruct20;

record UnnamedStruct21 (
    years : CLong,
    months : CLong,
    days : CLong,
    hours : CLong,
    minutes : CLong,
    seconds : Double,
);

alias CFGregorianUnits = UnnamedStruct21;

alias kCFGregorianUnitsYears = 1;
alias kCFGregorianUnitsMonths = 2;
alias kCFGregorianUnitsDays = 4;
alias kCFGregorianUnitsHours = 8;
alias kCFGregorianUnitsMinutes = 16;
alias kCFGregorianUnitsSeconds = 32;
alias kCFGregorianAllUnits = 16777215;

alias CFGregorianUnitFlags = CULong;

external CFGregorianDateIsValid(
    gdate : CFGregorianDate,
    unitFlags : CULong) : CUChar;

external CFGregorianDateGetAbsoluteTime(
    gdate : CFGregorianDate,
    tz : CFTimeZoneRef) : Double;

external CFAbsoluteTimeGetGregorianDate(
    at : Double,
    tz : CFTimeZoneRef) : CFGregorianDate;

external CFAbsoluteTimeAddGregorianUnits(
    at : Double,
    tz : CFTimeZoneRef,
    units : CFGregorianUnits) : Double;

external CFAbsoluteTimeGetDifferenceAsGregorianUnits(
    at1 : Double,
    at2 : Double,
    tz : CFTimeZoneRef,
    unitFlags : CULong) : CFGregorianUnits;

external CFAbsoluteTimeGetDayOfWeek(
    at : Double,
    tz : CFTimeZoneRef) : CLong;

external CFAbsoluteTimeGetDayOfYear(
    at : Double,
    tz : CFTimeZoneRef) : CLong;

external CFAbsoluteTimeGetWeekOfYear(
    at : Double,
    tz : CFTimeZoneRef) : CLong;

external CFTimeZoneGetTypeID() : CULong;

external CFTimeZoneCopySystem() : CFTimeZoneRef;

external CFTimeZoneResetSystem();

external CFTimeZoneCopyDefault() : CFTimeZoneRef;

external CFTimeZoneSetDefault(
    tz : CFTimeZoneRef);

external CFTimeZoneCopyKnownNames() : CFArrayRef;

external CFTimeZoneCopyAbbreviationDictionary() : CFDictionaryRef;

external CFTimeZoneSetAbbreviationDictionary(
    dict : CFDictionaryRef);

external CFTimeZoneCreate(
    allocator : CFAllocatorRef,
    name : CFStringRef,
    data : CFDataRef) : CFTimeZoneRef;

external CFTimeZoneCreateWithTimeIntervalFromGMT(
    allocator : CFAllocatorRef,
    ti : Double) : CFTimeZoneRef;

external CFTimeZoneCreateWithName(
    allocator : CFAllocatorRef,
    name : CFStringRef,
    tryAbbrev : CUChar) : CFTimeZoneRef;

external CFTimeZoneGetName(
    tz : CFTimeZoneRef) : CFStringRef;

external CFTimeZoneGetData(
    tz : CFTimeZoneRef) : CFDataRef;

external CFTimeZoneGetSecondsFromGMT(
    tz : CFTimeZoneRef,
    at : Double) : Double;

external CFTimeZoneCopyAbbreviation(
    tz : CFTimeZoneRef,
    at : Double) : CFStringRef;

external CFTimeZoneIsDaylightSavingTime(
    tz : CFTimeZoneRef,
    at : Double) : CUChar;

external CFTimeZoneGetDaylightSavingTimeOffset(
    tz : CFTimeZoneRef,
    at : Double) : Double;

external CFTimeZoneGetNextDaylightSavingTimeTransition(
    tz : CFTimeZoneRef,
    at : Double) : Double;

alias kCFTimeZoneNameStyleStandard = 0;
alias kCFTimeZoneNameStyleShortStandard = 1;
alias kCFTimeZoneNameStyleDaylightSaving = 2;
alias kCFTimeZoneNameStyleShortDaylightSaving = 3;
alias kCFTimeZoneNameStyleGeneric = 4;
alias kCFTimeZoneNameStyleShortGeneric = 5;

alias CFTimeZoneNameStyle = CLong;

external CFTimeZoneCopyLocalizedName(
    tz : CFTimeZoneRef,
    style : CLong,
    locale : CFLocaleRef) : CFStringRef;

external kCFTimeZoneSystemTimeZoneDidChangeNotification : CFStringRef;

alias CFCalendarRef = OpaquePointer;

external CFCalendarGetTypeID() : CULong;

external CFCalendarCopyCurrent() : CFCalendarRef;

external CFCalendarCreateWithIdentifier(
    allocator : CFAllocatorRef,
    identifier : CFStringRef) : CFCalendarRef;

external CFCalendarGetIdentifier(
    calendar : CFCalendarRef) : CFStringRef;

external CFCalendarCopyLocale(
    calendar : CFCalendarRef) : CFLocaleRef;

external CFCalendarSetLocale(
    calendar : CFCalendarRef,
    locale : CFLocaleRef);

external CFCalendarCopyTimeZone(
    calendar : CFCalendarRef) : CFTimeZoneRef;

external CFCalendarSetTimeZone(
    calendar : CFCalendarRef,
    tz : CFTimeZoneRef);

external CFCalendarGetFirstWeekday(
    calendar : CFCalendarRef) : CLong;

external CFCalendarSetFirstWeekday(
    calendar : CFCalendarRef,
    wkdy : CLong);

external CFCalendarGetMinimumDaysInFirstWeek(
    calendar : CFCalendarRef) : CLong;

external CFCalendarSetMinimumDaysInFirstWeek(
    calendar : CFCalendarRef,
    mwd : CLong);

alias kCFCalendarUnitEra = 2;
alias kCFCalendarUnitYear = 4;
alias kCFCalendarUnitMonth = 8;
alias kCFCalendarUnitDay = 16;
alias kCFCalendarUnitHour = 32;
alias kCFCalendarUnitMinute = 64;
alias kCFCalendarUnitSecond = 128;
alias kCFCalendarUnitWeek = 256;
alias kCFCalendarUnitWeekday = 512;
alias kCFCalendarUnitWeekdayOrdinal = 1024;
alias kCFCalendarUnitQuarter = 2048;

alias CFCalendarUnit = CULong;

external CFCalendarGetMinimumRangeOfUnit(
    calendar : CFCalendarRef,
    unit : CULong) : CFRange;

external CFCalendarGetMaximumRangeOfUnit(
    calendar : CFCalendarRef,
    unit : CULong) : CFRange;

external CFCalendarGetRangeOfUnit(
    calendar : CFCalendarRef,
    smallerUnit : CULong,
    biggerUnit : CULong,
    at : Double) : CFRange;

external CFCalendarGetOrdinalityOfUnit(
    calendar : CFCalendarRef,
    smallerUnit : CULong,
    biggerUnit : CULong,
    at : Double) : CLong;

external CFCalendarGetTimeRangeOfUnit(
    calendar : CFCalendarRef,
    unit : CULong,
    at : Double,
    startp : Pointer[Double],
    tip : Pointer[Double]) : CUChar;

external CFCalendarComposeAbsoluteTime(
    calendar : CFCalendarRef,
    at : Pointer[Double],
    componentDesc : Pointer[CChar],
    ..) : CUChar;

external CFCalendarDecomposeAbsoluteTime(
    calendar : CFCalendarRef,
    at : Double,
    componentDesc : Pointer[CChar],
    ..) : CUChar;

alias kCFCalendarComponentsWrap = 1;

external CFCalendarAddComponents(
    calendar : CFCalendarRef,
    at : Pointer[Double],
    options : CULong,
    componentDesc : Pointer[CChar],
    ..) : CUChar;

external CFCalendarGetComponentDifference(
    calendar : CFCalendarRef,
    startingAT : Double,
    resultAT : Double,
    options : CULong,
    componentDesc : Pointer[CChar],
    ..) : CUChar;

alias CFDateFormatterRef = OpaquePointer;

external CFDateFormatterCreateDateFormatFromTemplate(
    allocator : CFAllocatorRef,
    tmplate : CFStringRef,
    options : CULong,
    locale : CFLocaleRef) : CFStringRef;

external CFDateFormatterGetTypeID() : CULong;

alias kCFDateFormatterNoStyle = 0;
alias kCFDateFormatterShortStyle = 1;
alias kCFDateFormatterMediumStyle = 2;
alias kCFDateFormatterLongStyle = 3;
alias kCFDateFormatterFullStyle = 4;

alias CFDateFormatterStyle = CLong;

external CFDateFormatterCreate(
    allocator : CFAllocatorRef,
    locale : CFLocaleRef,
    dateStyle : CLong,
    timeStyle : CLong) : CFDateFormatterRef;

external CFDateFormatterGetLocale(
    formatter : CFDateFormatterRef) : CFLocaleRef;

external CFDateFormatterGetDateStyle(
    formatter : CFDateFormatterRef) : CLong;

external CFDateFormatterGetTimeStyle(
    formatter : CFDateFormatterRef) : CLong;

external CFDateFormatterGetFormat(
    formatter : CFDateFormatterRef) : CFStringRef;

external CFDateFormatterSetFormat(
    formatter : CFDateFormatterRef,
    formatString : CFStringRef);

external CFDateFormatterCreateStringWithDate(
    allocator : CFAllocatorRef,
    formatter : CFDateFormatterRef,
    date : CFDateRef) : CFStringRef;

external CFDateFormatterCreateStringWithAbsoluteTime(
    allocator : CFAllocatorRef,
    formatter : CFDateFormatterRef,
    at : Double) : CFStringRef;

external CFDateFormatterCreateDateFromString(
    allocator : CFAllocatorRef,
    formatter : CFDateFormatterRef,
    string : CFStringRef,
    rangep : Pointer[CFRange]) : CFDateRef;

external CFDateFormatterGetAbsoluteTimeFromString(
    formatter : CFDateFormatterRef,
    string : CFStringRef,
    rangep : Pointer[CFRange],
    atp : Pointer[Double]) : CUChar;

external CFDateFormatterSetProperty(
    formatter : CFDateFormatterRef,
    key : CFStringRef,
    value : CFTypeRef);

external CFDateFormatterCopyProperty(
    formatter : CFDateFormatterRef,
    key : CFStringRef) : CFTypeRef;

external kCFDateFormatterIsLenient : CFStringRef;

external kCFDateFormatterTimeZone : CFStringRef;

external kCFDateFormatterCalendarName : CFStringRef;

external kCFDateFormatterDefaultFormat : CFStringRef;

external kCFDateFormatterTwoDigitStartDate : CFStringRef;

external kCFDateFormatterDefaultDate : CFStringRef;

external kCFDateFormatterCalendar : CFStringRef;

external kCFDateFormatterEraSymbols : CFStringRef;

external kCFDateFormatterMonthSymbols : CFStringRef;

external kCFDateFormatterShortMonthSymbols : CFStringRef;

external kCFDateFormatterWeekdaySymbols : CFStringRef;

external kCFDateFormatterShortWeekdaySymbols : CFStringRef;

external kCFDateFormatterAMSymbol : CFStringRef;

external kCFDateFormatterPMSymbol : CFStringRef;

external kCFDateFormatterLongEraSymbols : CFStringRef;

external kCFDateFormatterVeryShortMonthSymbols : CFStringRef;

external kCFDateFormatterStandaloneMonthSymbols : CFStringRef;

external kCFDateFormatterShortStandaloneMonthSymbols : CFStringRef;

external kCFDateFormatterVeryShortStandaloneMonthSymbols : CFStringRef;

external kCFDateFormatterVeryShortWeekdaySymbols : CFStringRef;

external kCFDateFormatterStandaloneWeekdaySymbols : CFStringRef;

external kCFDateFormatterShortStandaloneWeekdaySymbols : CFStringRef;

external kCFDateFormatterVeryShortStandaloneWeekdaySymbols : CFStringRef;

external kCFDateFormatterQuarterSymbols : CFStringRef;

external kCFDateFormatterShortQuarterSymbols : CFStringRef;

external kCFDateFormatterStandaloneQuarterSymbols : CFStringRef;

external kCFDateFormatterShortStandaloneQuarterSymbols : CFStringRef;

external kCFDateFormatterGregorianStartDate : CFStringRef;

external kCFDateFormatterDoesRelativeDateFormattingKey : CFStringRef;

alias CFRunLoopRef = OpaquePointer;

alias CFRunLoopSourceRef = OpaquePointer;

alias CFRunLoopObserverRef = OpaquePointer;

alias CFRunLoopTimerRef = OpaquePointer;

alias kCFRunLoopRunFinished = 1;
alias kCFRunLoopRunStopped = 2;
alias kCFRunLoopRunTimedOut = 3;
alias kCFRunLoopRunHandledSource = 4;

alias kCFRunLoopEntry = 1;
alias kCFRunLoopBeforeTimers = 2;
alias kCFRunLoopBeforeSources = 4;
alias kCFRunLoopBeforeWaiting = 32;
alias kCFRunLoopAfterWaiting = 64;
alias kCFRunLoopExit = 128;
alias kCFRunLoopAllActivities = 268435455;

alias CFRunLoopActivity = CULong;

external kCFRunLoopDefaultMode : CFStringRef;

external kCFRunLoopCommonModes : CFStringRef;

external CFRunLoopGetTypeID() : CULong;

external CFRunLoopGetCurrent() : CFRunLoopRef;

external CFRunLoopGetMain() : CFRunLoopRef;

external CFRunLoopCopyCurrentMode(
    rl : CFRunLoopRef) : CFStringRef;

external CFRunLoopCopyAllModes(
    rl : CFRunLoopRef) : CFArrayRef;

external CFRunLoopAddCommonMode(
    rl : CFRunLoopRef,
    mode : CFStringRef);

external CFRunLoopGetNextTimerFireDate(
    rl : CFRunLoopRef,
    mode : CFStringRef) : Double;

external CFRunLoopRun();

external CFRunLoopRunInMode(
    mode : CFStringRef,
    seconds : Double,
    returnAfterSourceHandled : CUChar) : CLong;

external CFRunLoopIsWaiting(
    rl : CFRunLoopRef) : CUChar;

external CFRunLoopWakeUp(
    rl : CFRunLoopRef);

external CFRunLoopStop(
    rl : CFRunLoopRef);

external CFRunLoopPerformBlock(
    rl : CFRunLoopRef,
    mode : CFTypeRef,
    block : UnknownType);

external CFRunLoopContainsSource(
    rl : CFRunLoopRef,
    source : CFRunLoopSourceRef,
    mode : CFStringRef) : CUChar;

external CFRunLoopAddSource(
    rl : CFRunLoopRef,
    source : CFRunLoopSourceRef,
    mode : CFStringRef);

external CFRunLoopRemoveSource(
    rl : CFRunLoopRef,
    source : CFRunLoopSourceRef,
    mode : CFStringRef);

external CFRunLoopContainsObserver(
    rl : CFRunLoopRef,
    observer : CFRunLoopObserverRef,
    mode : CFStringRef) : CUChar;

external CFRunLoopAddObserver(
    rl : CFRunLoopRef,
    observer : CFRunLoopObserverRef,
    mode : CFStringRef);

external CFRunLoopRemoveObserver(
    rl : CFRunLoopRef,
    observer : CFRunLoopObserverRef,
    mode : CFStringRef);

external CFRunLoopContainsTimer(
    rl : CFRunLoopRef,
    timer : CFRunLoopTimerRef,
    mode : CFStringRef) : CUChar;

external CFRunLoopAddTimer(
    rl : CFRunLoopRef,
    timer : CFRunLoopTimerRef,
    mode : CFStringRef);

external CFRunLoopRemoveTimer(
    rl : CFRunLoopRef,
    timer : CFRunLoopTimerRef,
    mode : CFStringRef);

record UnnamedStruct22 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
    equal : CCodePointer[[RawPointer,RawPointer],[CUChar]],
    hash : CCodePointer[[RawPointer],[CULong]],
    schedule : CCodePointer[[RawPointer,OpaquePointer,OpaquePointer],[]],
    cancel : CCodePointer[[RawPointer,OpaquePointer,OpaquePointer],[]],
    perform : CCodePointer[[RawPointer],[]],
);

alias CFRunLoopSourceContext = UnnamedStruct22;

record UnnamedStruct23 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
    equal : CCodePointer[[RawPointer,RawPointer],[CUChar]],
    hash : CCodePointer[[RawPointer],[CULong]],
    getPort : CCodePointer[[RawPointer],[UInt]],
    perform : CCodePointer[[RawPointer,CLong,OpaquePointer,RawPointer],[RawPointer]],
);

alias CFRunLoopSourceContext1 = UnnamedStruct23;

external CFRunLoopSourceGetTypeID() : CULong;

external CFRunLoopSourceCreate(
    allocator : CFAllocatorRef,
    order : CLong,
    context : Pointer[CFRunLoopSourceContext]) : CFRunLoopSourceRef;

external CFRunLoopSourceGetOrder(
    source : CFRunLoopSourceRef) : CLong;

external CFRunLoopSourceInvalidate(
    source : CFRunLoopSourceRef);

external CFRunLoopSourceIsValid(
    source : CFRunLoopSourceRef) : CUChar;

external CFRunLoopSourceGetContext(
    source : CFRunLoopSourceRef,
    context : Pointer[CFRunLoopSourceContext]);

external CFRunLoopSourceSignal(
    source : CFRunLoopSourceRef);

record UnnamedStruct24 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFRunLoopObserverContext = UnnamedStruct24;

alias CFRunLoopObserverCallBack = CCodePointer[[OpaquePointer,CULong,RawPointer],[]];

external CFRunLoopObserverGetTypeID() : CULong;

external CFRunLoopObserverCreate(
    allocator : CFAllocatorRef,
    activities : CULong,
    repeats : CUChar,
    order : CLong,
    callout : CFRunLoopObserverCallBack,
    context : Pointer[CFRunLoopObserverContext]) : CFRunLoopObserverRef;

external CFRunLoopObserverGetActivities(
    observer : CFRunLoopObserverRef) : CULong;

external CFRunLoopObserverDoesRepeat(
    observer : CFRunLoopObserverRef) : CUChar;

external CFRunLoopObserverGetOrder(
    observer : CFRunLoopObserverRef) : CLong;

external CFRunLoopObserverInvalidate(
    observer : CFRunLoopObserverRef);

external CFRunLoopObserverIsValid(
    observer : CFRunLoopObserverRef) : CUChar;

external CFRunLoopObserverGetContext(
    observer : CFRunLoopObserverRef,
    context : Pointer[CFRunLoopObserverContext]);

record UnnamedStruct25 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFRunLoopTimerContext = UnnamedStruct25;

alias CFRunLoopTimerCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

external CFRunLoopTimerGetTypeID() : CULong;

external CFRunLoopTimerCreate(
    allocator : CFAllocatorRef,
    fireDate : Double,
    interval : Double,
    flags : CULong,
    order : CLong,
    callout : CFRunLoopTimerCallBack,
    context : Pointer[CFRunLoopTimerContext]) : CFRunLoopTimerRef;

external CFRunLoopTimerGetNextFireDate(
    timer : CFRunLoopTimerRef) : Double;

external CFRunLoopTimerSetNextFireDate(
    timer : CFRunLoopTimerRef,
    fireDate : Double);

external CFRunLoopTimerGetInterval(
    timer : CFRunLoopTimerRef) : Double;

external CFRunLoopTimerDoesRepeat(
    timer : CFRunLoopTimerRef) : CUChar;

external CFRunLoopTimerGetOrder(
    timer : CFRunLoopTimerRef) : CLong;

external CFRunLoopTimerInvalidate(
    timer : CFRunLoopTimerRef);

external CFRunLoopTimerIsValid(
    timer : CFRunLoopTimerRef) : CUChar;

external CFRunLoopTimerGetContext(
    timer : CFRunLoopTimerRef,
    context : Pointer[CFRunLoopTimerContext]);

alias CFMessagePortRef = OpaquePointer;

alias kCFMessagePortSuccess = 0;
alias kCFMessagePortSendTimeout = 4294967295;
alias kCFMessagePortReceiveTimeout = 4294967294;
alias kCFMessagePortIsInvalid = 4294967293;
alias kCFMessagePortTransportError = 4294967292;
alias kCFMessagePortBecameInvalidError = 4294967291;

record UnnamedStruct48 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFMessagePortContext = UnnamedStruct48;

alias CFMessagePortCallBack = CCodePointer[[OpaquePointer,CLong,OpaquePointer,RawPointer],[OpaquePointer]];

alias CFMessagePortInvalidationCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

external CFMessagePortGetTypeID() : CULong;

external CFMessagePortCreateLocal(
    allocator : CFAllocatorRef,
    name : CFStringRef,
    callout : CFMessagePortCallBack,
    context : Pointer[CFMessagePortContext],
    shouldFreeInfo : Pointer[CUChar]) : CFMessagePortRef;

external CFMessagePortCreateRemote(
    allocator : CFAllocatorRef,
    name : CFStringRef) : CFMessagePortRef;

external CFMessagePortIsRemote(
    ms : CFMessagePortRef) : CUChar;

external CFMessagePortGetName(
    ms : CFMessagePortRef) : CFStringRef;

external CFMessagePortSetName(
    ms : CFMessagePortRef,
    newName : CFStringRef) : CUChar;

external CFMessagePortGetContext(
    ms : CFMessagePortRef,
    context : Pointer[CFMessagePortContext]);

external CFMessagePortInvalidate(
    ms : CFMessagePortRef);

external CFMessagePortIsValid(
    ms : CFMessagePortRef) : CUChar;

external CFMessagePortGetInvalidationCallBack(
    ms : CFMessagePortRef) : CFMessagePortInvalidationCallBack;

external CFMessagePortSetInvalidationCallBack(
    ms : CFMessagePortRef,
    callout : CFMessagePortInvalidationCallBack);

external CFMessagePortSendRequest(
    remote : CFMessagePortRef,
    msgid : CLong,
    data : CFDataRef,
    sendTimeout : Double,
    rcvTimeout : Double,
    replyMode : CFStringRef,
    returnData : Pointer[CFDataRef]) : CLong;

external CFMessagePortCreateRunLoopSource(
    allocator : CFAllocatorRef,
    local : CFMessagePortRef,
    order : CLong) : CFRunLoopSourceRef;

external CFMessagePortSetDispatchQueue(
    ms : CFMessagePortRef,
    queue : dispatch_queue_t);

alias CFBooleanRef = OpaquePointer;

external kCFBooleanTrue : CFBooleanRef;

external kCFBooleanFalse : CFBooleanRef;

external CFBooleanGetTypeID() : CULong;

external CFBooleanGetValue(
    boolean : CFBooleanRef) : CUChar;

alias kCFNumberSInt8Type = 1;
alias kCFNumberSInt16Type = 2;
alias kCFNumberSInt32Type = 3;
alias kCFNumberSInt64Type = 4;
alias kCFNumberFloat32Type = 5;
alias kCFNumberFloat64Type = 6;
alias kCFNumberCharType = 7;
alias kCFNumberShortType = 8;
alias kCFNumberIntType = 9;
alias kCFNumberLongType = 10;
alias kCFNumberLongLongType = 11;
alias kCFNumberFloatType = 12;
alias kCFNumberDoubleType = 13;
alias kCFNumberCFIndexType = 14;
alias kCFNumberNSIntegerType = 15;
alias kCFNumberCGFloatType = 16;
alias kCFNumberMaxType = 16;

alias CFNumberType = CLong;

alias CFNumberRef = OpaquePointer;

external kCFNumberPositiveInfinity : CFNumberRef;

external kCFNumberNegativeInfinity : CFNumberRef;

external kCFNumberNaN : CFNumberRef;

external CFNumberGetTypeID() : CULong;

external CFNumberCreate(
    allocator : CFAllocatorRef,
    theType : CLong,
    valuePtr : RawPointer) : CFNumberRef;

external CFNumberGetType(
    number : CFNumberRef) : CLong;

external CFNumberGetByteSize(
    number : CFNumberRef) : CLong;

external CFNumberIsFloatType(
    number : CFNumberRef) : CUChar;

external CFNumberGetValue(
    number : CFNumberRef,
    theType : CLong,
    valuePtr : RawPointer) : CUChar;

external CFNumberCompare(
    number : CFNumberRef,
    otherNumber : CFNumberRef,
    context : RawPointer) : CLong;

alias CFNumberFormatterRef = OpaquePointer;

external CFNumberFormatterGetTypeID() : CULong;

alias kCFNumberFormatterNoStyle = 0;
alias kCFNumberFormatterDecimalStyle = 1;
alias kCFNumberFormatterCurrencyStyle = 2;
alias kCFNumberFormatterPercentStyle = 3;
alias kCFNumberFormatterScientificStyle = 4;
alias kCFNumberFormatterSpellOutStyle = 5;

alias CFNumberFormatterStyle = CLong;

external CFNumberFormatterCreate(
    allocator : CFAllocatorRef,
    locale : CFLocaleRef,
    style : CLong) : CFNumberFormatterRef;

external CFNumberFormatterGetLocale(
    formatter : CFNumberFormatterRef) : CFLocaleRef;

external CFNumberFormatterGetStyle(
    formatter : CFNumberFormatterRef) : CLong;

external CFNumberFormatterGetFormat(
    formatter : CFNumberFormatterRef) : CFStringRef;

external CFNumberFormatterSetFormat(
    formatter : CFNumberFormatterRef,
    formatString : CFStringRef);

external CFNumberFormatterCreateStringWithNumber(
    allocator : CFAllocatorRef,
    formatter : CFNumberFormatterRef,
    number : CFNumberRef) : CFStringRef;

external CFNumberFormatterCreateStringWithValue(
    allocator : CFAllocatorRef,
    formatter : CFNumberFormatterRef,
    numberType : CLong,
    valuePtr : RawPointer) : CFStringRef;

alias kCFNumberFormatterParseIntegersOnly = 1;

alias CFNumberFormatterOptionFlags = CULong;

external CFNumberFormatterCreateNumberFromString(
    allocator : CFAllocatorRef,
    formatter : CFNumberFormatterRef,
    string : CFStringRef,
    rangep : Pointer[CFRange],
    options : CULong) : CFNumberRef;

external CFNumberFormatterGetValueFromString(
    formatter : CFNumberFormatterRef,
    string : CFStringRef,
    rangep : Pointer[CFRange],
    numberType : CLong,
    valuePtr : RawPointer) : CUChar;

external CFNumberFormatterSetProperty(
    formatter : CFNumberFormatterRef,
    key : CFStringRef,
    value : CFTypeRef);

external CFNumberFormatterCopyProperty(
    formatter : CFNumberFormatterRef,
    key : CFStringRef) : CFTypeRef;

external kCFNumberFormatterCurrencyCode : CFStringRef;

external kCFNumberFormatterDecimalSeparator : CFStringRef;

external kCFNumberFormatterCurrencyDecimalSeparator : CFStringRef;

external kCFNumberFormatterAlwaysShowDecimalSeparator : CFStringRef;

external kCFNumberFormatterGroupingSeparator : CFStringRef;

external kCFNumberFormatterUseGroupingSeparator : CFStringRef;

external kCFNumberFormatterPercentSymbol : CFStringRef;

external kCFNumberFormatterZeroSymbol : CFStringRef;

external kCFNumberFormatterNaNSymbol : CFStringRef;

external kCFNumberFormatterInfinitySymbol : CFStringRef;

external kCFNumberFormatterMinusSign : CFStringRef;

external kCFNumberFormatterPlusSign : CFStringRef;

external kCFNumberFormatterCurrencySymbol : CFStringRef;

external kCFNumberFormatterExponentSymbol : CFStringRef;

external kCFNumberFormatterMinIntegerDigits : CFStringRef;

external kCFNumberFormatterMaxIntegerDigits : CFStringRef;

external kCFNumberFormatterMinFractionDigits : CFStringRef;

external kCFNumberFormatterMaxFractionDigits : CFStringRef;

external kCFNumberFormatterGroupingSize : CFStringRef;

external kCFNumberFormatterSecondaryGroupingSize : CFStringRef;

external kCFNumberFormatterRoundingMode : CFStringRef;

external kCFNumberFormatterRoundingIncrement : CFStringRef;

external kCFNumberFormatterFormatWidth : CFStringRef;

external kCFNumberFormatterPaddingPosition : CFStringRef;

external kCFNumberFormatterPaddingCharacter : CFStringRef;

external kCFNumberFormatterDefaultFormat : CFStringRef;

external kCFNumberFormatterMultiplier : CFStringRef;

external kCFNumberFormatterPositivePrefix : CFStringRef;

external kCFNumberFormatterPositiveSuffix : CFStringRef;

external kCFNumberFormatterNegativePrefix : CFStringRef;

external kCFNumberFormatterNegativeSuffix : CFStringRef;

external kCFNumberFormatterPerMillSymbol : CFStringRef;

external kCFNumberFormatterInternationalCurrencySymbol : CFStringRef;

external kCFNumberFormatterCurrencyGroupingSeparator : CFStringRef;

external kCFNumberFormatterIsLenient : CFStringRef;

external kCFNumberFormatterUseSignificantDigits : CFStringRef;

external kCFNumberFormatterMinSignificantDigits : CFStringRef;

external kCFNumberFormatterMaxSignificantDigits : CFStringRef;

alias kCFNumberFormatterRoundCeiling = 0;
alias kCFNumberFormatterRoundFloor = 1;
alias kCFNumberFormatterRoundDown = 2;
alias kCFNumberFormatterRoundUp = 3;
alias kCFNumberFormatterRoundHalfEven = 4;
alias kCFNumberFormatterRoundHalfDown = 5;
alias kCFNumberFormatterRoundHalfUp = 6;

alias CFNumberFormatterRoundingMode = CLong;

alias kCFNumberFormatterPadBeforePrefix = 0;
alias kCFNumberFormatterPadAfterPrefix = 1;
alias kCFNumberFormatterPadBeforeSuffix = 2;
alias kCFNumberFormatterPadAfterSuffix = 3;

alias CFNumberFormatterPadPosition = CLong;

external CFNumberFormatterGetDecimalInfoForCurrencyCode(
    currencyCode : CFStringRef,
    defaultFractionDigits : Pointer[Int],
    roundingIncrement : Pointer[Double]) : CUChar;

alias CFUUIDRef = OpaquePointer;

record UnnamedStruct49 (
    byte0 : CUChar,
    byte1 : CUChar,
    byte2 : CUChar,
    byte3 : CUChar,
    byte4 : CUChar,
    byte5 : CUChar,
    byte6 : CUChar,
    byte7 : CUChar,
    byte8 : CUChar,
    byte9 : CUChar,
    byte10 : CUChar,
    byte11 : CUChar,
    byte12 : CUChar,
    byte13 : CUChar,
    byte14 : CUChar,
    byte15 : CUChar,
);

alias CFUUIDBytes = UnnamedStruct49;

external CFUUIDGetTypeID() : CULong;

external CFUUIDCreate(
    alloc : CFAllocatorRef) : CFUUIDRef;

external CFUUIDCreateWithBytes(
    alloc : CFAllocatorRef,
    byte0 : CUChar,
    byte1 : CUChar,
    byte2 : CUChar,
    byte3 : CUChar,
    byte4 : CUChar,
    byte5 : CUChar,
    byte6 : CUChar,
    byte7 : CUChar,
    byte8 : CUChar,
    byte9 : CUChar,
    byte10 : CUChar,
    byte11 : CUChar,
    byte12 : CUChar,
    byte13 : CUChar,
    byte14 : CUChar,
    byte15 : CUChar) : CFUUIDRef;

external CFUUIDCreateFromString(
    alloc : CFAllocatorRef,
    uuidStr : CFStringRef) : CFUUIDRef;

external CFUUIDCreateString(
    alloc : CFAllocatorRef,
    uuid : CFUUIDRef) : CFStringRef;

external CFUUIDGetConstantUUIDWithBytes(
    alloc : CFAllocatorRef,
    byte0 : CUChar,
    byte1 : CUChar,
    byte2 : CUChar,
    byte3 : CUChar,
    byte4 : CUChar,
    byte5 : CUChar,
    byte6 : CUChar,
    byte7 : CUChar,
    byte8 : CUChar,
    byte9 : CUChar,
    byte10 : CUChar,
    byte11 : CUChar,
    byte12 : CUChar,
    byte13 : CUChar,
    byte14 : CUChar,
    byte15 : CUChar) : CFUUIDRef;

external CFUUIDGetUUIDBytes(
    uuid : CFUUIDRef) : CFUUIDBytes;

external CFUUIDCreateFromUUIDBytes(
    alloc : CFAllocatorRef,
    bytes : CFUUIDBytes) : CFUUIDRef;

external kCFPlugInDynamicRegistrationKey : CFStringRef;

external kCFPlugInDynamicRegisterFunctionKey : CFStringRef;

external kCFPlugInUnloadFunctionKey : CFStringRef;

external kCFPlugInFactoriesKey : CFStringRef;

external kCFPlugInTypesKey : CFStringRef;

alias CFPlugInDynamicRegisterFunction = CCodePointer[[OpaquePointer],[]];

alias CFPlugInUnloadFunction = CCodePointer[[OpaquePointer],[]];

alias CFPlugInFactoryFunction = CCodePointer[[OpaquePointer,OpaquePointer],[RawPointer]];

external CFPlugInGetTypeID() : CULong;

external CFPlugInCreate(
    allocator : CFAllocatorRef,
    plugInURL : CFURLRef) : CFPlugInRef;

external CFPlugInGetBundle(
    plugIn : CFPlugInRef) : CFBundleRef;

external CFPlugInSetLoadOnDemand(
    plugIn : CFPlugInRef,
    flag : CUChar);

external CFPlugInIsLoadOnDemand(
    plugIn : CFPlugInRef) : CUChar;

external CFPlugInFindFactoriesForPlugInType(
    typeUUID : CFUUIDRef) : CFArrayRef;

external CFPlugInFindFactoriesForPlugInTypeInPlugIn(
    typeUUID : CFUUIDRef,
    plugIn : CFPlugInRef) : CFArrayRef;

external CFPlugInInstanceCreate(
    allocator : CFAllocatorRef,
    factoryUUID : CFUUIDRef,
    typeUUID : CFUUIDRef) : RawPointer;

external CFPlugInRegisterFactoryFunction(
    factoryUUID : CFUUIDRef,
    func : CFPlugInFactoryFunction) : CUChar;

external CFPlugInRegisterFactoryFunctionByName(
    factoryUUID : CFUUIDRef,
    plugIn : CFPlugInRef,
    functionName : CFStringRef) : CUChar;

external CFPlugInUnregisterFactory(
    factoryUUID : CFUUIDRef) : CUChar;

external CFPlugInRegisterPlugInType(
    factoryUUID : CFUUIDRef,
    typeUUID : CFUUIDRef) : CUChar;

external CFPlugInUnregisterPlugInType(
    factoryUUID : CFUUIDRef,
    typeUUID : CFUUIDRef) : CUChar;

external CFPlugInAddInstanceForFactory(
    factoryID : CFUUIDRef);

external CFPlugInRemoveInstanceForFactory(
    factoryID : CFUUIDRef);

alias CFPlugInInstanceRef = OpaquePointer;

alias CFPlugInInstanceGetInterfaceFunction = CCodePointer[[OpaquePointer,OpaquePointer,Pointer[RawPointer]],[CUChar]];

alias CFPlugInInstanceDeallocateInstanceDataFunction = CCodePointer[[RawPointer],[]];

external CFPlugInInstanceGetInterfaceFunctionTable(
    instance_ : CFPlugInInstanceRef,
    interfaceName : CFStringRef,
    ftbl : Pointer[RawPointer]) : CUChar;

external CFPlugInInstanceGetFactoryName(
    instance_ : CFPlugInInstanceRef) : CFStringRef;

external CFPlugInInstanceGetInstanceData(
    instance_ : CFPlugInInstanceRef) : RawPointer;

external CFPlugInInstanceGetTypeID() : CULong;

external CFPlugInInstanceCreateWithInstanceDataSize(
    allocator : CFAllocatorRef,
    instanceDataSize : CLong,
    deallocateInstanceFunction : CFPlugInInstanceDeallocateInstanceDataFunction,
    factoryName : CFStringRef,
    getInterfaceFunction : CFPlugInInstanceGetInterfaceFunction) : CFPlugInInstanceRef;

external kCFPreferencesAnyApplication : CFStringRef;

external kCFPreferencesCurrentApplication : CFStringRef;

external kCFPreferencesAnyHost : CFStringRef;

external kCFPreferencesCurrentHost : CFStringRef;

external kCFPreferencesAnyUser : CFStringRef;

external kCFPreferencesCurrentUser : CFStringRef;

external CFPreferencesCopyAppValue(
    key : CFStringRef,
    applicationID : CFStringRef) : CFPropertyListRef;

external CFPreferencesGetAppBooleanValue(
    key : CFStringRef,
    applicationID : CFStringRef,
    keyExistsAndHasValidFormat : Pointer[CUChar]) : CUChar;

external CFPreferencesGetAppIntegerValue(
    key : CFStringRef,
    applicationID : CFStringRef,
    keyExistsAndHasValidFormat : Pointer[CUChar]) : CLong;

external CFPreferencesSetAppValue(
    key : CFStringRef,
    value : CFPropertyListRef,
    applicationID : CFStringRef);

external CFPreferencesAddSuitePreferencesToApp(
    applicationID : CFStringRef,
    suiteID : CFStringRef);

external CFPreferencesRemoveSuitePreferencesFromApp(
    applicationID : CFStringRef,
    suiteID : CFStringRef);

external CFPreferencesAppSynchronize(
    applicationID : CFStringRef) : CUChar;

external CFPreferencesCopyValue(
    key : CFStringRef,
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef) : CFPropertyListRef;

external CFPreferencesCopyMultiple(
    keysToFetch : CFArrayRef,
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef) : CFDictionaryRef;

external CFPreferencesSetValue(
    key : CFStringRef,
    value : CFPropertyListRef,
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef);

external CFPreferencesSetMultiple(
    keysToSet : CFDictionaryRef,
    keysToRemove : CFArrayRef,
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef);

external CFPreferencesSynchronize(
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef) : CUChar;

external CFPreferencesCopyApplicationList(
    userName : CFStringRef,
    hostName : CFStringRef) : CFArrayRef;

external CFPreferencesCopyKeyList(
    applicationID : CFStringRef,
    userName : CFStringRef,
    hostName : CFStringRef) : CFArrayRef;

external CFPreferencesAppValueIsForced(
    key : CFStringRef,
    applicationID : CFStringRef) : CUChar;

alias CFSocketNativeHandle = Int;

alias CFSocketRef = OpaquePointer;

alias kCFSocketSuccess = 0;
alias kCFSocketError = 4294967295;
alias kCFSocketTimeout = 4294967294;

alias CFSocketError = CLong;

record UnnamedStruct50 (
    protocolFamily : CLong,
    socketType : CLong,
    protocol : CLong,
    address : CFDataRef,
);

alias CFSocketSignature = UnnamedStruct50;

alias kCFSocketNoCallBack = 0;
alias kCFSocketReadCallBack = 1;
alias kCFSocketAcceptCallBack = 2;
alias kCFSocketDataCallBack = 3;
alias kCFSocketConnectCallBack = 4;
alias kCFSocketWriteCallBack = 8;

alias CFSocketCallBackType = CULong;

alias kCFSocketAutomaticallyReenableReadCallBack = 1;
alias kCFSocketAutomaticallyReenableAcceptCallBack = 2;
alias kCFSocketAutomaticallyReenableDataCallBack = 3;
alias kCFSocketAutomaticallyReenableWriteCallBack = 8;
alias kCFSocketLeaveErrors = 64;
alias kCFSocketCloseOnInvalidate = 128;

alias CFSocketCallBack = CCodePointer[[OpaquePointer,CULong,OpaquePointer,RawPointer,RawPointer],[]];

record UnnamedStruct51 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFSocketContext = UnnamedStruct51;

external CFSocketGetTypeID() : CULong;

external CFSocketCreate(
    allocator : CFAllocatorRef,
    protocolFamily : CLong,
    socketType : CLong,
    protocol : CLong,
    callBackTypes : CULong,
    callout : CFSocketCallBack,
    context : Pointer[CFSocketContext]) : CFSocketRef;

external CFSocketCreateWithNative(
    allocator : CFAllocatorRef,
    sock : Int,
    callBackTypes : CULong,
    callout : CFSocketCallBack,
    context : Pointer[CFSocketContext]) : CFSocketRef;

external CFSocketCreateWithSocketSignature(
    allocator : CFAllocatorRef,
    signature : Pointer[CFSocketSignature],
    callBackTypes : CULong,
    callout : CFSocketCallBack,
    context : Pointer[CFSocketContext]) : CFSocketRef;

external CFSocketCreateConnectedToSocketSignature(
    allocator : CFAllocatorRef,
    signature : Pointer[CFSocketSignature],
    callBackTypes : CULong,
    callout : CFSocketCallBack,
    context : Pointer[CFSocketContext],
    timeout : Double) : CFSocketRef;

external CFSocketSetAddress(
    s : CFSocketRef,
    address : CFDataRef) : CLong;

external CFSocketConnectToAddress(
    s : CFSocketRef,
    address : CFDataRef,
    timeout : Double) : CLong;

external CFSocketInvalidate(
    s : CFSocketRef);

external CFSocketIsValid(
    s : CFSocketRef) : CUChar;

external CFSocketCopyAddress(
    s : CFSocketRef) : CFDataRef;

external CFSocketCopyPeerAddress(
    s : CFSocketRef) : CFDataRef;

external CFSocketGetContext(
    s : CFSocketRef,
    context : Pointer[CFSocketContext]);

external CFSocketGetNative(
    s : CFSocketRef) : Int;

external CFSocketCreateRunLoopSource(
    allocator : CFAllocatorRef,
    s : CFSocketRef,
    order : CLong) : CFRunLoopSourceRef;

external CFSocketGetSocketFlags(
    s : CFSocketRef) : CULong;

external CFSocketSetSocketFlags(
    s : CFSocketRef,
    flags : CULong);

external CFSocketDisableCallBacks(
    s : CFSocketRef,
    callBackTypes : CULong);

external CFSocketEnableCallBacks(
    s : CFSocketRef,
    callBackTypes : CULong);

external CFSocketSendData(
    s : CFSocketRef,
    address : CFDataRef,
    data : CFDataRef,
    timeout : Double) : CLong;

external CFSocketRegisterValue(
    nameServerSignature : Pointer[CFSocketSignature],
    timeout : Double,
    name : CFStringRef,
    value : CFPropertyListRef) : CLong;

external CFSocketCopyRegisteredValue(
    nameServerSignature : Pointer[CFSocketSignature],
    timeout : Double,
    name : CFStringRef,
    value : Pointer[CFPropertyListRef],
    nameServerAddress : Pointer[CFDataRef]) : CLong;

external CFSocketRegisterSocketSignature(
    nameServerSignature : Pointer[CFSocketSignature],
    timeout : Double,
    name : CFStringRef,
    signature : Pointer[CFSocketSignature]) : CLong;

external CFSocketCopyRegisteredSocketSignature(
    nameServerSignature : Pointer[CFSocketSignature],
    timeout : Double,
    name : CFStringRef,
    signature : Pointer[CFSocketSignature],
    nameServerAddress : Pointer[CFDataRef]) : CLong;

external CFSocketUnregister(
    nameServerSignature : Pointer[CFSocketSignature],
    timeout : Double,
    name : CFStringRef) : CLong;

external CFSocketSetDefaultNameRegistryPortNumber(
    port : UShort);

external CFSocketGetDefaultNameRegistryPortNumber() : UShort;

external kCFSocketCommandKey : CFStringRef;

external kCFSocketNameKey : CFStringRef;

external kCFSocketValueKey : CFStringRef;

external kCFSocketResultKey : CFStringRef;

external kCFSocketErrorKey : CFStringRef;

external kCFSocketRegisterCommand : CFStringRef;

external kCFSocketRetrieveCommand : CFStringRef;

alias kCFStreamStatusNotOpen = 0;
alias kCFStreamStatusOpening = 1;
alias kCFStreamStatusOpen = 2;
alias kCFStreamStatusReading = 3;
alias kCFStreamStatusWriting = 4;
alias kCFStreamStatusAtEnd = 5;
alias kCFStreamStatusClosed = 6;
alias kCFStreamStatusError = 7;

alias CFStreamStatus = CLong;

alias kCFStreamEventNone = 0;
alias kCFStreamEventOpenCompleted = 1;
alias kCFStreamEventHasBytesAvailable = 2;
alias kCFStreamEventCanAcceptBytes = 4;
alias kCFStreamEventErrorOccurred = 8;
alias kCFStreamEventEndEncountered = 16;

alias CFStreamEventType = CULong;

record UnnamedStruct52 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFStreamClientContext = UnnamedStruct52;

alias CFReadStreamRef = OpaquePointer;

alias CFWriteStreamRef = OpaquePointer;

alias CFReadStreamClientCallBack = CCodePointer[[OpaquePointer,CULong,RawPointer],[]];

alias CFWriteStreamClientCallBack = CCodePointer[[OpaquePointer,CULong,RawPointer],[]];

external CFReadStreamGetTypeID() : CULong;

external CFWriteStreamGetTypeID() : CULong;

external kCFStreamPropertyDataWritten : CFStringRef;

external CFReadStreamCreateWithBytesNoCopy(
    alloc : CFAllocatorRef,
    bytes : Pointer[CUChar],
    length : CLong,
    bytesDeallocator : CFAllocatorRef) : CFReadStreamRef;

external CFWriteStreamCreateWithBuffer(
    alloc : CFAllocatorRef,
    buffer : Pointer[CUChar],
    bufferCapacity : CLong) : CFWriteStreamRef;

external CFWriteStreamCreateWithAllocatedBuffers(
    alloc : CFAllocatorRef,
    bufferAllocator : CFAllocatorRef) : CFWriteStreamRef;

external CFReadStreamCreateWithFile(
    alloc : CFAllocatorRef,
    fileURL : CFURLRef) : CFReadStreamRef;

external CFWriteStreamCreateWithFile(
    alloc : CFAllocatorRef,
    fileURL : CFURLRef) : CFWriteStreamRef;

external CFStreamCreateBoundPair(
    alloc : CFAllocatorRef,
    readStream : Pointer[CFReadStreamRef],
    writeStream : Pointer[CFWriteStreamRef],
    transferBufferSize : CLong);

external kCFStreamPropertyAppendToFile : CFStringRef;

external kCFStreamPropertyFileCurrentOffset : CFStringRef;

external kCFStreamPropertySocketNativeHandle : CFStringRef;

external kCFStreamPropertySocketRemoteHostName : CFStringRef;

external kCFStreamPropertySocketRemotePortNumber : CFStringRef;

external CFStreamCreatePairWithSocket(
    alloc : CFAllocatorRef,
    sock : Int,
    readStream : Pointer[CFReadStreamRef],
    writeStream : Pointer[CFWriteStreamRef]);

external CFStreamCreatePairWithSocketToHost(
    alloc : CFAllocatorRef,
    host : CFStringRef,
    port : CULong,
    readStream : Pointer[CFReadStreamRef],
    writeStream : Pointer[CFWriteStreamRef]);

external CFStreamCreatePairWithPeerSocketSignature(
    alloc : CFAllocatorRef,
    signature : Pointer[CFSocketSignature],
    readStream : Pointer[CFReadStreamRef],
    writeStream : Pointer[CFWriteStreamRef]);

external CFReadStreamGetStatus(
    stream : CFReadStreamRef) : CLong;

external CFWriteStreamGetStatus(
    stream : CFWriteStreamRef) : CLong;

external CFReadStreamCopyError(
    stream : CFReadStreamRef) : CFErrorRef;

external CFWriteStreamCopyError(
    stream : CFWriteStreamRef) : CFErrorRef;

external CFReadStreamOpen(
    stream : CFReadStreamRef) : CUChar;

external CFWriteStreamOpen(
    stream : CFWriteStreamRef) : CUChar;

external CFReadStreamClose(
    stream : CFReadStreamRef);

external CFWriteStreamClose(
    stream : CFWriteStreamRef);

external CFReadStreamHasBytesAvailable(
    stream : CFReadStreamRef) : CUChar;

external CFReadStreamRead(
    stream : CFReadStreamRef,
    buffer : Pointer[CUChar],
    bufferLength : CLong) : CLong;

external CFReadStreamGetBuffer(
    stream : CFReadStreamRef,
    maxBytesToRead : CLong,
    numBytesRead : Pointer[CLong]) : Pointer[CUChar];

external CFWriteStreamCanAcceptBytes(
    stream : CFWriteStreamRef) : CUChar;

external CFWriteStreamWrite(
    stream : CFWriteStreamRef,
    buffer : Pointer[CUChar],
    bufferLength : CLong) : CLong;

external CFReadStreamCopyProperty(
    stream : CFReadStreamRef,
    propertyName : CFStringRef) : CFTypeRef;

external CFWriteStreamCopyProperty(
    stream : CFWriteStreamRef,
    propertyName : CFStringRef) : CFTypeRef;

external CFReadStreamSetProperty(
    stream : CFReadStreamRef,
    propertyName : CFStringRef,
    propertyValue : CFTypeRef) : CUChar;

external CFWriteStreamSetProperty(
    stream : CFWriteStreamRef,
    propertyName : CFStringRef,
    propertyValue : CFTypeRef) : CUChar;

external CFReadStreamSetClient(
    stream : CFReadStreamRef,
    streamEvents : CULong,
    clientCB : CFReadStreamClientCallBack,
    clientContext : Pointer[CFStreamClientContext]) : CUChar;

external CFWriteStreamSetClient(
    stream : CFWriteStreamRef,
    streamEvents : CULong,
    clientCB : CFWriteStreamClientCallBack,
    clientContext : Pointer[CFStreamClientContext]) : CUChar;

external CFReadStreamScheduleWithRunLoop(
    stream : CFReadStreamRef,
    runLoop : CFRunLoopRef,
    runLoopMode : CFStringRef);

external CFWriteStreamScheduleWithRunLoop(
    stream : CFWriteStreamRef,
    runLoop : CFRunLoopRef,
    runLoopMode : CFStringRef);

external CFReadStreamUnscheduleFromRunLoop(
    stream : CFReadStreamRef,
    runLoop : CFRunLoopRef,
    runLoopMode : CFStringRef);

external CFWriteStreamUnscheduleFromRunLoop(
    stream : CFWriteStreamRef,
    runLoop : CFRunLoopRef,
    runLoopMode : CFStringRef);

alias kCFStreamErrorDomainCustom = 4294967295;
alias kCFStreamErrorDomainPOSIX = 1;
alias kCFStreamErrorDomainMacOSStatus = 2;

alias CFStreamErrorDomain = CLong;

record UnnamedStruct53 (
    domain : CLong,
    error : CLong,
);

alias CFStreamError = UnnamedStruct53;

external CFReadStreamGetError(
    stream : CFReadStreamRef) : CFStreamError;

external CFWriteStreamGetError(
    stream : CFWriteStreamRef) : CFStreamError;

alias kCFPropertyListImmutable = 0;
alias kCFPropertyListMutableContainers = 1;
alias kCFPropertyListMutableContainersAndLeaves = 2;

alias CFPropertyListMutabilityOptions = CULong;

external CFPropertyListCreateFromXMLData(
    allocator : CFAllocatorRef,
    xmlData : CFDataRef,
    mutabilityOption : CULong,
    errorString : Pointer[CFStringRef]) : CFPropertyListRef;

external CFPropertyListCreateXMLData(
    allocator : CFAllocatorRef,
    propertyList : CFPropertyListRef) : CFDataRef;

external CFPropertyListCreateDeepCopy(
    allocator : CFAllocatorRef,
    propertyList : CFPropertyListRef,
    mutabilityOption : CULong) : CFPropertyListRef;

alias kCFPropertyListOpenStepFormat = 1;
alias kCFPropertyListXMLFormat_v1_0 = 100;
alias kCFPropertyListBinaryFormat_v1_0 = 200;

alias CFPropertyListFormat = CLong;

external CFPropertyListIsValid(
    plist : CFPropertyListRef,
    format : CLong) : CUChar;

external CFPropertyListWriteToStream(
    propertyList : CFPropertyListRef,
    stream : CFWriteStreamRef,
    format : CLong,
    errorString : Pointer[CFStringRef]) : CLong;

external CFPropertyListCreateFromStream(
    allocator : CFAllocatorRef,
    stream : CFReadStreamRef,
    streamLength : CLong,
    mutabilityOption : CULong,
    format : Pointer[CLong],
    errorString : Pointer[CFStringRef]) : CFPropertyListRef;

alias kCFPropertyListReadCorruptError = 3840;
alias kCFPropertyListReadUnknownVersionError = 3841;
alias kCFPropertyListReadStreamError = 3842;
alias kCFPropertyListWriteStreamError = 3851;

external CFPropertyListCreateWithData(
    allocator : CFAllocatorRef,
    data : CFDataRef,
    options : CULong,
    format : Pointer[CLong],
    error : Pointer[CFErrorRef]) : CFPropertyListRef;

external CFPropertyListCreateWithStream(
    allocator : CFAllocatorRef,
    stream : CFReadStreamRef,
    streamLength : CLong,
    options : CULong,
    format : Pointer[CLong],
    error : Pointer[CFErrorRef]) : CFPropertyListRef;

external CFPropertyListWrite(
    propertyList : CFPropertyListRef,
    stream : CFWriteStreamRef,
    format : CLong,
    options : CULong,
    error : Pointer[CFErrorRef]) : CLong;

external CFPropertyListCreateData(
    allocator : CFAllocatorRef,
    propertyList : CFPropertyListRef,
    format : CLong,
    options : CULong,
    error : Pointer[CFErrorRef]) : CFDataRef;

alias CFSetRetainCallBack = CCodePointer[[OpaquePointer,RawPointer],[RawPointer]];

alias CFSetReleaseCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

alias CFSetCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

alias CFSetEqualCallBack = CCodePointer[[RawPointer,RawPointer],[CUChar]];

alias CFSetHashCallBack = CCodePointer[[RawPointer],[CULong]];

record UnnamedStruct54 (
    version : CLong,
    retain : CFSetRetainCallBack,
    release : CFSetReleaseCallBack,
    copyDescription : CFSetCopyDescriptionCallBack,
    equal : CFSetEqualCallBack,
    hash : CFSetHashCallBack,
);

alias CFSetCallBacks = UnnamedStruct54;

external kCFTypeSetCallBacks : CFSetCallBacks;

external kCFCopyStringSetCallBacks : CFSetCallBacks;

alias CFSetApplierFunction = CCodePointer[[RawPointer,RawPointer],[]];

alias CFSetRef = OpaquePointer;

alias CFMutableSetRef = OpaquePointer;

external CFSetGetTypeID() : CULong;

external CFSetCreate(
    allocator : CFAllocatorRef,
    values : Pointer[RawPointer],
    numValues : CLong,
    callBacks : Pointer[CFSetCallBacks]) : CFSetRef;

external CFSetCreateCopy(
    allocator : CFAllocatorRef,
    theSet : CFSetRef) : CFSetRef;

external CFSetCreateMutable(
    allocator : CFAllocatorRef,
    capacity : CLong,
    callBacks : Pointer[CFSetCallBacks]) : CFMutableSetRef;

external CFSetCreateMutableCopy(
    allocator : CFAllocatorRef,
    capacity : CLong,
    theSet : CFSetRef) : CFMutableSetRef;

external CFSetGetCount(
    theSet : CFSetRef) : CLong;

external CFSetGetCountOfValue(
    theSet : CFSetRef,
    value : RawPointer) : CLong;

external CFSetContainsValue(
    theSet : CFSetRef,
    value : RawPointer) : CUChar;

external CFSetGetValue(
    theSet : CFSetRef,
    value : RawPointer) : RawPointer;

external CFSetGetValueIfPresent(
    theSet : CFSetRef,
    candidate : RawPointer,
    value : Pointer[RawPointer]) : CUChar;

external CFSetGetValues(
    theSet : CFSetRef,
    values : Pointer[RawPointer]);

external CFSetApplyFunction(
    theSet : CFSetRef,
    applier : CFSetApplierFunction,
    context : RawPointer);

external CFSetAddValue(
    theSet : CFMutableSetRef,
    value : RawPointer);

external CFSetReplaceValue(
    theSet : CFMutableSetRef,
    value : RawPointer);

external CFSetSetValue(
    theSet : CFMutableSetRef,
    value : RawPointer);

external CFSetRemoveValue(
    theSet : CFMutableSetRef,
    value : RawPointer);

external CFSetRemoveAllValues(
    theSet : CFMutableSetRef);

alias kCFStringEncodingMacJapanese = 1;
alias kCFStringEncodingMacChineseTrad = 2;
alias kCFStringEncodingMacKorean = 3;
alias kCFStringEncodingMacArabic = 4;
alias kCFStringEncodingMacHebrew = 5;
alias kCFStringEncodingMacGreek = 6;
alias kCFStringEncodingMacCyrillic = 7;
alias kCFStringEncodingMacDevanagari = 9;
alias kCFStringEncodingMacGurmukhi = 10;
alias kCFStringEncodingMacGujarati = 11;
alias kCFStringEncodingMacOriya = 12;
alias kCFStringEncodingMacBengali = 13;
alias kCFStringEncodingMacTamil = 14;
alias kCFStringEncodingMacTelugu = 15;
alias kCFStringEncodingMacKannada = 16;
alias kCFStringEncodingMacMalayalam = 17;
alias kCFStringEncodingMacSinhalese = 18;
alias kCFStringEncodingMacBurmese = 19;
alias kCFStringEncodingMacKhmer = 20;
alias kCFStringEncodingMacThai = 21;
alias kCFStringEncodingMacLaotian = 22;
alias kCFStringEncodingMacGeorgian = 23;
alias kCFStringEncodingMacArmenian = 24;
alias kCFStringEncodingMacChineseSimp = 25;
alias kCFStringEncodingMacTibetan = 26;
alias kCFStringEncodingMacMongolian = 27;
alias kCFStringEncodingMacEthiopic = 28;
alias kCFStringEncodingMacCentralEurRoman = 29;
alias kCFStringEncodingMacVietnamese = 30;
alias kCFStringEncodingMacExtArabic = 31;
alias kCFStringEncodingMacSymbol = 33;
alias kCFStringEncodingMacDingbats = 34;
alias kCFStringEncodingMacTurkish = 35;
alias kCFStringEncodingMacCroatian = 36;
alias kCFStringEncodingMacIcelandic = 37;
alias kCFStringEncodingMacRomanian = 38;
alias kCFStringEncodingMacCeltic = 39;
alias kCFStringEncodingMacGaelic = 40;
alias kCFStringEncodingMacFarsi = 140;
alias kCFStringEncodingMacUkrainian = 152;
alias kCFStringEncodingMacInuit = 236;
alias kCFStringEncodingMacVT100 = 252;
alias kCFStringEncodingMacHFS = 255;
alias kCFStringEncodingISOLatin2 = 514;
alias kCFStringEncodingISOLatin3 = 515;
alias kCFStringEncodingISOLatin4 = 516;
alias kCFStringEncodingISOLatinCyrillic = 517;
alias kCFStringEncodingISOLatinArabic = 518;
alias kCFStringEncodingISOLatinGreek = 519;
alias kCFStringEncodingISOLatinHebrew = 520;
alias kCFStringEncodingISOLatin5 = 521;
alias kCFStringEncodingISOLatin6 = 522;
alias kCFStringEncodingISOLatinThai = 523;
alias kCFStringEncodingISOLatin7 = 525;
alias kCFStringEncodingISOLatin8 = 526;
alias kCFStringEncodingISOLatin9 = 527;
alias kCFStringEncodingISOLatin10 = 528;
alias kCFStringEncodingDOSLatinUS = 1024;
alias kCFStringEncodingDOSGreek = 1029;
alias kCFStringEncodingDOSBalticRim = 1030;
alias kCFStringEncodingDOSLatin1 = 1040;
alias kCFStringEncodingDOSGreek1 = 1041;
alias kCFStringEncodingDOSLatin2 = 1042;
alias kCFStringEncodingDOSCyrillic = 1043;
alias kCFStringEncodingDOSTurkish = 1044;
alias kCFStringEncodingDOSPortuguese = 1045;
alias kCFStringEncodingDOSIcelandic = 1046;
alias kCFStringEncodingDOSHebrew = 1047;
alias kCFStringEncodingDOSCanadianFrench = 1048;
alias kCFStringEncodingDOSArabic = 1049;
alias kCFStringEncodingDOSNordic = 1050;
alias kCFStringEncodingDOSRussian = 1051;
alias kCFStringEncodingDOSGreek2 = 1052;
alias kCFStringEncodingDOSThai = 1053;
alias kCFStringEncodingDOSJapanese = 1056;
alias kCFStringEncodingDOSChineseSimplif = 1057;
alias kCFStringEncodingDOSKorean = 1058;
alias kCFStringEncodingDOSChineseTrad = 1059;
alias kCFStringEncodingWindowsLatin2 = 1281;
alias kCFStringEncodingWindowsCyrillic = 1282;
alias kCFStringEncodingWindowsGreek = 1283;
alias kCFStringEncodingWindowsLatin5 = 1284;
alias kCFStringEncodingWindowsHebrew = 1285;
alias kCFStringEncodingWindowsArabic = 1286;
alias kCFStringEncodingWindowsBalticRim = 1287;
alias kCFStringEncodingWindowsVietnamese = 1288;
alias kCFStringEncodingWindowsKoreanJohab = 1296;
alias kCFStringEncodingANSEL = 1537;
alias kCFStringEncodingJIS_X0201_76 = 1568;
alias kCFStringEncodingJIS_X0208_83 = 1569;
alias kCFStringEncodingJIS_X0208_90 = 1570;
alias kCFStringEncodingJIS_X0212_90 = 1571;
alias kCFStringEncodingJIS_C6226_78 = 1572;
alias kCFStringEncodingShiftJIS_X0213 = 1576;
alias kCFStringEncodingShiftJIS_X0213_MenKuTen = 1577;
alias kCFStringEncodingGB_2312_80 = 1584;
alias kCFStringEncodingGBK_95 = 1585;
alias kCFStringEncodingGB_18030_2000 = 1586;
alias kCFStringEncodingKSC_5601_87 = 1600;
alias kCFStringEncodingKSC_5601_92_Johab = 1601;
alias kCFStringEncodingCNS_11643_92_P1 = 1617;
alias kCFStringEncodingCNS_11643_92_P2 = 1618;
alias kCFStringEncodingCNS_11643_92_P3 = 1619;
alias kCFStringEncodingISO_2022_JP = 2080;
alias kCFStringEncodingISO_2022_JP_2 = 2081;
alias kCFStringEncodingISO_2022_JP_1 = 2082;
alias kCFStringEncodingISO_2022_JP_3 = 2083;
alias kCFStringEncodingISO_2022_CN = 2096;
alias kCFStringEncodingISO_2022_CN_EXT = 2097;
alias kCFStringEncodingISO_2022_KR = 2112;
alias kCFStringEncodingEUC_JP = 2336;
alias kCFStringEncodingEUC_CN = 2352;
alias kCFStringEncodingEUC_TW = 2353;
alias kCFStringEncodingEUC_KR = 2368;
alias kCFStringEncodingShiftJIS = 2561;
alias kCFStringEncodingKOI8_R = 2562;
alias kCFStringEncodingBig5 = 2563;
alias kCFStringEncodingMacRomanLatin1 = 2564;
alias kCFStringEncodingHZ_GB_2312 = 2565;
alias kCFStringEncodingBig5_HKSCS_1999 = 2566;
alias kCFStringEncodingVISCII = 2567;
alias kCFStringEncodingKOI8_U = 2568;
alias kCFStringEncodingBig5_E = 2569;
alias kCFStringEncodingNextStepJapanese = 2818;
alias kCFStringEncodingEBCDIC_US = 3073;
alias kCFStringEncodingEBCDIC_CP037 = 3074;
alias kCFStringEncodingUTF7 = 67109120;
alias kCFStringEncodingUTF7_IMAP = 2576;
alias kCFStringEncodingShiftJIS_X0213_00 = 1576;

alias CFStringEncodings = CLong;

alias CFTreeRetainCallBack = CCodePointer[[RawPointer],[RawPointer]];

alias CFTreeReleaseCallBack = CCodePointer[[RawPointer],[]];

alias CFTreeCopyDescriptionCallBack = CCodePointer[[RawPointer],[OpaquePointer]];

record UnnamedStruct55 (
    version : CLong,
    info : RawPointer,
    retain : CFTreeRetainCallBack,
    release : CFTreeReleaseCallBack,
    copyDescription : CFTreeCopyDescriptionCallBack,
);

alias CFTreeContext = UnnamedStruct55;

alias CFTreeApplierFunction = CCodePointer[[RawPointer,RawPointer],[]];

alias CFTreeRef = OpaquePointer;

external CFTreeGetTypeID() : CULong;

external CFTreeCreate(
    allocator : CFAllocatorRef,
    context : Pointer[CFTreeContext]) : CFTreeRef;

external CFTreeGetParent(
    tree : CFTreeRef) : CFTreeRef;

external CFTreeGetNextSibling(
    tree : CFTreeRef) : CFTreeRef;

external CFTreeGetFirstChild(
    tree : CFTreeRef) : CFTreeRef;

external CFTreeGetContext(
    tree : CFTreeRef,
    context : Pointer[CFTreeContext]);

external CFTreeGetChildCount(
    tree : CFTreeRef) : CLong;

external CFTreeGetChildAtIndex(
    tree : CFTreeRef,
    idx : CLong) : CFTreeRef;

external CFTreeGetChildren(
    tree : CFTreeRef,
    children : Pointer[CFTreeRef]);

external CFTreeApplyFunctionToChildren(
    tree : CFTreeRef,
    applier : CFTreeApplierFunction,
    context : RawPointer);

external CFTreeFindRoot(
    tree : CFTreeRef) : CFTreeRef;

external CFTreeSetContext(
    tree : CFTreeRef,
    context : Pointer[CFTreeContext]);

external CFTreePrependChild(
    tree : CFTreeRef,
    newChild : CFTreeRef);

external CFTreeAppendChild(
    tree : CFTreeRef,
    newChild : CFTreeRef);

external CFTreeInsertSibling(
    tree : CFTreeRef,
    newSibling : CFTreeRef);

external CFTreeRemove(
    tree : CFTreeRef);

external CFTreeRemoveAllChildren(
    tree : CFTreeRef);

external CFTreeSortChildren(
    tree : CFTreeRef,
    comparator : CFComparatorFunction,
    context : RawPointer);

external CFURLCreateDataAndPropertiesFromResource(
    alloc : CFAllocatorRef,
    url : CFURLRef,
    resourceData : Pointer[CFDataRef],
    properties : Pointer[CFDictionaryRef],
    desiredProperties : CFArrayRef,
    errorCode : Pointer[CLong]) : CUChar;

external CFURLWriteDataAndPropertiesToResource(
    url : CFURLRef,
    dataToWrite : CFDataRef,
    propertiesToWrite : CFDictionaryRef,
    errorCode : Pointer[CLong]) : CUChar;

external CFURLDestroyResource(
    url : CFURLRef,
    errorCode : Pointer[CLong]) : CUChar;

external CFURLCreatePropertyFromResource(
    alloc : CFAllocatorRef,
    url : CFURLRef,
    property : CFStringRef,
    errorCode : Pointer[CLong]) : CFTypeRef;

alias kCFURLUnknownError = 4294967286;
alias kCFURLUnknownSchemeError = 4294967285;
alias kCFURLResourceNotFoundError = 4294967284;
alias kCFURLResourceAccessViolationError = 4294967283;
alias kCFURLRemoteHostUnavailableError = 4294967282;
alias kCFURLImproperArgumentsError = 4294967281;
alias kCFURLUnknownPropertyKeyError = 4294967280;
alias kCFURLPropertyKeyUnavailableError = 4294967279;
alias kCFURLTimeoutError = 4294967278;

alias CFURLError = CLong;

external kCFURLFileExists : CFStringRef;

external kCFURLFileDirectoryContents : CFStringRef;

external kCFURLFileLength : CFStringRef;

external kCFURLFileLastModificationTime : CFStringRef;

external kCFURLFilePOSIXMode : CFStringRef;

external kCFURLFileOwnerID : CFStringRef;

external kCFURLHTTPStatusCode : CFStringRef;

external kCFURLHTTPStatusLine : CFStringRef;

alias CFAttributedStringRef = OpaquePointer;

alias CFMutableAttributedStringRef = OpaquePointer;

external CFAttributedStringGetTypeID() : CULong;

external CFAttributedStringCreate(
    alloc : CFAllocatorRef,
    str : CFStringRef,
    attributes : CFDictionaryRef) : CFAttributedStringRef;

external CFAttributedStringCreateWithSubstring(
    alloc : CFAllocatorRef,
    aStr : CFAttributedStringRef,
    range : CFRange) : CFAttributedStringRef;

external CFAttributedStringCreateCopy(
    alloc : CFAllocatorRef,
    aStr : CFAttributedStringRef) : CFAttributedStringRef;

external CFAttributedStringGetString(
    aStr : CFAttributedStringRef) : CFStringRef;

external CFAttributedStringGetLength(
    aStr : CFAttributedStringRef) : CLong;

external CFAttributedStringGetAttributes(
    aStr : CFAttributedStringRef,
    loc : CLong,
    effectiveRange : Pointer[CFRange]) : CFDictionaryRef;

external CFAttributedStringGetAttribute(
    aStr : CFAttributedStringRef,
    loc : CLong,
    attrName : CFStringRef,
    effectiveRange : Pointer[CFRange]) : CFTypeRef;

external CFAttributedStringGetAttributesAndLongestEffectiveRange(
    aStr : CFAttributedStringRef,
    loc : CLong,
    inRange : CFRange,
    longestEffectiveRange : Pointer[CFRange]) : CFDictionaryRef;

external CFAttributedStringGetAttributeAndLongestEffectiveRange(
    aStr : CFAttributedStringRef,
    loc : CLong,
    attrName : CFStringRef,
    inRange : CFRange,
    longestEffectiveRange : Pointer[CFRange]) : CFTypeRef;

external CFAttributedStringCreateMutableCopy(
    alloc : CFAllocatorRef,
    maxLength : CLong,
    aStr : CFAttributedStringRef) : CFMutableAttributedStringRef;

external CFAttributedStringCreateMutable(
    alloc : CFAllocatorRef,
    maxLength : CLong) : CFMutableAttributedStringRef;

external CFAttributedStringReplaceString(
    aStr : CFMutableAttributedStringRef,
    range : CFRange,
    replacement : CFStringRef);

external CFAttributedStringGetMutableString(
    aStr : CFMutableAttributedStringRef) : CFMutableStringRef;

external CFAttributedStringSetAttributes(
    aStr : CFMutableAttributedStringRef,
    range : CFRange,
    replacement : CFDictionaryRef,
    clearOtherAttributes : CUChar);

external CFAttributedStringSetAttribute(
    aStr : CFMutableAttributedStringRef,
    range : CFRange,
    attrName : CFStringRef,
    value : CFTypeRef);

external CFAttributedStringRemoveAttribute(
    aStr : CFMutableAttributedStringRef,
    range : CFRange,
    attrName : CFStringRef);

external CFAttributedStringReplaceAttributedString(
    aStr : CFMutableAttributedStringRef,
    range : CFRange,
    replacement : CFAttributedStringRef);

external CFAttributedStringBeginEditing(
    aStr : CFMutableAttributedStringRef);

external CFAttributedStringEndEditing(
    aStr : CFMutableAttributedStringRef);

alias CFNotificationCenterRef = OpaquePointer;

alias CFNotificationCallback = CCodePointer[[OpaquePointer,RawPointer,OpaquePointer,RawPointer,OpaquePointer],[]];

alias CFNotificationSuspensionBehaviorDrop = 1;
alias CFNotificationSuspensionBehaviorCoalesce = 2;
alias CFNotificationSuspensionBehaviorHold = 3;
alias CFNotificationSuspensionBehaviorDeliverImmediately = 4;

alias CFNotificationSuspensionBehavior = CLong;

external CFNotificationCenterGetTypeID() : CULong;

external CFNotificationCenterGetLocalCenter() : CFNotificationCenterRef;

external CFNotificationCenterGetDarwinNotifyCenter() : CFNotificationCenterRef;

external CFNotificationCenterAddObserver(
    center : CFNotificationCenterRef,
    observer : RawPointer,
    callBack : CFNotificationCallback,
    name : CFStringRef,
    object : RawPointer,
    suspensionBehavior : CLong);

external CFNotificationCenterRemoveObserver(
    center : CFNotificationCenterRef,
    observer : RawPointer,
    name : CFStringRef,
    object : RawPointer);

external CFNotificationCenterRemoveEveryObserver(
    center : CFNotificationCenterRef,
    observer : RawPointer);

external CFNotificationCenterPostNotification(
    center : CFNotificationCenterRef,
    name : CFStringRef,
    object : RawPointer,
    userInfo : CFDictionaryRef,
    deliverImmediately : CUChar);

alias kCFNotificationDeliverImmediately = 1;
alias kCFNotificationPostToAllSessions = 2;

external CFNotificationCenterPostNotificationWithOptions(
    center : CFNotificationCenterRef,
    name : CFStringRef,
    object : RawPointer,
    userInfo : CFDictionaryRef,
    options : CULong);

alias CFMachPortRef = OpaquePointer;

record UnnamedStruct56 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFMachPortContext = UnnamedStruct56;

alias CFMachPortCallBack = CCodePointer[[OpaquePointer,RawPointer,CLong,RawPointer],[]];

alias CFMachPortInvalidationCallBack = CCodePointer[[OpaquePointer,RawPointer],[]];

external CFMachPortGetTypeID() : CULong;

external CFMachPortCreate(
    allocator : CFAllocatorRef,
    callout : CFMachPortCallBack,
    context : Pointer[CFMachPortContext],
    shouldFreeInfo : Pointer[CUChar]) : CFMachPortRef;

external CFMachPortCreateWithPort(
    allocator : CFAllocatorRef,
    portNum : UInt,
    callout : CFMachPortCallBack,
    context : Pointer[CFMachPortContext],
    shouldFreeInfo : Pointer[CUChar]) : CFMachPortRef;

external CFMachPortGetPort(
    port : CFMachPortRef) : UInt;

external CFMachPortGetContext(
    port : CFMachPortRef,
    context : Pointer[CFMachPortContext]);

external CFMachPortInvalidate(
    port : CFMachPortRef);

external CFMachPortIsValid(
    port : CFMachPortRef) : CUChar;

external CFMachPortGetInvalidationCallBack(
    port : CFMachPortRef) : CFMachPortInvalidationCallBack;

external CFMachPortSetInvalidationCallBack(
    port : CFMachPortRef,
    callout : CFMachPortInvalidationCallBack);

external CFMachPortCreateRunLoopSource(
    allocator : CFAllocatorRef,
    port : CFMachPortRef,
    order : CLong) : CFRunLoopSourceRef;

external CFStringTokenizerCopyBestStringLanguage(
    string : CFStringRef,
    range : CFRange) : CFStringRef;

alias CFStringTokenizerRef = OpaquePointer;

alias kCFStringTokenizerUnitWord = 0;
alias kCFStringTokenizerUnitSentence = 1;
alias kCFStringTokenizerUnitParagraph = 2;
alias kCFStringTokenizerUnitLineBreak = 3;
alias kCFStringTokenizerUnitWordBoundary = 4;
alias kCFStringTokenizerAttributeLatinTranscription = 65536;
alias kCFStringTokenizerAttributeLanguage = 131072;

alias kCFStringTokenizerTokenNone = 0;
alias kCFStringTokenizerTokenNormal = 1;
alias kCFStringTokenizerTokenHasSubTokensMask = 2;
alias kCFStringTokenizerTokenHasDerivedSubTokensMask = 4;
alias kCFStringTokenizerTokenHasHasNumbersMask = 8;
alias kCFStringTokenizerTokenHasNonLettersMask = 16;
alias kCFStringTokenizerTokenIsCJWordMask = 32;

alias CFStringTokenizerTokenType = CULong;

external CFStringTokenizerGetTypeID() : CULong;

external CFStringTokenizerCreate(
    alloc : CFAllocatorRef,
    string : CFStringRef,
    range : CFRange,
    options : CULong,
    locale : CFLocaleRef) : CFStringTokenizerRef;

external CFStringTokenizerSetString(
    tokenizer : CFStringTokenizerRef,
    string : CFStringRef,
    range : CFRange);

external CFStringTokenizerGoToTokenAtIndex(
    tokenizer : CFStringTokenizerRef,
    index : CLong) : CULong;

external CFStringTokenizerAdvanceToNextToken(
    tokenizer : CFStringTokenizerRef) : CULong;

external CFStringTokenizerGetCurrentTokenRange(
    tokenizer : CFStringTokenizerRef) : CFRange;

external CFStringTokenizerCopyCurrentTokenAttribute(
    tokenizer : CFStringTokenizerRef,
    attribute : CULong) : CFTypeRef;

external CFStringTokenizerGetCurrentSubTokens(
    tokenizer : CFStringTokenizerRef,
    ranges : Pointer[CFRange],
    maxRangeLength : CLong,
    derivedSubTokens : CFMutableArrayRef) : CLong;

alias CFFileDescriptorNativeDescriptor = Int;

alias CFFileDescriptorRef = OpaquePointer;

alias kCFFileDescriptorReadCallBack = 1;
alias kCFFileDescriptorWriteCallBack = 2;

alias CFFileDescriptorCallBack = CCodePointer[[OpaquePointer,CULong,RawPointer],[]];

record UnnamedStruct57 (
    version : CLong,
    info : RawPointer,
    retain : CCodePointer[[RawPointer],[RawPointer]],
    release : CCodePointer[[RawPointer],[]],
    copyDescription : CCodePointer[[RawPointer],[OpaquePointer]],
);

alias CFFileDescriptorContext = UnnamedStruct57;

external CFFileDescriptorGetTypeID() : CULong;

external CFFileDescriptorCreate(
    allocator : CFAllocatorRef,
    fd : Int,
    closeOnInvalidate : CUChar,
    callout : CFFileDescriptorCallBack,
    context : Pointer[CFFileDescriptorContext]) : CFFileDescriptorRef;

external CFFileDescriptorGetNativeDescriptor(
    f : CFFileDescriptorRef) : Int;

external CFFileDescriptorGetContext(
    f : CFFileDescriptorRef,
    context : Pointer[CFFileDescriptorContext]);

external CFFileDescriptorEnableCallBacks(
    f : CFFileDescriptorRef,
    callBackTypes : CULong);

external CFFileDescriptorDisableCallBacks(
    f : CFFileDescriptorRef,
    callBackTypes : CULong);

external CFFileDescriptorInvalidate(
    f : CFFileDescriptorRef);

external CFFileDescriptorIsValid(
    f : CFFileDescriptorRef) : CUChar;

external CFFileDescriptorCreateRunLoopSource(
    allocator : CFAllocatorRef,
    f : CFFileDescriptorRef,
    order : CLong) : CFRunLoopSourceRef;
