00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __XML_CHAR_ENCODING_H__
00022 #define __XML_CHAR_ENCODING_H__
00023
00024 #include <libxml/xmlversion.h>
00025
00026 #ifdef LIBXML_ICONV_ENABLED
00027 #include <iconv.h>
00028 #endif
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00051 typedef enum {
00052 XML_CHAR_ENCODING_ERROR= -1,
00053 XML_CHAR_ENCODING_NONE= 0,
00054 XML_CHAR_ENCODING_UTF8= 1,
00055 XML_CHAR_ENCODING_UTF16LE= 2,
00056 XML_CHAR_ENCODING_UTF16BE= 3,
00057 XML_CHAR_ENCODING_UCS4LE= 4,
00058 XML_CHAR_ENCODING_UCS4BE= 5,
00059 XML_CHAR_ENCODING_EBCDIC= 6,
00060 XML_CHAR_ENCODING_UCS4_2143=7,
00061 XML_CHAR_ENCODING_UCS4_3412=8,
00062 XML_CHAR_ENCODING_UCS2= 9,
00063 XML_CHAR_ENCODING_8859_1= 10,
00064 XML_CHAR_ENCODING_8859_2= 11,
00065 XML_CHAR_ENCODING_8859_3= 12,
00066 XML_CHAR_ENCODING_8859_4= 13,
00067 XML_CHAR_ENCODING_8859_5= 14,
00068 XML_CHAR_ENCODING_8859_6= 15,
00069 XML_CHAR_ENCODING_8859_7= 16,
00070 XML_CHAR_ENCODING_8859_8= 17,
00071 XML_CHAR_ENCODING_8859_9= 18,
00072 XML_CHAR_ENCODING_2022_JP= 19,
00073 XML_CHAR_ENCODING_SHIFT_JIS=20,
00074 XML_CHAR_ENCODING_EUC_JP= 21,
00075 XML_CHAR_ENCODING_ASCII= 22
00076 } xmlCharEncoding;
00077
00094 typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
00095 const unsigned char *in, int *inlen);
00096
00097
00116 typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
00117 const unsigned char *in, int *inlen);
00118
00119
00120
00121
00122
00123
00124
00125 typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
00126 typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
00127 struct _xmlCharEncodingHandler {
00128 char *name;
00129 xmlCharEncodingInputFunc input;
00130 xmlCharEncodingOutputFunc output;
00131 #ifdef LIBXML_ICONV_ENABLED
00132 iconv_t iconv_in;
00133 iconv_t iconv_out;
00134 #endif
00135 };
00136
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 #include <libxml/tree.h>
00141 #ifdef __cplusplus
00142 extern "C" {
00143 #endif
00144
00145
00146
00147
00148 XMLPUBFUN void XMLCALL
00149 xmlInitCharEncodingHandlers (void);
00150 XMLPUBFUN void XMLCALL
00151 xmlCleanupCharEncodingHandlers (void);
00152 XMLPUBFUN void XMLCALL
00153 xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
00154 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00155 xmlGetCharEncodingHandler (xmlCharEncoding enc);
00156 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00157 xmlFindCharEncodingHandler (const char *name);
00158 XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
00159 xmlNewCharEncodingHandler (const char *name,
00160 xmlCharEncodingInputFunc input,
00161 xmlCharEncodingOutputFunc output);
00162
00163
00164
00165
00166 XMLPUBFUN int XMLCALL
00167 xmlAddEncodingAlias (const char *name,
00168 const char *alias);
00169 XMLPUBFUN int XMLCALL
00170 xmlDelEncodingAlias (const char *alias);
00171 XMLPUBFUN const char * XMLCALL
00172 xmlGetEncodingAlias (const char *alias);
00173 XMLPUBFUN void XMLCALL
00174 xmlCleanupEncodingAliases (void);
00175 XMLPUBFUN xmlCharEncoding XMLCALL
00176 xmlParseCharEncoding (const char *name);
00177 XMLPUBFUN const char * XMLCALL
00178 xmlGetCharEncodingName (xmlCharEncoding enc);
00179
00180
00181
00182
00183 XMLPUBFUN xmlCharEncoding XMLCALL
00184 xmlDetectCharEncoding (const unsigned char *in,
00185 int len);
00186
00187 XMLPUBFUN int XMLCALL
00188 xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
00189 xmlBufferPtr out,
00190 xmlBufferPtr in);
00191
00192 XMLPUBFUN int XMLCALL
00193 xmlCharEncInFunc (xmlCharEncodingHandler *handler,
00194 xmlBufferPtr out,
00195 xmlBufferPtr in);
00196 XMLPUBFUN int XMLCALL
00197 xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
00198 xmlBufferPtr out,
00199 xmlBufferPtr in);
00200 XMLPUBFUN int XMLCALL
00201 xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
00202
00203
00204
00205
00206 XMLPUBFUN int XMLCALL
00207 UTF8Toisolat1 (unsigned char *out,
00208 int *outlen,
00209 const unsigned char *in,
00210 int *inlen);
00211 XMLPUBFUN int XMLCALL
00212 isolat1ToUTF8 (unsigned char *out,
00213 int *outlen,
00214 const unsigned char *in,
00215 int *inlen);
00216 XMLPUBFUN int XMLCALL
00217 xmlGetUTF8Char (const unsigned char *utf,
00218 int *len);
00219
00220
00221
00222
00223 XMLPUBFUN int XMLCALL
00224 xmlCheckUTF8 (const unsigned char *utf);
00225 XMLPUBFUN int XMLCALL
00226 xmlUTF8Strsize (const xmlChar *utf,
00227 int len);
00228 XMLPUBFUN xmlChar * XMLCALL
00229 xmlUTF8Strndup (const xmlChar *utf,
00230 int len);
00231 XMLPUBFUN xmlChar * XMLCALL
00232 xmlUTF8Strpos (const xmlChar *utf,
00233 int pos);
00234 XMLPUBFUN int XMLCALL
00235 xmlUTF8Strloc (const xmlChar *utf,
00236 const xmlChar *utfchar);
00237 XMLPUBFUN xmlChar * XMLCALL
00238 xmlUTF8Strsub (const xmlChar *utf,
00239 int start,
00240 int len);
00241 XMLPUBFUN int XMLCALL
00242 xmlUTF8Strlen (const xmlChar *utf);
00243 XMLPUBFUN int XMLCALL
00244 xmlUTF8Size (const xmlChar *utf);
00245 XMLPUBFUN int XMLCALL
00246 xmlUTF8Charcmp (const xmlChar *utf1,
00247 const xmlChar *utf2);
00248 #ifdef __cplusplus
00249 }
00250 #endif
00251
00252 #endif
00253