From c657df13157bd2eaa2389ea4b257f04a74bf33ab Mon Sep 17 00:00:00 2001 From: PHO <pho@cielonegro.org> Date: Tue, 19 Oct 2010 21:34:17 +0900 Subject: [PATCH] CFString.h --- Bindings/CoreFoundation/CFString.hsc | 41 ++++++++++++++++++++++++++++ cbits/helper_CFString.c | 25 +++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Bindings/CoreFoundation/CFString.hsc b/Bindings/CoreFoundation/CFString.hsc index ea41f9f..ed7d0a1 100644 --- a/Bindings/CoreFoundation/CFString.hsc +++ b/Bindings/CoreFoundation/CFString.hsc @@ -157,3 +157,44 @@ import Bindings.CoreFoundation.CFLocale #ccall CFStringTransform, <CFMutableStringRef> -> Ptr <CFRange> -> <CFStringRef> -> <Boolean> -> IO <Boolean> +#cinline kCFStringTransformStripCombiningMarks, IO <CFStringRef> +#cinline kCFStringTransformToLatin , IO <CFStringRef> +#cinline kCFStringTransformFullwidthHalfwidth , IO <CFStringRef> +#cinline kCFStringTransformLatinKatakana , IO <CFStringRef> +#cinline kCFStringTransformLatinHiragana , IO <CFStringRef> +#cinline kCFStringTransformHiraganaKatakana , IO <CFStringRef> +#cinline kCFStringTransformMandarinLatin , IO <CFStringRef> +#cinline kCFStringTransformLatinHangul , IO <CFStringRef> +#cinline kCFStringTransformLatinArabic , IO <CFStringRef> +#cinline kCFStringTransformLatinHebrew , IO <CFStringRef> +#cinline kCFStringTransformLatinThai , IO <CFStringRef> +#cinline kCFStringTransformLatinCyrillic , IO <CFStringRef> +#cinline kCFStringTransformLatinGreek , IO <CFStringRef> +#cinline kCFStringTransformToXMLHex , IO <CFStringRef> +#cinline kCFStringTransformToUnicodeName , IO <CFStringRef> +#cinline kCFStringTransformStripDiacritics , IO <CFStringRef> + +#ccall CFStringIsEncodingAvailable , <CFStringEncoding> -> IO <Boolean> +#ccall CFStringGetListOfAvailableEncodings , IO (Ptr <CFStringEncoding>) +#ccall CFStringGetNameOfEncoding , <CFStringEncoding> -> IO <CFStringRef> +#ccall CFStringConvertEncodingToNSStringEncoding , <CFStringEncoding> -> IO CULong +#ccall CFStringConvertEncodingToWindowsCodepage , <CFStringEncoding> -> IO <UInt32> +#ccall CFStringConvertWindowsCodepageToEncoding , <UInt32> -> IO <CFStringEncoding> +#ccall CFStringConvertIANACharSetNameToEncoding , <CFStringRef> -> IO <CFStringEncoding> +#ccall CFStringConvertEncodingToIANACharSetName , <CFStringEncoding> -> IO <CFStringRef> +#ccall CFStringGetMostCompatibleMacStringEncoding, <CFStringEncoding> -> IO <CFStringEncoding> + +#starttype CFStringInlineBuffer +# array_field buffer , <UniChar> +# field theString , <CFStringRef> +# field directBuffer , Ptr <UniChar> +# field rangeToBuffer , <CFRange> +# field bufferedRangeStart, <CFIndex> +# field bufferedRangeEnd , <CFIndex> +#stoptype + +#cinline CFStringInitInlineBuffer , <CFStringRef> -> Ptr <CFStringInlineBuffer> -> Ptr <CFRange> -> IO () +#cinline CFStringGetCharacterFromInlineBuffer, Ptr <CFStringInlineBuffer> -> <CFIndex> -> IO <UniChar> + +#ccall CFShow , <CFTypeRef> -> IO () +#ccall CFShowStr, <CFStringRef> -> IO () diff --git a/cbits/helper_CFString.c b/cbits/helper_CFString.c index b6288ef..544b1b4 100644 --- a/cbits/helper_CFString.c +++ b/cbits/helper_CFString.c @@ -166,3 +166,28 @@ inline_CFStringFindAndReplace(CFMutableStringRef theString, } #endif +BC_INLINE_(kCFStringTransformStripCombiningMarks, CFStringRef) +BC_INLINE_(kCFStringTransformToLatin , CFStringRef) +BC_INLINE_(kCFStringTransformFullwidthHalfwidth , CFStringRef) +BC_INLINE_(kCFStringTransformLatinKatakana , CFStringRef) +BC_INLINE_(kCFStringTransformLatinHiragana , CFStringRef) +BC_INLINE_(kCFStringTransformHiraganaKatakana , CFStringRef) +BC_INLINE_(kCFStringTransformMandarinLatin , CFStringRef) +BC_INLINE_(kCFStringTransformLatinHangul , CFStringRef) +BC_INLINE_(kCFStringTransformLatinArabic , CFStringRef) +BC_INLINE_(kCFStringTransformLatinHebrew , CFStringRef) +BC_INLINE_(kCFStringTransformLatinThai , CFStringRef) +BC_INLINE_(kCFStringTransformLatinCyrillic , CFStringRef) +BC_INLINE_(kCFStringTransformLatinGreek , CFStringRef) +BC_INLINE_(kCFStringTransformToXMLHex , CFStringRef) +BC_INLINE_(kCFStringTransformToUnicodeName , CFStringRef) +BC_INLINE_(kCFStringTransformStripDiacritics , CFStringRef) + +void +inline_CFStringInitInlineBuffer(CFStringRef str, + CFStringInlineBuffer *buf, + CFRange* range) { + return CFStringInitInlineBuffer(str, buf, *range); +} + +BC_INLINE2(CFStringGetCharacterFromInlineBuffer, CFStringInlineBuffer*, CFIndex, UniChar) -- 2.40.0