File indexing completed on 2025-10-31 09:06:17
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 #ifndef __XML_CHAR_ENCODING_H__
0023 #define __XML_CHAR_ENCODING_H__
0024 
0025 #include <libxml/xmlversion.h>
0026 
0027 #ifdef LIBXML_ICONV_ENABLED
0028 #include <iconv.h>
0029 #endif
0030 
0031 #ifdef __cplusplus
0032 extern "C" {
0033 #endif
0034 
0035 typedef enum {
0036     XML_ENC_ERR_SUCCESS     =  0,
0037     XML_ENC_ERR_SPACE       = -1,
0038     XML_ENC_ERR_INPUT       = -2,
0039     XML_ENC_ERR_PARTIAL     = -3,
0040     XML_ENC_ERR_INTERNAL    = -4,
0041     XML_ENC_ERR_MEMORY      = -5
0042 } xmlCharEncError;
0043 
0044 
0045 
0046 
0047 
0048 
0049 
0050 
0051 
0052 
0053 
0054 
0055 
0056 
0057 
0058 
0059 
0060 
0061 
0062 
0063 
0064 
0065 typedef enum {
0066     XML_CHAR_ENCODING_ERROR=   -1, 
0067     XML_CHAR_ENCODING_NONE= 0, 
0068     XML_CHAR_ENCODING_UTF8= 1, 
0069     XML_CHAR_ENCODING_UTF16LE=  2, 
0070     XML_CHAR_ENCODING_UTF16BE=  3, 
0071     XML_CHAR_ENCODING_UCS4LE=   4, 
0072     XML_CHAR_ENCODING_UCS4BE=   5, 
0073     XML_CHAR_ENCODING_EBCDIC=   6, 
0074     XML_CHAR_ENCODING_UCS4_2143=7, 
0075     XML_CHAR_ENCODING_UCS4_3412=8, 
0076     XML_CHAR_ENCODING_UCS2= 9, 
0077     XML_CHAR_ENCODING_8859_1=   10,
0078     XML_CHAR_ENCODING_8859_2=   11,
0079     XML_CHAR_ENCODING_8859_3=   12,
0080     XML_CHAR_ENCODING_8859_4=   13,
0081     XML_CHAR_ENCODING_8859_5=   14,
0082     XML_CHAR_ENCODING_8859_6=   15,
0083     XML_CHAR_ENCODING_8859_7=   16,
0084     XML_CHAR_ENCODING_8859_8=   17,
0085     XML_CHAR_ENCODING_8859_9=   18,
0086     XML_CHAR_ENCODING_2022_JP=  19,
0087     XML_CHAR_ENCODING_SHIFT_JIS=20,
0088     XML_CHAR_ENCODING_EUC_JP=   21,
0089     XML_CHAR_ENCODING_ASCII=    22 
0090 } xmlCharEncoding;
0091 
0092 
0093 
0094 
0095 
0096 
0097 
0098 
0099 
0100 
0101 
0102 
0103 
0104 
0105 
0106 
0107 
0108 typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
0109                                          const unsigned char *in, int *inlen);
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117 
0118 
0119 
0120 
0121 
0122 
0123 
0124 
0125 
0126 
0127 
0128 
0129 
0130 typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
0131                                           const unsigned char *in, int *inlen);
0132 
0133 
0134 
0135 
0136 
0137 
0138 typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
0139 typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
0140 struct _xmlCharEncodingHandler {
0141     char                       *name;
0142     xmlCharEncodingInputFunc   input;
0143     xmlCharEncodingOutputFunc  output;
0144 #ifdef LIBXML_ICONV_ENABLED
0145     iconv_t                    iconv_in;
0146     iconv_t                    iconv_out;
0147 #endif 
0148 #ifdef LIBXML_ICU_ENABLED
0149     struct _uconv_t            *uconv_in;
0150     struct _uconv_t            *uconv_out;
0151 #endif 
0152 };
0153 
0154 
0155 
0156 
0157 XML_DEPRECATED
0158 XMLPUBFUN void
0159     xmlInitCharEncodingHandlers (void);
0160 XML_DEPRECATED
0161 XMLPUBFUN void
0162     xmlCleanupCharEncodingHandlers  (void);
0163 XMLPUBFUN void
0164     xmlRegisterCharEncodingHandler  (xmlCharEncodingHandlerPtr handler);
0165 XMLPUBFUN int
0166     xmlLookupCharEncodingHandler    (xmlCharEncoding enc,
0167                      xmlCharEncodingHandlerPtr *out);
0168 XMLPUBFUN int
0169     xmlOpenCharEncodingHandler  (const char *name,
0170                      int output,
0171                      xmlCharEncodingHandlerPtr *out);
0172 XMLPUBFUN xmlCharEncodingHandlerPtr
0173     xmlGetCharEncodingHandler   (xmlCharEncoding enc);
0174 XMLPUBFUN xmlCharEncodingHandlerPtr
0175     xmlFindCharEncodingHandler  (const char *name);
0176 XMLPUBFUN xmlCharEncodingHandlerPtr
0177     xmlNewCharEncodingHandler   (const char *name,
0178                      xmlCharEncodingInputFunc input,
0179                      xmlCharEncodingOutputFunc output);
0180 
0181 
0182 
0183 
0184 XMLPUBFUN int
0185     xmlAddEncodingAlias     (const char *name,
0186                      const char *alias);
0187 XMLPUBFUN int
0188     xmlDelEncodingAlias     (const char *alias);
0189 XMLPUBFUN const char *
0190     xmlGetEncodingAlias     (const char *alias);
0191 XMLPUBFUN void
0192     xmlCleanupEncodingAliases   (void);
0193 XMLPUBFUN xmlCharEncoding
0194     xmlParseCharEncoding        (const char *name);
0195 XMLPUBFUN const char *
0196     xmlGetCharEncodingName      (xmlCharEncoding enc);
0197 
0198 
0199 
0200 
0201 XMLPUBFUN xmlCharEncoding
0202     xmlDetectCharEncoding       (const unsigned char *in,
0203                      int len);
0204 
0205 
0206 struct _xmlBuffer;
0207 
0208 XMLPUBFUN int
0209     xmlCharEncOutFunc       (xmlCharEncodingHandler *handler,
0210                      struct _xmlBuffer *out,
0211                      struct _xmlBuffer *in);
0212 
0213 XMLPUBFUN int
0214     xmlCharEncInFunc        (xmlCharEncodingHandler *handler,
0215                      struct _xmlBuffer *out,
0216                      struct _xmlBuffer *in);
0217 XML_DEPRECATED
0218 XMLPUBFUN int
0219     xmlCharEncFirstLine     (xmlCharEncodingHandler *handler,
0220                      struct _xmlBuffer *out,
0221                      struct _xmlBuffer *in);
0222 XMLPUBFUN int
0223     xmlCharEncCloseFunc     (xmlCharEncodingHandler *handler);
0224 
0225 
0226 
0227 
0228 #ifdef LIBXML_OUTPUT_ENABLED
0229 XMLPUBFUN int
0230     UTF8Toisolat1           (unsigned char *out,
0231                      int *outlen,
0232                      const unsigned char *in,
0233                      int *inlen);
0234 #endif 
0235 XMLPUBFUN int
0236     isolat1ToUTF8           (unsigned char *out,
0237                      int *outlen,
0238                      const unsigned char *in,
0239                      int *inlen);
0240 #ifdef __cplusplus
0241 }
0242 #endif
0243 
0244 #endif