ICU 56.1: ucnv_err.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

ucnv_err.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (C) 1999-2009, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 *
7 *
8 * ucnv_err.h:
9 */
10
83 #ifndef UCNV_ERR_H
84 #define UCNV_ERR_H
85
86 #include "unicode/utypes.h"
87
88 #if !UCONFIG_NO_CONVERSION
89
91 struct UConverter;
92
94 typedef struct UConverter UConverter;
95
100 #define UCNV_SUB_STOP_ON_ILLEGAL "i"
101
106 #define UCNV_SKIP_STOP_ON_ILLEGAL "i"
107
112 #define UCNV_ESCAPE_ICU NULL
113
117 #define UCNV_ESCAPE_JAVA "J"
118
123 #define UCNV_ESCAPE_C "C"
124
129 #define UCNV_ESCAPE_XML_DEC "D"
130
135 #define UCNV_ESCAPE_XML_HEX "X"
136
140 #define UCNV_ESCAPE_UNICODE "U"
141
147 #define UCNV_ESCAPE_CSS2 "S"
148
155 typedef enum {
156 UCNV_UNASSIGNED = 0,
158 UCNV_ILLEGAL = 1,
166 UCNV_IRREGULAR = 2,
171 UCNV_RESET = 3,
174 UCNV_CLOSE = 4,
176 UCNV_CLONE = 5
185 } UConverterCallbackReason;
186
187
192 typedef struct {
193 uint16_t size;
194 UBool flush;
195 UConverter *converter;
196 const UChar *source;
197 const UChar *sourceLimit;
198 char *target;
199 const char *targetLimit;
200 int32_t *offsets;
201 } UConverterFromUnicodeArgs;
202
203
208 typedef struct {
209 uint16_t size;
210 UBool flush;
211 UConverter *converter;
212 const char *source;
213 const char *sourceLimit;
214 UChar *target;
215 const UChar *targetLimit;
216 int32_t *offsets;
217 } UConverterToUnicodeArgs;
218
219
234 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (
235 const void *context,
236 UConverterFromUnicodeArgs *fromUArgs,
237 const UChar* codeUnits,
238 int32_t length,
239 UChar32 codePoint,
240 UConverterCallbackReason reason,
241 UErrorCode * err);
242
243
244
258 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (
259 const void *context,
260 UConverterToUnicodeArgs *toUArgs,
261 const char* codeUnits,
262 int32_t length,
263 UConverterCallbackReason reason,
264 UErrorCode * err);
265
285 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (
286 const void *context,
287 UConverterFromUnicodeArgs *fromUArgs,
288 const UChar* codeUnits,
289 int32_t length,
290 UChar32 codePoint,
291 UConverterCallbackReason reason,
292 UErrorCode * err);
293
315 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
316 const void *context,
317 UConverterFromUnicodeArgs *fromUArgs,
318 const UChar* codeUnits,
319 int32_t length,
320 UChar32 codePoint,
321 UConverterCallbackReason reason,
322 UErrorCode * err);
323
371 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (
372 const void *context,
373 UConverterFromUnicodeArgs *fromUArgs,
374 const UChar* codeUnits,
375 int32_t length,
376 UChar32 codePoint,
377 UConverterCallbackReason reason,
378 UErrorCode * err);
379
380
399 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (
400 const void *context,
401 UConverterToUnicodeArgs *toUArgs,
402 const char* codeUnits,
403 int32_t length,
404 UConverterCallbackReason reason,
405 UErrorCode * err);
406
425 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_SUBSTITUTE (
426 const void *context,
427 UConverterToUnicodeArgs *toUArgs,
428 const char* codeUnits,
429 int32_t length,
430 UConverterCallbackReason reason,
431 UErrorCode * err);
432
451 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (
452 const void *context,
453 UConverterToUnicodeArgs *toUArgs,
454 const char* codeUnits,
455 int32_t length,
456 UConverterCallbackReason reason,
457 UErrorCode * err);
458
459 #endif
460
461 #endif
462
463 /*UCNV_ERR_H*/
UConverterToUnicodeArgs
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:208
UConverterFromUnicodeArgs::targetLimit
const char * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:199
UConverterCallbackReason
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:155
UConverterToUnicodeArgs::offsets
int32_t * offsets
Pointer to the buffer that recieves the offsets.
Definition: ucnv_err.h:216
UConverterFromUnicodeArgs::flush
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:194
UConverterFromUnicodeArgs::converter
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:195
UCNV_CLONE
Called when ucnv_safeClone() is called on the converter.
Definition: ucnv_err.h:176
UCNV_ILLEGAL
The code point is illegal.
Definition: ucnv_err.h:158
UConverterFromUnicodeArgs::source
const UChar * source
Pointer to the source source buffer.
Definition: ucnv_err.h:196
UConverterToUnicodeArgs::sourceLimit
const char * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:213
UCNV_UNASSIGNED
The code point is unassigned.
Definition: ucnv_err.h:156
UConverterToUnicodeArgs::targetLimit
const UChar * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:215
UConverterFromUnicodeArgs
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:192
UCNV_CLOSE
Called when the converter is closed.
Definition: ucnv_err.h:174
UConverterFromUnicodeArgs::target
char * target
Pointer to the target buffer.
Definition: ucnv_err.h:198
UCNV_FROM_U_CALLBACK_STOP
void UCNV_FROM_U_CALLBACK_STOP(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately.
UCNV_FROM_U_CALLBACK_SKIP
void UCNV_FROM_U_CALLBACK_SKIP(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback skips any ILLEGAL_SEQUENCE, or skips only UNASSINGED_SEQUENCE depending on the context parameter simply ignoring those characters.
UCNV_TO_U_CALLBACK_ESCAPE
void UCNV_TO_U_CALLBACK_ESCAPE(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE wit...
UConverterFromUnicodeArgs::sourceLimit
const UChar * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:197
UConverterToUnicodeArgs::flush
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:210
UConverterToUnicodeArgs::target
UChar * target
Pointer to the target buffer.
Definition: ucnv_err.h:214
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:332
UCNV_RESET
The callback is called with this reason when a 'reset' has occured.
Definition: ucnv_err.h:171
UConverterFromUnicodeArgs::size
uint16_t size
The size of this struct.
Definition: ucnv_err.h:193
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
UCNV_IRREGULAR
The codepoint is not a regular sequence in the encoding.
Definition: ucnv_err.h:166
UConverterToUnicodeArgs::size
uint16_t size
The size of this struct.
Definition: ucnv_err.h:209
UConverter
struct UConverter UConverter
Definition: ucnv_err.h:94
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
UCNV_TO_U_CALLBACK_SUBSTITUTE
void UCNV_TO_U_CALLBACK_SUBSTITUTE(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE...
UConverterFromUnicodeArgs::offsets
int32_t * offsets
Pointer to the buffer that recieves the offsets.
Definition: ucnv_err.h:200
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UCNV_TO_U_CALLBACK_STOP
void UCNV_TO_U_CALLBACK_STOP(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately.
UCNV_TO_U_CALLBACK_SKIP
void UCNV_TO_U_CALLBACK_SKIP(const void *context, UConverterToUnicodeArgs *toUArgs, const char *codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback skips any ILLEGAL_SEQUENCE, or skips only UNASSINGED_SEQUENCE depending on the context parameter simply ignoring those characters.
UCNV_FROM_U_CALLBACK_ESCAPE
void UCNV_FROM_U_CALLBACK_ESCAPE(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE w...
UConverterToUnicodeArgs::source
const char * source
Pointer to the source source buffer.
Definition: ucnv_err.h:212
UCNV_FROM_U_CALLBACK_SUBSTITUTE
void UCNV_FROM_U_CALLBACK_SUBSTITUTE(const void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar *codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode *err)
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE...
UConverterToUnicodeArgs::converter
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:211
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234