CORBA defines fixes, char encoding atodetection, Daniel
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index b5a11f9..217edbc 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -13,22 +13,49 @@
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
* Information Interchange, ANSI X3.4-1986.
*
- * Original code from "Martin J. Duerst" <duerst@w3.org>
- *
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*/
-#ifndef __XML_ENCODING_H__
-#define __XML_ENCODING_H__
+#ifndef __XML_CHAR_ENCODING_H__
+#define __XML_CHAR_ENCODING_H__
#ifdef __cplusplus
extern "C" {
#endif
+typedef enum {
+ XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
+ XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
+ XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
+ XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
+ XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
+ XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
+ XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
+ XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
+ XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
+ XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
+ XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
+ XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
+ XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
+ XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
+ XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
+ XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
+ XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
+ XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
+ XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
+ XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
+ XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
+ XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
+ XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
+} xmlCharEncoding;
+
+extern xmlCharEncoding xmlDetectCharEncoding(unsigned char* in);
+extern xmlCharEncoding xmlParseCharEncoding(char* name);
+
#ifdef __cplusplus
}
#endif
-#endif /* __XML_ENCODING_H__ */
+#endif /* __XML_CHAR_ENCODING_H__ */
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 3e433a2..2075607 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -81,10 +81,10 @@
*/
typedef struct xmlSAXLocator {
- const CHAR *(*getPublicId)(xmlParserCtxtPtr ctxt);
- const CHAR *(*getSystemId)(xmlParserCtxtPtr ctxt);
- int (*getLineNumber)(xmlParserCtxtPtr ctxt);
- int (*getColumnNumber)(xmlParserCtxtPtr ctxt);
+ const CHAR *(*getPublicId)(void *ctx);
+ const CHAR *(*getSystemId)(void *ctx);
+ int (*getLineNumber)(void *ctx);
+ int (*getColumnNumber)(void *ctx);
} _xmlSAXLocator;
typedef _xmlSAXLocator xmlSAXLocator;
typedef xmlSAXLocator *xmlSAXLocatorPtr;
@@ -95,48 +95,48 @@
#include "entities.h"
-typedef xmlParserInputPtr (*resolveEntitySAXFunc) (xmlParserCtxtPtr ctxt,
+typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
const CHAR *publicId, const CHAR *systemId);
-typedef void (*internalSubsetSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *name,
+typedef void (*internalSubsetSAXFunc) (void *ctx, const CHAR *name,
const CHAR *ExternalID, const CHAR *SystemID);
-typedef xmlEntityPtr (*getEntitySAXFunc) (xmlParserCtxtPtr ctxt,
+typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
const CHAR *name);
-typedef void (*entityDeclSAXFunc) (xmlParserCtxtPtr ctxt,
+typedef void (*entityDeclSAXFunc) (void *ctx,
const CHAR *name, int type, const CHAR *publicId,
const CHAR *systemId, CHAR *content);
-typedef void (*notationDeclSAXFunc)(xmlParserCtxtPtr ctxt, const CHAR *name,
+typedef void (*notationDeclSAXFunc)(void *ctx, const CHAR *name,
const CHAR *publicId, const CHAR *systemId);
-typedef void (*attributeDeclSAXFunc)(xmlParserCtxtPtr ctxt, const CHAR *elem,
+typedef void (*attributeDeclSAXFunc)(void *ctx, const CHAR *elem,
const CHAR *name, int type, int def,
const CHAR *defaultValue, xmlEnumerationPtr tree);
-typedef void (*elementDeclSAXFunc)(xmlParserCtxtPtr ctxt, const CHAR *name,
+typedef void (*elementDeclSAXFunc)(void *ctx, const CHAR *name,
int type, xmlElementContentPtr content);
-typedef void (*unparsedEntityDeclSAXFunc)(xmlParserCtxtPtr ctxt,
+typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
const CHAR *name, const CHAR *publicId,
const CHAR *systemId, const CHAR *notationName);
-typedef void (*setDocumentLocatorSAXFunc) (xmlParserCtxtPtr ctxt,
+typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
xmlSAXLocatorPtr loc);
-typedef void (*startDocumentSAXFunc) (xmlParserCtxtPtr ctxt);
-typedef void (*endDocumentSAXFunc) (xmlParserCtxtPtr ctxt);
-typedef void (*startElementSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *name,
+typedef void (*startDocumentSAXFunc) (void *ctx);
+typedef void (*endDocumentSAXFunc) (void *ctx);
+typedef void (*startElementSAXFunc) (void *ctx, const CHAR *name,
const CHAR **atts);
-typedef void (*endElementSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *name);
-typedef void (*attributeSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *name,
+typedef void (*endElementSAXFunc) (void *ctx, const CHAR *name);
+typedef void (*attributeSAXFunc) (void *ctx, const CHAR *name,
const CHAR *value);
-typedef void (*referenceSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *name);
-typedef void (*charactersSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *ch,
+typedef void (*referenceSAXFunc) (void *ctx, const CHAR *name);
+typedef void (*charactersSAXFunc) (void *ctx, const CHAR *ch,
int len);
-typedef void (*ignorableWhitespaceSAXFunc) (xmlParserCtxtPtr ctxt,
+typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
const CHAR *ch, int len);
-typedef void (*processingInstructionSAXFunc) (xmlParserCtxtPtr ctxt,
+typedef void (*processingInstructionSAXFunc) (void *ctx,
const CHAR *target, const CHAR *data);
-typedef void (*commentSAXFunc) (xmlParserCtxtPtr ctxt, const CHAR *value);
-typedef void (*warningSAXFunc) (xmlParserCtxtPtr ctxt, const char *msg, ...);
-typedef void (*errorSAXFunc) (xmlParserCtxtPtr ctxt, const char *msg, ...);
-typedef void (*fatalErrorSAXFunc) (xmlParserCtxtPtr ctxt, const char *msg, ...);
-typedef int (*isStandaloneSAXFunc) (xmlParserCtxtPtr ctxt);
-typedef int (*hasInternalSubsetSAXFunc) (xmlParserCtxtPtr ctxt);
-typedef int (*hasExternalSubsetSAXFunc) (xmlParserCtxtPtr ctxt);
+typedef void (*commentSAXFunc) (void *ctx, const CHAR *value);
+typedef void (*warningSAXFunc) (void *ctx, const char *msg, ...);
+typedef void (*errorSAXFunc) (void *ctx, const char *msg, ...);
+typedef void (*fatalErrorSAXFunc) (void *ctx, const char *msg, ...);
+typedef int (*isStandaloneSAXFunc) (void *ctx);
+typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
+typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
typedef struct xmlSAXHandler {
internalSubsetSAXFunc internalSubset;