Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ucnv_err.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 1999-2001, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 **********************************************************************
00006  *
00007  *
00008  *   ucnv_err.h:
00009  */
00052 /* This file isn't designed to be included all by itself. */
00053 #ifndef UCNV_H
00054 # include "unicode/ucnv.h"
00055  /* and the rest of this file will be ignored. */
00056 #endif
00057 
00058 #ifndef UCNV_ERR_H
00059 #define UCNV_ERR_H
00060 
00061 #include "unicode/utypes.h"
00062 
00066 #define UCNV_SUB_STOP_ON_ILLEGAL "i"
00067 #define UCNV_SKIP_STOP_ON_ILLEGAL "i"
00068 
00072 #define UCNV_ESCAPE_ICU     NULL
00073 #define UCNV_ESCAPE_JAVA    "J"
00074 #define UCNV_ESCAPE_C       "C"
00075 #define UCNV_ESCAPE_XML_DEC "D"
00076 #define UCNV_ESCAPE_XML_HEX "X"
00077 
00081 typedef enum {
00082     UCNV_UNASSIGNED = 0,  /* The code point is unassigned */
00083     UCNV_ILLEGAL = 1,     /* The code point is illegal, for example, 
00084                              \x81\x2E is illegal in SJIS because \x2E
00085                              is not a valid trail byte for the \x81 
00086                              lead byte. */
00087     UCNV_IRREGULAR = 2,   /* The codepoint is not a regular sequence in 
00088                              the encoding. For example, \xC0\xE1 would
00089                              be irregular in UTF-8 because \x61 represents
00090                              the same character. */
00091     UCNV_RESET = 3,       /* The callback is called with this reason when a
00092                              'reset' has occured. Callback should reset all
00093                              state. */
00094     UCNV_CLOSE = 4        /* Called when the converter is closed. The
00095                              callback should release any allocated memory.*/
00096 } UConverterCallbackReason;
00097 
00098 
00102 typedef struct {
00103     uint16_t size;
00104     UBool flush;
00105     UConverter *converter;
00106     const UChar *source;
00107     const UChar *sourceLimit;
00108     char *target;
00109     const char *targetLimit;
00110     int32_t *offsets;  /* *offset = blah ; offset++; */
00111 } UConverterFromUnicodeArgs;
00112 
00113 
00117 typedef struct {
00118     uint16_t size;
00119     UBool flush;
00120     UConverter *converter;
00121     const char *source;
00122     const char *sourceLimit;
00123     UChar *target;
00124     const UChar *targetLimit;
00125     int32_t *offsets;
00126 } UConverterToUnicodeArgs;
00127 
00128 
00135 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (
00136                   void *context,
00137                   UConverterFromUnicodeArgs *fromUArgs,
00138                   const UChar* codeUnits,
00139                   int32_t length,
00140                   UChar32 codePoint,
00141                   UConverterCallbackReason reason,
00142                   UErrorCode * err);
00143 
00144 
00145 
00153 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (
00154                   void *context,
00155                   UConverterToUnicodeArgs *fromUArgs,
00156                   const char* codeUnits,
00157                   int32_t length,
00158                   UConverterCallbackReason reason,
00159                   UErrorCode * err);
00160 
00173 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (
00174                   void *context,
00175                   UConverterFromUnicodeArgs *fromUArgs,
00176                   const UChar* codeUnits,
00177                   int32_t length,
00178                   UChar32 codePoint,
00179                   UConverterCallbackReason reason,
00180                   UErrorCode * err);
00181 
00196 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
00197                   void *context,
00198                   UConverterFromUnicodeArgs *fromUArgs,
00199                   const UChar* codeUnits,
00200                   int32_t length,
00201                   UChar32 codePoint,
00202                   UConverterCallbackReason reason,
00203                   UErrorCode * err);
00204 
00245 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (
00246                   void *context,
00247                   UConverterFromUnicodeArgs *fromUArgs,
00248                   const UChar* codeUnits,
00249                   int32_t length,
00250                   UChar32 codePoint,
00251                   UConverterCallbackReason reason,
00252                   UErrorCode * err);
00253 
00254 
00267 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (
00268                   void *context,
00269                   UConverterToUnicodeArgs *fromUArgs,
00270                   const char* codeUnits,
00271                   int32_t length,
00272                   UConverterCallbackReason reason,
00273                   UErrorCode * err);
00274 
00286 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SUBSTITUTE (
00287                   void *context,
00288                   UConverterToUnicodeArgs *fromUArgs,
00289                   const char* codeUnits,
00290                   int32_t length,
00291                   UConverterCallbackReason reason,
00292                   UErrorCode * err);
00293 
00302 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (
00303                   void *context,
00304                   UConverterToUnicodeArgs *fromUArgs,
00305                   const char* codeUnits,
00306                   int32_t length,
00307                   UConverterCallbackReason reason,
00308                   UErrorCode * err);
00309 
00310 #endif
00311 
00312 /*UCNV_ERR_H*/ 

Generated at Tue Jun 12 14:04:00 2001 for ICU 1.8.1 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000