From 99b78502b649a03a00b0ec83288a2e7216da7a17 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 11 Sep 2005 22:04:08 +0000 Subject: [PATCH] started work needed to generate devhelp content, not too hard based on the * configure.in doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml doc/devhelp/*: started work needed to generate devhelp content, not too hard based on the existing format and extractor. Daniel --- ChangeLog | 6 + configure.in | 2 +- doc/Makefile.am | 2 +- doc/apibuild.py | 70 +++++- doc/devhelp/Makefile.am | 7 + doc/devhelp/devhelp.xsl | 473 +++++++++++++++++++++++++++++++++++++ doc/devhelp/home.png | Bin 0 -> 654 bytes doc/devhelp/left.png | Bin 0 -> 459 bytes doc/devhelp/right.png | Bin 0 -> 472 bytes doc/devhelp/up.png | Bin 0 -> 406 bytes doc/libxml2-api.xml | 28 ++- include/libxml/xmlstring.h | 1 - 12 files changed, 573 insertions(+), 16 deletions(-) create mode 100644 doc/devhelp/Makefile.am create mode 100644 doc/devhelp/devhelp.xsl create mode 100644 doc/devhelp/home.png create mode 100644 doc/devhelp/left.png create mode 100644 doc/devhelp/right.png create mode 100644 doc/devhelp/up.png diff --git a/ChangeLog b/ChangeLog index 5664b44c..e07fcfac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 12 00:03:27 CEST 2005 Daniel Veillard + + * configure.in doc/Makefile.am doc/apibuild.py doc/libxml2-api.xml + doc/devhelp/*: started work needed to generate devhelp content, + not too hard based on the existing format and extractor. + Fri Sep 9 12:56:19 CEST 2005 Daniel Veillard * parser.c: fixes bug #315617 when using push CDATA in some cases. diff --git a/configure.in b/configure.in index ad902eb2..93e3850b 100644 --- a/configure.in +++ b/configure.in @@ -1317,6 +1317,6 @@ rm -f COPYING.LIB COPYING ln -s Copyright COPYING # keep on one line for cygwin c.f. #130896 -AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py) +AC_OUTPUT(libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py) chmod +x xml2-config python/setup.py diff --git a/doc/Makefile.am b/doc/Makefile.am index 8c96a7b6..eb5bc656 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS=examples +SUBDIRS=examples devhelp # The top-level SGML file. DOC_MAIN_XML_FILE=gnome-xml.xml diff --git a/doc/apibuild.py b/doc/apibuild.py index 8a11db0c..108c42c9 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -679,9 +679,54 @@ class CParser: return token - # - # Parse a comment block associate to a macro - # + # + # Parse a comment block associate to a typedef + # + def parseTypeComment(self, name, quiet = 0): + if name[0:2] == '__': + quiet = 1 + + args = [] + desc = "" + + if self.comment == None: + if not quiet: + self.warning("Missing comment for type %s" % (name)) + return((args, desc)) + if self.comment[0] != '*': + if not quiet: + self.warning("Missing * in type comment for %s" % (name)) + return((args, desc)) + lines = string.split(self.comment, '\n') + if lines[0] == '*': + del lines[0] + if lines[0] != "* %s:" % (name): + if not quiet: + self.warning("Misformatted type comment for %s" % (name)) + self.warning(" Expecting '* %s:' got '%s'" % (name, lines[0])) + return((args, desc)) + del lines[0] + while len(lines) > 0 and lines[0] == '*': + del lines[0] + desc = "" + while len(lines) > 0: + l = lines[0] + while len(l) > 0 and l[0] == '*': + l = l[1:] + l = string.strip(l) + desc = desc + " " + l + del lines[0] + + desc = string.strip(desc) + + if quiet == 0: + if desc == "": + self.warning("Type comment for %s lack description of the macro" % (name)) + + return(desc) + # + # Parse a comment block associate to a macro + # def parseMacroComment(self, name, quiet = 0): if name[0:2] == '__': quiet = 1 @@ -1025,8 +1070,10 @@ class CParser: "struct", type) base_type = "struct " + name else: + # TODO report missing or misformatted comments + info = self.parseTypeComment(name, 1) self.index_add(name, self.filename, not self.is_header, - "typedef", type) + "typedef", type, info) token = self.token() else: self.error("parsing typedef: expecting a name") @@ -1690,6 +1737,8 @@ class docBuilder: def serialize_typedef(self, output, name): id = self.idx.typedefs[name] + if name == 'xmlChar': + print id if id.info[0:7] == 'struct ': output.write(" \n"); else : - output.write(" \n" % ( - name, self.modulename_file(id.header), id.info)) + output.write(" \n %s\n" % (escape(desc))) + output.write(" \n") + else: + output.write("/>\n") + except: + output.write("/>\n") def serialize_variable(self, output, name): id = self.idx.variables[name] diff --git a/doc/devhelp/Makefile.am b/doc/devhelp/Makefile.am new file mode 100644 index 00000000..b804a55b --- /dev/null +++ b/doc/devhelp/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST=devhelp.xsl + +libxml2.devhelp: devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml + -@(if [ -x $(XSLTPROC) ] ; then \ + $(XSLTPROC) --nonet -o $(srcdir)/libxml2.devhelp devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml ; fi ); + +all: libxml2.devhelp diff --git a/doc/devhelp/devhelp.xsl b/doc/devhelp/devhelp.xsl new file mode 100644 index 00000000..7ecbd1ba --- /dev/null +++ b/doc/devhelp/devhelp.xsl @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="concat(@name, ': ', summary)"/> + + + + + + + + + + + + + + + + +

+

-

+

+ +

WARNING: this module is deprecated !

+
+

Author(s):

+
+

Synopsis

+
+	    
+	  
+
+
+

Description

+
+
+

Details

+
+ + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + ( + + void + + + + + + + + + ,
+ + + + + + + +
+
+ ); + + +
+ + + + + + + typedef + + + + + + + + + + + + ( + + void + + + + + + + + + ,
+ + + + + + + +
+
+ ); + + +
+ + + + + + + + typedef + + + + + + ; + + + + + + #define + + + ( + + + + , + + + ) + + ; + + + + + + + + + + +
+

Structure

+
+     {
+
+    
+      The content of this structure is not made public by the API.
+
+    
+    
+            
+	
+	  
+	
+		
+	
+	
+	  	: 
+	  
+	    
+	  
+	
+	
+
+    
+    } 
+    
+    ;
+
+    
+

+ + + +

+ +

+
+ + + +
+

Typedef

+
+    
+      
+    
+     
+    
+    ;
+
+    
+

+ + + +

+ +

+
+ + + +
+

Enum

+
+    enum 
+    
+     {
+
+    
+      
+          
+      
+      
+         = 
+	
+      
+      
+         /* 
+	
+         */
+      
+      
+
+    
+    };
+
+    
+

+ + + +

+ +

+
+ + + +
+

Macro

+
+    #define 
+    
+    
+      (
+      
+        
+	
+	  , 
+	
+      
+      )
+    
+    ;
+
+    
+

+ + + +

+ +
+ + + + + + +
: + + + +
+
+ + +

+
+ + + + + + +
+

()

+
+    
+      
+    
+    	
+    
+    
+      	
+    
+    
+      	
+    
+    	(
+    
+      void
+    
+    
+      
+        
+      
+       
+      
+      
+        , 
+ + + + + + + +
+
+ )
+ + +
+

+ + + +

+ + +
+ + + + + + + + + + + + +
: + + + +
Returns: + + + +
+
+

+
+
+ + diff --git a/doc/devhelp/home.png b/doc/devhelp/home.png new file mode 100644 index 0000000000000000000000000000000000000000..17003611d9df2b066afc682cbde962f3a575002d GIT binary patch literal 654 zcmV;90&)F`P)~yY zO1cF+0vxb!W?!x?K+*#62Jq)nA4q`)5S6sgX4ao{=)(Mgq+YMr)7sjak|a^9)zS!j zlk{-n29mabXYF=7SYBQx&vO8xC}MYams+hxqtO7sImhPaCf@rq;I^3!#u*2aUP)55 zT2&N90xmEJ0s&fGT~(T<3d2xYmK9C>IP*x-M@ib*+0pFm>>uW37N2Wzaq-fCnIZE9 zpb8}0+uN+KuQM2oZVHfP8U6kQdo3?>Wo2dT)WeM9So8DqhLi#T0 z-i(>mfjhvbsYV`;4sgfJ-p>G-SqJ!fjR6BQYs1h*y9xaN0l{VB;o%`08yiy@)$8@~ z2PD1gcDuiy;j1tR0v#V8OH%W)25-YKyx(j#IXO9*YWf0mb8}QG6@b@;cHxh9{t7+@ o!Yd`f8L$sLH?yBt^q3C6015TtIu@BS5dZ)H07*qoM6N<$f*igdr~m)} literal 0 HcmV?d00001 diff --git a/doc/devhelp/left.png b/doc/devhelp/left.png new file mode 100644 index 0000000000000000000000000000000000000000..2d05b3d5b4aeec9384bbfe404bfc4ed0897051c4 GIT binary patch literal 459 zcmV;+0W|)JP)40xL?wO*>WZ(J#ML5j2<9jD6A%Q&kC}jOeEc;X{s;`zcnxLeZR6?6h#^ihmNF6NpGdilO$m<82oD9WQ|6nVv1`? z>KufRi{?QPXg;4;wroQu4?mN1Ydd@|kaQ|ZyWLK!)yi7Wb%=0{}lD)tfliHAUyWRQ+fD_;aV6j->y6!O_8bENg6P)Cd4HCN^TYHBC0dz3r5|}*T3c5!K}0^NPTey!^rYo;W&eW{b1SE%dR-1ljcju- zJITo5P_e{cPDWDszO|97o#m$fni3V4d%~7^?0HU4-k!+X`e~w55Q}HA=c?CM9`EK` z^o5GF_RsnG`ey+9wOf8O4bzg>7W*;jU~M?g`OZAA$mNp|Lz<$s+~N9!2`ir8RcClo$(Q~19INM~9}j;&*|enC yGd}kJak0wj?aUKd8;%}`i}SSew>!A-2iw}^5}Rh(M>+vRkipZ{&t;ucLK6U4uc96R literal 0 HcmV?d00001 diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 26263a58..da218752 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -5767,9 +5767,13 @@ if necessary or NULL'/> - + + A libxml automata description, It can be compiled into a regexp + - + + A state int the automata description, + @@ -5799,7 +5803,9 @@ if necessary or NULL'/> - + + This is a basic byte in an UTF-8 encoded string. It's unsigned allowing to pinpoint case where char * are assigned to xmlChar * (possibly making serialization back impossible). + @@ -6007,7 +6013,9 @@ actually an xmlCharEncoding'/> - + + A handle to a dynamically loaded module + @@ -6222,9 +6230,13 @@ actually an xmlCharEncoding'/> - + + A libxml progressive regular expression evaluation context + - + + A libxml regular expression, they can actually be far more complex thank the POSIX regex expressions. + @@ -6529,7 +6541,9 @@ actually an xmlCharEncoding'/> - + + Pointer to an xmlReader context. + diff --git a/include/libxml/xmlstring.h b/include/libxml/xmlstring.h index 39f846e2..1dfc5ea0 100644 --- a/include/libxml/xmlstring.h +++ b/include/libxml/xmlstring.h @@ -25,7 +25,6 @@ extern "C" { * It's unsigned allowing to pinpoint case where char * are assigned * to xmlChar * (possibly making serialization back impossible). */ - typedef unsigned char xmlChar; /**