mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-02-10 12:32:25 +00:00
started integrating the non-controversial parts of Gary Pennington
* HTMLtree.c catalog.c debugXML.c entities.c nanoftp.c parser.c valid.c xmlmemory.c xpath.c xpointer.c: started integrating the non-controversial parts of Gary Pennington multithread patches * catalog.c: corrected a small bug introduced Daniel
This commit is contained in:
parent
75b96824bc
commit
b44025c72b
@ -1,3 +1,11 @@
|
||||
Fri Oct 12 00:53:03 CEST 2001 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* HTMLtree.c catalog.c debugXML.c entities.c nanoftp.c
|
||||
parser.c valid.c xmlmemory.c xpath.c xpointer.c: started
|
||||
integrating the non-controversial parts of Gary Pennington
|
||||
multithread patches
|
||||
* catalog.c: corrected a small bug introduced
|
||||
|
||||
Thu Oct 11 20:58:15 CEST 2001 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* catalog.c include/libxml/catalog.h: very serious cleanup,
|
||||
|
@ -451,8 +451,8 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
||||
}
|
||||
if (cur->type == HTML_TEXT_NODE) {
|
||||
if (cur->content != NULL) {
|
||||
if (((cur->name == xmlStringText) ||
|
||||
(cur->name != xmlStringTextNoenc)) &&
|
||||
if (((cur->name == (const xmlChar *)xmlStringText) ||
|
||||
(cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
|
||||
((cur->parent == NULL) ||
|
||||
(!xmlStrEqual(cur->parent->name, BAD_CAST "script")))) {
|
||||
xmlChar *buffer;
|
||||
@ -949,8 +949,8 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
|
||||
}
|
||||
if (cur->type == HTML_TEXT_NODE) {
|
||||
if (cur->content != NULL) {
|
||||
if (((cur->name == xmlStringText) ||
|
||||
(cur->name != xmlStringTextNoenc)) &&
|
||||
if (((cur->name == (const xmlChar *)xmlStringText) ||
|
||||
(cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
|
||||
((cur->parent == NULL) ||
|
||||
(!xmlStrEqual(cur->parent->name, BAD_CAST "script")))) {
|
||||
xmlChar *buffer;
|
||||
|
@ -2607,7 +2607,7 @@ xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) {
|
||||
if ((URI == NULL) || (catal == NULL))
|
||||
return(NULL);
|
||||
|
||||
if (catal->type == XML_XML_CATALOG_TYPE)
|
||||
if (xmlDebugCatalogs)
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Resolve URI %s\n", URI);
|
||||
|
||||
@ -2734,7 +2734,7 @@ xmlInitializeCatalog(void) {
|
||||
const char *catalogs;
|
||||
xmlCatalogPtr catal;
|
||||
|
||||
catalogs = getenv("XML_CATALOG_FILES");
|
||||
catalogs = (const char *) getenv("XML_CATALOG_FILES");
|
||||
if (catalogs == NULL)
|
||||
catalogs = XML_XML_DEFAULT_CATALOG;
|
||||
|
||||
|
@ -567,7 +567,7 @@ xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth)
|
||||
break;
|
||||
case XML_TEXT_NODE:
|
||||
fprintf(output, shift);
|
||||
if (node->name == xmlStringTextNoenc)
|
||||
if (node->name == (const xmlChar *) xmlStringTextNoenc)
|
||||
fprintf(output, "TEXT no enc\n");
|
||||
else
|
||||
fprintf(output, "TEXT\n");
|
||||
|
@ -38,7 +38,7 @@ static struct xmlPredefinedEntityValue xmlPredefinedEntityValues[] = {
|
||||
* TODO: This is GROSS, allocation of a 256 entry hash for
|
||||
* a fixed number of 4 elements !
|
||||
*/
|
||||
xmlHashTablePtr xmlPredefinedEntities = NULL;
|
||||
static xmlHashTablePtr xmlPredefinedEntities = NULL;
|
||||
|
||||
/*
|
||||
* xmlFreeEntity : clean-up an entity record.
|
||||
|
14
nanoftp.c
14
nanoftp.c
@ -74,8 +74,6 @@
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
||||
static char hostname[100];
|
||||
|
||||
#define FTP_COMMAND_OK 200
|
||||
#define FTP_SYNTAX_ERROR 500
|
||||
#define FTP_GET_PASSWD 331
|
||||
@ -99,6 +97,7 @@ typedef struct xmlNanoFTPCtxt {
|
||||
int controlBufIndex;
|
||||
int controlBufUsed;
|
||||
int controlBufAnswer;
|
||||
char localhostname[100];
|
||||
} xmlNanoFTPCtxt, *xmlNanoFTPCtxtPtr;
|
||||
|
||||
static int initialized = 0;
|
||||
@ -131,8 +130,6 @@ xmlNanoFTPInit(void) {
|
||||
return;
|
||||
#endif
|
||||
|
||||
gethostname(hostname, sizeof(hostname));
|
||||
|
||||
proxyPort = 21;
|
||||
env = getenv("no_proxy");
|
||||
if (env != NULL)
|
||||
@ -177,7 +174,6 @@ xmlNanoFTPCleanup(void) {
|
||||
xmlFree(proxyPasswd);
|
||||
proxyPasswd = NULL;
|
||||
}
|
||||
hostname[0] = 0;
|
||||
#ifdef _WINSOCKAPI_
|
||||
if (initialized)
|
||||
WSACleanup();
|
||||
@ -480,6 +476,7 @@ xmlNanoFTPNewCtxt(const char *URL) {
|
||||
ret->returnValue = 0;
|
||||
ret->controlBufIndex = 0;
|
||||
ret->controlBufUsed = 0;
|
||||
gethostname(ret->localhostname, sizeof(ret->localhostname));
|
||||
|
||||
if (URL != NULL)
|
||||
xmlNanoFTPScanURL(ret, URL);
|
||||
@ -778,7 +775,7 @@ xmlNanoFTPSendPasswd(void *ctx) {
|
||||
int res;
|
||||
|
||||
if (ctxt->passwd == NULL)
|
||||
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n", hostname);
|
||||
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n", ctxt->localhostname);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "PASS %s\r\n", ctxt->passwd);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
@ -951,7 +948,7 @@ xmlNanoFTPConnect(void *ctx) {
|
||||
snprintf(buf, sizeof(buf), "PASS %s\r\n", proxyPasswd);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n",
|
||||
hostname);
|
||||
ctxt->localhostname);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
len = strlen(buf);
|
||||
#ifdef DEBUG_FTP
|
||||
@ -1040,7 +1037,8 @@ xmlNanoFTPConnect(void *ctx) {
|
||||
return(0);
|
||||
}
|
||||
if (ctxt->passwd == NULL)
|
||||
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n", hostname);
|
||||
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n",
|
||||
ctxt->localhostname);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "PASS %s\r\n", ctxt->passwd);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
|
4
parser.c
4
parser.c
@ -86,7 +86,7 @@ int xmlParserDebugEntities = 0;
|
||||
* List of XML prefixed PI allowed by W3C specs
|
||||
*/
|
||||
|
||||
const char *xmlW3CPIs[] = {
|
||||
static const char *xmlW3CPIs[] = {
|
||||
"xml-stylesheet",
|
||||
NULL
|
||||
};
|
||||
@ -1187,7 +1187,7 @@ xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static xmlChar casemap[256] = {
|
||||
static const xmlChar casemap[256] = {
|
||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
||||
0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
|
||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
||||
|
4
valid.c
4
valid.c
@ -70,7 +70,7 @@ scope type name##VPop(xmlValidCtxtPtr ctxt) { \
|
||||
} \
|
||||
|
||||
/*
|
||||
* I will use a home made algorithm less complex and easier to
|
||||
* I use a home made algorithm less complex and easier to
|
||||
* debug/maintin than a generic NFA -> DFA state based algo. The
|
||||
* only restriction is on the deepness of the tree limited by the
|
||||
* size of the occurs bitfield
|
||||
@ -81,7 +81,7 @@ scope type name##VPop(xmlValidCtxtPtr ctxt) { \
|
||||
#define ROLLBACK_OR 0
|
||||
#define ROLLBACK_PARENT 1
|
||||
|
||||
struct _xmlValidState {
|
||||
typedef struct _xmlValidState {
|
||||
xmlElementContentPtr cont; /* pointer to the content model subtree */
|
||||
xmlNodePtr node; /* pointer to the current node in the list */
|
||||
long occurs;/* bitfield for multiple occurences */
|
||||
|
@ -94,9 +94,9 @@ typedef struct memnod {
|
||||
static unsigned long debugMemSize = 0;
|
||||
static unsigned long debugMaxMemSize = 0;
|
||||
static int block=0;
|
||||
int xmlMemStopAtBlock = 0;
|
||||
void *xmlMemTraceBlockAt = NULL;
|
||||
int xmlMemInitialized = 0;
|
||||
static int xmlMemStopAtBlock = 0;
|
||||
static void *xmlMemTraceBlockAt = NULL;
|
||||
static int xmlMemInitialized = 0;
|
||||
#ifdef MEM_LIST
|
||||
static MEMHDR *memlist = NULL;
|
||||
#endif
|
||||
@ -625,7 +625,7 @@ void debugmem_tag_error(void *p)
|
||||
#endif
|
||||
}
|
||||
|
||||
FILE *xmlMemoryDumpFile = NULL;
|
||||
static FILE *xmlMemoryDumpFile = NULL;
|
||||
|
||||
|
||||
/**
|
||||
|
4
xpath.c
4
xpath.c
@ -1176,7 +1176,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
|
||||
************************************************************************/
|
||||
|
||||
|
||||
const char *xmlXPathErrorMessages[] = {
|
||||
static const char *xmlXPathErrorMessages[] = {
|
||||
"Ok",
|
||||
"Number encoding",
|
||||
"Unfinished litteral",
|
||||
@ -3830,7 +3830,6 @@ xmlXPathCompareNodeSetValue(xmlXPathParserContextPtr ctxt, int inf, int strict,
|
||||
return(xmlXPathCompareValues(ctxt, inf, strict));
|
||||
default:
|
||||
TODO
|
||||
return(0);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@ -9280,7 +9279,6 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
|
||||
"xmlXPathRunEval: function %s not found\n",
|
||||
op->value4);
|
||||
XP_ERROR0(XPATH_UNKNOWN_FUNC_ERROR);
|
||||
return (total);
|
||||
}
|
||||
op->cache = (void *) func;
|
||||
op->cacheURI = (void *) URI;
|
||||
|
@ -2027,7 +2027,7 @@ xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
|
||||
xmlXPtrGetArity(node)));
|
||||
}
|
||||
default:
|
||||
return(NULL);
|
||||
break;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
@ -2064,7 +2064,7 @@ xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
|
||||
xmlXPtrGetArity(node)));
|
||||
}
|
||||
default:
|
||||
return(NULL);
|
||||
break;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
@ -2629,7 +2629,7 @@ xmlXPtrGetStartPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) {
|
||||
*indx = obj->index;
|
||||
return(0);
|
||||
default:
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
@ -2665,7 +2665,7 @@ xmlXPtrGetEndPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) {
|
||||
*indx = obj->index;
|
||||
return(0);
|
||||
default:
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user