gobject-introspection 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +129 -0
- data/ext/gobject-introspection/depend +10 -0
- data/ext/gobject-introspection/extconf.rb +94 -0
- data/ext/gobject-introspection/gobject_introspection.def +5 -0
- data/ext/gobject-introspection/rb-gi-arg-info.c +151 -0
- data/ext/gobject-introspection/rb-gi-argument.c +2053 -0
- data/ext/gobject-introspection/rb-gi-base-info.c +218 -0
- data/ext/gobject-introspection/rb-gi-boxed-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-callable-info.c +104 -0
- data/ext/gobject-introspection/rb-gi-callback-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-constant-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-constructor-info.c +133 -0
- data/ext/gobject-introspection/rb-gi-conversions.h +145 -0
- data/ext/gobject-introspection/rb-gi-enum-info.c +155 -0
- data/ext/gobject-introspection/rb-gi-field-info.c +153 -0
- data/ext/gobject-introspection/rb-gi-flags-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-function-info.c +841 -0
- data/ext/gobject-introspection/rb-gi-interface-info.c +222 -0
- data/ext/gobject-introspection/rb-gi-loader.c +224 -0
- data/ext/gobject-introspection/rb-gi-method-info.c +83 -0
- data/ext/gobject-introspection/rb-gi-object-info.c +345 -0
- data/ext/gobject-introspection/rb-gi-private.h +105 -0
- data/ext/gobject-introspection/rb-gi-property-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-registered-type-info.c +86 -0
- data/ext/gobject-introspection/rb-gi-repository.c +246 -0
- data/ext/gobject-introspection/rb-gi-signal-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-struct-info.c +202 -0
- data/ext/gobject-introspection/rb-gi-type-info.c +143 -0
- data/ext/gobject-introspection/rb-gi-type-tag.c +43 -0
- data/ext/gobject-introspection/rb-gi-types.h +71 -0
- data/ext/gobject-introspection/rb-gi-union-info.c +206 -0
- data/ext/gobject-introspection/rb-gi-unresolved-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-value-info.c +57 -0
- data/ext/gobject-introspection/rb-gi-vfunc-info.c +91 -0
- data/ext/gobject-introspection/rb-gobject-introspection.c +44 -0
- data/ext/gobject-introspection/rb-gobject-introspection.h +60 -0
- data/extconf.rb +71 -0
- data/lib/2.0/gobject_introspection.so +0 -0
- data/lib/2.1/gobject_introspection.so +0 -0
- data/lib/2.2/gobject_introspection.so +0 -0
- data/lib/gobject-introspection.rb +53 -0
- data/lib/gobject-introspection/boxed-info.rb +28 -0
- data/lib/gobject-introspection/callable-info.rb +100 -0
- data/lib/gobject-introspection/collection-reader.rb +34 -0
- data/lib/gobject-introspection/interface-info.rb +32 -0
- data/lib/gobject-introspection/loader.rb +465 -0
- data/lib/gobject-introspection/object-info.rb +33 -0
- data/lib/gobject-introspection/repository.rb +32 -0
- data/lib/gobject-introspection/struct-info.rb +28 -0
- data/lib/gobject-introspection/union-info.rb +28 -0
- data/test/gobject-introspection-test-utils.rb +26 -0
- data/test/run-test.rb +45 -0
- data/test/test-arg-info.rb +68 -0
- data/test/test-base-info.rb +31 -0
- data/test/test-boxed-info.rb +21 -0
- data/test/test-callable-info.rb +49 -0
- data/test/test-callback-info.rb +29 -0
- data/test/test-constant-info.rb +24 -0
- data/test/test-enum-info.rb +61 -0
- data/test/test-field-type.rb +42 -0
- data/test/test-flags-info.rb +27 -0
- data/test/test-function-info.rb +39 -0
- data/test/test-interface-info.rb +97 -0
- data/test/test-loader.rb +30 -0
- data/test/test-object-info.rb +131 -0
- data/test/test-property-info.rb +38 -0
- data/test/test-registered-type-info.rb +35 -0
- data/test/test-repository.rb +62 -0
- data/test/test-signal-info.rb +40 -0
- data/test/test-struct-info.rb +57 -0
- data/test/test-type-info.rb +62 -0
- data/test/test-type-tag.rb +29 -0
- data/test/test-union-info.rb +21 -0
- data/test/test-value-info.rb +28 -0
- data/test/test-vfunc-info.rb +42 -0
- data/vendor/local/bin/g-ir-compiler.exe +0 -0
- data/vendor/local/bin/g-ir-generate.exe +0 -0
- data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
- data/vendor/local/include/gobject-introspection-1.0/giarginfo.h +82 -0
- data/vendor/local/include/gobject-introspection-1.0/gibaseinfo.h +120 -0
- data/vendor/local/include/gobject-introspection-1.0/gicallableinfo.h +110 -0
- data/vendor/local/include/gobject-introspection-1.0/giconstantinfo.h +58 -0
- data/vendor/local/include/gobject-introspection-1.0/gienuminfo.h +82 -0
- data/vendor/local/include/gobject-introspection-1.0/gifieldinfo.h +71 -0
- data/vendor/local/include/gobject-introspection-1.0/gifunctioninfo.h +100 -0
- data/vendor/local/include/gobject-introspection-1.0/giinterfaceinfo.h +106 -0
- data/vendor/local/include/gobject-introspection-1.0/giobjectinfo.h +207 -0
- data/vendor/local/include/gobject-introspection-1.0/gipropertyinfo.h +56 -0
- data/vendor/local/include/gobject-introspection-1.0/giregisteredtypeinfo.h +64 -0
- data/vendor/local/include/gobject-introspection-1.0/girepository.h +239 -0
- data/vendor/local/include/gobject-introspection-1.0/girffi.h +104 -0
- data/vendor/local/include/gobject-introspection-1.0/gisignalinfo.h +57 -0
- data/vendor/local/include/gobject-introspection-1.0/gistructinfo.h +77 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypeinfo.h +87 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypelib.h +80 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypes.h +524 -0
- data/vendor/local/include/gobject-introspection-1.0/giunioninfo.h +84 -0
- data/vendor/local/include/gobject-introspection-1.0/giversionmacros.h +128 -0
- data/vendor/local/include/gobject-introspection-1.0/givfuncinfo.h +73 -0
- data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GL-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/cairo-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/fontconfig-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/freetype2-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/libxml2-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/win32-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xfixes-4.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xft-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xlib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xrandr-1.3.typelib +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.py +24 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +76 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +2161 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.py +1139 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +203 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.py +202 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +173 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.py +23 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.py +305 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.py +120 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +72 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/callback.tmpl +4 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/class.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/enum.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/field.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/function.tmpl +60 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/interface.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/namespace.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/property.tmpl +5 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/record.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/signal.tmpl +5 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/vfunc.tmpl +4 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/callback.tmpl +27 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/class.tmpl +30 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/enum.tmpl +21 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/field.tmpl +9 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/function.tmpl +47 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/interface.tmpl +17 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/namespace.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/property.tmpl +9 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/record.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/signal.tmpl +38 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/vfunc.tmpl +27 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/callback.tmpl +27 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/class.tmpl +18 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/enum.tmpl +13 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/field.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/function.tmpl +47 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/interface.tmpl +16 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/namespace.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/property.tmpl +9 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/record.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/signal.tmpl +41 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/vfunc.tmpl +27 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/base.tmpl +20 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/class.tmpl +61 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/namespace.tmpl +16 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +958 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +338 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +529 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +593 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +612 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +240 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +76 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +1366 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.py +203 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +561 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +152 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +140 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +329 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +136 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +971 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.py +211 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +156 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
- data/vendor/local/lib/libgirepository-1.0.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.la +41 -0
- data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +26 -0
- data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +23 -0
- data/vendor/local/lib/pkgconfig/patched +0 -0
- data/vendor/local/share/aclocal/introspection.m4 +96 -0
- data/vendor/local/share/gir-1.0/DBus-1.0.gir +32 -0
- data/vendor/local/share/gir-1.0/DBusGLib-1.0.gir +18 -0
- data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +4042 -0
- data/vendor/local/share/gir-1.0/GL-1.0.gir +31 -0
- data/vendor/local/share/gir-1.0/GLib-2.0.gir +47221 -0
- data/vendor/local/share/gir-1.0/GModule-2.0.gir +301 -0
- data/vendor/local/share/gir-1.0/GObject-2.0.gir +14733 -0
- data/vendor/local/share/gir-1.0/Gio-2.0.gir +82459 -0
- data/vendor/local/share/gir-1.0/cairo-1.0.gir +70 -0
- data/vendor/local/share/gir-1.0/fontconfig-2.0.gir +18 -0
- data/vendor/local/share/gir-1.0/freetype2-2.0.gir +22 -0
- data/vendor/local/share/gir-1.0/libxml2-2.0.gir +25 -0
- data/vendor/local/share/gir-1.0/win32-1.0.gir +19 -0
- data/vendor/local/share/gir-1.0/xfixes-4.0.gir +10 -0
- data/vendor/local/share/gir-1.0/xft-2.0.gir +23 -0
- data/vendor/local/share/gir-1.0/xlib-2.0.gir +67 -0
- data/vendor/local/share/gir-1.0/xrandr-1.3.gir +16 -0
- data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +166 -0
- data/vendor/local/share/gobject-introspection-1.0/gdump.c +569 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +831 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +301 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/drawable.c +57 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/drawable.h +44 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/everything.c +1579 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/everything.h +535 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/foo.c +790 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/foo.h +582 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +5426 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +1948 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gitestmacros.h +10 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +4068 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +1415 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/utility.c +47 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/utility.h +102 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.c +47 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.h +46 -0
- data/vendor/local/share/license/gobject-introspection/AUTHORS +9 -0
- data/vendor/local/share/license/gobject-introspection/COPYING +12 -0
- data/vendor/local/share/man/man1/g-ir-compiler.1 +42 -0
- data/vendor/local/share/man/man1/g-ir-generate.1 +29 -0
- metadata +363 -0
Binary file
|
Binary file
|
@@ -0,0 +1,152 @@
|
|
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
|
+
from . import ast
|
22
|
+
from .utils import to_underscores
|
23
|
+
|
24
|
+
|
25
|
+
class SectionsFile(object):
|
26
|
+
def __init__(self, sections):
|
27
|
+
self.sections = sections
|
28
|
+
|
29
|
+
|
30
|
+
class Section(object):
|
31
|
+
def __init__(self):
|
32
|
+
self.file = None
|
33
|
+
self.title = None
|
34
|
+
self.includes = None
|
35
|
+
self.subsections = []
|
36
|
+
|
37
|
+
|
38
|
+
class Subsection(object):
|
39
|
+
def __init__(self, name):
|
40
|
+
self.name = name
|
41
|
+
self.symbols = []
|
42
|
+
|
43
|
+
|
44
|
+
def parse_sections_file(lines):
|
45
|
+
sections = []
|
46
|
+
current_section = None
|
47
|
+
current_subsection = None
|
48
|
+
|
49
|
+
for line in lines:
|
50
|
+
line = line.rstrip()
|
51
|
+
|
52
|
+
if not line or line.isspace():
|
53
|
+
continue
|
54
|
+
|
55
|
+
if line == "<SECTION>":
|
56
|
+
current_section = Section()
|
57
|
+
sections.append(current_section)
|
58
|
+
current_subsection = Subsection(None)
|
59
|
+
current_section.subsections.append(current_subsection)
|
60
|
+
continue
|
61
|
+
|
62
|
+
if line == "</SECTION>":
|
63
|
+
current_section = None
|
64
|
+
continue
|
65
|
+
|
66
|
+
match = re.match(r"<FILE>(?P<contents>.*)</FILE>", line)
|
67
|
+
if match:
|
68
|
+
current_section.file = match.groupdict['contents']
|
69
|
+
continue
|
70
|
+
|
71
|
+
match = re.match(r"<TITLE>(?P<contents>.*)</TITLE>", line)
|
72
|
+
if match:
|
73
|
+
current_section.title = match.groupdict['contents']
|
74
|
+
continue
|
75
|
+
|
76
|
+
match = re.match(r"<INCLUDE>(?P<contents>.*)</INCLUDE>", line)
|
77
|
+
if match:
|
78
|
+
current_section.includes = match.groupdict['contents']
|
79
|
+
continue
|
80
|
+
|
81
|
+
match = re.match(r"<SUBSECTION(?: (?P<name>.*))?>", line)
|
82
|
+
if match:
|
83
|
+
current_subsection = Subsection(match.groupdict.get('name', None))
|
84
|
+
current_section.subsections.append(current_subsection)
|
85
|
+
continue
|
86
|
+
|
87
|
+
if line.startswith("<") and line.endswith(">"):
|
88
|
+
# Other directive to gtk-doc, not a symbol.
|
89
|
+
continue
|
90
|
+
|
91
|
+
current_subsection.symbols.append(line)
|
92
|
+
|
93
|
+
return SectionsFile(sections)
|
94
|
+
|
95
|
+
|
96
|
+
def write_sections_file(f, sections_file):
|
97
|
+
for section in sections_file.sections:
|
98
|
+
f.write("\n<SECTION>\n")
|
99
|
+
if section.file is not None:
|
100
|
+
f.write("<FILE>%s</FILE>\n" % (section.file, ))
|
101
|
+
if section.title is not None:
|
102
|
+
f.write("<TITLE>%s</TITLE>\n" % (section.title, ))
|
103
|
+
if section.includes is not None:
|
104
|
+
f.write("<INCLUDE>%s</INCLUDE>\n" % (section.includes, ))
|
105
|
+
|
106
|
+
is_first_subsection = True
|
107
|
+
for subsection in section.subsections:
|
108
|
+
if subsection.name is not None:
|
109
|
+
f.write("<SUBSECTION %s>\n" % (subsection.name, ))
|
110
|
+
elif not is_first_subsection:
|
111
|
+
f.write("\n<SUBSECTION>\n")
|
112
|
+
|
113
|
+
is_first_subsection = False
|
114
|
+
|
115
|
+
for symbol in subsection.symbols:
|
116
|
+
f.write(symbol + "\n")
|
117
|
+
|
118
|
+
|
119
|
+
def generate_sections_file(transformer):
|
120
|
+
ns = transformer.namespace
|
121
|
+
|
122
|
+
sections = []
|
123
|
+
|
124
|
+
def new_section(file_, title):
|
125
|
+
section = Section()
|
126
|
+
section.file = file_
|
127
|
+
section.title = title
|
128
|
+
section.subsections.append(Subsection(None))
|
129
|
+
sections.append(section)
|
130
|
+
return section
|
131
|
+
|
132
|
+
def append_symbol(section, sym):
|
133
|
+
section.subsections[0].symbols.append(sym)
|
134
|
+
|
135
|
+
general_section = new_section("main", "Main")
|
136
|
+
|
137
|
+
for node in ns.itervalues():
|
138
|
+
if isinstance(node, ast.Function):
|
139
|
+
append_symbol(general_section, node.symbol)
|
140
|
+
elif isinstance(node, (ast.Class, ast.Interface)):
|
141
|
+
gtype_name = node.gtype_name
|
142
|
+
file_name = to_underscores(gtype_name).replace('_', '-').lower()
|
143
|
+
section = new_section(file_name, gtype_name)
|
144
|
+
append_symbol(section, gtype_name)
|
145
|
+
append_symbol(section, node.glib_type_struct.target_giname.replace('.', ''))
|
146
|
+
|
147
|
+
for meth in node.methods:
|
148
|
+
append_symbol(section, meth.symbol)
|
149
|
+
for meth in node.static_methods:
|
150
|
+
append_symbol(section, meth.symbol)
|
151
|
+
|
152
|
+
return SectionsFile(sections)
|
Binary file
|
Binary file
|
@@ -0,0 +1,140 @@
|
|
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, which
|
28
|
+
from .ccompiler import CCompiler
|
29
|
+
|
30
|
+
|
31
|
+
# For .la files, the situation is easy.
|
32
|
+
def _resolve_libtool(options, binary, libraries):
|
33
|
+
shlibs = []
|
34
|
+
for library in libraries:
|
35
|
+
shlib = extract_libtool_shlib(library)
|
36
|
+
if shlib:
|
37
|
+
shlibs.append(shlib)
|
38
|
+
|
39
|
+
return shlibs
|
40
|
+
|
41
|
+
|
42
|
+
# Assume ldd output is something vaguely like
|
43
|
+
#
|
44
|
+
# libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x006c1000)
|
45
|
+
#
|
46
|
+
# We say that if something in the output looks like libpangoft2<blah>
|
47
|
+
# then the *first* such in the output is the soname. We require <blah>
|
48
|
+
# to start with [^A-Za-z0-9_-] to avoid problems with libpango vs libpangoft2
|
49
|
+
#
|
50
|
+
# The negative lookbehind at the start is to avoid problems if someone
|
51
|
+
# is crazy enough to name a library liblib<foo> when lib<foo> exists.
|
52
|
+
#
|
53
|
+
# Match absolute paths on OS X to conform to how libraries are usually
|
54
|
+
# referenced on OS X systems.
|
55
|
+
def _ldd_library_pattern(library_name):
|
56
|
+
pattern = "(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
|
57
|
+
if platform.system() == 'Darwin':
|
58
|
+
pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
|
59
|
+
return re.compile(pattern % re.escape(library_name))
|
60
|
+
|
61
|
+
|
62
|
+
# This is a what we do for non-la files. We assume that we are on an
|
63
|
+
# ELF-like system where ldd exists and the soname extracted with ldd is
|
64
|
+
# a filename that can be opened with dlopen().
|
65
|
+
#
|
66
|
+
# On OS X this will need a straightforward alternate implementation
|
67
|
+
# in terms of otool.
|
68
|
+
#
|
69
|
+
# Windows is more difficult, since there isn't always a straightforward
|
70
|
+
# translation between library name (.lib) and the name of the .dll, so
|
71
|
+
# extracting the dll names from the compiled app may not be sufficient.
|
72
|
+
# We might need to hunt down the .lib in the compile-time path and
|
73
|
+
# use that to figure out the name of the DLL.
|
74
|
+
#
|
75
|
+
def _resolve_non_libtool(options, binary, libraries):
|
76
|
+
if not libraries:
|
77
|
+
return []
|
78
|
+
|
79
|
+
if platform.platform().startswith('OpenBSD'):
|
80
|
+
# Hack for OpenBSD when using the ports' libtool which uses slightly
|
81
|
+
# different directories to store the libraries in. So rewite binary.args[0]
|
82
|
+
# by inserting '.libs/'.
|
83
|
+
old_argdir = binary.args[0]
|
84
|
+
new_libsdir = os.path.join(os.path.dirname(binary.args[0]), '.libs/')
|
85
|
+
new_lib = new_libsdir + os.path.basename(binary.args[0])
|
86
|
+
if os.path.exists(new_lib):
|
87
|
+
binary.args[0] = new_lib
|
88
|
+
os.putenv('LD_LIBRARY_PATH', new_libsdir)
|
89
|
+
else:
|
90
|
+
binary.args[0] = old_argdir
|
91
|
+
|
92
|
+
if os.name == 'nt':
|
93
|
+
cc = CCompiler()
|
94
|
+
shlibs = cc.resolve_windows_libs(libraries, options)
|
95
|
+
|
96
|
+
else:
|
97
|
+
args = []
|
98
|
+
libtool = get_libtool_command(options)
|
99
|
+
if libtool:
|
100
|
+
args.extend(libtool)
|
101
|
+
args.append('--mode=execute')
|
102
|
+
platform_system = platform.system()
|
103
|
+
if platform_system == 'Darwin':
|
104
|
+
args.extend(['otool', '-L', binary.args[0]])
|
105
|
+
else:
|
106
|
+
args.extend(['ldd', binary.args[0]])
|
107
|
+
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
|
108
|
+
patterns = {}
|
109
|
+
for library in libraries:
|
110
|
+
patterns[library] = _ldd_library_pattern(library)
|
111
|
+
|
112
|
+
shlibs = []
|
113
|
+
for line in proc.stdout:
|
114
|
+
for library, pattern in patterns.iteritems():
|
115
|
+
m = pattern.search(line)
|
116
|
+
if m:
|
117
|
+
del patterns[library]
|
118
|
+
shlibs.append(m.group(1))
|
119
|
+
break
|
120
|
+
|
121
|
+
if len(patterns) > 0:
|
122
|
+
raise SystemExit(
|
123
|
+
"ERROR: can't resolve libraries to shared libraries: " +
|
124
|
+
", ".join(patterns.keys()))
|
125
|
+
|
126
|
+
return shlibs
|
127
|
+
|
128
|
+
|
129
|
+
# We want to resolve a set of library names (the <foo> of -l<foo>)
|
130
|
+
# against a library to find the shared library name. The shared
|
131
|
+
# library name is suppose to be what you pass to dlopen() (or
|
132
|
+
# equivalent). And we want to do this using the libraries that 'binary'
|
133
|
+
# is linking against.
|
134
|
+
#
|
135
|
+
def resolve_shlibs(options, binary, libraries):
|
136
|
+
libtool = filter(lambda x: x.endswith(".la"), libraries)
|
137
|
+
non_libtool = filter(lambda x: not x.endswith(".la"), libraries)
|
138
|
+
|
139
|
+
return (_resolve_libtool(options, binary, libtool) +
|
140
|
+
_resolve_non_libtool(options, binary, non_libtool))
|
Binary file
|
Binary file
|
@@ -0,0 +1,329 @@
|
|
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
|
+
HEADER_EXTS = ['.h', '.hpp', '.hxx']
|
36
|
+
SOURCE_EXTS = ['.c', '.cpp', '.cc', '.cxx']
|
37
|
+
ALL_EXTS = SOURCE_EXTS + HEADER_EXTS
|
38
|
+
|
39
|
+
(CSYMBOL_TYPE_INVALID,
|
40
|
+
CSYMBOL_TYPE_ELLIPSIS,
|
41
|
+
CSYMBOL_TYPE_CONST,
|
42
|
+
CSYMBOL_TYPE_OBJECT,
|
43
|
+
CSYMBOL_TYPE_FUNCTION,
|
44
|
+
CSYMBOL_TYPE_STRUCT,
|
45
|
+
CSYMBOL_TYPE_UNION,
|
46
|
+
CSYMBOL_TYPE_ENUM,
|
47
|
+
CSYMBOL_TYPE_TYPEDEF,
|
48
|
+
CSYMBOL_TYPE_MEMBER) = range(10)
|
49
|
+
|
50
|
+
(CTYPE_INVALID,
|
51
|
+
CTYPE_VOID,
|
52
|
+
CTYPE_BASIC_TYPE,
|
53
|
+
CTYPE_TYPEDEF,
|
54
|
+
CTYPE_STRUCT,
|
55
|
+
CTYPE_UNION,
|
56
|
+
CTYPE_ENUM,
|
57
|
+
CTYPE_POINTER,
|
58
|
+
CTYPE_ARRAY,
|
59
|
+
CTYPE_FUNCTION) = range(10)
|
60
|
+
|
61
|
+
STORAGE_CLASS_NONE = 0
|
62
|
+
STORAGE_CLASS_TYPEDEF = 1 << 1
|
63
|
+
STORAGE_CLASS_EXTERN = 1 << 2
|
64
|
+
STORAGE_CLASS_STATIC = 1 << 3
|
65
|
+
STORAGE_CLASS_AUTO = 1 << 4
|
66
|
+
STORAGE_CLASS_REGISTER = 1 << 5
|
67
|
+
|
68
|
+
TYPE_QUALIFIER_NONE = 0
|
69
|
+
TYPE_QUALIFIER_CONST = 1 << 1
|
70
|
+
TYPE_QUALIFIER_RESTRICT = 1 << 2
|
71
|
+
TYPE_QUALIFIER_VOLATILE = 1 << 3
|
72
|
+
TYPE_QUALIFIER_EXTENSION = 1 << 4
|
73
|
+
|
74
|
+
FUNCTION_NONE = 0
|
75
|
+
FUNCTION_INLINE = 1 << 1
|
76
|
+
|
77
|
+
(UNARY_ADDRESS_OF,
|
78
|
+
UNARY_POINTER_INDIRECTION,
|
79
|
+
UNARY_PLUS,
|
80
|
+
UNARY_MINUS,
|
81
|
+
UNARY_BITWISE_COMPLEMENT,
|
82
|
+
UNARY_LOGICAL_NEGATION) = range(6)
|
83
|
+
|
84
|
+
|
85
|
+
def symbol_type_name(symbol_type):
|
86
|
+
return {
|
87
|
+
CSYMBOL_TYPE_INVALID: 'invalid',
|
88
|
+
CSYMBOL_TYPE_ELLIPSIS: 'ellipsis',
|
89
|
+
CSYMBOL_TYPE_CONST: 'const',
|
90
|
+
CSYMBOL_TYPE_OBJECT: 'object',
|
91
|
+
CSYMBOL_TYPE_FUNCTION: 'function',
|
92
|
+
CSYMBOL_TYPE_STRUCT: 'struct',
|
93
|
+
CSYMBOL_TYPE_UNION: 'union',
|
94
|
+
CSYMBOL_TYPE_ENUM: 'enum',
|
95
|
+
CSYMBOL_TYPE_TYPEDEF: 'typedef',
|
96
|
+
CSYMBOL_TYPE_MEMBER: 'member'}.get(symbol_type)
|
97
|
+
|
98
|
+
|
99
|
+
def ctype_name(ctype):
|
100
|
+
return {
|
101
|
+
CTYPE_INVALID: 'invalid',
|
102
|
+
CTYPE_VOID: 'void',
|
103
|
+
CTYPE_BASIC_TYPE: 'basic',
|
104
|
+
CTYPE_TYPEDEF: 'typedef',
|
105
|
+
CTYPE_STRUCT: 'struct',
|
106
|
+
CTYPE_UNION: 'union',
|
107
|
+
CTYPE_ENUM: 'enum',
|
108
|
+
CTYPE_POINTER: 'pointer',
|
109
|
+
CTYPE_ARRAY: 'array',
|
110
|
+
CTYPE_FUNCTION: 'function'}.get(ctype)
|
111
|
+
|
112
|
+
|
113
|
+
class SourceType(object):
|
114
|
+
__members__ = ['type', 'base_type', 'name', 'type_qualifier',
|
115
|
+
'child_list', 'is_bitfield']
|
116
|
+
|
117
|
+
def __init__(self, scanner, stype):
|
118
|
+
self._scanner = scanner
|
119
|
+
self._stype = stype
|
120
|
+
|
121
|
+
def __repr__(self):
|
122
|
+
return '<%s type=%r name=%r>' % (
|
123
|
+
self.__class__.__name__,
|
124
|
+
ctype_name(self.type),
|
125
|
+
self.name)
|
126
|
+
|
127
|
+
@property
|
128
|
+
def type(self):
|
129
|
+
return self._stype.type
|
130
|
+
|
131
|
+
@property
|
132
|
+
def base_type(self):
|
133
|
+
if self._stype.base_type is not None:
|
134
|
+
return SourceType(self._scanner, self._stype.base_type)
|
135
|
+
|
136
|
+
@property
|
137
|
+
def name(self):
|
138
|
+
return self._stype.name
|
139
|
+
|
140
|
+
@property
|
141
|
+
def type_qualifier(self):
|
142
|
+
return self._stype.type_qualifier
|
143
|
+
|
144
|
+
@property
|
145
|
+
def child_list(self):
|
146
|
+
for symbol in self._stype.child_list:
|
147
|
+
if symbol is None:
|
148
|
+
continue
|
149
|
+
yield SourceSymbol(self._scanner, symbol)
|
150
|
+
|
151
|
+
@property
|
152
|
+
def is_bitfield(self):
|
153
|
+
return self._stype.is_bitfield
|
154
|
+
|
155
|
+
|
156
|
+
class SourceSymbol(object):
|
157
|
+
__members__ = ['const_int', 'const_double', 'const_string', 'const_boolean',
|
158
|
+
'ident', 'type', 'base_type']
|
159
|
+
|
160
|
+
def __init__(self, scanner, symbol):
|
161
|
+
self._scanner = scanner
|
162
|
+
self._symbol = symbol
|
163
|
+
|
164
|
+
def __repr__(self):
|
165
|
+
src = self.source_filename
|
166
|
+
if src:
|
167
|
+
line = self.line
|
168
|
+
if line:
|
169
|
+
src += ':%r' % (line, )
|
170
|
+
return '<%s type=%r ident=%r src=%r>' % (
|
171
|
+
self.__class__.__name__,
|
172
|
+
symbol_type_name(self.type),
|
173
|
+
self.ident,
|
174
|
+
src)
|
175
|
+
|
176
|
+
@property
|
177
|
+
def const_int(self):
|
178
|
+
return self._symbol.const_int
|
179
|
+
|
180
|
+
@property
|
181
|
+
def const_double(self):
|
182
|
+
return self._symbol.const_double
|
183
|
+
|
184
|
+
@property
|
185
|
+
def const_string(self):
|
186
|
+
return self._symbol.const_string
|
187
|
+
|
188
|
+
@property
|
189
|
+
def const_boolean(self):
|
190
|
+
return self._symbol.const_boolean
|
191
|
+
|
192
|
+
@property
|
193
|
+
def ident(self):
|
194
|
+
return self._symbol.ident
|
195
|
+
|
196
|
+
@property
|
197
|
+
def type(self):
|
198
|
+
return self._symbol.type
|
199
|
+
|
200
|
+
@property
|
201
|
+
def base_type(self):
|
202
|
+
if self._symbol.base_type is not None:
|
203
|
+
return SourceType(self._scanner, self._symbol.base_type)
|
204
|
+
|
205
|
+
@property
|
206
|
+
def source_filename(self):
|
207
|
+
return self._symbol.source_filename
|
208
|
+
|
209
|
+
@property
|
210
|
+
def line(self):
|
211
|
+
return self._symbol.line
|
212
|
+
|
213
|
+
@property
|
214
|
+
def private(self):
|
215
|
+
return self._symbol.private
|
216
|
+
|
217
|
+
@property
|
218
|
+
def position(self):
|
219
|
+
return Position(self._symbol.source_filename,
|
220
|
+
self._symbol.line)
|
221
|
+
|
222
|
+
|
223
|
+
class SourceScanner(object):
|
224
|
+
|
225
|
+
def __init__(self):
|
226
|
+
self._scanner = CSourceScanner()
|
227
|
+
self._filenames = []
|
228
|
+
self._cpp_options = []
|
229
|
+
|
230
|
+
# Public API
|
231
|
+
|
232
|
+
def set_cpp_options(self, includes, defines, undefines, cflags=[]):
|
233
|
+
self._cpp_options.extend(cflags)
|
234
|
+
for prefix, args in [('-I', [os.path.realpath(f) for f in includes]),
|
235
|
+
('-D', defines),
|
236
|
+
('-U', undefines)]:
|
237
|
+
for arg in (args or []):
|
238
|
+
opt = prefix + arg
|
239
|
+
if not opt in self._cpp_options:
|
240
|
+
self._cpp_options.append(opt)
|
241
|
+
|
242
|
+
def parse_files(self, filenames):
|
243
|
+
for filename in filenames:
|
244
|
+
# self._scanner expects file names to be canonicalized and symlinks to be resolved
|
245
|
+
filename = os.path.realpath(filename)
|
246
|
+
self._scanner.append_filename(filename)
|
247
|
+
self._filenames.append(filename)
|
248
|
+
|
249
|
+
headers = []
|
250
|
+
for filename in self._filenames:
|
251
|
+
if os.path.splitext(filename)[1] in SOURCE_EXTS:
|
252
|
+
self._scanner.lex_filename(filename)
|
253
|
+
else:
|
254
|
+
headers.append(filename)
|
255
|
+
|
256
|
+
self._parse(headers)
|
257
|
+
|
258
|
+
def parse_macros(self, filenames):
|
259
|
+
self._scanner.set_macro_scan(True)
|
260
|
+
# self._scanner expects file names to be canonicalized and symlinks to be resolved
|
261
|
+
self._scanner.parse_macros([os.path.realpath(f) for f in filenames])
|
262
|
+
self._scanner.set_macro_scan(False)
|
263
|
+
|
264
|
+
def get_symbols(self):
|
265
|
+
for symbol in self._scanner.get_symbols():
|
266
|
+
yield SourceSymbol(self._scanner, symbol)
|
267
|
+
|
268
|
+
def get_comments(self):
|
269
|
+
return self._scanner.get_comments()
|
270
|
+
|
271
|
+
def dump(self):
|
272
|
+
print '-' * 30
|
273
|
+
for symbol in self._scanner.get_symbols():
|
274
|
+
print symbol.ident, symbol.base_type.name, symbol.type
|
275
|
+
|
276
|
+
# Private
|
277
|
+
|
278
|
+
def _parse(self, filenames):
|
279
|
+
if not filenames:
|
280
|
+
return
|
281
|
+
|
282
|
+
defines = ['__GI_SCANNER__']
|
283
|
+
undefs = []
|
284
|
+
cpp_args = os.environ.get('CC', 'cc').split() # support CC="ccache gcc"
|
285
|
+
if 'cl' in cpp_args:
|
286
|
+
# The Microsoft compiler/preprocessor (cl) does not accept
|
287
|
+
# source input from stdin (the '-' flag), so we need
|
288
|
+
# some help from gcc from MinGW/Cygwin or so.
|
289
|
+
# Note that the generated dumper program is
|
290
|
+
# still built and linked by Visual C++.
|
291
|
+
cpp_args = ['gcc']
|
292
|
+
cpp_args += os.environ.get('CPPFLAGS', '').split()
|
293
|
+
cpp_args += os.environ.get('CFLAGS', '').split()
|
294
|
+
cpp_args += ['-E', '-C', '-I.', '-']
|
295
|
+
cpp_args += self._cpp_options
|
296
|
+
|
297
|
+
proc = subprocess.Popen(cpp_args,
|
298
|
+
stdin=subprocess.PIPE,
|
299
|
+
stdout=subprocess.PIPE)
|
300
|
+
|
301
|
+
for define in defines:
|
302
|
+
proc.stdin.write('#ifndef %s\n' % (define, ))
|
303
|
+
proc.stdin.write('# define %s\n' % (define, ))
|
304
|
+
proc.stdin.write('#endif\n')
|
305
|
+
for undef in undefs:
|
306
|
+
proc.stdin.write('#undef %s\n' % (undef, ))
|
307
|
+
for filename in filenames:
|
308
|
+
proc.stdin.write('#include <%s>\n' % (filename, ))
|
309
|
+
proc.stdin.close()
|
310
|
+
|
311
|
+
tmp_fd, tmp_name = tempfile.mkstemp()
|
312
|
+
fp = os.fdopen(tmp_fd, 'w+b')
|
313
|
+
while True:
|
314
|
+
data = proc.stdout.read(4096)
|
315
|
+
if data is None:
|
316
|
+
break
|
317
|
+
fp.write(data)
|
318
|
+
if len(data) < 4096:
|
319
|
+
break
|
320
|
+
fp.seek(0, 0)
|
321
|
+
|
322
|
+
assert proc, 'Proc was none'
|
323
|
+
proc.wait()
|
324
|
+
if proc.returncode != 0:
|
325
|
+
raise SystemExit('Error while processing the source.')
|
326
|
+
|
327
|
+
self._scanner.parse_file(fp.fileno())
|
328
|
+
fp.close()
|
329
|
+
os.unlink(tmp_name)
|