ICU 73.2  73.2
ucnv_err.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /*
00004 **********************************************************************
00005 *   Copyright (C) 1999-2009, International Business Machines
00006 *   Corporation and others.  All Rights Reserved.
00007 **********************************************************************
00008  *
00009  *
00010  *   ucnv_err.h:
00011  */
00012 
00085 #ifndef UCNV_ERR_H
00086 #define UCNV_ERR_H
00087 
00088 #include "unicode/utypes.h"
00089 
00090 #if !UCONFIG_NO_CONVERSION
00091 
00093 struct UConverter;
00094 
00096 typedef struct UConverter UConverter;
00097 
00102 #define UCNV_SUB_STOP_ON_ILLEGAL "i"
00103 
00108 #define UCNV_SKIP_STOP_ON_ILLEGAL "i"
00109 
00114 #define UCNV_ESCAPE_ICU       NULL
00115 
00119 #define UCNV_ESCAPE_JAVA      "J"
00120 
00125 #define UCNV_ESCAPE_C         "C"
00126 
00131 #define UCNV_ESCAPE_XML_DEC   "D"
00132 
00137 #define UCNV_ESCAPE_XML_HEX   "X"
00138 
00142 #define UCNV_ESCAPE_UNICODE   "U"
00143 
00149 #define UCNV_ESCAPE_CSS2   "S"
00150 
00157 typedef enum {
00158     UCNV_UNASSIGNED = 0,  
00160     UCNV_ILLEGAL = 1,     
00168     UCNV_IRREGULAR = 2,   
00173     UCNV_RESET = 3,       
00176     UCNV_CLOSE = 4,        
00178     UCNV_CLONE = 5         
00187 } UConverterCallbackReason;
00188 
00189 
00194 typedef struct {
00195     uint16_t size;              
00196     UBool flush;                
00197     UConverter *converter;      
00198     const UChar *source;        
00199     const UChar *sourceLimit;   
00200     char *target;               
00201     const char *targetLimit;    
00202     int32_t *offsets;           
00203 } UConverterFromUnicodeArgs;
00204 
00205 
00210 typedef struct {
00211     uint16_t size;              
00212     UBool flush;                
00213     UConverter *converter;      
00214     const char *source;         
00215     const char *sourceLimit;    
00216     UChar *target;              
00217     const UChar *targetLimit;   
00218     int32_t *offsets;           
00219 } UConverterToUnicodeArgs;
00220 
00221 
00236 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (
00237                   const void *context,
00238                   UConverterFromUnicodeArgs *fromUArgs,
00239                   const UChar* codeUnits,
00240                   int32_t length,
00241                   UChar32 codePoint,
00242                   UConverterCallbackReason reason,
00243                   UErrorCode * err);
00244 
00245 
00246 
00260 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (
00261                   const void *context,
00262                   UConverterToUnicodeArgs *toUArgs,
00263                   const char* codeUnits,
00264                   int32_t length,
00265                   UConverterCallbackReason reason,
00266                   UErrorCode * err);
00267 
00287 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (
00288                   const void *context,
00289                   UConverterFromUnicodeArgs *fromUArgs,
00290                   const UChar* codeUnits,
00291                   int32_t length,
00292                   UChar32 codePoint,
00293                   UConverterCallbackReason reason,
00294                   UErrorCode * err);
00295 
00317 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
00318                   const void *context,
00319                   UConverterFromUnicodeArgs *fromUArgs,
00320                   const UChar* codeUnits,
00321                   int32_t length,
00322                   UChar32 codePoint,
00323                   UConverterCallbackReason reason,
00324                   UErrorCode * err);
00325 
00373 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (
00374                   const void *context,
00375                   UConverterFromUnicodeArgs *fromUArgs,
00376                   const UChar* codeUnits,
00377                   int32_t length,
00378                   UChar32 codePoint,
00379                   UConverterCallbackReason reason,
00380                   UErrorCode * err);
00381 
00382 
00401 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (
00402                   const void *context,
00403                   UConverterToUnicodeArgs *toUArgs,
00404                   const char* codeUnits,
00405                   int32_t length,
00406                   UConverterCallbackReason reason,
00407                   UErrorCode * err);
00408 
00427 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SUBSTITUTE (
00428                   const void *context,
00429                   UConverterToUnicodeArgs *toUArgs,
00430                   const char* codeUnits,
00431                   int32_t length,
00432                   UConverterCallbackReason reason,
00433                   UErrorCode * err);
00434 
00453 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (
00454                   const void *context,
00455                   UConverterToUnicodeArgs *toUArgs,
00456                   const char* codeUnits,
00457                   int32_t length,
00458                   UConverterCallbackReason reason,
00459                   UErrorCode * err);
00460 
00461 #endif
00462 
00463 #endif
00464 
00465 /*UCNV_ERR_H*/