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