]> git.saurik.com Git - apple/cf.git/blob - StringEncodings.subproj/CFStringEncodingConverterPriv.h
CF-299.35.tar.gz
[apple/cf.git] / StringEncodings.subproj / CFStringEncodingConverterPriv.h
1 /*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /* CFStringEncodingConverterPriv.h
26 Copyright (c) 1998-2003, Apple, Inc. All rights reserved.
27 */
28
29 #if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__)
30 #define __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ 1
31
32 #include <CoreFoundation/CFBase.h>
33 #include "CFStringEncodingConverterExt.h"
34
35 #define MAX_IANA_ALIASES (4)
36
37 typedef UInt32 (*_CFToBytesProc)(const void *converter, UInt32 flags, const UniChar *characters, UInt32 numChars, UInt8 *bytes, UInt32 maxByteLen, UInt32 *usedByteLen);
38 typedef UInt32 (*_CFToUnicodeProc)(const void *converter, UInt32 flags, const UInt8 *bytes, UInt32 numBytes, UniChar *characters, UInt32 maxCharLen, UInt32 *usedCharLen);
39
40 typedef struct {
41 _CFToBytesProc toBytes;
42 _CFToUnicodeProc toUnicode;
43 _CFToUnicodeProc toCanonicalUnicode;
44 void *_toBytes; // original proc
45 void *_toUnicode; // original proc
46 UInt16 maxLen;
47 UInt16 :16;
48 CFStringEncodingToBytesLenProc toBytesLen;
49 CFStringEncodingToUnicodeLenProc toUnicodeLen;
50 CFStringEncodingToBytesFallbackProc toBytesFallback;
51 CFStringEncodingToUnicodeFallbackProc toUnicodeFallback;
52 CFStringEncodingToBytesPrecomposeProc toBytesPrecompose;
53 CFStringEncodingIsValidCombiningCharacterProc isValidCombiningChar;
54 } _CFEncodingConverter;
55
56 typedef struct {
57 UInt32 encoding;
58 _CFEncodingConverter *converter;
59 const char *encodingName;
60 const char *ianaNames[MAX_IANA_ALIASES];
61 const char *loadablePath;
62 CFStringEncodingBootstrapProc bootstrap;
63 CFStringEncodingToBytesFallbackProc toBytesFallback;
64 CFStringEncodingToUnicodeFallbackProc toUnicodeFallback;
65 UInt32 scriptCode;
66 } _CFConverterEntry;
67
68 extern CFStringEncodingConverter __CFConverterASCII;
69 extern CFStringEncodingConverter __CFConverterISOLatin1;
70 extern CFStringEncodingConverter __CFConverterMacRoman;
71 extern CFStringEncodingConverter __CFConverterWinLatin1;
72 extern CFStringEncodingConverter __CFConverterNextStepLatin;
73 extern CFStringEncodingConverter __CFConverterUTF8;
74
75
76 #endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ */
77