gobject-introspection 2.0.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. data/Rakefile +118 -0
  2. data/ext/gobject-introspection/depend +10 -0
  3. data/ext/gobject-introspection/extconf.rb +97 -0
  4. data/ext/gobject-introspection/gobject_introspection.def +5 -0
  5. data/ext/gobject-introspection/rb-gi-arg-info.c +151 -0
  6. data/ext/gobject-introspection/rb-gi-argument.c +1015 -0
  7. data/ext/gobject-introspection/rb-gi-base-info.c +218 -0
  8. data/ext/gobject-introspection/rb-gi-boxed-info.c +48 -0
  9. data/ext/gobject-introspection/rb-gi-callable-info.c +104 -0
  10. data/ext/gobject-introspection/rb-gi-callback-info.c +48 -0
  11. data/ext/gobject-introspection/rb-gi-constant-info.c +77 -0
  12. data/ext/gobject-introspection/rb-gi-constructor-info.c +120 -0
  13. data/ext/gobject-introspection/rb-gi-conversions.h +116 -0
  14. data/ext/gobject-introspection/rb-gi-enum-info.c +145 -0
  15. data/ext/gobject-introspection/rb-gi-field-info.c +153 -0
  16. data/ext/gobject-introspection/rb-gi-flags-info.c +48 -0
  17. data/ext/gobject-introspection/rb-gi-function-info.c +658 -0
  18. data/ext/gobject-introspection/rb-gi-interface-info.c +222 -0
  19. data/ext/gobject-introspection/rb-gi-loader.c +162 -0
  20. data/ext/gobject-introspection/rb-gi-method-info.c +109 -0
  21. data/ext/gobject-introspection/rb-gi-object-info.c +345 -0
  22. data/ext/gobject-introspection/rb-gi-private.h +110 -0
  23. data/ext/gobject-introspection/rb-gi-property-info.c +77 -0
  24. data/ext/gobject-introspection/rb-gi-registered-type-info.c +86 -0
  25. data/ext/gobject-introspection/rb-gi-repository.c +164 -0
  26. data/ext/gobject-introspection/rb-gi-signal-info.c +77 -0
  27. data/ext/gobject-introspection/rb-gi-struct-info.c +190 -0
  28. data/ext/gobject-introspection/rb-gi-type-info.c +143 -0
  29. data/ext/gobject-introspection/rb-gi-type-tag.c +43 -0
  30. data/ext/gobject-introspection/rb-gi-types.h +71 -0
  31. data/ext/gobject-introspection/rb-gi-union-info.c +206 -0
  32. data/ext/gobject-introspection/rb-gi-unresolved-info.c +48 -0
  33. data/ext/gobject-introspection/rb-gi-value-info.c +57 -0
  34. data/ext/gobject-introspection/rb-gi-vfunc-info.c +91 -0
  35. data/ext/gobject-introspection/rb-gobject-introspection.c +44 -0
  36. data/ext/gobject-introspection/rb-gobject-introspection.h +57 -0
  37. data/extconf.rb +71 -0
  38. data/lib/1.9/gobject_introspection.so +0 -0
  39. data/lib/2.0/gobject_introspection.so +0 -0
  40. data/lib/gobject-introspection.rb +52 -0
  41. data/lib/gobject-introspection/callable-info.rb +91 -0
  42. data/lib/gobject-introspection/collection-reader.rb +34 -0
  43. data/lib/gobject-introspection/interface-info.rb +32 -0
  44. data/lib/gobject-introspection/loader.rb +328 -0
  45. data/lib/gobject-introspection/object-info.rb +33 -0
  46. data/lib/gobject-introspection/repository.rb +32 -0
  47. data/lib/gobject-introspection/struct-info.rb +28 -0
  48. data/lib/gobject-introspection/union-info.rb +28 -0
  49. data/test/gobject-introspection-test-utils.rb +26 -0
  50. data/test/run-test.rb +45 -0
  51. data/test/test-arg-info.rb +68 -0
  52. data/test/test-base-info.rb +31 -0
  53. data/test/test-boxed-info.rb +21 -0
  54. data/test/test-callable-info.rb +49 -0
  55. data/test/test-callback-info.rb +29 -0
  56. data/test/test-constant-info.rb +24 -0
  57. data/test/test-enum-info.rb +56 -0
  58. data/test/test-field-type.rb +42 -0
  59. data/test/test-flags-info.rb +27 -0
  60. data/test/test-function-info.rb +37 -0
  61. data/test/test-interface-info.rb +97 -0
  62. data/test/test-loader.rb +30 -0
  63. data/test/test-object-info.rb +131 -0
  64. data/test/test-property-info.rb +38 -0
  65. data/test/test-registered-type-info.rb +35 -0
  66. data/test/test-repository.rb +59 -0
  67. data/test/test-signal-info.rb +37 -0
  68. data/test/test-struct-info.rb +57 -0
  69. data/test/test-type-info.rb +62 -0
  70. data/test/test-type-tag.rb +29 -0
  71. data/test/test-union-info.rb +21 -0
  72. data/test/test-value-info.rb +28 -0
  73. data/test/test-vfunc-info.rb +42 -0
  74. data/vendor/local/bin/g-ir-compiler.exe +0 -0
  75. data/vendor/local/bin/g-ir-generate.exe +0 -0
  76. data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
  77. data/vendor/local/include/gobject-introspection-1.0/giarginfo.h +52 -0
  78. data/vendor/local/include/gobject-introspection-1.0/gibaseinfo.h +89 -0
  79. data/vendor/local/include/gobject-introspection-1.0/gicallableinfo.h +74 -0
  80. data/vendor/local/include/gobject-introspection-1.0/giconstantinfo.h +46 -0
  81. data/vendor/local/include/gobject-introspection-1.0/gienuminfo.h +56 -0
  82. data/vendor/local/include/gobject-introspection-1.0/gifieldinfo.h +52 -0
  83. data/vendor/local/include/gobject-introspection-1.0/gifunctioninfo.h +77 -0
  84. data/vendor/local/include/gobject-introspection-1.0/giinterfaceinfo.h +68 -0
  85. data/vendor/local/include/gobject-introspection-1.0/giobjectinfo.h +137 -0
  86. data/vendor/local/include/gobject-introspection-1.0/gipropertyinfo.h +44 -0
  87. data/vendor/local/include/gobject-introspection-1.0/giregisteredtypeinfo.h +53 -0
  88. data/vendor/local/include/gobject-introspection-1.0/girepository.h +179 -0
  89. data/vendor/local/include/gobject-introspection-1.0/girffi.h +80 -0
  90. data/vendor/local/include/gobject-introspection-1.0/gisignalinfo.h +45 -0
  91. data/vendor/local/include/gobject-introspection-1.0/gistructinfo.h +53 -0
  92. data/vendor/local/include/gobject-introspection-1.0/gitypeinfo.h +56 -0
  93. data/vendor/local/include/gobject-introspection-1.0/gitypelib.h +55 -0
  94. data/vendor/local/include/gobject-introspection-1.0/gitypes.h +453 -0
  95. data/vendor/local/include/gobject-introspection-1.0/giunioninfo.h +57 -0
  96. data/vendor/local/include/gobject-introspection-1.0/givfuncinfo.h +56 -0
  97. data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
  98. data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
  99. data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
  100. data/vendor/local/lib/girepository-1.0/GL-1.0.typelib +0 -0
  101. data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
  102. data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
  103. data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
  104. data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
  105. data/vendor/local/lib/girepository-1.0/cairo-1.0.typelib +0 -0
  106. data/vendor/local/lib/girepository-1.0/fontconfig-2.0.typelib +0 -0
  107. data/vendor/local/lib/girepository-1.0/freetype2-2.0.typelib +0 -0
  108. data/vendor/local/lib/girepository-1.0/libxml2-2.0.typelib +0 -0
  109. data/vendor/local/lib/girepository-1.0/xfixes-4.0.typelib +0 -0
  110. data/vendor/local/lib/girepository-1.0/xft-2.0.typelib +0 -0
  111. data/vendor/local/lib/girepository-1.0/xlib-2.0.typelib +0 -0
  112. data/vendor/local/lib/girepository-1.0/xrandr-1.3.typelib +0 -0
  113. data/vendor/local/lib/gobject-introspection/giscanner/__init__.py +24 -0
  114. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
  115. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
  116. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +74 -0
  117. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
  118. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
  119. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +1204 -0
  120. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
  121. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
  122. data/vendor/local/lib/gobject-introspection/giscanner/ast.py +1100 -0
  123. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
  124. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
  125. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +196 -0
  126. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
  127. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
  128. data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +140 -0
  129. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
  130. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
  131. data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +60 -0
  132. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
  133. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
  134. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/class.tmpl +2 -0
  135. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/constructor.tmpl +1 -0
  136. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/default.tmpl +1 -0
  137. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/enum.tmpl +2 -0
  138. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/function.tmpl +61 -0
  139. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/method.tmpl +1 -0
  140. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/namespace.tmpl +1 -0
  141. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/property.tmpl +5 -0
  142. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/record.tmpl +1 -0
  143. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/signal.tmpl +5 -0
  144. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/vfunc.tmpl +4 -0
  145. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/class.tmpl +18 -0
  146. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/constructor.tmpl +1 -0
  147. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/default.tmpl +1 -0
  148. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/enum.tmpl +13 -0
  149. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/function.tmpl +48 -0
  150. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/method.tmpl +1 -0
  151. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/namespace.tmpl +2 -0
  152. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/property.tmpl +10 -0
  153. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/record.tmpl +2 -0
  154. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/signal.tmpl +37 -0
  155. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/vfunc.tmpl +27 -0
  156. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/class.tmpl +17 -0
  157. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/constructor.tmpl +1 -0
  158. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/default.tmpl +1 -0
  159. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/enum.tmpl +13 -0
  160. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/function.tmpl +53 -0
  161. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/method.tmpl +1 -0
  162. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/namespace.tmpl +2 -0
  163. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/property.tmpl +10 -0
  164. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/record.tmpl +2 -0
  165. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/signal.tmpl +42 -0
  166. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/vfunc.tmpl +33 -0
  167. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/base.tmpl +29 -0
  168. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/class.tmpl +40 -0
  169. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/namespace.tmpl +19 -0
  170. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +635 -0
  171. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
  172. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
  173. data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +363 -0
  174. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
  175. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
  176. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +551 -0
  177. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
  178. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
  179. data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +581 -0
  180. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
  181. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
  182. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +584 -0
  183. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
  184. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
  185. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +236 -0
  186. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
  187. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
  188. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +76 -0
  189. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
  190. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
  191. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +1337 -0
  192. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
  193. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
  194. data/vendor/local/lib/gobject-introspection/giscanner/message.py +185 -0
  195. data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
  196. data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
  197. data/vendor/local/lib/gobject-introspection/giscanner/odict.py +50 -0
  198. data/vendor/local/lib/gobject-introspection/giscanner/odict.pyc +0 -0
  199. data/vendor/local/lib/gobject-introspection/giscanner/odict.pyo +0 -0
  200. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +497 -0
  201. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
  202. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
  203. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +78 -0
  204. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
  205. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
  206. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +132 -0
  207. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
  208. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
  209. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +324 -0
  210. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
  211. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
  212. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +119 -0
  213. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
  214. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
  215. data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +999 -0
  216. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
  217. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
  218. data/vendor/local/lib/gobject-introspection/giscanner/utils.py +141 -0
  219. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
  220. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
  221. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +197 -0
  222. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
  223. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
  224. data/vendor/local/lib/libgirepository-1.0.a +0 -0
  225. data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
  226. data/vendor/local/lib/libgirepository-1.0.la +41 -0
  227. data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +26 -0
  228. data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +23 -0
  229. data/vendor/local/share/aclocal/introspection.m4 +96 -0
  230. data/vendor/local/share/gir-1.0/DBus-1.0.gir +32 -0
  231. data/vendor/local/share/gir-1.0/DBusGLib-1.0.gir +18 -0
  232. data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +3833 -0
  233. data/vendor/local/share/gir-1.0/GL-1.0.gir +31 -0
  234. data/vendor/local/share/gir-1.0/GLib-2.0.gir +44304 -0
  235. data/vendor/local/share/gir-1.0/GModule-2.0.gir +184 -0
  236. data/vendor/local/share/gir-1.0/GObject-2.0.gir +13947 -0
  237. data/vendor/local/share/gir-1.0/Gio-2.0.gir +73619 -0
  238. data/vendor/local/share/gir-1.0/cairo-1.0.gir +70 -0
  239. data/vendor/local/share/gir-1.0/fontconfig-2.0.gir +18 -0
  240. data/vendor/local/share/gir-1.0/freetype2-2.0.gir +22 -0
  241. data/vendor/local/share/gir-1.0/libxml2-2.0.gir +25 -0
  242. data/vendor/local/share/gir-1.0/xfixes-4.0.gir +10 -0
  243. data/vendor/local/share/gir-1.0/xft-2.0.gir +23 -0
  244. data/vendor/local/share/gir-1.0/xlib-2.0.gir +67 -0
  245. data/vendor/local/share/gir-1.0/xrandr-1.3.gir +16 -0
  246. data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +166 -0
  247. data/vendor/local/share/gobject-introspection-1.0/gdump.c +564 -0
  248. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +835 -0
  249. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +198 -0
  250. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.c +55 -0
  251. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.h +33 -0
  252. data/vendor/local/share/gobject-introspection-1.0/tests/everything.c +1473 -0
  253. data/vendor/local/share/gobject-introspection-1.0/tests/everything.h +428 -0
  254. data/vendor/local/share/gobject-introspection-1.0/tests/foo.c +790 -0
  255. data/vendor/local/share/gobject-introspection-1.0/tests/foo.h +437 -0
  256. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +5256 -0
  257. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +1158 -0
  258. data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +4009 -0
  259. data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +944 -0
  260. data/vendor/local/share/gobject-introspection-1.0/tests/utility.c +45 -0
  261. data/vendor/local/share/gobject-introspection-1.0/tests/utility.h +95 -0
  262. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.c +33 -0
  263. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.h +36 -0
  264. data/vendor/local/share/license/gobject-introspection/AUTHORS +9 -0
  265. data/vendor/local/share/license/gobject-introspection/COPYING +12 -0
  266. data/vendor/local/share/man/man1/g-ir-compiler.1 +51 -0
  267. data/vendor/local/share/man/man1/g-ir-generate.1 +29 -0
  268. metadata +343 -0
@@ -0,0 +1,78 @@
1
+ # -*- Mode: Python -*-
2
+ # Copyright (C) 2013 Hat, Inc.
3
+ #
4
+ # This library is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU Lesser General Public
6
+ # License as published by the Free Software Foundation; either
7
+ # version 2 of the License, or (at your option) any later version.
8
+ #
9
+ # This library is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ # Lesser General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the
16
+ # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
+ # Boston, MA 02111-1307, USA.
18
+ #
19
+
20
+ import re
21
+ import sys
22
+
23
+ class SectionFile(object):
24
+ def __init__(self, sections):
25
+ self.sections = sections
26
+
27
+ class Section(object):
28
+ def __init__(self):
29
+ self.file = None
30
+ self.title = None
31
+ self.main_subsection = Subsection(None)
32
+ self.subsections = []
33
+
34
+ class Subsection(object):
35
+ def __init__(self, name):
36
+ self.name = name
37
+ self.symbols = []
38
+
39
+ def parse_sections_file(lines):
40
+ sections = []
41
+ current_section = None
42
+ current_subsection = None
43
+
44
+ for line in lines:
45
+ line = line.rstrip()
46
+
47
+ if not line or line.isspace():
48
+ continue
49
+
50
+ if line == "<SECTION>":
51
+ current_section = Section()
52
+ sections.append(current_section)
53
+ current_subsection = current_section.main_subsection
54
+ continue
55
+
56
+ if line == "</SECTION>":
57
+ current_section = None
58
+ continue
59
+
60
+ match = re.match(line, r"<FILE>(?P<contents>.*)</FILE>")
61
+ if match:
62
+ current_section.file = match.groupdict['contents']
63
+ continue
64
+
65
+ match = re.match(line, r"<TITLE>(?P<contents>.*)</TITLE>")
66
+ if match:
67
+ current_section.title = match.groupdict['contents']
68
+ continue
69
+
70
+ match = re.match(line, r"<SUBSECTION (?P<name>).*>")
71
+ if match:
72
+ current_subsection = Section(match.groupdict['name'])
73
+ current_section.subsections.append(current_subsection)
74
+ continue
75
+
76
+ current_subsection.symbols.append(line)
77
+
78
+ return SectionFile(sections)
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env python
2
+ # -*- Mode: Python -*-
3
+ # GObject-Introspection - a framework for introspecting GObject libraries
4
+ # Copyright (C) 2009 Red Hat, Inc.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+
22
+ import os
23
+ import platform
24
+ import re
25
+ import subprocess
26
+
27
+ from .utils import get_libtool_command, extract_libtool_shlib
28
+
29
+ # For .la files, the situation is easy.
30
+ def _resolve_libtool(options, binary, libraries):
31
+ shlibs = []
32
+ for library in libraries:
33
+ shlib = extract_libtool_shlib(library)
34
+ if shlib:
35
+ shlibs.append(shlib)
36
+
37
+ return shlibs
38
+
39
+ # Assume ldd output is something vaguely like
40
+ #
41
+ # libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x006c1000)
42
+ #
43
+ # We say that if something in the output looks like libpangoft2<blah>
44
+ # then the *first* such in the output is the soname. We require <blah>
45
+ # to start with [^A-Za-z0-9_-] to avoid problems with libpango vs libpangoft2
46
+ #
47
+ # The negative lookbehind at the start is to avoid problems if someone
48
+ # is crazy enough to name a library liblib<foo> when lib<foo> exists.
49
+ #
50
+ def _ldd_library_pattern(library_name):
51
+ return re.compile("(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
52
+ % re.escape(library_name))
53
+
54
+ # This is a what we do for non-la files. We assume that we are on an
55
+ # ELF-like system where ldd exists and the soname extracted with ldd is
56
+ # a filename that can be opened with dlopen().
57
+ #
58
+ # On OS X this will need a straightforward alternate implementation
59
+ # in terms of otool.
60
+ #
61
+ # Windows is more difficult, since there isn't always a straightforward
62
+ # translation between library name (.lib) and the name of the .dll, so
63
+ # extracting the dll names from the compiled app may not be sufficient.
64
+ # We might need to hunt down the .lib in the compile-time path and
65
+ # use that to figure out the name of the DLL.
66
+ #
67
+ def _resolve_non_libtool(options, binary, libraries):
68
+ if not libraries:
69
+ return []
70
+
71
+ if os.name == 'OpenBSD':
72
+ # Hack for OpenBSD when using the ports' libtool which uses slightly
73
+ # different directories to store the libraries in. So rewite binary.args[0]
74
+ # by inserting '.libs/'.
75
+ old_argdir = binary.args[0]
76
+ new_libsdir = os.path.join(os.path.dirname(binary.args[0]), '.libs/')
77
+ new_lib = new_libsdir + os.path.basename(binary.args[0])
78
+ if os.path.exists(new_lib):
79
+ binary.args[0] = new_lib
80
+ os.putenv('LD_LIBRARY_PATH', new_libsdir)
81
+ else:
82
+ binary.args[0] = old_argdir
83
+
84
+ if os.name == 'nt':
85
+ shlibs = []
86
+
87
+ for library in libraries:
88
+ shlibs.append(library + '.dll')
89
+ else:
90
+ args = []
91
+ libtool = get_libtool_command(options)
92
+ if libtool:
93
+ args.extend(libtool)
94
+ args.append('--mode=execute')
95
+ platform_system = platform.system()
96
+ if platform_system == 'Darwin':
97
+ args.extend(['otool', '-L', binary.args[0]])
98
+ else:
99
+ args.extend(['ldd', binary.args[0]])
100
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE)
101
+ patterns = {}
102
+ for library in libraries:
103
+ patterns[library] = _ldd_library_pattern(library)
104
+
105
+ shlibs = []
106
+ for line in proc.stdout:
107
+ for library, pattern in patterns.iteritems():
108
+ m = pattern.search(line)
109
+ if m:
110
+ del patterns[library]
111
+ shlibs.append(m.group(1))
112
+ break
113
+
114
+ if len(patterns) > 0:
115
+ raise SystemExit(
116
+ "ERROR: can't resolve libraries to shared libraries: " +
117
+ ", ".join(patterns.keys()))
118
+
119
+ return shlibs
120
+
121
+ # We want to resolve a set of library names (the <foo> of -l<foo>)
122
+ # against a library to find the shared library name. The shared
123
+ # library name is suppose to be what you pass to dlopen() (or
124
+ # equivalent). And we want to do this using the libraries that 'binary'
125
+ # is linking against.
126
+ #
127
+ def resolve_shlibs(options, binary, libraries):
128
+ libtool = filter(lambda x: x.endswith(".la"), libraries)
129
+ non_libtool = filter(lambda x: not x.endswith(".la"), libraries)
130
+
131
+ return (_resolve_libtool(options, binary, libtool) +
132
+ _resolve_non_libtool(options, binary, non_libtool))
@@ -0,0 +1,324 @@
1
+ # -*- Mode: Python -*-
2
+ # GObject-Introspection - a framework for introspecting GObject libraries
3
+ # Copyright (C) 2008 Johan Dahlin
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the
17
+ # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
+ # Boston, MA 02111-1307, USA.
19
+ #
20
+
21
+ from __future__ import with_statement
22
+ import os
23
+ import subprocess
24
+ import tempfile
25
+
26
+ from .libtoolimporter import LibtoolImporter
27
+ from .message import Position
28
+
29
+ with LibtoolImporter(None, None):
30
+ if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ:
31
+ from _giscanner import SourceScanner as CSourceScanner
32
+ else:
33
+ from giscanner._giscanner import SourceScanner as CSourceScanner
34
+
35
+ (CSYMBOL_TYPE_INVALID,
36
+ CSYMBOL_TYPE_ELLIPSIS,
37
+ CSYMBOL_TYPE_CONST,
38
+ CSYMBOL_TYPE_OBJECT,
39
+ CSYMBOL_TYPE_FUNCTION,
40
+ CSYMBOL_TYPE_STRUCT,
41
+ CSYMBOL_TYPE_UNION,
42
+ CSYMBOL_TYPE_ENUM,
43
+ CSYMBOL_TYPE_TYPEDEF,
44
+ CSYMBOL_TYPE_MEMBER) = range(10)
45
+
46
+ (CTYPE_INVALID,
47
+ CTYPE_VOID,
48
+ CTYPE_BASIC_TYPE,
49
+ CTYPE_TYPEDEF,
50
+ CTYPE_STRUCT,
51
+ CTYPE_UNION,
52
+ CTYPE_ENUM,
53
+ CTYPE_POINTER,
54
+ CTYPE_ARRAY,
55
+ CTYPE_FUNCTION) = range(10)
56
+
57
+ STORAGE_CLASS_NONE = 0
58
+ STORAGE_CLASS_TYPEDEF = 1 << 1
59
+ STORAGE_CLASS_EXTERN = 1 << 2
60
+ STORAGE_CLASS_STATIC = 1 << 3
61
+ STORAGE_CLASS_AUTO = 1 << 4
62
+ STORAGE_CLASS_REGISTER = 1 << 5
63
+
64
+ TYPE_QUALIFIER_NONE = 0
65
+ TYPE_QUALIFIER_CONST = 1 << 1
66
+ TYPE_QUALIFIER_RESTRICT = 1 << 2
67
+ TYPE_QUALIFIER_VOLATILE = 1 << 3
68
+ TYPE_QUALIFIER_EXTENSION = 1 << 4
69
+
70
+ FUNCTION_NONE = 0
71
+ FUNCTION_INLINE = 1 << 1
72
+
73
+ (UNARY_ADDRESS_OF,
74
+ UNARY_POINTER_INDIRECTION,
75
+ UNARY_PLUS,
76
+ UNARY_MINUS,
77
+ UNARY_BITWISE_COMPLEMENT,
78
+ UNARY_LOGICAL_NEGATION) = range(6)
79
+
80
+
81
+ def symbol_type_name(symbol_type):
82
+ return {
83
+ CSYMBOL_TYPE_INVALID: 'invalid',
84
+ CSYMBOL_TYPE_ELLIPSIS: 'ellipsis',
85
+ CSYMBOL_TYPE_CONST: 'const',
86
+ CSYMBOL_TYPE_OBJECT: 'object',
87
+ CSYMBOL_TYPE_FUNCTION: 'function',
88
+ CSYMBOL_TYPE_STRUCT: 'struct',
89
+ CSYMBOL_TYPE_UNION: 'union',
90
+ CSYMBOL_TYPE_ENUM: 'enum',
91
+ CSYMBOL_TYPE_TYPEDEF: 'typedef',
92
+ CSYMBOL_TYPE_MEMBER: 'member',
93
+ }.get(symbol_type)
94
+
95
+
96
+ def ctype_name(ctype):
97
+ return {
98
+ CTYPE_INVALID: 'invalid',
99
+ CTYPE_VOID: 'void',
100
+ CTYPE_BASIC_TYPE: 'basic',
101
+ CTYPE_TYPEDEF: 'typedef',
102
+ CTYPE_STRUCT: 'struct',
103
+ CTYPE_UNION: 'union',
104
+ CTYPE_ENUM: 'enum',
105
+ CTYPE_POINTER: 'pointer',
106
+ CTYPE_ARRAY: 'array',
107
+ CTYPE_FUNCTION: 'function',
108
+ }.get(ctype)
109
+
110
+
111
+ class SourceType(object):
112
+ __members__ = ['type', 'base_type', 'name', 'type_qualifier',
113
+ 'child_list', 'is_bitfield']
114
+
115
+ def __init__(self, scanner, stype):
116
+ self._scanner = scanner
117
+ self._stype = stype
118
+
119
+ def __repr__(self):
120
+ return '<%s type=%r name=%r>' % (
121
+ self.__class__.__name__,
122
+ ctype_name(self.type),
123
+ self.name)
124
+
125
+ @property
126
+ def type(self):
127
+ return self._stype.type
128
+
129
+ @property
130
+ def base_type(self):
131
+ if self._stype.base_type is not None:
132
+ return SourceType(self._scanner, self._stype.base_type)
133
+
134
+ @property
135
+ def name(self):
136
+ return self._stype.name
137
+
138
+ @property
139
+ def type_qualifier(self):
140
+ return self._stype.type_qualifier
141
+
142
+ @property
143
+ def child_list(self):
144
+ for symbol in self._stype.child_list:
145
+ if symbol is None:
146
+ continue
147
+ yield SourceSymbol(self._scanner, symbol)
148
+
149
+ @property
150
+ def is_bitfield(self):
151
+ return self._stype.is_bitfield
152
+
153
+
154
+ class SourceSymbol(object):
155
+ __members__ = ['const_int', 'const_double', 'const_string', 'ident',
156
+ 'type', 'base_type']
157
+
158
+ def __init__(self, scanner, symbol):
159
+ self._scanner = scanner
160
+ self._symbol = symbol
161
+
162
+ def __repr__(self):
163
+ src = self.source_filename
164
+ if src:
165
+ line = self.line
166
+ if line:
167
+ src += ':%r' % (line, )
168
+ return '<%s type=%r ident=%r src=%r>' % (
169
+ self.__class__.__name__,
170
+ symbol_type_name(self.type),
171
+ self.ident,
172
+ src)
173
+
174
+ @property
175
+ def const_int(self):
176
+ return self._symbol.const_int
177
+
178
+ @property
179
+ def const_double(self):
180
+ return self._symbol.const_double
181
+
182
+ @property
183
+ def const_string(self):
184
+ return self._symbol.const_string
185
+
186
+ @property
187
+ def ident(self):
188
+ return self._symbol.ident
189
+
190
+ @property
191
+ def type(self):
192
+ return self._symbol.type
193
+
194
+ @property
195
+ def base_type(self):
196
+ if self._symbol.base_type is not None:
197
+ return SourceType(self._scanner, self._symbol.base_type)
198
+
199
+ @property
200
+ def source_filename(self):
201
+ return self._symbol.source_filename
202
+
203
+ @property
204
+ def line(self):
205
+ return self._symbol.line
206
+
207
+ @property
208
+ def private(self):
209
+ return self._symbol.private
210
+
211
+ @property
212
+ def position(self):
213
+ return Position(self._symbol.source_filename,
214
+ self._symbol.line)
215
+
216
+
217
+ class SourceScanner(object):
218
+
219
+ def __init__(self):
220
+ self._scanner = CSourceScanner()
221
+ self._filenames = []
222
+ self._cpp_options = []
223
+
224
+ # Public API
225
+
226
+ def set_cpp_options(self, includes, defines, undefines, cflags=[]):
227
+ self._cpp_options.extend(cflags)
228
+ for prefix, args in [('-I', includes),
229
+ ('-D', defines),
230
+ ('-U', undefines)]:
231
+ for arg in (args or []):
232
+ opt = prefix + arg
233
+ if not opt in self._cpp_options:
234
+ self._cpp_options.append(opt)
235
+
236
+ def parse_files(self, filenames):
237
+ for filename in filenames:
238
+ filename = os.path.abspath(filename)
239
+ self._scanner.append_filename(filename)
240
+ self._filenames.append(filename)
241
+
242
+ headers = []
243
+ for filename in filenames:
244
+ if (filename.endswith('.c') or filename.endswith('.cpp') or
245
+ filename.endswith('.cc') or filename.endswith('.cxx')):
246
+ filename = os.path.abspath(filename)
247
+ self._scanner.lex_filename(filename)
248
+ else:
249
+ headers.append(filename)
250
+
251
+ self._parse(headers)
252
+
253
+ def parse_macros(self, filenames):
254
+ self._scanner.set_macro_scan(True)
255
+ self._scanner.parse_macros(filenames)
256
+ self._scanner.set_macro_scan(False)
257
+
258
+ def get_symbols(self):
259
+ for symbol in self._scanner.get_symbols():
260
+ yield SourceSymbol(self._scanner, symbol)
261
+
262
+ def get_comments(self):
263
+ return self._scanner.get_comments()
264
+
265
+ def dump(self):
266
+ print '-'*30
267
+ for symbol in self._scanner.get_symbols():
268
+ print symbol.ident, symbol.base_type.name, symbol.type
269
+
270
+ # Private
271
+
272
+ def _parse(self, filenames):
273
+ if not filenames:
274
+ return
275
+
276
+ defines = ['__GI_SCANNER__']
277
+ undefs = []
278
+ cpp_exec = os.environ.get('CC', 'cc').split()
279
+ # The Microsoft compiler/preprocessor (cl) does not accept
280
+ # source input from stdin (the '-' flag), so we need
281
+ # some help from gcc from MinGW/Cygwin or so.
282
+ # Note that the generated dumper program is
283
+ # still built and linked by Visual C++.
284
+ if 'cl' in cpp_exec:
285
+ cpp_args = 'gcc'.split()
286
+ else:
287
+ cpp_args = cpp_exec
288
+ cpp_args += ['-E', '-C', '-I.', '-']
289
+
290
+ cpp_args += self._cpp_options
291
+ proc = subprocess.Popen(cpp_args,
292
+ stdin=subprocess.PIPE,
293
+ stdout=subprocess.PIPE)
294
+
295
+ for define in defines:
296
+ proc.stdin.write('#ifndef %s\n' % (define, ))
297
+ proc.stdin.write('# define %s\n' % (define, ))
298
+ proc.stdin.write('#endif\n')
299
+ for undef in undefs:
300
+ proc.stdin.write('#undef %s\n' % (undef, ))
301
+ for filename in filenames:
302
+ filename = os.path.abspath(filename)
303
+ proc.stdin.write('#include <%s>\n' % (filename, ))
304
+ proc.stdin.close()
305
+
306
+ tmp = tempfile.mktemp()
307
+ fp = open(tmp, 'w+')
308
+ while True:
309
+ data = proc.stdout.read(4096)
310
+ if data is None:
311
+ break
312
+ fp.write(data)
313
+ if len(data) < 4096:
314
+ break
315
+ fp.seek(0, 0)
316
+
317
+ assert proc, 'Proc was none'
318
+ proc.wait()
319
+ if proc.returncode != 0:
320
+ raise SystemExit('Error while processing the source.')
321
+
322
+ self._scanner.parse_file(fp.fileno())
323
+ fp.close()
324
+ os.unlink(tmp)