Commit 4a6845df authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Restarted hacking :-) :

- xmllint.c: Made is so if the file name is "-" is will read form
  standard input. Sven Heinicke  <sven@zen.org>
- tree.c: fixed a problem when growing buffer
- tree.h: fixed the comment of the node types following andersca
  comment
- TODO: updated
Daniel
parent a6d8eb62
Wed Jan 3 14:22:33 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xmllint.c: Made is so if the file name is "-" is will read form
standard input. Sven Heinicke <sven@zen.org>
* tree.c: fixed a problem when growing buffer
* tree.h: fixed the comment of the node types following andersca
comment
* TODO: updated
Wed Dec 27 12:35:49 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* HTMLparser.[ch]: added a way to avoid adding automatically
......
......@@ -34,7 +34,8 @@ TODO:
data, close last element, etc
- htmlParseDoc has parameter encoding which is not used.
Function htmlCreateDocParserCtxt ignore it.
- bug reported by Michael Meallin on validation problems
- solve the problems related to post-validating of XInclude results.
TODO:
=====
......
......@@ -25,6 +25,9 @@ extern "C" {
*
* NOTE: This is synchronized with DOM Level1 values
* See http://www.w3.org/TR/REC-DOM-Level-1/
*
* Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
* be deprecated to use an XML_DTD_NODE.
*/
typedef enum {
XML_ELEMENT_NODE= 1,
......
......@@ -4347,7 +4347,7 @@ xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
/**
* xmlBufferGrow:
* @buf: the buffer
* @len: the minimum free sie to allocate
* @len: the minimum free size to allocate
*
* Grow the available space of an XML buffer.
*
......@@ -4358,7 +4358,7 @@ xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
int size;
xmlChar *newbuf;
if (len <= buf->use) return(0);
if (len + buf->use < buf->size) return(0);
size = buf->use + len + 100;
......
......@@ -25,6 +25,9 @@ extern "C" {
*
* NOTE: This is synchronized with DOM Level1 values
* See http://www.w3.org/TR/REC-DOM-Level-1/
*
* Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
* be deprecated to use an XML_DTD_NODE.
*/
typedef enum {
XML_ELEMENT_NODE= 1,
......
......@@ -372,7 +372,9 @@ int myRead(FILE *f, char * buffer, int len) {
return(fread(buffer, 1, len, f));
}
void myClose(FILE *f) {
if (f != stdin) {
fclose(f);
}
}
/************************************************************************
......@@ -394,7 +396,12 @@ void parseAndPrintFile(char *filename) {
if (push) {
FILE *f;
f = fopen(filename, "r");
/* '-' Usually means stdin -<sven@zen.org> */
if ((filename[0] == '-') && (filename[1] == 0)) {
f = stdin;
} else {
f = fopen(filename, "r");
}
if (f != NULL) {
int ret;
int res, size = 3;
......@@ -424,7 +431,12 @@ void parseAndPrintFile(char *filename) {
int ret;
FILE *f;
f = fopen(filename, "r");
/* '-' Usually means stdin -<sven@zen.org> */
if ((filename[0] == '-') && (filename[1] == 0)) {
f = stdin;
} else {
f = fopen(filename, "r");
}
if (f != NULL) {
xmlParserCtxtPtr ctxt;
......@@ -633,7 +645,8 @@ void parseAndPrintFile(char *filename) {
xmlFreeDoc(doc);
}
int main(int argc, char **argv) {
int
main(int argc, char **argv) {
int i, count;
int files = 0;
......@@ -766,7 +779,8 @@ int main(int argc, char **argv) {
i++;
continue;
}
if (argv[i][0] != '-') {
/* Remember file names. "-" means stding. <sven@zen.org> */
if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
if (repeat) {
for (count = 0;count < 100 * repeat;count++)
parseAndPrintFile(argv[i]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment