00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __XML_CHAR_ENCODING_H__
00023 #define __XML_CHAR_ENCODING_H__
00024
00025 #include <libxml/xmlversion.h>
00026
00027 #ifdef LIBXML_ICONV_ENABLED
00028 #include <iconv.h>
00029 #endif
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 typedef enum {
00056 XML_CHAR_ENCODING_ERROR= -1,
00057 XML_CHAR_ENCODING_NONE= 0,
00058 XML_CHAR_ENCODING_UTF8= 1,
00059 XML_CHAR_ENCODING_UTF16LE= 2,
00060 XML_CHAR_ENCODING_UTF16BE= 3,
00061 XML_CHAR_ENCODING_UCS4LE= 4,
00062 XML_CHAR_ENCODING_UCS4BE= 5,
00063 XML_CHAR_ENCODING_EBCDIC= 6,
00064 XML_CHAR_ENCODING_UCS4_2143=7,
00065 XML_CHAR_ENCODING_UCS4_3412=8,
00066 XML_CHAR_ENCODING_UCS2= 9,
00067 XML_CHAR_ENCODING_8859_1= 10,
00068 XML_CHAR_ENCODING_8859_2= 11,
00069 XML_CHAR_ENCODING_8859_3= 12,
00070 XML_CHAR_ENCODING_8859_4= 13,
00071 XML_CHAR_ENCODING_8859_5= 14,
00072 XML_CHAR_ENCODING_8859_6= 15,
00073 XML_CHAR_ENCODING_8859_7= 16,
00074 XML_CHAR_ENCODING_8859_8= 17,
00075 XML_CHAR_ENCODING_8859_9= 18,
00076 XML_CHAR_ENCODING_2022_JP= 19,
00077 XML_CHAR_ENCODING_SHIFT_JIS=20,
00078 XML_CHAR_ENCODING_EUC_JP= 21,
00079 XML_CHAR_ENCODING_ASCII= 22
00080 } xmlCharEncoding;
00081
00098 typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
00099 const unsigned char *in, int *inlen);
00100
00101
00120 typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
00121 const unsigned char *in, int *inlen);
00122
00123
00124
00125
00126
00127
00128
00129 typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
00130 typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
00131 struct _xmlCharEncodingHandler {
00132 char *name;
00133 xmlCharEncodingInputFunc input;
00134 xmlCharEncodingOutputFunc output;
00135 #ifdef LIBXML_ICONV_ENABLED
00136 iconv_t iconv_in;
00137 iconv_t iconv_out;
00138 #endif
00139 };
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144 #include <libxml/tree.h>
00145 #ifdef __cplusplus
00146 extern "C" {
00147 #endif
00148
00149
00150
00151
00152 XMLPUBFUN void XMLCALL
00153 xmlInitCharEncodingHandlers (void);
00154 XMLPUBFUN void XMLCALL
00155 xmlCleanupCharEncodingHandlers (void);
00156 XMLPUBFUN void XMLCALL
00157 xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
00158 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00159 xmlGetCharEncodingHandler (xmlCharEncoding enc);
00160 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00161 xmlFindCharEncodingHandler (const char *name);
00162 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00163 xmlNewCharEncodingHandler (const char *name,
00164 xmlCharEncodingInputFunc input,
00165 xmlCharEncodingOutputFunc output);
00166
00167
00168
00169
00170 XMLPUBFUN int XMLCALL
00171 xmlAddEncodingAlias (const char *name,
00172 const char *alias);
00173 XMLPUBFUN int XMLCALL
00174 xmlDelEncodingAlias (const char *alias);
00175 XMLPUBFUN const char * XMLCALL
00176 xmlGetEncodingAlias (const char *alias);
00177 XMLPUBFUN void XMLCALL
00178 xmlCleanupEncodingAliases (void);
00179 XMLPUBFUN xmlCharEncoding XMLCALL
00180 xmlParseCharEncoding (const char *name);
00181 XMLPUBFUN const char * XMLCALL
00182 xmlGetCharEncodingName (xmlCharEncoding enc);
00183
00184
00185
00186
00187 XMLPUBFUN xmlCharEncoding XMLCALL
00188 xmlDetectCharEncoding (const unsigned char *in,
00189 int len);
00190
00191 XMLPUBFUN int XMLCALL
00192 xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
00193 xmlBufferPtr out,
00194 xmlBufferPtr in);
00195
00196 XMLPUBFUN int XMLCALL
00197 xmlCharEncInFunc (xmlCharEncodingHandler *handler,
00198 xmlBufferPtr out,
00199 xmlBufferPtr in);
00200 XMLPUBFUN int XMLCALL
00201 xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
00202 xmlBufferPtr out,
00203 xmlBufferPtr in);
00204 XMLPUBFUN int XMLCALL
00205 xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
00206
00207
00208
00209
00210 #ifdef LIBXML_OUTPUT_ENABLED
00211 XMLPUBFUN int XMLCALL
00212 UTF8Toisolat1 (unsigned char *out,
00213 int *outlen,
00214 const unsigned char *in,
00215 int *inlen);
00216 #endif
00217 XMLPUBFUN int XMLCALL
00218 isolat1ToUTF8 (unsigned char *out,
00219 int *outlen,
00220 const unsigned char *in,
00221 int *inlen);
00222 #ifdef __cplusplus
00223 }
00224 #endif
00225
00226 #endif