ICU 50.1.2  50.1.2
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 {
186 
187 
192 typedef struct {
193  uint16_t size;
196  const UChar *source;
198  char *target;
199  const char *targetLimit;
200  int32_t *offsets;
202 
203 
208 typedef struct {
209  uint16_t size;
212  const char *source;
213  const char *sourceLimit;
216  int32_t *offsets;
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,
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,
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,
292  UErrorCode * err);
293 
316  const void *context,
317  UConverterFromUnicodeArgs *fromUArgs,
318  const UChar* codeUnits,
319  int32_t length,
320  UChar32 codePoint,
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,
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,
405  UErrorCode * err);
406 
426  const void *context,
427  UConverterToUnicodeArgs *toUArgs,
428  const char* codeUnits,
429  int32_t length,
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,
457  UErrorCode * err);
458 
459 #endif
460 
461 #endif
462 
463 /*UCNV_ERR_H*/
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:208
const char * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:199
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:155
int32_t * offsets
Pointer to the buffer that recieves the offsets.
Definition: ucnv_err.h:216
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:194
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:195
Called when ucnv_safeClone() is called on the converter.
Definition: ucnv_err.h:176
The code point is illegal.
Definition: ucnv_err.h:158
const UChar * source
Pointer to the source source buffer.
Definition: ucnv_err.h:196
const char * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:213
The code point is unassigned.
Definition: ucnv_err.h:156
const UChar * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:215
The structure for the fromUnicode callback function parameter.
Definition: ucnv_err.h:192
Called when the converter is closed.
Definition: ucnv_err.h:174
char * target
Pointer to the target buffer.
Definition: ucnv_err.h:198
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:197
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:210
UChar * target
Pointer to the target buffer.
Definition: ucnv_err.h:214
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:298
The callback is called with this reason when a 'reset' has occured.
Definition: ucnv_err.h:171
uint16_t size
The size of this struct.
Definition: ucnv_err.h:193
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:278
The codepoint is not a regular sequence in the encoding.
Definition: ucnv_err.h:166
uint16_t size
The size of this struct.
Definition: ucnv_err.h:209
struct UConverter UConverter
Definition: ucnv_err.h:94
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
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 recieves the offsets.
Definition: ucnv_err.h:200
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:212
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:211
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
int8_t UBool
The ICU boolean type.
Definition: umachine.h:200