00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SCSU_H
00020 #define SCSU_H 1
00021
00022 #include "unicode/utypes.h"
00023
00024
00033
00034 #define USCSU_NUM_WINDOWS 8
00035 #define USCSU_NUM_STATIC_WINDOWS 8
00036
00037
00038 #define USCSU_MAX_INDEX 0xFF
00039
00040
00041 #define USCSU_BUFSIZE 3
00042
00044 struct UnicodeCompressor {
00045
00047 int32_t fCurrentWindow;
00048
00050 int32_t fOffsets [ USCSU_NUM_WINDOWS ];
00051
00053 int32_t fMode;
00054
00056 int32_t fIndexCount [ USCSU_MAX_INDEX + 1 ];
00057
00059 int32_t fTimeStamps [ USCSU_NUM_WINDOWS ];
00060
00062 int32_t fTimeStamp;
00063
00065 uint8_t fBuffer [ USCSU_BUFSIZE ];
00066
00068 int32_t fBufferLength;
00069 };
00070 typedef struct UnicodeCompressor UnicodeCompressor;
00071
00079 U_CAPI void U_EXPORT2 scsu_init(UnicodeCompressor *comp);
00080
00087 U_CAPI void U_EXPORT2 scsu_reset(UnicodeCompressor *comp);
00088
00116 U_CAPI void U_EXPORT2 scsu_compress(UnicodeCompressor *comp,
00117 uint8_t **target,
00118 const uint8_t *targetLimit,
00119 const UChar **source,
00120 const UChar *sourceLimit,
00121 UErrorCode *status);
00122
00152 U_CAPI void U_EXPORT2 scsu_decompress(UnicodeCompressor *comp,
00153 UChar **target,
00154 const UChar *targetLimit,
00155 const uint8_t **source,
00156 const uint8_t *sourceLimit,
00157 UErrorCode *status);
00158
00159 #endif