00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __UCNVMBCS_H__
00018 #define __UCNVMBCS_H__
00019
00020 #include "unicode/utypes.h"
00021
00022
00023
00024 enum {
00025 MBCS_STATE_ILLEGAL,
00026 MBCS_STATE_CHANGE_ONLY,
00027 MBCS_STATE_UNASSIGNED,
00028
00029 MBCS_STATE_FALLBACK_DIRECT_16,
00030 MBCS_STATE_FALLBACK_DIRECT_20,
00031
00032 MBCS_STATE_VALID_DIRECT_16,
00033 MBCS_STATE_VALID_DIRECT_20,
00034
00035 MBCS_STATE_VALID_16,
00036 MBCS_STATE_VALID_16_PAIR
00037 };
00038
00039 enum {
00040 MBCS_OUTPUT_1,
00041 MBCS_OUTPUT_2,
00042 MBCS_OUTPUT_3,
00043 MBCS_OUTPUT_4,
00044
00045 MBCS_OUTPUT_3_EUC=8,
00046 MBCS_OUTPUT_4_EUC
00047 };
00048
00049 typedef struct {
00050 uint32_t offset;
00051 UChar32 codePoint;
00052 } _MBCSToUFallback;
00053
00054 typedef struct UConverterMBCSTable {
00055
00056 uint8_t countStates;
00057 uint32_t countToUFallbacks;
00058
00059 const int32_t (*stateTable)[256];
00060 const uint16_t *unicodeCodeUnits;
00061 const _MBCSToUFallback *toUFallbacks;
00062
00063
00064 const uint16_t *fromUnicodeTable;
00065 const uint8_t *fromUnicodeBytes;
00066 uint8_t outputType;
00067 } UConverterMBCSTable;
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 typedef struct {
00098 UVersionInfo version;
00099 uint32_t countStates,
00100 countToUFallbacks,
00101 offsetToUCodeUnits,
00102 offsetFromUTable,
00103 offsetFromUBytes,
00104 flags,
00105 reserved;
00106 } _MBCSHeader;
00107
00108 struct UConverterSharedData;
00109 typedef struct UConverterSharedData UConverterSharedData;
00110
00111 U_CFUNC UChar32
00112 _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
00113 const char **pSource, const char *sourceLimit,
00114 UBool useFallback);
00115
00116 U_CFUNC UBool
00117 _MBCSIsLeadByte(UConverterSharedData *sharedData, char byte);
00118
00119 U_CFUNC int32_t
00120 _MBCSFromUChar32(UConverterSharedData *sharedData,
00121 UChar32 c, uint32_t *pValue,
00122 UBool useFallback);
00123
00124 #endif