ICU 64.2  64.2
ucnv_err.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 **********************************************************************
5 * Copyright (C) 1999-2009, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8  *
9  *
10  * ucnv_err.h:
11  */
12 
85 #ifndef UCNV_ERR_H
86 #define UCNV_ERR_H
87 
88 #include "unicode/utypes.h"
89 
90 #if !UCONFIG_NO_CONVERSION
91 
93 struct UConverter;
94 
96 typedef struct UConverter UConverter;
97 
102 #define UCNV_SUB_STOP_ON_ILLEGAL "i"
103 
108 #define UCNV_SKIP_STOP_ON_ILLEGAL "i"
109 
114 #define UCNV_ESCAPE_ICU NULL
115 
119 #define UCNV_ESCAPE_JAVA "J"
120 
125 #define UCNV_ESCAPE_C "C"
126 
131 #define UCNV_ESCAPE_XML_DEC "D"
132 
137 #define UCNV_ESCAPE_XML_HEX "X"
138 
142 #define UCNV_ESCAPE_UNICODE "U"
143 
149 #define UCNV_ESCAPE_CSS2 "S"
150 
157 typedef enum {
188 
189 
194 typedef struct {
195  uint16_t size;
198  const UChar *source;
200  char *target;
201  const char *targetLimit;
202  int32_t *offsets;
204 
205 
210 typedef struct {
211  uint16_t size;
214  const char *source;
215  const char *sourceLimit;
218  int32_t *offsets;
220 
221 
236 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (
237  const void *context,
238  UConverterFromUnicodeArgs *fromUArgs,
239  const UChar* codeUnits,
240  int32_t length,
241  UChar32 codePoint,
243  UErrorCode * err);
244 
245 
246 
260 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (
261  const void *context,
262  UConverterToUnicodeArgs *toUArgs,
263  const char* codeUnits,
264  int32_t length,
266  UErrorCode * err);
267 
287 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (
288  const void *context,
289  UConverterFromUnicodeArgs *fromUArgs,
290  const UChar* codeUnits,
291  int32_t length,
292  UChar32 codePoint,
294  UErrorCode * err);
295 
318  const void *context,
319  UConverterFromUnicodeArgs *fromUArgs,
320  const UChar* codeUnits,
321  int32_t length,
322  UChar32 codePoint,
324  UErrorCode * err);
325 
373 U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (
374  const void *context,
375  UConverterFromUnicodeArgs *fromUArgs,
376  const UChar* codeUnits,
377  int32_t length,
378  UChar32 codePoint,
380  UErrorCode * err);
381 
382 
401 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (
402  const void *context,
403  UConverterToUnicodeArgs *toUArgs,
404  const char* codeUnits,
405  int32_t length,
407  UErrorCode * err);
408 
428  const void *context,
429  UConverterToUnicodeArgs *toUArgs,
430  const char* codeUnits,
431  int32_t length,
433  UErrorCode * err);
434 
453 U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (
454  const void *context,
455  UConverterToUnicodeArgs *toUArgs,
456  const char* codeUnits,
457  int32_t length,
459  UErrorCode * err);
460 
461 #endif
462 
463 #endif
464 
465 /*UCNV_ERR_H*/
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:210
const char * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:201
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:157
int32_t * offsets
Pointer to the buffer that receives the offsets.
Definition: ucnv_err.h:218
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:196
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:197
Called when ucnv_safeClone() is called on the converter.
Definition: ucnv_err.h:178
The code point is illegal.
Definition: ucnv_err.h:160
const UChar * source
Pointer to the source source buffer.
Definition: ucnv_err.h:198
const char * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:215
The code point is unassigned.
Definition: ucnv_err.h:158
const UChar * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:217
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:194
Called when the converter is closed.
Definition: ucnv_err.h:176
char * target
Pointer to the target buffer.
Definition: ucnv_err.h:200
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.
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.
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...
const UChar * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:199
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:212
UChar * target
Pointer to the target buffer.
Definition: ucnv_err.h:216
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:389
The callback is called with this reason when a 'reset' has occurred.
Definition: ucnv_err.h:173
uint16_t size
The size of this struct.
Definition: ucnv_err.h:195
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:342
The codepoint is not a regular sequence in the encoding.
Definition: ucnv_err.h:168
uint16_t size
The size of this struct.
Definition: ucnv_err.h:211
struct UConverter UConverter
Definition: ucnv_err.h:96
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
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...
int32_t * offsets
Pointer to the buffer that receives the offsets.
Definition: ucnv_err.h:202
Basic definitions for ICU, for both C and C++ APIs.
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.
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.
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...
const char * source
Pointer to the source source buffer.
Definition: ucnv_err.h:214
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...
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:213
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225