mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-13 09:01:53 +03:00
- added a nano FTP module
- removed SNAP from RPM - updated the status in doc
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
Wed Jan 26 16:52:50 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
|
* nanoftp.[ch] parser.c xmlIO.[ch]: added a Nano FTP implementation
|
||||||
|
* debugXML.c : fixed a bug in the cat command
|
||||||
|
* valid.c: fixing some small probs
|
||||||
|
* libxml.spec.in: get rid of the SNAP suffix
|
||||||
|
* doc/xml.html: updated the status
|
||||||
|
|
||||||
Mon Jan 24 14:31:09 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
Mon Jan 24 14:31:09 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||||
|
|
||||||
* xml-config.in: xml-config --version to just return the
|
* xml-config.in: xml-config --version to just return the
|
||||||
|
10
doc/xml.html
10
doc/xml.html
@ -146,6 +146,14 @@ for really accurate description</h3>
|
|||||||
<ul>
|
<ul>
|
||||||
<li>working on HTML and XML links recognition layers, get in touch with me
|
<li>working on HTML and XML links recognition layers, get in touch with me
|
||||||
if you want to test those.</li>
|
if you want to test those.</li>
|
||||||
|
<li>there is some kind of roadmap to libxml-2.0: fix I18N, and <a
|
||||||
|
href="http://rpmfind.net/tools/gdome/messages/0039.html">change structures
|
||||||
|
to accomodate DOM</a></li>
|
||||||
|
<li>added a nanoFTP transport module</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>1.8.5: Jan 21 2000</h3>
|
||||||
|
<ul>
|
||||||
<li>adding APIs to parse a well balanced chunk of XML (production <a
|
<li>adding APIs to parse a well balanced chunk of XML (production <a
|
||||||
href="http://www.w3.org/TR/REC-xml#NT-content">[43] content</a> of the XML
|
href="http://www.w3.org/TR/REC-xml#NT-content">[43] content</a> of the XML
|
||||||
spec)</li>
|
spec)</li>
|
||||||
@ -996,6 +1004,6 @@ base under gnome-xml/example</p>
|
|||||||
|
|
||||||
<p><a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a></p>
|
<p><a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a></p>
|
||||||
|
|
||||||
<p>$Id: xml.html,v 1.21 2000/01/14 14:45:21 veillard Exp $</p>
|
<p>$Id: xml.html,v 1.22 2000/01/18 18:01:01 veillard Exp $</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
36
include/libxml/nanoftp.h
Normal file
36
include/libxml/nanoftp.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* nanohttp.c: minimalist FTP implementation to fetch external subsets.
|
||||||
|
*
|
||||||
|
* See Copyright for the status of this software.
|
||||||
|
*
|
||||||
|
* Daniel.Veillard@w3.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NANO_FTP_H__
|
||||||
|
#define __NANO_FTP_H__
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef void (*ftpListCallback) (void *userData,
|
||||||
|
const char *filename, const char* attrib,
|
||||||
|
const char *owner, const char *group,
|
||||||
|
unsigned long size, int links, int year,
|
||||||
|
const char *month, int day, int minute);
|
||||||
|
typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
|
||||||
|
|
||||||
|
|
||||||
|
void * xmlNanoFTPConnectTo (const char *hostname, int port);
|
||||||
|
int xmlNanoFTPClose (void *ctx);
|
||||||
|
void * xmlNanoFTPOpen (const char *URL);
|
||||||
|
int xmlNanoFTPFetch (const char *URL,
|
||||||
|
const char *filename);
|
||||||
|
int xmlNanoFTPRead (void *ctx,
|
||||||
|
void *dest,
|
||||||
|
int len);
|
||||||
|
int xmlNanoFTPGet (void *ctxt, ftpDataCallback callback,
|
||||||
|
void *userData, const char *filename);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* __NANO_FTP_H__ */
|
@ -25,12 +25,12 @@ struct _xmlParserInputBuffer {
|
|||||||
FILE *file; /* Input on file handler */
|
FILE *file; /* Input on file handler */
|
||||||
void* gzfile; /* Input on a compressed stream */
|
void* gzfile; /* Input on a compressed stream */
|
||||||
int fd; /* Input on a file descriptor */
|
int fd; /* Input on a file descriptor */
|
||||||
void *netIO; /* Input from a network stream */
|
void *httpIO; /* Input from an HTTP stream */
|
||||||
|
void *ftpIO; /* Input from an FTP stream */
|
||||||
|
|
||||||
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
||||||
|
|
||||||
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
|
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
# Note that this is NOT a relocatable package
|
# Note that this is NOT a relocatable package
|
||||||
%define ver @VERSION@
|
%define ver @VERSION@
|
||||||
%define RELEASE SNAP
|
|
||||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
|
||||||
%define prefix /usr
|
%define prefix /usr
|
||||||
|
|
||||||
Summary: libXML library
|
Summary: libXML library
|
||||||
Name: libxml
|
Name: libxml
|
||||||
Version: %ver
|
Version: %ver
|
||||||
Release: %rel
|
Release: 1
|
||||||
Copyright: LGPL
|
Copyright: LGPL
|
||||||
Group: X11/Libraries
|
Group: X11/Libraries
|
||||||
Source: ftp://ftp.gnome.org/pub/GNOME/sources/libxml/libxml-%{ver}.tar.gz
|
Source: ftp://ftp.gnome.org/pub/GNOME/sources/libxml/libxml-%{ver}.tar.gz
|
||||||
|
36
nanoftp.h
Normal file
36
nanoftp.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* nanohttp.c: minimalist FTP implementation to fetch external subsets.
|
||||||
|
*
|
||||||
|
* See Copyright for the status of this software.
|
||||||
|
*
|
||||||
|
* Daniel.Veillard@w3.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NANO_FTP_H__
|
||||||
|
#define __NANO_FTP_H__
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef void (*ftpListCallback) (void *userData,
|
||||||
|
const char *filename, const char* attrib,
|
||||||
|
const char *owner, const char *group,
|
||||||
|
unsigned long size, int links, int year,
|
||||||
|
const char *month, int day, int minute);
|
||||||
|
typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
|
||||||
|
|
||||||
|
|
||||||
|
void * xmlNanoFTPConnectTo (const char *hostname, int port);
|
||||||
|
int xmlNanoFTPClose (void *ctx);
|
||||||
|
void * xmlNanoFTPOpen (const char *URL);
|
||||||
|
int xmlNanoFTPFetch (const char *URL,
|
||||||
|
const char *filename);
|
||||||
|
int xmlNanoFTPRead (void *ctx,
|
||||||
|
void *dest,
|
||||||
|
int len);
|
||||||
|
int xmlNanoFTPGet (void *ctxt, ftpDataCallback callback,
|
||||||
|
void *userData, const char *filename);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* __NANO_FTP_H__ */
|
22
parser.c
22
parser.c
@ -176,7 +176,8 @@ xmlParserInputGrow(xmlParserInputPtr in, int len) {
|
|||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
if ((in->buf->netIO != NULL) || (in->buf->file != NULL) ||
|
if ((in->buf->httpIO != NULL) || (in->buf->ftpIO != NULL) ||
|
||||||
|
(in->buf->file != NULL) ||
|
||||||
#ifdef HAVE_ZLIB_H
|
#ifdef HAVE_ZLIB_H
|
||||||
(in->buf->gzfile != NULL) ||
|
(in->buf->gzfile != NULL) ||
|
||||||
#endif
|
#endif
|
||||||
@ -5978,11 +5979,22 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt) {
|
|||||||
* start-tag.
|
* start-tag.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (xmlStrcmp(name, ctxt->name)) {
|
if ((name == NULL) || (ctxt->name == NULL) ||
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
(xmlStrcmp(name, ctxt->name))) {
|
||||||
ctxt->sax->error(ctxt->userData,
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) {
|
||||||
"Opening and ending tag mismatch: %s and %s\n", ctxt->name, name);
|
if ((name != NULL) && (ctxt->name != NULL)) {
|
||||||
|
ctxt->sax->error(ctxt->userData,
|
||||||
|
"Opening and ending tag mismatch: %s and %s\n",
|
||||||
|
ctxt->name, name);
|
||||||
|
} else if (ctxt->name != NULL) {
|
||||||
|
ctxt->sax->error(ctxt->userData,
|
||||||
|
"Ending tag eror for: %s\n", ctxt->name);
|
||||||
|
} else {
|
||||||
|
ctxt->sax->error(ctxt->userData,
|
||||||
|
"Ending tag error: internal error ???\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
ctxt->errNo = XML_ERR_TAG_NAME_MISMATCH;
|
ctxt->errNo = XML_ERR_TAG_NAME_MISMATCH;
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
}
|
}
|
||||||
|
17
valid.c
17
valid.c
@ -2602,9 +2602,9 @@ xmlValidateElementTypeExpr(xmlValidCtxtPtr ctxt, xmlNodePtr *child,
|
|||||||
}
|
}
|
||||||
switch (cont->type) {
|
switch (cont->type) {
|
||||||
case XML_ELEMENT_CONTENT_PCDATA:
|
case XML_ELEMENT_CONTENT_PCDATA:
|
||||||
/* Internal error !!! */
|
if (*child == NULL) return(0);
|
||||||
fprintf(stderr, "Internal: MIXED struct bad\n");
|
if ((*child)->type == XML_TEXT_NODE) return(1);
|
||||||
return(-1);
|
return(0);
|
||||||
case XML_ELEMENT_CONTENT_ELEMENT:
|
case XML_ELEMENT_CONTENT_ELEMENT:
|
||||||
if (*child == NULL) return(0);
|
if (*child == NULL) return(0);
|
||||||
ret = (!xmlStrcmp((*child)->name, cont->name));
|
ret = (!xmlStrcmp((*child)->name, cont->name));
|
||||||
@ -3049,10 +3049,13 @@ xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
if (xmlStrcmp(doc->intSubset->name, root->name)) {
|
if (xmlStrcmp(doc->intSubset->name, root->name)) {
|
||||||
VERROR(ctxt->userData,
|
if ((xmlStrcmp(doc->intSubset->name, BAD_CAST "HTML")) ||
|
||||||
"Not valid: root and DtD name do not match '%s' and '%s'\n",
|
(xmlStrcmp(root->name, BAD_CAST "html"))) {
|
||||||
root->name, doc->intSubset->name);
|
VERROR(ctxt->userData,
|
||||||
return(0);
|
"Not valid: root and DtD name do not match '%s' and '%s'\n",
|
||||||
|
root->name, doc->intSubset->name);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
37
xmlIO.c
37
xmlIO.c
@ -39,6 +39,7 @@
|
|||||||
#include "parserInternals.h"
|
#include "parserInternals.h"
|
||||||
#include "xmlIO.h"
|
#include "xmlIO.h"
|
||||||
#include "nanohttp.h"
|
#include "nanohttp.h"
|
||||||
|
#include "nanoftp.h"
|
||||||
|
|
||||||
/* #define DEBUG_INPUT */
|
/* #define DEBUG_INPUT */
|
||||||
/* #define VERBOSE_FAILURE */
|
/* #define VERBOSE_FAILURE */
|
||||||
@ -76,7 +77,8 @@ xmlAllocParserInputBuffer(xmlCharEncoding enc) {
|
|||||||
ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
|
ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
|
||||||
ret->encoder = xmlGetCharEncodingHandler(enc);
|
ret->encoder = xmlGetCharEncodingHandler(enc);
|
||||||
ret->fd = -1;
|
ret->fd = -1;
|
||||||
ret->netIO = NULL;
|
ret->httpIO = NULL;
|
||||||
|
ret->ftpIO = NULL;
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
@ -97,8 +99,10 @@ xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
|
|||||||
if (in->gzfile != NULL)
|
if (in->gzfile != NULL)
|
||||||
gzclose(in->gzfile);
|
gzclose(in->gzfile);
|
||||||
#endif
|
#endif
|
||||||
if (in->netIO != NULL)
|
if (in->httpIO != NULL)
|
||||||
xmlNanoHTTPClose(in->netIO);
|
xmlNanoHTTPClose(in->httpIO);
|
||||||
|
if (in->ftpIO != NULL)
|
||||||
|
xmlNanoFTPClose(in->ftpIO);
|
||||||
if (in->fd >= 0)
|
if (in->fd >= 0)
|
||||||
close(in->fd);
|
close(in->fd);
|
||||||
memset(in, 0xbe, (size_t) sizeof(xmlParserInputBuffer));
|
memset(in, 0xbe, (size_t) sizeof(xmlParserInputBuffer));
|
||||||
@ -125,16 +129,26 @@ xmlParserInputBufferCreateFilename(const char *filename, xmlCharEncoding enc) {
|
|||||||
#else
|
#else
|
||||||
int input = -1;
|
int input = -1;
|
||||||
#endif
|
#endif
|
||||||
void *netIO = NULL;
|
void *httpIO = NULL;
|
||||||
|
void *ftpIO = NULL;
|
||||||
|
|
||||||
if (filename == NULL) return(NULL);
|
if (filename == NULL) return(NULL);
|
||||||
|
|
||||||
if (!strncmp(filename, "http://", 7)) {
|
if (!strncmp(filename, "http://", 7)) {
|
||||||
netIO = xmlNanoHTTPOpen(filename, NULL);
|
httpIO = xmlNanoHTTPOpen(filename, NULL);
|
||||||
if (netIO == NULL) {
|
if (httpIO == NULL) {
|
||||||
#ifdef VERBOSE_FAILURE
|
#ifdef VERBOSE_FAILURE
|
||||||
fprintf (stderr, "Cannot read URL %s\n", filename);
|
fprintf (stderr, "Cannot read URL %s\n", filename);
|
||||||
perror ("xmlNanoHTTPOpen failed");
|
perror ("xmlNanoHTTPOpen failed");
|
||||||
|
#endif
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
} else if (!strncmp(filename, "ftp://", 6)) {
|
||||||
|
ftpIO = xmlNanoFTPOpen(filename);
|
||||||
|
if (ftpIO == NULL) {
|
||||||
|
#ifdef VERBOSE_FAILURE
|
||||||
|
fprintf (stderr, "Cannot read URL %s\n", filename);
|
||||||
|
perror ("xmlNanoFTPOpen failed");
|
||||||
#endif
|
#endif
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -201,7 +215,8 @@ xmlParserInputBufferCreateFilename(const char *filename, xmlCharEncoding enc) {
|
|||||||
#else
|
#else
|
||||||
ret->fd = input;
|
ret->fd = input;
|
||||||
#endif
|
#endif
|
||||||
ret->netIO = netIO;
|
ret->httpIO = httpIO;
|
||||||
|
ret->ftpIO = ftpIO;
|
||||||
}
|
}
|
||||||
xmlParserInputBufferRead(ret, 4);
|
xmlParserInputBufferRead(ret, 4);
|
||||||
|
|
||||||
@ -339,8 +354,10 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
|
|||||||
fprintf(stderr, "xmlParserInputBufferGrow : out of memory !\n");
|
fprintf(stderr, "xmlParserInputBufferGrow : out of memory !\n");
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (in->netIO != NULL) {
|
if (in->httpIO != NULL) {
|
||||||
res = xmlNanoHTTPRead(in->netIO, &buffer[0], len);
|
res = xmlNanoHTTPRead(in->httpIO, &buffer[0], len);
|
||||||
|
} else if (in->ftpIO != NULL) {
|
||||||
|
res = xmlNanoFTPRead(in->ftpIO, &buffer[0], len);
|
||||||
} else if (in->file != NULL) {
|
} else if (in->file != NULL) {
|
||||||
res = fread(&buffer[0], 1, len, in->file);
|
res = fread(&buffer[0], 1, len, in->file);
|
||||||
#ifdef HAVE_ZLIB_H
|
#ifdef HAVE_ZLIB_H
|
||||||
@ -405,7 +422,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
|
|||||||
int
|
int
|
||||||
xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len) {
|
xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len) {
|
||||||
/* xmlBufferEmpty(in->buffer); */
|
/* xmlBufferEmpty(in->buffer); */
|
||||||
if ((in->netIO != NULL) || (in->file != NULL) ||
|
if ((in->httpIO != NULL) || (in->ftpIO != NULL) || (in->file != NULL) ||
|
||||||
#ifdef HAVE_ZLIB_H
|
#ifdef HAVE_ZLIB_H
|
||||||
(in->gzfile != NULL) ||
|
(in->gzfile != NULL) ||
|
||||||
#endif
|
#endif
|
||||||
|
4
xmlIO.h
4
xmlIO.h
@ -25,12 +25,12 @@ struct _xmlParserInputBuffer {
|
|||||||
FILE *file; /* Input on file handler */
|
FILE *file; /* Input on file handler */
|
||||||
void* gzfile; /* Input on a compressed stream */
|
void* gzfile; /* Input on a compressed stream */
|
||||||
int fd; /* Input on a file descriptor */
|
int fd; /* Input on a file descriptor */
|
||||||
void *netIO; /* Input from a network stream */
|
void *httpIO; /* Input from an HTTP stream */
|
||||||
|
void *ftpIO; /* Input from an FTP stream */
|
||||||
|
|
||||||
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
||||||
|
|
||||||
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
|
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user