Commit 61006471 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

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
parent d2f23009
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>
* tree.c: Adam Lounds pointed out a bug in xmlSearchNs()
......
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS=no-dependencies
#AUTOMAKE_OPTIONS=no-dependencies
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 );
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
gtkdoc-mktmpl --module=libxml
......@@ -34,6 +34,18 @@ templates: scan
sgml:
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 "&#x00A0;"> ]>' > \
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:
if test -n -d html ; then mkdir html ; fi
-cd html && gtkdoc-mkhtml libxml ../$(DOC_MAIN_SGML_FILE)
......@@ -49,7 +61,7 @@ libxml-decl-list.txt : templates
libxml-sections.txt : scan
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:
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
......@@ -59,6 +71,6 @@ install-data-local:
-(cd $(DESTDIR); gtkdoc-fixxref --module=libxml --html-dir=$(HTML_DIR))
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
<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"
> &nbsp;&nbsp;&nbsp;&nbsp;daniel@veillard.com<br>
&nbsp;&nbsp;</P
></DIV
></DIV
><P
CLASS="COPYRIGHT"
>Copyright &copy; 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
> &#8212; </DT
><DT
><A
HREF="libxml-sax.html"
>SAX</A
> &#8212; </DT
><DT
><A
HREF="libxml-tree.html"
>tree</A
> &#8212; </DT
><DT
><A
HREF="libxml-entities.html"
>entities</A
> &#8212; </DT
><DT
><A
HREF="libxml-valid.html"
>valid</A
> &#8212; </DT
><DT
><A
HREF="libxml-uri.html"
>uri</A
> &#8212; </DT
><DT
><A
HREF="libxml-xmlerror.html"
>xmlerror</A
> &#8212; </DT
><DT
><A
HREF="libxml-htmlparser.html"
>HTMLparser</A
> &#8212; </DT
><DT
><A
HREF="libxml-htmltree.html"
>HTMLtree</A
> &#8212; </DT
><DT
><A
HREF="libxml-xpath.html"
>xpath</A
> &#8212; </DT
><DT
><A
HREF="libxml-xpathinternals.html"
>xpathInternals</A
> &#8212; </DT
><DT
><A
HREF="libxml-xpointer.html"
>xpointer</A
> &#8212; </DT
><DT
><A
HREF="libxml-xinclude.html"
>xinclude</A
> &#8212; </DT
><DT
><A
HREF="libxml-nanohttp.html"
>nanohttp</A
> &#8212; </DT
><DT
><A
HREF="libxml-nanoftp.html"
>nanoftp</A
> &#8212; </DT
><DT
><A
HREF="libxml-xmlio.html"
>xmlIO</A
> &#8212; </DT
><DT
><A
HREF="libxml-catalog.html"
>catalog</A
> &#8212; </DT
><DT
><A
HREF="libxml-threads.html"
>threads</A
> &#8212; </DT
><DT
><A
HREF="libxml-globals.html"
>globals</A
> &#8212; </DT
><DT
><A
HREF="libxml-docbparser.html"
>DOCBparser</A
> &#8212; </DT
><DT
><A
HREF="libxml-parserinternals.html"
>parserInternals</A
> &#8212; </DT
><DT
><A
HREF="libxml-encoding.html"
>encoding</A
> &#8212; </DT
><DT
><A
HREF="libxml-hash.html"
>hash</A
> &#8212; </DT
><DT
><A
HREF="libxml-debugxml.html"
>debugXML</A
> &#8212; </DT
><DT
><A
HREF="libxml-xmlmemory.html"
>xmlmemory</A
> &#8212; </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"
>&nbsp;</TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="libxml-notes.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="left"
>&nbsp;</TD
><TD
COLSPAN="2"
ALIGN="right"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Libxml Programming Notes</B
></FONT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
\ No newline at end of file
......@@ -166,184 +166,4 @@ HREF="libxml-htmltree.html"
><A
HREF="libxml-xpath.html"
>xpath</A
> &#8212; </DT
><DT
><A
HREF="libxml-xpathinternals.html"
>xpathInternals</A
> &#8212; </DT
><DT
><A
HREF="libxml-xpointer.html"
>xpointer</A
> &#8212; </DT
><DT
><A
HREF="libxml-xinclude.html"
>xinclude</A
> &#8212; </DT
><DT
><A
HREF="libxml-nanohttp.html"
>nanohttp</A
> &#8212; </DT
><DT
><A
HREF="libxml-nanoftp.html"
>nanoftp</A
> &#8212; </DT
><DT
><A
HREF="libxml-xmlio.html"
>xmlIO</A
> &#8212; </DT
><DT
><A
HREF="libxml-catalog.html"
>catalog</A
> &#8212; </DT
><DT
><A
HREF="libxml-threads.html"
>threads</A
> &#8212; </DT
><DT
><A
HREF="libxml-globals.html"
>globals</A
> &#8212; </DT
><DT
><A
HREF="libxml-docbparser.html"
>DOCBparser</A
> &#8212; </DT
><DT
><A
HREF="libxml-parserinternals.html"
>parserInternals</A
> &#8212; </DT
><DT
><A
HREF="libxml-encoding.html"
>encoding</A
> &#8212; </DT
><DT
><A
HREF="libxml-hash.html"
>hash</A
> &#8212; </DT
><DT
><A
HREF="libxml-debugxml.html"
>debugXML</A
> &#8212; </DT
><DT
><A
HREF="libxml-xmlmemory.html"
>xmlmemory</A
> &#8212; </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
>&#60;&#60;&#60; 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
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="libxml-parser.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</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
>
\ No newline at end of file
> &#8212;
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/python -u
#
# tries to parse the output of gtk-doc declaration files and make
# something usable from them
# an XML reusable description from them
#
# TODO: try to extracts comments from the DocBook output of
import sys
import string
input = open('doc/libxml-decl.txt')
macros = []
structs = []
typedefs = []
enums = {}
functions = {}
private_functions = {}
ret_types = {}
types = {}
def extractTypes(raw, function):
sections = []
files = {}
identifiers_file = {}
identifiers_type = {}
def mormalizeTypeSpaces(raw, function):
global types
tokens = string.split(raw)
......@@ -32,6 +38,61 @@ def extractTypes(raw, function):
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]