gtksourceview2 1.1.5-x86-mingw32 → 1.1.6-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. data/lib/1.8/gtksourceview2.so +0 -0
  2. data/lib/1.9/gtksourceview2.so +0 -0
  3. data/vendor/local/bin/libxml2-2.dll +0 -0
  4. data/vendor/local/bin/xmlcatalog.exe +0 -0
  5. data/vendor/local/bin/xmllint.exe +0 -0
  6. data/vendor/local/include/libxml2/libxml/DOCBparser.h +9 -9
  7. data/vendor/local/include/libxml2/libxml/HTMLparser.h +25 -23
  8. data/vendor/local/include/libxml2/libxml/HTMLtree.h +19 -19
  9. data/vendor/local/include/libxml2/libxml/SAX.h +37 -37
  10. data/vendor/local/include/libxml2/libxml/SAX2.h +34 -34
  11. data/vendor/local/include/libxml2/libxml/c14n.h +1 -1
  12. data/vendor/local/include/libxml2/libxml/catalog.h +35 -35
  13. data/vendor/local/include/libxml2/libxml/debugXML.h +26 -26
  14. data/vendor/local/include/libxml2/libxml/dict.h +16 -5
  15. data/vendor/local/include/libxml2/libxml/encoding.h +28 -14
  16. data/vendor/local/include/libxml2/libxml/hash.h +24 -24
  17. data/vendor/local/include/libxml2/libxml/list.h +26 -26
  18. data/vendor/local/include/libxml2/libxml/nanoftp.h +44 -24
  19. data/vendor/local/include/libxml2/libxml/nanohttp.h +13 -13
  20. data/vendor/local/include/libxml2/libxml/parser.h +78 -73
  21. data/vendor/local/include/libxml2/libxml/parserInternals.h +106 -73
  22. data/vendor/local/include/libxml2/libxml/schemasInternals.h +2 -2
  23. data/vendor/local/include/libxml2/libxml/schematron.h +11 -11
  24. data/vendor/local/include/libxml2/libxml/tree.h +203 -152
  25. data/vendor/local/include/libxml2/libxml/valid.h +72 -72
  26. data/vendor/local/include/libxml2/libxml/xlink.h +7 -7
  27. data/vendor/local/include/libxml2/libxml/xmlIO.h +71 -65
  28. data/vendor/local/include/libxml2/libxml/xmlautomata.h +22 -22
  29. data/vendor/local/include/libxml2/libxml/xmlerror.h +6 -6
  30. data/vendor/local/include/libxml2/libxml/xmlexports.h +2 -2
  31. data/vendor/local/include/libxml2/libxml/xmlmodule.h +1 -1
  32. data/vendor/local/include/libxml2/libxml/xmlreader.h +24 -20
  33. data/vendor/local/include/libxml2/libxml/xmlsave.h +2 -1
  34. data/vendor/local/include/libxml2/libxml/xmlschemas.h +30 -2
  35. data/vendor/local/include/libxml2/libxml/xmlschemastypes.h +20 -20
  36. data/vendor/local/include/libxml2/libxml/xmlstring.h +3 -3
  37. data/vendor/local/include/libxml2/libxml/xmlversion.h +29 -7
  38. data/vendor/local/include/libxml2/libxml/xmlwriter.h +4 -1
  39. data/vendor/local/include/libxml2/libxml/xpath.h +47 -43
  40. data/vendor/local/include/libxml2/libxml/xpathInternals.h +81 -79
  41. data/vendor/local/include/libxml2/libxml/xpointer.h +23 -23
  42. data/vendor/local/lib/libxml2.def +16 -14
  43. data/vendor/local/lib/libxml2.dll.a +0 -0
  44. data/vendor/local/lib/libxml2.lib +0 -0
  45. data/vendor/local/lib/pkgconfig/libxml-2.0.pc +3 -3
  46. data/vendor/local/manifest/libxml2-dev_2.9.0-1_win32.mft +268 -0
  47. data/vendor/local/manifest/libxml2_2.9.0-1_win32.mft +2 -0
  48. data/vendor/local/share/doc/libxml2-2.9.0/Copyright +27 -0
  49. data/vendor/local/share/doc/libxml2-2.9.0/examples/testHTML.c +880 -0
  50. data/vendor/local/share/doc/libxml2-2.9.0/examples/testSAX.c +1198 -0
  51. data/vendor/local/share/doc/libxml2-2.9.0/examples/testXPath.c +229 -0
  52. data/vendor/local/share/doc/libxml2-2.9.0/examples/xmllint.c +3770 -0
  53. data/vendor/local/share/doc/libxml2-2.9.0/html/DOM.gif +0 -0
  54. data/vendor/local/share/doc/libxml2-2.9.0/html/FAQ.html +282 -0
  55. data/vendor/local/share/doc/libxml2-2.9.0/html/Libxml2-Logo-180x168.gif +0 -0
  56. data/vendor/local/share/doc/libxml2-2.9.0/html/Libxml2-Logo-90x34.gif +0 -0
  57. data/vendor/local/share/doc/libxml2-2.9.0/html/encoding.html +207 -0
  58. data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xml +751 -0
  59. data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xsl +174 -0
  60. data/vendor/local/share/doc/libxml2-2.9.0/html/html/book1.html +13 -0
  61. data/vendor/local/share/doc/libxml2-2.9.0/html/html/home.png +0 -0
  62. data/vendor/local/share/doc/libxml2-2.9.0/html/html/index.html +13 -0
  63. data/vendor/local/share/doc/libxml2-2.9.0/html/html/left.png +0 -0
  64. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-DOCBparser.html +51 -0
  65. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLparser.html +184 -0
  66. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLtree.html +73 -0
  67. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX.html +125 -0
  68. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX2.html +128 -0
  69. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-c14n.html +38 -0
  70. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-catalog.html +142 -0
  71. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-chvalid.html +72 -0
  72. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-debugXML.html +120 -0
  73. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-dict.html +58 -0
  74. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-encoding.html +124 -0
  75. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-entities.html +79 -0
  76. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-globals.html +152 -0
  77. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-hash.html +116 -0
  78. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-lib.html +13 -0
  79. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-list.html +120 -0
  80. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanoftp.html +94 -0
  81. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanohttp.html +65 -0
  82. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parser.html +559 -0
  83. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parserInternals.html +322 -0
  84. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-pattern.html +76 -0
  85. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-relaxng.html +162 -0
  86. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schemasInternals.html +373 -0
  87. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schematron.html +81 -0
  88. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-threads.html +72 -0
  89. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-tree.html +989 -0
  90. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-uri.html +73 -0
  91. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-valid.html +289 -0
  92. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xinclude.html +59 -0
  93. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xlink.html +82 -0
  94. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlIO.html +212 -0
  95. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlautomata.html +85 -0
  96. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlerror.html +864 -0
  97. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlexports.html +20 -0
  98. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmemory.html +107 -0
  99. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmodule.html +38 -0
  100. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlreader.html +330 -0
  101. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlregexp.html +143 -0
  102. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlsave.html +60 -0
  103. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemas.html +185 -0
  104. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemastypes.html +123 -0
  105. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlstring.html +108 -0
  106. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlunicode.html +512 -0
  107. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlversion.html +62 -0
  108. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlwriter.html +261 -0
  109. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpath.html +310 -0
  110. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpathInternals.html +394 -0
  111. data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpointer.html +83 -0
  112. data/vendor/local/share/doc/libxml2-2.9.0/html/html/right.png +0 -0
  113. data/vendor/local/share/doc/libxml2-2.9.0/html/html/up.png +0 -0
  114. data/vendor/local/share/doc/libxml2-2.9.0/html/index.html +14 -0
  115. data/vendor/local/share/doc/libxml2-2.9.0/html/io1.c +166 -0
  116. data/vendor/local/share/doc/libxml2-2.9.0/html/io1.res +5 -0
  117. data/vendor/local/share/doc/libxml2-2.9.0/html/io2.c +58 -0
  118. data/vendor/local/share/doc/libxml2-2.9.0/html/io2.res +2 -0
  119. data/vendor/local/share/doc/libxml2-2.9.0/html/libxml.gif +0 -0
  120. data/vendor/local/share/doc/libxml2-2.9.0/html/parse1.c +56 -0
  121. data/vendor/local/share/doc/libxml2-2.9.0/html/parse2.c +72 -0
  122. data/vendor/local/share/doc/libxml2-2.9.0/html/parse3.c +60 -0
  123. data/vendor/local/share/doc/libxml2-2.9.0/html/parse4.c +143 -0
  124. data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.c +107 -0
  125. data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.res +14 -0
  126. data/vendor/local/share/doc/libxml2-2.9.0/html/reader2.c +122 -0
  127. data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.c +120 -0
  128. data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.res +13 -0
  129. data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.c +122 -0
  130. data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.res +3 -0
  131. data/vendor/local/share/doc/libxml2-2.9.0/html/redhat.gif +0 -0
  132. data/vendor/local/share/doc/libxml2-2.9.0/html/smallfootonly.gif +0 -0
  133. data/vendor/local/share/doc/libxml2-2.9.0/html/structure.gif +0 -0
  134. data/vendor/local/share/doc/libxml2-2.9.0/html/test1.xml +1 -0
  135. data/vendor/local/share/doc/libxml2-2.9.0/html/test2.xml +13 -0
  136. data/vendor/local/share/doc/libxml2-2.9.0/html/test3.xml +39 -0
  137. data/vendor/local/share/doc/libxml2-2.9.0/html/testWriter.c +1198 -0
  138. data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.c +94 -0
  139. data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.res +4 -0
  140. data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.c +118 -0
  141. data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.res +18 -0
  142. data/vendor/local/share/doc/libxml2-2.9.0/html/tst.xml +7 -0
  143. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apa.html +8 -0
  144. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apb.html +14 -0
  145. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apc.html +82 -0
  146. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apd.html +76 -0
  147. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ape.html +78 -0
  148. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apf.html +67 -0
  149. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apg.html +75 -0
  150. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/aph.html +76 -0
  151. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/api.html +4 -0
  152. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s02.html +14 -0
  153. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s03.html +47 -0
  154. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s04.html +54 -0
  155. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s05.html +55 -0
  156. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s06.html +35 -0
  157. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s07.html +30 -0
  158. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s08.html +38 -0
  159. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s09.html +63 -0
  160. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/blank.png +0 -0
  161. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/1.png +0 -0
  162. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/10.png +0 -0
  163. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/2.png +0 -0
  164. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/3.png +0 -0
  165. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/4.png +0 -0
  166. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/5.png +0 -0
  167. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/6.png +0 -0
  168. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/7.png +0 -0
  169. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/8.png +0 -0
  170. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/9.png +0 -0
  171. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/caution.png +0 -0
  172. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/draft.png +0 -0
  173. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/home.png +0 -0
  174. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/important.png +0 -0
  175. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/next.png +0 -0
  176. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/note.png +0 -0
  177. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/prev.png +0 -0
  178. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/tip.png +0 -0
  179. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-blank.png +0 -0
  180. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-minus.png +0 -0
  181. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-plus.png +0 -0
  182. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/up.png +0 -0
  183. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/warning.png +0 -0
  184. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeaddattribute.c +64 -0
  185. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeaddkeyword.c +75 -0
  186. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeconvert.c +73 -0
  187. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includegetattribute.c +72 -0
  188. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includekeyword.c +79 -0
  189. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includexpath.c +74 -0
  190. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/index.html +14 -0
  191. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ix01.html +1 -0
  192. data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/xmltutorial.pdf +1336 -0
  193. data/vendor/local/share/doc/libxml2-2.9.0/html/w3c.png +0 -0
  194. data/vendor/local/share/doc/libxml2-2.9.0/html/writer.xml +2 -0
  195. data/vendor/local/share/doc/libxml2-2.9.0/html/xml.html +5715 -0
  196. data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.c +250 -0
  197. data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.res +5 -0
  198. data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.c +190 -0
  199. data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.res +30 -0
  200. data/vendor/local/share/gtk-doc/html/libxml2/general.html +1 -1
  201. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html +3 -1
  202. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-dict.html +16 -1
  203. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-encoding.html +11 -1
  204. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html +15 -5
  205. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parser.html +8 -4
  206. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html +20 -5
  207. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-tree.html +72 -18
  208. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html +10 -0
  209. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html +5 -3
  210. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html +2 -2
  211. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html +8 -3
  212. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html +2 -1
  213. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html +15 -0
  214. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html +12 -2
  215. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html +8 -3
  216. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpath.html +3 -0
  217. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html +9 -9
  218. data/vendor/local/share/gtk-doc/html/libxml2/libxml2.devhelp +42 -2
  219. data/vendor/local/share/man/man1/xml2-config.1 +0 -1
  220. data/vendor/local/share/man/man1/xmlcatalog.1 +204 -93
  221. data/vendor/local/share/man/man3/libxml.3 +1 -1
  222. data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.log +867 -0
  223. data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.sh +68 -0
  224. metadata +163 -7
@@ -0,0 +1,143 @@
1
+ /**
2
+ * section: Parsing
3
+ * synopsis: Parse an XML document chunk by chunk to a tree and free it
4
+ * purpose: Demonstrate the use of xmlCreatePushParserCtxt() and
5
+ * xmlParseChunk() to read an XML file progressively
6
+ * into a tree and and xmlFreeDoc() to free the resulting tree
7
+ * usage: parse4 test3.xml
8
+ * test: parse4 test3.xml
9
+ * author: Daniel Veillard
10
+ * copy: see Copyright for the status of this software.
11
+ */
12
+
13
+ #include <stdio.h>
14
+ #include <libxml/parser.h>
15
+ #include <libxml/tree.h>
16
+
17
+ #ifdef LIBXML_PUSH_ENABLED
18
+ static FILE *desc;
19
+
20
+ /**
21
+ * readPacket:
22
+ * @mem: array to store the packet
23
+ * @size: the packet size
24
+ *
25
+ * read at most @size bytes from the document and store it in @mem
26
+ *
27
+ * Returns the number of bytes read
28
+ */
29
+ static int
30
+ readPacket(char *mem, int size) {
31
+ int res;
32
+
33
+ res = fread(mem, 1, size, desc);
34
+ return(res);
35
+ }
36
+
37
+ /**
38
+ * example4Func:
39
+ * @filename: a filename or an URL
40
+ *
41
+ * Parse the resource and free the resulting tree
42
+ */
43
+ static void
44
+ example4Func(const char *filename) {
45
+ xmlParserCtxtPtr ctxt;
46
+ char chars[4];
47
+ xmlDocPtr doc; /* the resulting document tree */
48
+ int res;
49
+
50
+ /*
51
+ * Read a few first byte to check the input used for the
52
+ * encoding detection at the parser level.
53
+ */
54
+ res = readPacket(chars, 4);
55
+ if (res <= 0) {
56
+ fprintf(stderr, "Failed to parse %s\n", filename);
57
+ return;
58
+ }
59
+
60
+ /*
61
+ * Create a progressive parsing context, the 2 first arguments
62
+ * are not used since we want to build a tree and not use a SAX
63
+ * parsing interface. We also pass the first bytes of the document
64
+ * to allow encoding detection when creating the parser but this
65
+ * is optional.
66
+ */
67
+ ctxt = xmlCreatePushParserCtxt(NULL, NULL,
68
+ chars, res, filename);
69
+ if (ctxt == NULL) {
70
+ fprintf(stderr, "Failed to create parser context !\n");
71
+ return;
72
+ }
73
+
74
+ /*
75
+ * loop on the input getting the document data, of course 4 bytes
76
+ * at a time is not realistic but allows to verify testing on small
77
+ * documents.
78
+ */
79
+ while ((res = readPacket(chars, 4)) > 0) {
80
+ xmlParseChunk(ctxt, chars, res, 0);
81
+ }
82
+
83
+ /*
84
+ * there is no more input, indicate the parsing is finished.
85
+ */
86
+ xmlParseChunk(ctxt, chars, 0, 1);
87
+
88
+ /*
89
+ * collect the document back and if it was wellformed
90
+ * and destroy the parser context.
91
+ */
92
+ doc = ctxt->myDoc;
93
+ res = ctxt->wellFormed;
94
+ xmlFreeParserCtxt(ctxt);
95
+
96
+ if (!res) {
97
+ fprintf(stderr, "Failed to parse %s\n", filename);
98
+ }
99
+
100
+ /*
101
+ * since we don't use the document, destroy it now.
102
+ */
103
+ xmlFreeDoc(doc);
104
+ }
105
+
106
+ int main(int argc, char **argv) {
107
+ if (argc != 2)
108
+ return(1);
109
+
110
+ /*
111
+ * this initialize the library and check potential ABI mismatches
112
+ * between the version it was compiled for and the actual shared
113
+ * library used.
114
+ */
115
+ LIBXML_TEST_VERSION
116
+
117
+ /*
118
+ * simulate a progressive parsing using the input file.
119
+ */
120
+ desc = fopen(argv[1], "rb");
121
+ if (desc != NULL) {
122
+ example4Func(argv[1]);
123
+ fclose(desc);
124
+ } else {
125
+ fprintf(stderr, "Failed to parse %s\n", argv[1]);
126
+ }
127
+
128
+ /*
129
+ * Cleanup function for the XML library.
130
+ */
131
+ xmlCleanupParser();
132
+ /*
133
+ * this is to debug memory for regression tests
134
+ */
135
+ xmlMemoryDump();
136
+ return(0);
137
+ }
138
+ #else /* ! LIBXML_PUSH_ENABLED */
139
+ int main(int argc, char **argv) {
140
+ fprintf(stderr, "Library not compiled with push parser support\n");
141
+ return(1);
142
+ }
143
+ #endif
@@ -0,0 +1,107 @@
1
+ /**
2
+ * section: xmlReader
3
+ * synopsis: Parse an XML file with an xmlReader
4
+ * purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
5
+ * and dump the informations about the nodes found in the process.
6
+ * (Note that the XMLReader functions require libxml2 version later
7
+ * than 2.6.)
8
+ * usage: reader1 <filename>
9
+ * test: reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
10
+ * author: Daniel Veillard
11
+ * copy: see Copyright for the status of this software.
12
+ */
13
+
14
+ #include <stdio.h>
15
+ #include <libxml/xmlreader.h>
16
+
17
+ #ifdef LIBXML_READER_ENABLED
18
+
19
+ /**
20
+ * processNode:
21
+ * @reader: the xmlReader
22
+ *
23
+ * Dump information about the current node
24
+ */
25
+ static void
26
+ processNode(xmlTextReaderPtr reader) {
27
+ const xmlChar *name, *value;
28
+
29
+ name = xmlTextReaderConstName(reader);
30
+ if (name == NULL)
31
+ name = BAD_CAST "--";
32
+
33
+ value = xmlTextReaderConstValue(reader);
34
+
35
+ printf("%d %d %s %d %d",
36
+ xmlTextReaderDepth(reader),
37
+ xmlTextReaderNodeType(reader),
38
+ name,
39
+ xmlTextReaderIsEmptyElement(reader),
40
+ xmlTextReaderHasValue(reader));
41
+ if (value == NULL)
42
+ printf("\n");
43
+ else {
44
+ if (xmlStrlen(value) > 40)
45
+ printf(" %.40s...\n", value);
46
+ else
47
+ printf(" %s\n", value);
48
+ }
49
+ }
50
+
51
+ /**
52
+ * streamFile:
53
+ * @filename: the file name to parse
54
+ *
55
+ * Parse and print information about an XML file.
56
+ */
57
+ static void
58
+ streamFile(const char *filename) {
59
+ xmlTextReaderPtr reader;
60
+ int ret;
61
+
62
+ reader = xmlReaderForFile(filename, NULL, 0);
63
+ if (reader != NULL) {
64
+ ret = xmlTextReaderRead(reader);
65
+ while (ret == 1) {
66
+ processNode(reader);
67
+ ret = xmlTextReaderRead(reader);
68
+ }
69
+ xmlFreeTextReader(reader);
70
+ if (ret != 0) {
71
+ fprintf(stderr, "%s : failed to parse\n", filename);
72
+ }
73
+ } else {
74
+ fprintf(stderr, "Unable to open %s\n", filename);
75
+ }
76
+ }
77
+
78
+ int main(int argc, char **argv) {
79
+ if (argc != 2)
80
+ return(1);
81
+
82
+ /*
83
+ * this initialize the library and check potential ABI mismatches
84
+ * between the version it was compiled for and the actual shared
85
+ * library used.
86
+ */
87
+ LIBXML_TEST_VERSION
88
+
89
+ streamFile(argv[1]);
90
+
91
+ /*
92
+ * Cleanup function for the XML library.
93
+ */
94
+ xmlCleanupParser();
95
+ /*
96
+ * this is to debug memory for regression tests
97
+ */
98
+ xmlMemoryDump();
99
+ return(0);
100
+ }
101
+
102
+ #else
103
+ int main(void) {
104
+ fprintf(stderr, "XInclude support not compiled in\n");
105
+ exit(1);
106
+ }
107
+ #endif
@@ -0,0 +1,14 @@
1
+ 0 10 doc 0 0
2
+ 0 1 doc 0 0
3
+ 1 14 #text 0 1
4
+
5
+ 1 1 src 1 0
6
+ 1 14 #text 0 1
7
+
8
+ 1 1 dest 1 0
9
+ 1 14 #text 0 1
10
+
11
+ 1 1 src 1 0
12
+ 1 14 #text 0 1
13
+
14
+ 0 15 doc 0 0
@@ -0,0 +1,122 @@
1
+ /**
2
+ * section: xmlReader
3
+ * synopsis: Parse and validate an XML file with an xmlReader
4
+ * purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
5
+ * validating the content in the process and activating options
6
+ * like entities substitution, and DTD attributes defaulting.
7
+ * (Note that the XMLReader functions require libxml2 version later
8
+ * than 2.6.)
9
+ * usage: reader2 <valid_xml_filename>
10
+ * test: reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
11
+ * author: Daniel Veillard
12
+ * copy: see Copyright for the status of this software.
13
+ */
14
+
15
+ #include <stdio.h>
16
+ #include <libxml/xmlreader.h>
17
+
18
+ #ifdef LIBXML_READER_ENABLED
19
+
20
+ /**
21
+ * processNode:
22
+ * @reader: the xmlReader
23
+ *
24
+ * Dump information about the current node
25
+ */
26
+ static void
27
+ processNode(xmlTextReaderPtr reader) {
28
+ const xmlChar *name, *value;
29
+
30
+ name = xmlTextReaderConstName(reader);
31
+ if (name == NULL)
32
+ name = BAD_CAST "--";
33
+
34
+ value = xmlTextReaderConstValue(reader);
35
+
36
+ printf("%d %d %s %d %d",
37
+ xmlTextReaderDepth(reader),
38
+ xmlTextReaderNodeType(reader),
39
+ name,
40
+ xmlTextReaderIsEmptyElement(reader),
41
+ xmlTextReaderHasValue(reader));
42
+ if (value == NULL)
43
+ printf("\n");
44
+ else {
45
+ if (xmlStrlen(value) > 40)
46
+ printf(" %.40s...\n", value);
47
+ else
48
+ printf(" %s\n", value);
49
+ }
50
+ }
51
+
52
+ /**
53
+ * streamFile:
54
+ * @filename: the file name to parse
55
+ *
56
+ * Parse, validate and print information about an XML file.
57
+ */
58
+ static void
59
+ streamFile(const char *filename) {
60
+ xmlTextReaderPtr reader;
61
+ int ret;
62
+
63
+
64
+ /*
65
+ * Pass some special parsing options to activate DTD attribute defaulting,
66
+ * entities substitution and DTD validation
67
+ */
68
+ reader = xmlReaderForFile(filename, NULL,
69
+ XML_PARSE_DTDATTR | /* default DTD attributes */
70
+ XML_PARSE_NOENT | /* substitute entities */
71
+ XML_PARSE_DTDVALID); /* validate with the DTD */
72
+ if (reader != NULL) {
73
+ ret = xmlTextReaderRead(reader);
74
+ while (ret == 1) {
75
+ processNode(reader);
76
+ ret = xmlTextReaderRead(reader);
77
+ }
78
+ /*
79
+ * Once the document has been fully parsed check the validation results
80
+ */
81
+ if (xmlTextReaderIsValid(reader) != 1) {
82
+ fprintf(stderr, "Document %s does not validate\n", filename);
83
+ }
84
+ xmlFreeTextReader(reader);
85
+ if (ret != 0) {
86
+ fprintf(stderr, "%s : failed to parse\n", filename);
87
+ }
88
+ } else {
89
+ fprintf(stderr, "Unable to open %s\n", filename);
90
+ }
91
+ }
92
+
93
+ int main(int argc, char **argv) {
94
+ if (argc != 2)
95
+ return(1);
96
+
97
+ /*
98
+ * this initialize the library and check potential ABI mismatches
99
+ * between the version it was compiled for and the actual shared
100
+ * library used.
101
+ */
102
+ LIBXML_TEST_VERSION
103
+
104
+ streamFile(argv[1]);
105
+
106
+ /*
107
+ * Cleanup function for the XML library.
108
+ */
109
+ xmlCleanupParser();
110
+ /*
111
+ * this is to debug memory for regression tests
112
+ */
113
+ xmlMemoryDump();
114
+ return(0);
115
+ }
116
+
117
+ #else
118
+ int main(void) {
119
+ fprintf(stderr, "XInclude support not compiled in\n");
120
+ exit(1);
121
+ }
122
+ #endif
@@ -0,0 +1,120 @@
1
+ /**
2
+ * section: xmlReader
3
+ * synopsis: Show how to extract subdocuments with xmlReader
4
+ * purpose: Demonstrate the use of xmlTextReaderPreservePattern()
5
+ * to parse an XML file with the xmlReader while collecting
6
+ * only some subparts of the document.
7
+ * (Note that the XMLReader functions require libxml2 version later
8
+ * than 2.6.)
9
+ * usage: reader3
10
+ * test: reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res
11
+ * author: Daniel Veillard
12
+ * copy: see Copyright for the status of this software.
13
+ */
14
+
15
+ #include <stdio.h>
16
+ #include <libxml/xmlreader.h>
17
+
18
+ #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
19
+
20
+
21
+ /**
22
+ * streamFile:
23
+ * @filename: the file name to parse
24
+ *
25
+ * Parse and print information about an XML file.
26
+ *
27
+ * Returns the resulting doc with just the elements preserved.
28
+ */
29
+ static xmlDocPtr
30
+ extractFile(const char *filename, const xmlChar *pattern) {
31
+ xmlDocPtr doc;
32
+ xmlTextReaderPtr reader;
33
+ int ret;
34
+
35
+ /*
36
+ * build an xmlReader for that file
37
+ */
38
+ reader = xmlReaderForFile(filename, NULL, 0);
39
+ if (reader != NULL) {
40
+ /*
41
+ * add the pattern to preserve
42
+ */
43
+ if (xmlTextReaderPreservePattern(reader, pattern, NULL) < 0) {
44
+ fprintf(stderr, "%s : failed add preserve pattern %s\n",
45
+ filename, (const char *) pattern);
46
+ }
47
+ /*
48
+ * Parse and traverse the tree, collecting the nodes in the process
49
+ */
50
+ ret = xmlTextReaderRead(reader);
51
+ while (ret == 1) {
52
+ ret = xmlTextReaderRead(reader);
53
+ }
54
+ if (ret != 0) {
55
+ fprintf(stderr, "%s : failed to parse\n", filename);
56
+ xmlFreeTextReader(reader);
57
+ return(NULL);
58
+ }
59
+ /*
60
+ * get the resulting nodes
61
+ */
62
+ doc = xmlTextReaderCurrentDoc(reader);
63
+ /*
64
+ * Free up the reader
65
+ */
66
+ xmlFreeTextReader(reader);
67
+ } else {
68
+ fprintf(stderr, "Unable to open %s\n", filename);
69
+ return(NULL);
70
+ }
71
+ return(doc);
72
+ }
73
+
74
+ int main(int argc, char **argv) {
75
+ const char *filename = "test3.xml";
76
+ const char *pattern = "preserved";
77
+ xmlDocPtr doc;
78
+
79
+ if (argc == 3) {
80
+ filename = argv[1];
81
+ pattern = argv[2];
82
+ }
83
+
84
+ /*
85
+ * this initialize the library and check potential ABI mismatches
86
+ * between the version it was compiled for and the actual shared
87
+ * library used.
88
+ */
89
+ LIBXML_TEST_VERSION
90
+
91
+ doc = extractFile(filename, (const xmlChar *) pattern);
92
+ if (doc != NULL) {
93
+ /*
94
+ * ouptut the result.
95
+ */
96
+ xmlDocDump(stdout, doc);
97
+ /*
98
+ * don't forget to free up the doc
99
+ */
100
+ xmlFreeDoc(doc);
101
+ }
102
+
103
+
104
+ /*
105
+ * Cleanup function for the XML library.
106
+ */
107
+ xmlCleanupParser();
108
+ /*
109
+ * this is to debug memory for regression tests
110
+ */
111
+ xmlMemoryDump();
112
+ return(0);
113
+ }
114
+
115
+ #else
116
+ int main(void) {
117
+ fprintf(stderr, "Reader, Pattern or output support not compiled in\n");
118
+ exit(1);
119
+ }
120
+ #endif