summaryrefslogtreecommitdiff
path: root/xmlIO.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-07-06 12:57:17 +0000
committerMike Hommey <mh@glandium.org>2004-07-06 12:57:17 +0000
commitc14c53a3645d81281058d4bb4cff24fa8d6faf33 (patch)
tree29bccc2e7499af078a3d1cdcfb517a1dee891be5 /xmlIO.c
parentd4e028c96af89ade493b440d4f2de6b684c03a06 (diff)
downloadlibxml2-c14c53a3645d81281058d4bb4cff24fa8d6faf33.tar.gz
Load /tmp/tmp.DIvcnD/libxml2-2.6.11 intoupstream/2.6.11
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c109
1 files changed, 84 insertions, 25 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 2f9874f..a51bf64 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -2125,21 +2125,8 @@ xmlOutputBufferClose(xmlOutputBufferPtr out)
}
#endif /* LIBXML_OUTPUT_ENABLED */
-/**
- * xmlParserInputBufferCreateFilename:
- * @URI: a C string containing the URI or filename
- * @enc: the charset encoding if known
- *
- * Create a buffered parser input for the progressive parsing of a file
- * If filename is "-' then we use stdin as the input.
- * Automatic support for ZLIB/Compress compressed document is provided
- * by default if found at compile-time.
- * Do an encoding check if enc == XML_CHAR_ENCODING_NONE
- *
- * Returns the new parser input or NULL
- */
xmlParserInputBufferPtr
-xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
+__xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
xmlParserInputBufferPtr ret;
int i = 0;
void *context = NULL;
@@ -2196,26 +2183,32 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
return(ret);
}
-#ifdef LIBXML_OUTPUT_ENABLED
/**
- * xmlOutputBufferCreateFilename:
+ * xmlParserInputBufferCreateFilename:
* @URI: a C string containing the URI or filename
- * @encoder: the encoding converter or NULL
- * @compression: the compression ration (0 none, 9 max).
+ * @enc: the charset encoding if known
*
- * Create a buffered output for the progressive saving of a file
- * If filename is "-' then we use stdout as the output.
+ * Create a buffered parser input for the progressive parsing of a file
+ * If filename is "-' then we use stdin as the input.
* Automatic support for ZLIB/Compress compressed document is provided
* by default if found at compile-time.
- * TODO: currently if compression is set, the library only support
- * writing to a local file.
+ * Do an encoding check if enc == XML_CHAR_ENCODING_NONE
*
- * Returns the new output or NULL
+ * Returns the new parser input or NULL
*/
+xmlParserInputBufferPtr
+xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
+ if ((xmlParserInputBufferCreateFilenameValue)) {
+ return xmlParserInputBufferCreateFilenameValue(URI, enc);
+ }
+ return __xmlParserInputBufferCreateFilename(URI, enc);
+}
+
+#ifdef LIBXML_OUTPUT_ENABLED
xmlOutputBufferPtr
-xmlOutputBufferCreateFilename(const char *URI,
+__xmlOutputBufferCreateFilename(const char *URI,
xmlCharEncodingHandlerPtr encoder,
- int compression ATTRIBUTE_UNUSED) {
+ int compression ATTRIBUTE_UNUSED) {
xmlOutputBufferPtr ret;
xmlURIPtr puri;
int i = 0;
@@ -2329,6 +2322,31 @@ xmlOutputBufferCreateFilename(const char *URI,
}
return(ret);
}
+
+/**
+ * xmlOutputBufferCreateFilename:
+ * @URI: a C string containing the URI or filename
+ * @encoder: the encoding converter or NULL
+ * @compression: the compression ration (0 none, 9 max).
+ *
+ * Create a buffered output for the progressive saving of a file
+ * If filename is "-' then we use stdout as the output.
+ * Automatic support for ZLIB/Compress compressed document is provided
+ * by default if found at compile-time.
+ * TODO: currently if compression is set, the library only support
+ * writing to a local file.
+ *
+ * Returns the new output or NULL
+ */
+xmlOutputBufferPtr
+xmlOutputBufferCreateFilename(const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression ATTRIBUTE_UNUSED) {
+ if ((xmlOutputBufferCreateFilenameValue)) {
+ return xmlOutputBufferCreateFilenameValue(URI, encoder, compression);
+ }
+ return __xmlOutputBufferCreateFilename(URI, encoder, compression);
+}
#endif /* LIBXML_OUTPUT_ENABLED */
/**
@@ -2581,6 +2599,47 @@ xmlOutputBufferCreateIO(xmlOutputWriteCallback iowrite,
#endif /* LIBXML_OUTPUT_ENABLED */
/**
+ * xmlParserInputBufferCreateFilenameDefault:
+ * @func: function pointer to the new ParserInputBufferCreateFilenameFunc
+ *
+ * Registers a callback for URI input file handling
+ *
+ * Returns the old value of the registration function
+ */
+xmlParserInputBufferCreateFilenameFunc
+xmlParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
+{
+ xmlParserInputBufferCreateFilenameFunc old = xmlParserInputBufferCreateFilenameValue;
+ if (old == NULL) {
+ old = __xmlParserInputBufferCreateFilename;
+ }
+
+ xmlParserInputBufferCreateFilenameValue = func;
+ return(old);
+}
+
+/**
+ * xmlOutputBufferCreateFilenameDefault:
+ * @func: function pointer to the new OutputBufferCreateFilenameFunc
+ *
+ * Registers a callback for URI output file handling
+ *
+ * Returns the old value of the registration function
+ */
+xmlOutputBufferCreateFilenameFunc
+xmlOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
+{
+ xmlOutputBufferCreateFilenameFunc old = xmlOutputBufferCreateFilenameValue;
+#ifdef LIBXML_OUTPUT_ENABLED
+ if (old == NULL) {
+ old = __xmlOutputBufferCreateFilename;
+ }
+#endif
+ xmlOutputBufferCreateFilenameValue = func;
+ return(old);
+}
+
+/**
* xmlParserInputBufferPush:
* @in: a buffered parser input
* @len: the size in bytes of the array.