|
ReactOS 0.4.16-dev-2208-g6350669
|
#include "libxml.h"#include <string.h>#include <limits.h>#include <ctype.h>#include <stdlib.h>#include <libxml/encoding.h>#include <libxml/xmlmemory.h>#include <libxml/parser.h>#include <libxml/xmlerror.h>#include "private/buf.h"#include "private/enc.h"#include "private/error.h"
Go to the source code of this file.
Classes | |
| struct | _xmlCharEncodingAlias |
Macros | |
| #define | IN_LIBXML |
Typedefs | |
| typedef struct _xmlCharEncodingAlias | xmlCharEncodingAlias |
| typedef xmlCharEncodingAlias * | xmlCharEncodingAliasPtr |
Functions | |
| static int | asciiToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen) |
| int | isolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen) |
| static int | UTF8ToUTF8 (unsigned char *out, int *outlen, const unsigned char *inb, int *inlenb) |
| static int | UTF16LEToUTF8 (unsigned char *out, int *outlen, const unsigned char *inb, int *inlenb) |
| static int | UTF16BEToUTF8 (unsigned char *out, int *outlen, const unsigned char *inb, int *inlenb) |
| xmlCharEncoding | xmlDetectCharEncoding (const unsigned char *in, int len) |
| void | xmlCleanupEncodingAliases (void) |
| const char * | xmlGetEncodingAlias (const char *alias) |
. Existing alias | |
will be overwritten. Returns 0 in case of success, -1 in case of error | |
| int | xmlAddEncodingAlias (const char *name, const char *alias) |
| int | xmlDelEncodingAlias (const char *alias) |
: the encoding name, in UTF-8 format (ASCII actually) | |
xmlNewCharEncodingHandler: @input: the xmlCharEncodingInputFunc to read that encoding @output: the xmlCharEncodingOutputFunc to write that encoding Create and registers an xmlCharEncodingHandler. Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error). | |
| xmlCharEncodingHandlerPtr | xmlNewCharEncodingHandler (const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output) |
| void | xmlInitCharEncodingHandlers (void) |
| void | xmlInitEncodingInternal (void) |
| void | xmlCleanupCharEncodingHandlers (void) |
| void | xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler) |
| xmlCharEncodingHandlerPtr | xmlGetCharEncodingHandler (xmlCharEncoding enc) |
: a string describing the char encoding. | |
xmlFindCharEncodingHandler: Search in the registered set the handler able to read/write that encoding or create a new one. Returns the handler or NULL if not found | |
| xmlCharEncodingHandlerPtr | xmlFindCharEncodingHandler (const char *name) |
Variables | |
| static xmlCharEncodingAliasPtr | xmlCharEncodingAliases = NULL |
| static int | xmlCharEncodingAliasesNb = 0 |
| static int | xmlCharEncodingAliasesMax = 0 |
| static int | xmlLittleEndian = 1 |
| #define EMPTY_ICONV |
Definition at line 1320 of file encoding.c.
| #define EMPTY_UCONV |
Definition at line 1326 of file encoding.c.
| #define IN_LIBXML |
Definition at line 23 of file encoding.c.
| #define MAKE_HANDLER | ( | name, | |
| in, | |||
| out | |||
| ) | { (char *) name, in, out EMPTY_ICONV EMPTY_UCONV } |
Definition at line 1329 of file encoding.c.
| #define MAX_ENCODING_HANDLERS 50 |
Definition at line 1379 of file encoding.c.
| #define NUM_DEFAULT_HANDLERS (sizeof(defaultHandlers) / sizeof(defaultHandlers[0])) |
Definition at line 1372 of file encoding.c.
Definition at line 61 of file encoding.c.
Definition at line 62 of file encoding.c.
|
static |
asciiToUTF8: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @in: a pointer to an array of ASCII chars @inlen: the length of @in
Take a block of ASCII chars in and try to convert it to an UTF-8 block of chars out.
Returns the number of bytes written or an XML_ENC_ERR code.
The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.
Definition at line 148 of file encoding.c.
isolat1ToUTF8: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @in: a pointer to an array of ISO Latin 1 chars @inlen: the length of @in
Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.
Returns the number of bytes written or an XML_ENC_ERR code.
The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.
Definition at line 283 of file encoding.c.
|
static |
UTF16BEToUTF8: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @inb: a pointer to an array of UTF-16 passed as a byte array @inlenb: the length of @in in UTF-16 chars
Take a block of UTF-16 ushorts in and try to convert it to an UTF-8 block of chars out. This function assumes the endian property is the same between the native type of this machine and the inputed one.
Returns the number of bytes written or an XML_ENC_ERR code.
The value of *inlen after return is the number of octets consumed if the return value is positive, else unpredictable.
Definition at line 715 of file encoding.c.
|
static |
UTF16LEToUTF8: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @inb: a pointer to an array of UTF-16LE passwd as a byte array @inlenb: the length of @in in UTF-16LE chars
Take a block of UTF-16LE ushorts in and try to convert it to an UTF-8 block of chars out. This function assumes the endian property is the same between the native type of this machine and the inputed one.
Returns the number of bytes written or an XML_ENC_ERR code.
The value of *inlen after return is the number of octets consumed if the return value is positive, else unpredictable.
Definition at line 477 of file encoding.c.
|
static |
UTF8ToUTF8: @out: a pointer to an array of bytes to store the result @outlen: the length of @out @inb: a pointer to an array of UTF-8 chars @inlenb: the length of @in in UTF-8 chars
No op copy operation for UTF8 handling.
Returns the number of bytes written or an XML_ENC_ERR code.
The value of *inlen after return is the number of octets consumed if the return value is positive, else unpredictable.
Definition at line 332 of file encoding.c.
Definition at line 1041 of file encoding.c.
xmlCleanupCharEncodingHandlers:
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all.
Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.
Definition at line 1490 of file encoding.c.
Referenced by xmlCleanupParser().
xmlCleanupEncodingAliases:
Unregisters all aliases
Definition at line 976 of file encoding.c.
Referenced by xmlCleanupCharEncodingHandlers().
xmlDelEncodingAlias: @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
Unregisters an encoding alias @alias
Returns 0 in case of success, -1 in case of error
Definition at line 1112 of file encoding.c.
| xmlCharEncoding xmlDetectCharEncoding | ( | const unsigned char * | in, |
| int | len | ||
| ) |
xmlDetectCharEncoding: @in: a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). @len: pointer to the length of the buffer
Guess the encoding of the entity using the first bytes of the entity content according to the non-normative appendix F of the XML-1.0 recommendation.
Returns one of the XML_CHAR_ENCODING_... values.
Definition at line 916 of file encoding.c.
Referenced by internal_parseBuffer().
| xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler | ( | const char * | name | ) |
Definition at line 1677 of file encoding.c.
Referenced by init_char_encoders(), node_transform_write_to_bstr(), node_transform_write_to_stream(), xmlCtxtResetPush(), xmlDetectEBCDIC(), xmlDoRead(), xmlFindCharEncodingHandler(), xmlGetCharEncodingHandler(), xmlParseInNodeContext(), xmlSetDeclaredEncoding(), xsltSaveResultToFd(), xsltSaveResultToFile(), xsltSaveResultToFilename(), and xsltSaveResultToString().
| xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler | ( | xmlCharEncoding | enc | ) |
xmlGetCharEncodingHandler: @enc: an xmlCharEncoding value.
Search in the registered set the handler able to read/write that encoding.
Returns the handler or NULL if not found
Definition at line 1547 of file encoding.c.
Referenced by xmlDetectEBCDIC(), and xmlSwitchEncoding().
| const char * xmlGetCharEncodingName | ( | xmlCharEncoding | enc | ) |
xmlGetCharEncodingName: @enc: the encoding
The "canonical" name for XML encoding. C.f. http://www.w3.org/TR/REC-xml#charencoding Section 4.3.3 Character Encoding in Entities
Returns the canonical name for the given encoding
Definition at line 1229 of file encoding.c.
Referenced by internal_parseBuffer(), xmlFindCharEncodingHandler(), xmlSwitchEncoding(), and xsltSaveResultTo().
xmlGetEncodingAlias: @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
Lookup an encoding name for the given alias.
Returns NULL if not found, otherwise the original name
Definition at line 1003 of file encoding.c.
Referenced by xmlFindCharEncodingHandler(), xmlNewCharEncodingHandler(), and xmlParseCharEncoding().
xmlInitCharEncodingHandlers:
DEPRECATED: Alias for xmlInitParser.
Definition at line 1460 of file encoding.c.
xmlInitEncodingInternal:
Initialize the char encoding support.
Definition at line 1470 of file encoding.c.
Referenced by xmlInitParser().
| xmlCharEncodingHandlerPtr xmlNewCharEncodingHandler | ( | const char * | name, |
| xmlCharEncodingInputFunc | input, | ||
| xmlCharEncodingOutputFunc | output | ||
| ) |
Definition at line 1394 of file encoding.c.
Referenced by init_char_encoders().
| xmlCharEncoding xmlParseCharEncoding | ( | const char * | name | ) |
Definition at line 1148 of file encoding.c.
Referenced by xmlFindCharEncodingHandler().
| void xmlRegisterCharEncodingHandler | ( | xmlCharEncodingHandlerPtr | handler | ) |
xmlRegisterCharEncodingHandler: @handler: the xmlCharEncodingHandlerPtr handler block
Register the char encoding handler, surprising, isn't it ?
Definition at line 1515 of file encoding.c.
Referenced by xmlNewCharEncodingHandler().
|
static |
Definition at line 1332 of file encoding.c.
Referenced by xmlFindCharEncodingHandler().
|
static |
Definition at line 1380 of file encoding.c.
Referenced by compile_state_table(), do_install_or_uninstall_handler(), find_handler(), find_sink_entry(), free_handlers(), handler_container(), notify_DllMain(), notify_TlsCallback(), reg_or_unreg_all_opregions(), uacpi_initialize_opregion_node(), uacpi_install_address_space_handler_with_flags(), uacpi_install_notify_handler(), uacpi_namespace_initialize(), uacpi_uninstall_address_space_handler(), uacpi_uninstall_notify_handler(), xmlCleanupCharEncodingHandlers(), xmlFindCharEncodingHandler(), and xmlRegisterCharEncodingHandler().
|
static |
Definition at line 1381 of file encoding.c.
Referenced by xmlCleanupCharEncodingHandlers(), xmlFindCharEncodingHandler(), and xmlRegisterCharEncodingHandler().
|
static |
Definition at line 68 of file encoding.c.
Referenced by xmlAddEncodingAlias(), xmlCleanupEncodingAliases(), xmlDelEncodingAlias(), and xmlGetEncodingAlias().
|
static |
Definition at line 70 of file encoding.c.
Referenced by xmlAddEncodingAlias(), and xmlCleanupEncodingAliases().
|
static |
Definition at line 69 of file encoding.c.
Referenced by xmlAddEncodingAlias(), xmlCleanupEncodingAliases(), xmlDelEncodingAlias(), and xmlGetEncodingAlias().
|
static |
Definition at line 72 of file encoding.c.
Referenced by UTF16BEToUTF8(), UTF16LEToUTF8(), and xmlInitEncodingInternal().
|
static |
Definition at line 1376 of file encoding.c.
Referenced by xmlGetCharEncodingHandler().
|
static |
Definition at line 1375 of file encoding.c.
Referenced by xmlGetCharEncodingHandler().