ICU 57.1 57.1
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
91struct UConverter;
92
94typedef 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
117#define UCNV_ESCAPE_JAVA "J"
123#define UCNV_ESCAPE_C "C"
129#define UCNV_ESCAPE_XML_DEC "D"
135#define UCNV_ESCAPE_XML_HEX "X"
140#define UCNV_ESCAPE_UNICODE "U"
141
147#define UCNV_ESCAPE_CSS2 "S"
148
155typedef 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
186
187
192typedef struct {
193 uint16_t size;
196 const UChar *source;
198 char *target;
199 const char *targetLimit;
200 int32_t *offsets;
202
203
208typedef struct {
209 uint16_t size;
212 const char *source;
213 const char *sourceLimit;
216 int32_t *offsets;
218
219
235 const void *context,
236 UConverterFromUnicodeArgs *fromUArgs,
237 const UChar* codeUnits,
238 int32_t length,
239 UChar32 codePoint,
241 UErrorCode * err);
242
243
244
259 const void *context,
261 const char* codeUnits,
262 int32_t length,
264 UErrorCode * err);
265
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
372 const void *context,
373 UConverterFromUnicodeArgs *fromUArgs,
374 const UChar* codeUnits,
375 int32_t length,
376 UChar32 codePoint,
378 UErrorCode * err);
379
380
400 const void *context,
402 const char* codeUnits,
403 int32_t length,
405 UErrorCode * err);
406
426 const void *context,
428 const char* codeUnits,
429 int32_t length,
431 UErrorCode * err);
432
452 const void *context,
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 fromUnicode callback function parameter.
Definition: ucnv_err.h:192
const char * targetLimit
Pointer to the limit (end + 1) of target 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:194
const UChar * source
Pointer to the source source buffer.
Definition: ucnv_err.h:196
int32_t * offsets
Pointer to the buffer that recieves the offsets.
Definition: ucnv_err.h:200
const UChar * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:197
uint16_t size
The size of this struct.
Definition: ucnv_err.h:193
char * target
Pointer to the target buffer.
Definition: ucnv_err.h:198
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:195
The structure for the toUnicode callback function parameter.
Definition: ucnv_err.h:208
const UChar * targetLimit
Pointer to the limit (end + 1) of target buffer.
Definition: ucnv_err.h:215
UBool flush
The internal state of converter will be reset and data flushed if set to TRUE.
Definition: ucnv_err.h:210
uint16_t size
The size of this struct.
Definition: ucnv_err.h:209
UChar * target
Pointer to the target buffer.
Definition: ucnv_err.h:214
UConverter * converter
Pointer to the converter that is opened and to which this struct is passed as an argument.
Definition: ucnv_err.h:211
int32_t * offsets
Pointer to the buffer that recieves the offsets.
Definition: ucnv_err.h:216
const char * sourceLimit
Pointer to the limit (end + 1) of source buffer.
Definition: ucnv_err.h:213
const char * source
Pointer to the source source buffer.
Definition: ucnv_err.h:212
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,...
struct UConverter UConverter
Definition: ucnv_err.h:94
UConverterCallbackReason
The process condition code to be used with the callbacks.
Definition: ucnv_err.h:155
@ UCNV_IRREGULAR
The codepoint is not a regular sequence in the encoding.
Definition: ucnv_err.h:166
@ UCNV_ILLEGAL
The code point is illegal.
Definition: ucnv_err.h:158
@ UCNV_RESET
The callback is called with this reason when a 'reset' has occured.
Definition: ucnv_err.h:171
@ UCNV_CLOSE
Called when the converter is closed.
Definition: ucnv_err.h:174
@ UCNV_UNASSIGNED
The code point is unassigned.
Definition: ucnv_err.h:156
@ UCNV_CLONE
Called when ucnv_safeClone() is called on the converter.
Definition: ucnv_err.h:176
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,...
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,...
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...
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...
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,...
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,...
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,...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:332
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
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
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:476