GNOME Bugzilla – Bug 166625
Problems in libxml2-api.xml API description
Last modified: 2021-07-05 13:23:26 UTC
The libxml2-api.xml file contains a description of the libxml2 API. While developing Delphi binding for libxml2, I encountered a few minor problems with the description: 1) If case-sensitivity is removed (as when developing bindings for a case-insenstive language), there are two name conflicts: the "xmlXPathError" enumeration conflicts with the "xmlXPatherror" function; and the "xmlBufferWriteChar" function conflicts with the "xmlBufferWriteCHAR" function. 2) The type information for the "xmlStringText", "xmlStringTextNoenc", and "xmlStringComment" variables is mangled. For example, for "xmlStringText", the type is given as "const xmlCharxmlStringText[]", when it ought to be just "const xmlChar[]" or "const xmlChar *". 3)In the description of the "xmlElement" struct, the "contModel" field appears twice: first as type "xmlRegexpPtr", then as type "void *". This appears to be the result of conditional definitions in tree.h. Similarly, in the "xmlValidCtxt" struct, fields "am" and "state" are described twice. 4) It can be a bit tricky to import some of the variables when using a language other than C or C++. For a few of these variables, the symbol actually exported from the DLL (or shared object) is not the variable name, but is that of a function returning a pointer to the variable. The C language interface relies on the pre-processor to adjust this. Hence for "xmlParserVersion", the following is in globals.h : XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void); #ifdef LIBXML_THREAD_ENABLED #define xmlParserVersion \ (*(__xmlParserVersion())) #else XMLPUBVAR const char * xmlParserVersion; #endif In the thread-enabled Windows DLL, "xmlParserVersion" is not exported as such, but the function "__xmlParserVersion" is. However, there is no way to determine from libxml2-api.xml that this is the case.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.