mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-14 20:01:04 +03:00
added an XML description of the API, moved the script generating it here.
* Makefile.am doc/Makefile.am doc/libxml2-api.xml doc/parsedecl.py: added an XML description of the API, moved the script generating it here. Added a "make api" target Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Mon Jan 21 18:29:19 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* Makefile.am doc/Makefile.am doc/libxml2-api.xml doc/parsedecl.py:
|
||||||
|
added an XML description of the API, moved the script generating
|
||||||
|
it here. Added a "make api" target
|
||||||
|
|
||||||
Mon Jan 21 14:34:37 CET 2002 Daniel Veillard <daniel@veillard.com>
|
Mon Jan 21 14:34:37 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* tree.c: Adam Lounds pointed out a bug in xmlSearchNs()
|
* tree.c: Adam Lounds pointed out a bug in xmlSearchNs()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
AUTOMAKE_OPTIONS=no-dependencies
|
#AUTOMAKE_OPTIONS=no-dependencies
|
||||||
|
|
||||||
SUBDIRS = include . doc example
|
SUBDIRS = include . doc example
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ $(PAGES): xml.html site.xsl
|
|||||||
$(bindir)/xsltproc --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
|
$(bindir)/xsltproc --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/xml.html > index.html ; fi );
|
||||||
|
|
||||||
scan:
|
scan:
|
||||||
gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h xmlwin32version.h win32config.h trio.h triostr.h triop.h config-mac.h XMLTestPrefix2.h XMLTestPrefix.h triodef.h trionan.h xlink.h"
|
gtkdoc-scan --module=libxml --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="acconfig.h config.h xmlwin32version.h win32config.h trio.h triostr.h triop.h config-mac.h XMLTestPrefix2.h XMLTestPrefix.h triodef.h trionan.h xlink.h libxml.h"
|
||||||
|
|
||||||
templates: scan
|
templates: scan
|
||||||
gtkdoc-mktmpl --module=libxml
|
gtkdoc-mktmpl --module=libxml
|
||||||
@ -34,6 +34,18 @@ templates: scan
|
|||||||
sgml:
|
sgml:
|
||||||
gtkdoc-mkdb --module=libxml --source-dir=$(DOC_SOURCE_DIR)
|
gtkdoc-mkdb --module=libxml --source-dir=$(DOC_SOURCE_DIR)
|
||||||
|
|
||||||
|
xml: sgml
|
||||||
|
if test -d xml ; then rm xml/* ; else mkdir xml ; fi
|
||||||
|
-@(for s in sgml/*.sgml ; do name=`basename $$s .sgml` ; \
|
||||||
|
echo '<!DOCTYPE refentry [ <!ENTITY nbsp " "> ]>' > \
|
||||||
|
xml/"$$name".xml ;\
|
||||||
|
grep -v "^<colspec" $$s >> xml/"$$name".xml ; done)
|
||||||
|
|
||||||
|
libxml2-api.xml: xml parsedecl.py libxml-decl.txt libxml-decl-list.txt
|
||||||
|
-./parsedecl.py
|
||||||
|
|
||||||
|
api: libxml2-api.xml
|
||||||
|
|
||||||
html:
|
html:
|
||||||
if test -n -d html ; then mkdir html ; fi
|
if test -n -d html ; then mkdir html ; fi
|
||||||
-cd html && gtkdoc-mkhtml libxml ../$(DOC_MAIN_SGML_FILE)
|
-cd html && gtkdoc-mkhtml libxml ../$(DOC_MAIN_SGML_FILE)
|
||||||
@ -49,7 +61,7 @@ libxml-decl-list.txt : templates
|
|||||||
libxml-sections.txt : scan
|
libxml-sections.txt : scan
|
||||||
cp libxml-decl-list.txt libxml-sections.txt
|
cp libxml-decl-list.txt libxml-sections.txt
|
||||||
|
|
||||||
rebuild: libxml-sections.txt templates sgml html
|
rebuild: libxml-sections.txt templates sgml html api
|
||||||
|
|
||||||
install-data-local:
|
install-data-local:
|
||||||
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
|
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
|
||||||
@ -59,6 +71,6 @@ install-data-local:
|
|||||||
-(cd $(DESTDIR); gtkdoc-fixxref --module=libxml --html-dir=$(HTML_DIR))
|
-(cd $(DESTDIR); gtkdoc-fixxref --module=libxml --html-dir=$(HTML_DIR))
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
(cd $(srcdir) ; tar cvf - *.1 site.xsl *.html *.gif html/*.html html/*.sgml) | (cd $(distdir); tar xf -)
|
(cd $(srcdir) ; tar cvf - *.1 site.xsl *.html *.gif html/*.html html/*.sgml libxml2-api.xml parsedecl.py) | (cd $(distdir); tar xf -)
|
||||||
|
|
||||||
.PHONY : html sgml templates scan
|
.PHONY : html sgml templates scan
|
||||||
|
@ -1,327 +0,0 @@
|
|||||||
<HTML
|
|
||||||
><HEAD
|
|
||||||
><TITLE
|
|
||||||
>Gnome XML Library Reference Manual</TITLE
|
|
||||||
><META
|
|
||||||
NAME="GENERATOR"
|
|
||||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
|
|
||||||
"><LINK
|
|
||||||
REL="NEXT"
|
|
||||||
TITLE="Libxml Programming Notes"
|
|
||||||
HREF="libxml-notes.html"></HEAD
|
|
||||||
><BODY
|
|
||||||
CLASS="BOOK"
|
|
||||||
BGCOLOR="#FFFFFF"
|
|
||||||
TEXT="#000000"
|
|
||||||
LINK="#0000FF"
|
|
||||||
VLINK="#840084"
|
|
||||||
ALINK="#0000FF"
|
|
||||||
><DIV
|
|
||||||
CLASS="BOOK"
|
|
||||||
><DIV
|
|
||||||
CLASS="TITLEPAGE"
|
|
||||||
><TABLE
|
|
||||||
WIDTH="100%"
|
|
||||||
BORDER="0"
|
|
||||||
BGCOLOR="#000000"
|
|
||||||
CELLPADDING="1"
|
|
||||||
CELLSPACING="0"
|
|
||||||
><TR
|
|
||||||
><TH
|
|
||||||
ALIGN="center"
|
|
||||||
VALIGN="center"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="7"
|
|
||||||
><P
|
|
||||||
CLASS="TITLE"
|
|
||||||
><A
|
|
||||||
NAME="AEN2"
|
|
||||||
>Gnome XML Library Reference Manual</A
|
|
||||||
></P
|
|
||||||
></FONT
|
|
||||||
></TH
|
|
||||||
></TR
|
|
||||||
></TABLE
|
|
||||||
><H3
|
|
||||||
CLASS="AUTHOR"
|
|
||||||
><A
|
|
||||||
NAME="AEN5"
|
|
||||||
>Daniel Veillard</A
|
|
||||||
></H3
|
|
||||||
><DIV
|
|
||||||
CLASS="AFFILIATION"
|
|
||||||
><DIV
|
|
||||||
CLASS="ADDRESS"
|
|
||||||
><P
|
|
||||||
CLASS="ADDRESS"
|
|
||||||
> daniel@veillard.com<br>
|
|
||||||
</P
|
|
||||||
></DIV
|
|
||||||
></DIV
|
|
||||||
><P
|
|
||||||
CLASS="COPYRIGHT"
|
|
||||||
>Copyright © 1999 by Daniel Veillard</P
|
|
||||||
><DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="ABSTRACT"
|
|
||||||
><A
|
|
||||||
NAME="AEN18"
|
|
||||||
></A
|
|
||||||
><P
|
|
||||||
></P
|
|
||||||
><P
|
|
||||||
>This manual documents the interfaces of the libxml
|
|
||||||
library and has some short notes to help get you up to speed
|
|
||||||
with using the library.</P
|
|
||||||
><P
|
|
||||||
></P
|
|
||||||
></DIV
|
|
||||||
></DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="LEGALNOTICE"
|
|
||||||
><A
|
|
||||||
NAME="AEN14"
|
|
||||||
></A
|
|
||||||
><P
|
|
||||||
></P
|
|
||||||
><P
|
|
||||||
>Permission is granted to make and distribute verbatim
|
|
||||||
copies of this manual provided the copyright notice and this
|
|
||||||
permission notice are preserved on all copies.</P
|
|
||||||
><P
|
|
||||||
>Permission is granted to copy and distribute modified
|
|
||||||
versions of this manual under the conditions for verbatim
|
|
||||||
copying, provided also that the entire resulting derived work is
|
|
||||||
distributed under the terms of a permission notice identical to
|
|
||||||
this one.</P
|
|
||||||
><P
|
|
||||||
>Permission is granted to copy and distribute translations
|
|
||||||
of this manual into another language, under the above conditions
|
|
||||||
for modified versions.</P
|
|
||||||
><P
|
|
||||||
></P
|
|
||||||
></DIV
|
|
||||||
></DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="TOC"
|
|
||||||
><DL
|
|
||||||
><DT
|
|
||||||
><B
|
|
||||||
>Table of Contents</B
|
|
||||||
></DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-notes.html"
|
|
||||||
>Libxml Programming Notes</A
|
|
||||||
></DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-lib.html"
|
|
||||||
>Libxml Library Reference</A
|
|
||||||
></DT
|
|
||||||
><DD
|
|
||||||
><DL
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-parser.html"
|
|
||||||
>parser</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-sax.html"
|
|
||||||
>SAX</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-tree.html"
|
|
||||||
>tree</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-entities.html"
|
|
||||||
>entities</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-valid.html"
|
|
||||||
>valid</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-uri.html"
|
|
||||||
>uri</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xmlerror.html"
|
|
||||||
>xmlerror</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-htmlparser.html"
|
|
||||||
>HTMLparser</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-htmltree.html"
|
|
||||||
>HTMLtree</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xpath.html"
|
|
||||||
>xpath</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xpathinternals.html"
|
|
||||||
>xpathInternals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xpointer.html"
|
|
||||||
>xpointer</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xinclude.html"
|
|
||||||
>xinclude</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-nanohttp.html"
|
|
||||||
>nanohttp</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-nanoftp.html"
|
|
||||||
>nanoftp</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xmlio.html"
|
|
||||||
>xmlIO</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-catalog.html"
|
|
||||||
>catalog</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-threads.html"
|
|
||||||
>threads</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-globals.html"
|
|
||||||
>globals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-docbparser.html"
|
|
||||||
>DOCBparser</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-parserinternals.html"
|
|
||||||
>parserInternals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-encoding.html"
|
|
||||||
>encoding</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-hash.html"
|
|
||||||
>hash</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-debugxml.html"
|
|
||||||
>debugXML</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xmlmemory.html"
|
|
||||||
>xmlmemory</A
|
|
||||||
> — </DT
|
|
||||||
></DL
|
|
||||||
></DD
|
|
||||||
></DL
|
|
||||||
></DIV
|
|
||||||
></DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="NAVFOOTER"
|
|
||||||
><BR
|
|
||||||
CLEAR="all"><BR><TABLE
|
|
||||||
WIDTH="100%"
|
|
||||||
BORDER="0"
|
|
||||||
BGCOLOR="#000000"
|
|
||||||
CELLPADDING="1"
|
|
||||||
CELLSPACING="0"
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#C00000"
|
|
||||||
ALIGN="left"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#0000C0"
|
|
||||||
ALIGN="center"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
> </B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#00C000"
|
|
||||||
ALIGN="center"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
> </B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#C00000"
|
|
||||||
ALIGN="right"
|
|
||||||
><A
|
|
||||||
HREF="libxml-notes.html"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>Next Page >>></B
|
|
||||||
></FONT
|
|
||||||
></A
|
|
||||||
></TD
|
|
||||||
></TR
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
COLSPAN="2"
|
|
||||||
ALIGN="left"
|
|
||||||
> </TD
|
|
||||||
><TD
|
|
||||||
COLSPAN="2"
|
|
||||||
ALIGN="right"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>Libxml Programming Notes</B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
></TR
|
|
||||||
></TABLE
|
|
||||||
></DIV
|
|
||||||
></BODY
|
|
||||||
></HTML
|
|
||||||
>
|
|
@ -166,184 +166,4 @@ HREF="libxml-htmltree.html"
|
|||||||
><A
|
><A
|
||||||
HREF="libxml-xpath.html"
|
HREF="libxml-xpath.html"
|
||||||
>xpath</A
|
>xpath</A
|
||||||
> — </DT
|
> —
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xpathinternals.html"
|
|
||||||
>xpathInternals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xpointer.html"
|
|
||||||
>xpointer</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xinclude.html"
|
|
||||||
>xinclude</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-nanohttp.html"
|
|
||||||
>nanohttp</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-nanoftp.html"
|
|
||||||
>nanoftp</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xmlio.html"
|
|
||||||
>xmlIO</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-catalog.html"
|
|
||||||
>catalog</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-threads.html"
|
|
||||||
>threads</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-globals.html"
|
|
||||||
>globals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-docbparser.html"
|
|
||||||
>DOCBparser</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-parserinternals.html"
|
|
||||||
>parserInternals</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-encoding.html"
|
|
||||||
>encoding</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-hash.html"
|
|
||||||
>hash</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-debugxml.html"
|
|
||||||
>debugXML</A
|
|
||||||
> — </DT
|
|
||||||
><DT
|
|
||||||
><A
|
|
||||||
HREF="libxml-xmlmemory.html"
|
|
||||||
>xmlmemory</A
|
|
||||||
> — </DT
|
|
||||||
></DL
|
|
||||||
></DIV
|
|
||||||
><P
|
|
||||||
>This section contains the API reference for libxml. All
|
|
||||||
the public interfaces are documented here. This reference guide is
|
|
||||||
build by extracting comments from the code sources. </P
|
|
||||||
>_functions;
|
|
||||||
</DIV
|
|
||||||
><DIV
|
|
||||||
CLASS="NAVFOOTER"
|
|
||||||
><BR
|
|
||||||
CLEAR="all"><BR><TABLE
|
|
||||||
WIDTH="100%"
|
|
||||||
BORDER="0"
|
|
||||||
BGCOLOR="#000000"
|
|
||||||
CELLPADDING="1"
|
|
||||||
CELLSPACING="0"
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#C00000"
|
|
||||||
ALIGN="left"
|
|
||||||
><A
|
|
||||||
HREF="libxml-notes.html"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
><<< Previous Page</B
|
|
||||||
></FONT
|
|
||||||
></A
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#0000C0"
|
|
||||||
ALIGN="center"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
><A
|
|
||||||
HREF="book1.html"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>Home</B
|
|
||||||
></FONT
|
|
||||||
></A
|
|
||||||
></B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#00C000"
|
|
||||||
ALIGN="center"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
> </B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
WIDTH="25%"
|
|
||||||
BGCOLOR="#C00000"
|
|
||||||
ALIGN="right"
|
|
||||||
><A
|
|
||||||
HREF="libxml-parser.html"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>Next Page >>></B
|
|
||||||
></FONT
|
|
||||||
></A
|
|
||||||
></TD
|
|
||||||
></TR
|
|
||||||
><TR
|
|
||||||
><TD
|
|
||||||
COLSPAN="2"
|
|
||||||
ALIGN="left"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>Libxml Programming Notes</B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
><TD
|
|
||||||
COLSPAN="2"
|
|
||||||
ALIGN="right"
|
|
||||||
><FONT
|
|
||||||
COLOR="#FFFFFF"
|
|
||||||
SIZE="3"
|
|
||||||
><B
|
|
||||||
>parser</B
|
|
||||||
></FONT
|
|
||||||
></TD
|
|
||||||
></TR
|
|
||||||
></TABLE
|
|
||||||
></DIV
|
|
||||||
></BODY
|
|
||||||
></HTML
|
|
||||||
>
|
|
File diff suppressed because it is too large
Load Diff
6043
doc/libxml2-api.xml
Normal file
6043
doc/libxml2-api.xml
Normal file
File diff suppressed because it is too large
Load Diff
336
doc/parsedecl.py
Executable file
336
doc/parsedecl.py
Executable file
@ -0,0 +1,336 @@
|
|||||||
|
#!/usr/bin/python -u
|
||||||
|
#
|
||||||
|
# tries to parse the output of gtk-doc declaration files and make
|
||||||
|
# an XML reusable description from them
|
||||||
|
#
|
||||||
|
# TODO: try to extracts comments from the DocBook output of
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import string
|
||||||
|
|
||||||
|
macros = []
|
||||||
|
structs = []
|
||||||
|
typedefs = []
|
||||||
|
enums = {}
|
||||||
|
functions = {}
|
||||||
|
private_functions = {}
|
||||||
|
ret_types = {}
|
||||||
|
types = {}
|
||||||
|
|
||||||
|
sections = []
|
||||||
|
files = {}
|
||||||
|
identifiers_file = {}
|
||||||
|
identifiers_type = {}
|
||||||
|
|
||||||
|
def mormalizeTypeSpaces(raw, function):
|
||||||
|
global types
|
||||||
|
|
||||||
|
tokens = string.split(raw)
|
||||||
|
type = ''
|
||||||
|
for token in tokens:
|
||||||
|
if type != '':
|
||||||
|
type = type + ' ' + token
|
||||||
|
else:
|
||||||
|
type = token
|
||||||
|
if types.has_key(type):
|
||||||
|
types[type].append(function)
|
||||||
|
else:
|
||||||
|
types[type] = [function]
|
||||||
|
return type
|
||||||
|
|
||||||
|
def removeComments(raw):
|
||||||
|
while string.find(raw, '/*') > 0:
|
||||||
|
e = string.find(raw, '/*')
|
||||||
|
tmp = raw[0:e]
|
||||||
|
raw = raw[e:]
|
||||||
|
e = string.find(raw, '*/')
|
||||||
|
if e > 0:
|
||||||
|
raw = tmp + raw[e + 2:]
|
||||||
|
else:
|
||||||
|
raw = tmp
|
||||||
|
return raw
|
||||||
|
|
||||||
|
def extractArgs(raw, function):
|
||||||
|
raw = removeComments(raw)
|
||||||
|
list = string.split(raw, ",")
|
||||||
|
ret = []
|
||||||
|
for arg in list:
|
||||||
|
i = len(arg)
|
||||||
|
if i == 0:
|
||||||
|
continue
|
||||||
|
i = i - 1
|
||||||
|
c = arg[i]
|
||||||
|
while string.find(string.letters, c) >= 0 or \
|
||||||
|
string.find(string.digits, c) >= 0:
|
||||||
|
i = i - 1
|
||||||
|
if i < 0:
|
||||||
|
break
|
||||||
|
c = arg[i]
|
||||||
|
name = arg[i+1:]
|
||||||
|
while string.find(string.whitespace, c) >= 0:
|
||||||
|
i = i - 1
|
||||||
|
if i < 0:
|
||||||
|
break
|
||||||
|
c = arg[i]
|
||||||
|
type = mormalizeTypeSpaces(arg[0:i+1], function)
|
||||||
|
# print "list: %s -> %s, %s" % (list, type, name)
|
||||||
|
ret.append((type, name))
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def extractTypes(raw, function):
|
||||||
|
global ret_types
|
||||||
|
|
||||||
|
tokens = string.split(raw)
|
||||||
|
type = ''
|
||||||
|
for token in tokens:
|
||||||
|
if type != '':
|
||||||
|
type = type + ' ' + token
|
||||||
|
else:
|
||||||
|
type = token
|
||||||
|
if ret_types.has_key(type):
|
||||||
|
ret_types[type].append(function)
|
||||||
|
else:
|
||||||
|
ret_types[type] = [function]
|
||||||
|
return type
|
||||||
|
|
||||||
|
def parseMacro():
|
||||||
|
global input
|
||||||
|
global macros
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
while line != "</MACRO>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
macros.append(name)
|
||||||
|
identifiers_type[name] = "macro"
|
||||||
|
|
||||||
|
def parseStruct():
|
||||||
|
global input
|
||||||
|
global structs
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
while line != "</STRUCT>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
structs.append(name)
|
||||||
|
identifiers_type[name] = "struct"
|
||||||
|
|
||||||
|
def parseTypedef():
|
||||||
|
global input
|
||||||
|
global typedefs
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
while line != "</TYPEDEF>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
typedefs.append(name)
|
||||||
|
identifiers_type[name] = "typedef"
|
||||||
|
|
||||||
|
def parseEnum():
|
||||||
|
global input
|
||||||
|
global enums
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
consts = []
|
||||||
|
while line != "</ENUM>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
elif string.find(line, 'enum') >= 0:
|
||||||
|
pass
|
||||||
|
elif string.find(line, '{') >= 0:
|
||||||
|
pass
|
||||||
|
elif string.find(line, '}') >= 0:
|
||||||
|
pass
|
||||||
|
elif string.find(line, ';') >= 0:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
comment = string.find(line, '/*')
|
||||||
|
if comment >= 0:
|
||||||
|
line = line[0:comment]
|
||||||
|
decls = string.split(line, ",")
|
||||||
|
for decl in decls:
|
||||||
|
val = string.split(decl, "=")[0]
|
||||||
|
tokens = string.split(val)
|
||||||
|
if len(tokens) >= 1:
|
||||||
|
token = tokens[0]
|
||||||
|
if string.find(string.letters, token[0]) >= 0:
|
||||||
|
consts.append(token)
|
||||||
|
identifiers_type[token] = "const"
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
enums[name] = consts
|
||||||
|
identifiers_type[name] = "enum"
|
||||||
|
|
||||||
|
def parseStaticFunction():
|
||||||
|
global input
|
||||||
|
global private_functions
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
type = None
|
||||||
|
signature = None
|
||||||
|
while line != "</USER_FUNCTION>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
elif line[0:9] == "<RETURNS>" and line[-10:] == "</RETURNS>":
|
||||||
|
type = extractTypes(line[9:-10], name)
|
||||||
|
else:
|
||||||
|
signature = line
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
args = extractArgs(signature, name)
|
||||||
|
private_functions[name] = (type , args)
|
||||||
|
identifiers_type[name] = "private_func"
|
||||||
|
|
||||||
|
def parseFunction():
|
||||||
|
global input
|
||||||
|
global functions
|
||||||
|
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
type = None
|
||||||
|
signature = None
|
||||||
|
while line != "</FUNCTION>":
|
||||||
|
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
||||||
|
name = line[6:-7]
|
||||||
|
elif line[0:9] == "<RETURNS>" and line[-10:] == "</RETURNS>":
|
||||||
|
type = extractTypes(line[9:-10], name)
|
||||||
|
else:
|
||||||
|
signature = line
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
args = extractArgs(signature, name)
|
||||||
|
functions[name] = (type , args)
|
||||||
|
identifiers_type[name] = "function"
|
||||||
|
|
||||||
|
def parseSection():
|
||||||
|
global input
|
||||||
|
global sections
|
||||||
|
global files
|
||||||
|
global identifiers_file
|
||||||
|
|
||||||
|
tokens = []
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
while line != "</SECTION>":
|
||||||
|
if line[0:6] == "<FILE>" and line[-7:] == "</FILE>":
|
||||||
|
name = line[6:-7]
|
||||||
|
elif len(line) > 0:
|
||||||
|
tokens.append(line)
|
||||||
|
line = input.readline()[:-1]
|
||||||
|
|
||||||
|
sections.append(name)
|
||||||
|
files[name] = tokens
|
||||||
|
for token in tokens:
|
||||||
|
identifiers_file[token] = name
|
||||||
|
#
|
||||||
|
# Small transitivity for enum values
|
||||||
|
#
|
||||||
|
if enums.has_key(token):
|
||||||
|
for const in enums[token]:
|
||||||
|
identifiers_file[const] = name
|
||||||
|
|
||||||
|
print "Parsing: libxml-decl.txt"
|
||||||
|
input = open('libxml-decl.txt')
|
||||||
|
while 1:
|
||||||
|
line = input.readline()
|
||||||
|
if not line:
|
||||||
|
break
|
||||||
|
line = line[:-1]
|
||||||
|
if line == "<MACRO>":
|
||||||
|
parseMacro()
|
||||||
|
elif line == "<ENUM>":
|
||||||
|
parseEnum()
|
||||||
|
elif line == "<FUNCTION>":
|
||||||
|
parseFunction()
|
||||||
|
elif line == "<STRUCT>":
|
||||||
|
parseStruct()
|
||||||
|
elif line == "<TYPEDEF>":
|
||||||
|
parseTypedef()
|
||||||
|
elif line == "<USER_FUNCTION>":
|
||||||
|
parseStaticFunction()
|
||||||
|
elif len(line) >= 1 and line[0] == "<":
|
||||||
|
print "unhandled %s" % (line)
|
||||||
|
|
||||||
|
print "Parsed: %d macros. %d structs, %d typedefs, %d enums" % (
|
||||||
|
len(macros), len(structs), len(typedefs), len(enums))
|
||||||
|
c = 0
|
||||||
|
for enum in enums.keys():
|
||||||
|
consts = enums[enum]
|
||||||
|
c = c + len(consts)
|
||||||
|
print " %d constants, %d functions and %d private functions" % (
|
||||||
|
c, len(functions.keys()), len(private_functions.keys()))
|
||||||
|
print "The functions manipulates %d different types" % (len(types.keys()))
|
||||||
|
print "The functions returns %d different types" % (len(ret_types.keys()))
|
||||||
|
|
||||||
|
print "Parsing: libxml-decl-list.txt"
|
||||||
|
input = open('libxml-decl-list.txt')
|
||||||
|
while 1:
|
||||||
|
line = input.readline()
|
||||||
|
if not line:
|
||||||
|
break
|
||||||
|
line = line[:-1]
|
||||||
|
if line == "<SECTION>":
|
||||||
|
parseSection()
|
||||||
|
elif len(line) >= 1 and line[0] == "<":
|
||||||
|
print "unhandled %s" % (line)
|
||||||
|
|
||||||
|
print "Parsed: %d files %d identifiers" % (len(files), len(identifiers_file.keys()))
|
||||||
|
|
||||||
|
print "Saving XML description libxml2-api.xml"
|
||||||
|
output = open("libxml2-api.xml", "w")
|
||||||
|
output.write("<api name='libxml2'>\n")
|
||||||
|
output.write(" <files>\n")
|
||||||
|
for file in files.keys():
|
||||||
|
output.write(" <file name='%s'>\n" % file)
|
||||||
|
for symbol in files[file]:
|
||||||
|
output.write(" <exports symbol='%s'/>\n" % (symbol))
|
||||||
|
output.write(" </file>\n")
|
||||||
|
output.write(" </files>\n")
|
||||||
|
|
||||||
|
output.write(" <symbols>\n")
|
||||||
|
symbols=macros
|
||||||
|
for i in structs: symbols.append(i)
|
||||||
|
for i in typedefs: symbols.append(i)
|
||||||
|
for i in enums.keys():
|
||||||
|
symbols.append(i)
|
||||||
|
for j in enums[i]:
|
||||||
|
symbols.append(j)
|
||||||
|
for i in functions.keys(): symbols.append(i)
|
||||||
|
symbols.sort()
|
||||||
|
prev = None
|
||||||
|
for i in symbols:
|
||||||
|
if i == prev:
|
||||||
|
# print "Symbol %s redefined" % (i)
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
prev = i
|
||||||
|
if identifiers_type.has_key(i):
|
||||||
|
type = identifiers_type[i]
|
||||||
|
|
||||||
|
if identifiers_file.has_key(i):
|
||||||
|
file = identifiers_file[i]
|
||||||
|
else:
|
||||||
|
file = None
|
||||||
|
|
||||||
|
output.write(" <%s name='%s'" % (type, i))
|
||||||
|
if file != None:
|
||||||
|
output.write(" file='%s'" % (file))
|
||||||
|
if type == "function":
|
||||||
|
output.write(">\n");
|
||||||
|
(ret, args) = functions[i]
|
||||||
|
output.write(" <return type='%s'/>\n" % (ret))
|
||||||
|
for arg in args:
|
||||||
|
output.write(" <arg name='%s' type='%s'/>\n" % (
|
||||||
|
arg[1], arg[0]))
|
||||||
|
output.write(" </%s>\n" % (type));
|
||||||
|
else:
|
||||||
|
output.write("/>\n");
|
||||||
|
else:
|
||||||
|
print "Symbol %s not found in identifiers list" % (i)
|
||||||
|
output.write(" </symbols>\n")
|
||||||
|
output.write("</api>\n")
|
||||||
|
print "generated XML for %d symbols" % (len(symbols))
|
185
parsedecl.py
185
parsedecl.py
@ -1,185 +0,0 @@
|
|||||||
#!/usr/bin/python -u
|
|
||||||
#
|
|
||||||
# tries to parse the output of gtk-doc declaration files and make
|
|
||||||
# something usable from them
|
|
||||||
#
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import string
|
|
||||||
|
|
||||||
input = open('doc/libxml-decl.txt')
|
|
||||||
macros = []
|
|
||||||
structs = []
|
|
||||||
typedefs = []
|
|
||||||
enums = {}
|
|
||||||
functions = {}
|
|
||||||
private_functions = {}
|
|
||||||
types = {}
|
|
||||||
|
|
||||||
def extractTypes(raw, function):
|
|
||||||
global types
|
|
||||||
|
|
||||||
tokens = string.split(raw)
|
|
||||||
type = ''
|
|
||||||
for token in tokens:
|
|
||||||
if type != '':
|
|
||||||
type = type + ' ' + token
|
|
||||||
else:
|
|
||||||
type = token
|
|
||||||
if types.has_key(type):
|
|
||||||
types[type].append(function)
|
|
||||||
else:
|
|
||||||
types[type] = [function]
|
|
||||||
return type
|
|
||||||
|
|
||||||
def parseMacro():
|
|
||||||
global input
|
|
||||||
global macros
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
while line != "</MACRO>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
macros.append(name)
|
|
||||||
|
|
||||||
def parseStruct():
|
|
||||||
global input
|
|
||||||
global structs
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
while line != "</STRUCT>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
structs.append(name)
|
|
||||||
|
|
||||||
def parseTypedef():
|
|
||||||
global input
|
|
||||||
global typedefs
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
while line != "</TYPEDEF>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
typedefs.append(name)
|
|
||||||
|
|
||||||
def parseEnum():
|
|
||||||
global input
|
|
||||||
global enums
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
consts = []
|
|
||||||
while line != "</ENUM>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
elif string.find(line, 'enum') >= 0:
|
|
||||||
pass
|
|
||||||
elif string.find(line, '{') >= 0:
|
|
||||||
pass
|
|
||||||
elif string.find(line, '}') >= 0:
|
|
||||||
pass
|
|
||||||
elif string.find(line, ';') >= 0:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
comment = string.find(line, '/*')
|
|
||||||
if comment >= 0:
|
|
||||||
line = line[0:comment]
|
|
||||||
decls = string.split(line, ",")
|
|
||||||
for decl in decls:
|
|
||||||
val = string.split(decl, "=")[0]
|
|
||||||
tokens = string.split(val)
|
|
||||||
if len(tokens) >= 1:
|
|
||||||
token = tokens[0]
|
|
||||||
if string.find(string.letters, token[0]) >= 0:
|
|
||||||
consts.append(token)
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
enums[name] = consts
|
|
||||||
|
|
||||||
def parseStaticFunction():
|
|
||||||
global input
|
|
||||||
global private_functions
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
type = None
|
|
||||||
signature = None
|
|
||||||
while line != "</USER_FUNCTION>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
elif line[0:9] == "<RETURNS>" and line[-10:] == "</RETURNS>":
|
|
||||||
type = extractTypes(line[9:-10], name)
|
|
||||||
else:
|
|
||||||
signature = line
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
args = string.split(signature, ",")
|
|
||||||
sig = []
|
|
||||||
for arg in args:
|
|
||||||
l = string.split(arg)
|
|
||||||
sig.append(extractTypes(l[0], name))
|
|
||||||
|
|
||||||
private_functions[name] = (type , sig)
|
|
||||||
|
|
||||||
def parseFunction():
|
|
||||||
global input
|
|
||||||
global functions
|
|
||||||
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
type = None
|
|
||||||
signature = None
|
|
||||||
while line != "</FUNCTION>":
|
|
||||||
if line[0:6] == "<NAME>" and line[-7:] == "</NAME>":
|
|
||||||
name = line[6:-7]
|
|
||||||
elif line[0:9] == "<RETURNS>" and line[-10:] == "</RETURNS>":
|
|
||||||
type = extractTypes(line[9:-10], name)
|
|
||||||
else:
|
|
||||||
signature = line
|
|
||||||
line = input.readline()[:-1]
|
|
||||||
|
|
||||||
args = string.split(signature, ",")
|
|
||||||
sig = []
|
|
||||||
for arg in args:
|
|
||||||
l = string.split(arg)
|
|
||||||
sig.append(extractTypes(l[0], name))
|
|
||||||
|
|
||||||
functions[name] = (type , sig)
|
|
||||||
|
|
||||||
while 1:
|
|
||||||
line = input.readline()
|
|
||||||
if not line:
|
|
||||||
break
|
|
||||||
line = line[:-1]
|
|
||||||
if line == "<MACRO>":
|
|
||||||
parseMacro()
|
|
||||||
elif line == "<ENUM>":
|
|
||||||
parseEnum()
|
|
||||||
elif line == "<FUNCTION>":
|
|
||||||
parseFunction()
|
|
||||||
elif line == "<STRUCT>":
|
|
||||||
parseStruct()
|
|
||||||
elif line == "<TYPEDEF>":
|
|
||||||
parseTypedef()
|
|
||||||
elif line == "<USER_FUNCTION>":
|
|
||||||
parseStaticFunction()
|
|
||||||
elif len(line) >= 1 and line[0] == "<":
|
|
||||||
print "unhandled %s" % (line)
|
|
||||||
|
|
||||||
print "Parsed: %d macros. %d structs, %d typedefs, %d enums" % (
|
|
||||||
len(macros), len(structs), len(typedefs), len(enums))
|
|
||||||
c = 0
|
|
||||||
for enum in enums.keys():
|
|
||||||
consts = enums[enum]
|
|
||||||
c = c + len(consts)
|
|
||||||
print " %d constants, %d functions and %d private functions" % (
|
|
||||||
c, len(functions.keys()), len(private_functions.keys()))
|
|
||||||
print "The functions uses %d different types" % (len(types.keys()))
|
|
||||||
for type in types.keys():
|
|
||||||
if string.find(type, '*') >= 0 or (type[0:3] != 'xml' and
|
|
||||||
type[0:4] != 'html' and type[0:4] != 'docb'):
|
|
||||||
# print " %s : %s" % (type, types[type])
|
|
||||||
print " %s" % (type)
|
|
Reference in New Issue
Block a user