1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

augmented types supported a number of new bug fixes and documentation

* gentest.py testapi.c: augmented types supported
* HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new
  bug fixes and documentation updates.
Daniel
This commit is contained in:
Daniel Veillard
2004-11-06 19:24:28 +00:00
parent 57b2516af5
commit d5cc0f7f51
7 changed files with 1728 additions and 84 deletions

View File

@@ -1,3 +1,9 @@
Sat Nov 6 20:24:07 CET 2004 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: augmented types supported
* HTMLtree.c tree.c xmlreader.c xmlwriter.c: a number of new
bug fixes and documentation updates.
Sat Nov 6 15:50:11 CET 2004 Daniel Veillard <daniel@veillard.com> Sat Nov 6 15:50:11 CET 2004 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: augmented type autogeneration for enums * gentest.py testapi.c: augmented type autogeneration for enums

View File

@@ -522,6 +522,8 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
xmlInitParser(); xmlInitParser();
if ((mem == NULL) || (size == NULL))
return;
if (cur == NULL) { if (cur == NULL) {
*mem = NULL; *mem = NULL;
*size = 0; *size = 0;

View File

@@ -40,7 +40,7 @@ skipped_functions = [
"xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc", "xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc",
"xmlSetTreeDoc", "xmlUnlinkNode", "xmlSetTreeDoc", "xmlUnlinkNode",
# hard to avoid leaks in the tests # hard to avoid leaks in the tests
"xmlStrcat", "xmlStrncat", "xmlCatalogAddLocal", "xmlStrcat", "xmlStrncat", "xmlCatalogAddLocal", "xmlNewTextWriterDoc",
# unimplemented # unimplemented
"xmlTextReaderReadInnerXml", "xmlTextReaderReadOuterXml", "xmlTextReaderReadInnerXml", "xmlTextReaderReadOuterXml",
"xmlTextReaderReadString", "xmlTextReaderReadString",
@@ -48,6 +48,7 @@ skipped_functions = [
"xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose", "xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose",
# deprecated # deprecated
"xmlCatalogGetPublic", "xmlCatalogGetSystem", "xmlEncodeEntities", "xmlCatalogGetPublic", "xmlCatalogGetSystem", "xmlEncodeEntities",
"xmlNewGlobalNs",
# allocators # allocators
"xmlMemFree", "xmlMemFree",
] ]
@@ -76,6 +77,8 @@ extra_pre_call = {
"if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;", "if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;",
"xmlParseBalancedChunkMemoryRecover": "xmlParseBalancedChunkMemoryRecover":
"if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;", "if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;",
"xmlParserInputBufferCreateFd":
"if (fd >= 0) fd = -1;",
} }
extra_post_call = { extra_post_call = {
"xmlAddChild": "xmlAddChild":
@@ -116,6 +119,11 @@ extra_post_call = {
"xmlSaveFormatFileTo": """buf = NULL;""", "xmlSaveFormatFileTo": """buf = NULL;""",
"xmlIOParseDTD": "input = NULL;", "xmlIOParseDTD": "input = NULL;",
"xmlRemoveProp": "cur = NULL;", "xmlRemoveProp": "cur = NULL;",
"xmlNewNs": "if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);",
"xmlCopyNamespace": "if (ret_val != NULL) xmlFreeNs(ret_val);",
"xmlCopyNamespaceList": "if (ret_val != NULL) xmlFreeNsList(ret_val);",
"xmlNewTextWriter": "if (ret_val != NULL) out = NULL;",
"xmlNewTextWriterPushParser": "if (ret_val != NULL) ctxt = NULL;",
} }
modules = [] modules = []
@@ -174,7 +182,11 @@ def add_missing_functions(name, module):
# #
def type_convert(str, name, info, module, function, pos): def type_convert(str, name, info, module, function, pos):
# res = string.replace(str, " ", " ")
# res = string.replace(str, " ", " ")
# res = string.replace(str, " ", " ")
res = string.replace(str, " *", "_ptr") res = string.replace(str, " *", "_ptr")
# res = string.replace(str, "*", "_ptr")
res = string.replace(res, " ", "_") res = string.replace(res, " ", "_")
res = string.replace(res, "htmlNode", "xmlNode") res = string.replace(res, "htmlNode", "xmlNode")
res = string.replace(res, "htmlDoc", "xmlDoc") res = string.replace(res, "htmlDoc", "xmlDoc")
@@ -223,6 +235,16 @@ def type_convert(str, name, info, module, function, pos):
if res == 'xmlChar_ptr' and name == 'name' and \ if res == 'xmlChar_ptr' and name == 'name' and \
string.find(function, "EatName") != -1: string.find(function, "EatName") != -1:
return('eaten_name') return('eaten_name')
if res == 'void_ptr*':
res = 'void_ptr_ptr'
if res == 'char_ptr*':
res = 'char_ptr_ptr'
if res == 'xmlChar_ptr*':
res = 'xmlChar_ptr_ptr'
if res == 'const_xmlChar_ptr*':
res = 'const_xmlChar_ptr_ptr'
if res == 'const_char_ptr*':
res = 'const_char_ptr_ptr'
return res return res

1771
testapi.c

File diff suppressed because it is too large Load Diff

1
tree.c
View File

@@ -242,6 +242,7 @@ xmlSplitQName2(const xmlChar *name, xmlChar **prefix) {
int len = 0; int len = 0;
xmlChar *ret = NULL; xmlChar *ret = NULL;
if (prefix == NULL) return(NULL);
*prefix = NULL; *prefix = NULL;
if (name == NULL) return(NULL); if (name == NULL) return(NULL);

View File

@@ -4213,8 +4213,8 @@ void
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
xmlTextReaderErrorFunc *f, xmlTextReaderErrorFunc *f,
void **arg) { void **arg) {
*f = reader->errorFunc; if (f != NULL) *f = reader->errorFunc;
*arg = reader->errorFuncArg; if (arg != NULL) *arg = reader->errorFuncArg;
} }

View File

@@ -145,6 +145,8 @@ xmlWriterErrMsgInt(xmlTextWriterPtr ctxt, xmlParserErrors error,
* @out: an xmlOutputBufferPtr * @out: an xmlOutputBufferPtr
* *
* Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr * Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr
* NOTE: the @out parameter will be deallocated when the writer is closed
* (if the call succeed.)
* *
* Returns the new xmlTextWriterPtr or NULL in case of error * Returns the new xmlTextWriterPtr or NULL in case of error
*/ */
@@ -280,6 +282,8 @@ xmlNewTextWriterMemory(xmlBufferPtr buf, int compression ATTRIBUTE_UNUSED)
* @compression: compress the output? * @compression: compress the output?
* *
* Create a new xmlNewTextWriter structure with @ctxt as output * Create a new xmlNewTextWriter structure with @ctxt as output
* NOTE: the @ctxt context will be freed with the resulting writer
* (if the call succeeds).
* TODO: handle compression * TODO: handle compression
* *
* Returns the new xmlTextWriterPtr or NULL in case of error * Returns the new xmlTextWriterPtr or NULL in case of error