Eneboo - Documentación para desarrolladores
Clases | 'typedefs' | Enumeraciones | Funciones
Referencia del Archivo src/libdigidoc/libxml2/include/libxml/encoding.h
#include <libxml/xmlversion.h>
#include <libxml/tree.h>

Ir al código fuente de este archivo.

Clases

struct  _xmlCharEncodingHandler

'typedefs'

typedef int(* xmlCharEncodingInputFunc )(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
typedef int(* xmlCharEncodingOutputFunc )(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
typedef struct
_xmlCharEncodingHandler 
xmlCharEncodingHandler
typedef xmlCharEncodingHandlerxmlCharEncodingHandlerPtr

Enumeraciones

enum  xmlCharEncoding {
  XML_CHAR_ENCODING_ERROR = -1, XML_CHAR_ENCODING_NONE = 0, XML_CHAR_ENCODING_UTF8 = 1, XML_CHAR_ENCODING_UTF16LE = 2,
  XML_CHAR_ENCODING_UTF16BE = 3, XML_CHAR_ENCODING_UCS4LE = 4, XML_CHAR_ENCODING_UCS4BE = 5, XML_CHAR_ENCODING_EBCDIC = 6,
  XML_CHAR_ENCODING_UCS4_2143 = 7, XML_CHAR_ENCODING_UCS4_3412 = 8, XML_CHAR_ENCODING_UCS2 = 9, XML_CHAR_ENCODING_8859_1 = 10,
  XML_CHAR_ENCODING_8859_2 = 11, XML_CHAR_ENCODING_8859_3 = 12, XML_CHAR_ENCODING_8859_4 = 13, XML_CHAR_ENCODING_8859_5 = 14,
  XML_CHAR_ENCODING_8859_6 = 15, XML_CHAR_ENCODING_8859_7 = 16, XML_CHAR_ENCODING_8859_8 = 17, XML_CHAR_ENCODING_8859_9 = 18,
  XML_CHAR_ENCODING_2022_JP = 19, XML_CHAR_ENCODING_SHIFT_JIS = 20, XML_CHAR_ENCODING_EUC_JP = 21, XML_CHAR_ENCODING_ASCII = 22
}

Funciones

XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers (void)
XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers (void)
XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler)
XMLPUBFUN
xmlCharEncodingHandlerPtr
XMLCALL 
xmlGetCharEncodingHandler (xmlCharEncoding enc)
XMLPUBFUN
xmlCharEncodingHandlerPtr
XMLCALL 
xmlFindCharEncodingHandler (const char *name)
XMLPUBFUN
xmlCharEncodingHandlerPtr
XMLCALL 
xmlNewCharEncodingHandler (const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output)
XMLPUBFUN int XMLCALL xmlAddEncodingAlias (const char *name, const char *alias)
XMLPUBFUN int XMLCALL xmlDelEncodingAlias (const char *alias)
XMLPUBFUN const char *XMLCALL xmlGetEncodingAlias (const char *alias)
XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases (void)
XMLPUBFUN xmlCharEncoding XMLCALL xmlParseCharEncoding (const char *name)
XMLPUBFUN const char *XMLCALL xmlGetCharEncodingName (xmlCharEncoding enc)
XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding (const unsigned char *in, int len)
XMLPUBFUN int XMLCALL xmlCharEncOutFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncInFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncFirstLine (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncCloseFunc (xmlCharEncodingHandler *handler)
XMLPUBFUN int XMLCALL isolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen)

Documentación de los 'typedefs'

typedef int(* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)

xmlCharEncodingInputFunc: : a pointer to an array of bytes to store the UTF-8 result : the length of : a pointer to an array of chars in the original encoding : the length of

Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.

Returns the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of after return is the number of octets consumed.

typedef int(* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)

xmlCharEncodingOutputFunc: : a pointer to an array of bytes to store the result : the length of : a pointer to an array of UTF-8 chars : the length of

Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.

Returns the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of after return is the number of octets produced.


Documentación de las enumeraciones

Valores de enumeraciones:
XML_CHAR_ENCODING_ERROR 
XML_CHAR_ENCODING_NONE 
XML_CHAR_ENCODING_UTF8 
XML_CHAR_ENCODING_UTF16LE 
XML_CHAR_ENCODING_UTF16BE 
XML_CHAR_ENCODING_UCS4LE 
XML_CHAR_ENCODING_UCS4BE 
XML_CHAR_ENCODING_EBCDIC 
XML_CHAR_ENCODING_UCS4_2143 
XML_CHAR_ENCODING_UCS4_3412 
XML_CHAR_ENCODING_UCS2 
XML_CHAR_ENCODING_8859_1 
XML_CHAR_ENCODING_8859_2 
XML_CHAR_ENCODING_8859_3 
XML_CHAR_ENCODING_8859_4 
XML_CHAR_ENCODING_8859_5 
XML_CHAR_ENCODING_8859_6 
XML_CHAR_ENCODING_8859_7 
XML_CHAR_ENCODING_8859_8 
XML_CHAR_ENCODING_8859_9 
XML_CHAR_ENCODING_2022_JP 
XML_CHAR_ENCODING_SHIFT_JIS 
XML_CHAR_ENCODING_EUC_JP 
XML_CHAR_ENCODING_ASCII 

Documentación de las funciones

XMLPUBFUN int XMLCALL isolat1ToUTF8 ( unsigned char *  out,
int outlen,
const unsigned char *  in,
int inlen 
)

isolat1ToUTF8: : a pointer to an array of bytes to store the result : the length of : a pointer to an array of ISO Latin 1 chars : the length of

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 if success, or -1 otherwise The value of after return is the number of octets consumed if the return value is positive, else unpredictable. The value of after return is the number of octets consumed.

XMLPUBFUN int XMLCALL xmlAddEncodingAlias ( const char *  name,
const char *  alias 
)
XMLPUBFUN int XMLCALL xmlCharEncCloseFunc ( xmlCharEncodingHandler handler)

xmlCharEncCloseFunc: : char enconding transformation data structure

Generic front-end for encoding handler close function

Returns 0 if success, or -1 in case of error

XMLPUBFUN int XMLCALL xmlCharEncFirstLine ( xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in 
)

xmlCharEncFirstLine: : char enconding transformation data structure : an xmlBuffer for the output. : an xmlBuffer for the input

Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.

Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or

XMLPUBFUN int XMLCALL xmlCharEncInFunc ( xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in 
)

xmlCharEncInFunc: : char encoding transformation data structure : an xmlBuffer for the output. : an xmlBuffer for the input

Generic front-end for the encoding handler input function

Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or

XMLPUBFUN int XMLCALL xmlCharEncOutFunc ( xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in 
)

xmlCharEncOutFunc: : char enconding transformation data structure : an xmlBuffer for the output. : an xmlBuffer for the input

Generic front-end for the encoding handler output function a first call with == NULL has to be made firs to initiate the output in case of non-stateless encoding needing to initiate their state or the output (like the BOM in UTF16). In case of UTF8 sequence conversion errors for the given encoder, the content will be automatically remapped to a CharRef sequence.

Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or

XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers ( void  )

xmlCleanupCharEncodingHandlers:

Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.

XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases ( void  )

xmlCleanupEncodingAliases:

Unregisters all aliases

XMLPUBFUN int XMLCALL xmlDelEncodingAlias ( const char *  alias)

xmlDelEncodingAlias: : the alias name as parsed, in UTF-8 format (ASCII actually)

Unregisters an encoding alias

Returns 0 in case of success, -1 in case of error

XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding ( const unsigned char *  in,
int  len 
)

xmlDetectCharEncoding: : 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). : 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.

XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler ( const char *  name)
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlGetCharEncodingHandler ( xmlCharEncoding  enc)

xmlGetCharEncodingHandler: : an xmlCharEncoding value.

Search in the registered set the handler able to read/write that encoding.

Returns the handler or NULL if not found

XMLPUBFUN const char* XMLCALL xmlGetCharEncodingName ( xmlCharEncoding  enc)

xmlGetCharEncodingName: : 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

XMLPUBFUN const char* XMLCALL xmlGetEncodingAlias ( const char *  alias)

xmlGetEncodingAlias: : 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

XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers ( void  )

xmlInitCharEncodingHandlers:

Initialize the char encoding support, it registers the default encoding supported. NOTE: while public, this function usually doesn't need to be called in normal processing.

XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlNewCharEncodingHandler ( const char *  name,
xmlCharEncodingInputFunc  input,
xmlCharEncodingOutputFunc  output 
)
XMLPUBFUN xmlCharEncoding XMLCALL xmlParseCharEncoding ( const char *  name)
XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler ( xmlCharEncodingHandlerPtr  handler)

xmlRegisterCharEncodingHandler: : the xmlCharEncodingHandlerPtr handler block

Register the char encoding handler, surprising, isn't it ?

 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'