summaryrefslogtreecommitdiff
path: root/tests/scanner/foo.h
Commit message (Collapse)AuthorAgeFilesLines
* Reuse const_table between calls to SourceScanner parse_files and parse_macros.Tomasz Miąsko2018-02-131-0/+1
| | | | | | | | Macro constants may now refer to constants defined in source files. Test case provided by Philip Chimento. Fixes issues #173 and #75.
* tests/scanner: Decorate Symbols for ExportChun-wei Fan2014-08-151-0/+145
| | | | | | | | | | This updates the test headers and sources to decorate the symbols with the macro that can be used to export the symbols, and include config.h first in the c-sources so that the macro can be defined with the compiler directive to export the symbols. Update the CFLAGS as well so that the header that defines the export decoration macro can be found. https://bugzilla.gnome.org/show_bug.cgi?id=732669
* tests: Move do_moo to warnlibJasper St. Pierre2013-02-071-4/+0
| | | | | | | | We want to warn on unnamed params in declarations to ensure that all functions are bindable. Thus, we need to move a test containing unnamed params to WarnLib so it can be tested. https://bugzilla.gnome.org/show_bug.cgi?id=693098
* tests: Move Foo into RegressJasper St. Pierre2013-02-071-219/+219
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=693097
* scanner: allow for functions that look like constructors but aren'tDan Winship2012-05-261-0/+2
| | | | | | | | | | | | If the scanner found a function with _new in its name, but not prefixed by the name of a known type, it would assume that the function was a constructor, and then complain that it couldn't figure out what it was a constructor for, and mark it introspectable=0. Instead, just assume that the function is not actually a constructor in that case (unless it's explicitly tagged as such). https://bugzilla.gnome.org/show_bug.cgi?id=676815
* Fix malformed GTK-Doc comment blocks:Dieter Verfaillie2012-04-051-2/+2
| | | | | | | | | | | | | | | | | - add missing colons - invalid annotations - invalid parameters and tags - correct parameter name - preserve description indentation - no description parts - comment end marker - invalid empty lines - line numbers AnnotationParser now emits warnings which are considered as errors by "make check" so fix those warnings... https://bugzilla.gnome.org/show_bug.cgi?id=672254
* scanner: allow GObject.Object as a superclass return typeDan Winship2011-10-131-1/+2
| | | | | | | 6172c268 made the scanner think GObject* wasn't a superclass of its subclasses. Fix that. https://bugzilla.gnome.org/show_bug.cgi?id=661677
* scanner: handle static methods on all typesTorsten Schönfeld2011-08-131-0/+2
| | | | | | | | | | | | Instead of just handling static methods for classes, handle them for: - Records and boxed - Unions - Interfaces Based on a patch by Owen Taylor. https://bugzilla.gnome.org/show_bug.cgi?id=572408
* Move recently added (skip) tests to the regress moduleDavid Zeuthen2011-05-131-12/+0
| | | | Signed-off-by: David Zeuthen <davidz@redhat.com>
* Add support for the (skip) annotation on parameters or return valuesDavid Zeuthen2011-05-131-0/+12
| | | | | | | | This was discussed in bug 649657. https://bugzilla.gnome.org/show_bug.cgi?id=649657 Signed-off-by: David Zeuthen <davidz@redhat.com>
* Make Full the default transfer for returned foreign structs.Tomeu Vizoso2010-09-171-0/+1
| | | | | | | For that we also need to read the annotations for foreign structs before guessing the transfer mode of return values. https://bugzilla.gnome.org/show_bug.cgi?id=629188
* Foreign structs can have constructorsTomeu Vizoso2010-09-091-0/+2
|
* scanner: Don't mark as constructors things that are more obviously methodsColin Walters2010-09-081-0/+10
| | | | | If the first parameter matches the origin, don't scan as a constructor. Happened in practice with meta_screen_append_new_workspace from mutter.
* scanner: Don't attempt to pair methods/constructors with foreign namespacesColin Walters2010-09-081-0/+4
| | | | See test case, hit in practice in gnome-shell.
* scanner: Readd --warn-error to tests, fix test caseColin Walters2010-09-031-1/+5
| | | | | | | | | Commit b6fb70f9 wrongly disabled fatal warnings - in fact there is a way to make this test case work, and it was a bug in the scanner not processing virtual function annotations correctly. Add a different test case for un-named parameters that doesn't have a callback.
* [scanner] Allow nameless parameters for vfuncsJohan Dahlin2010-09-021-0/+5
| | | | | | | Add a test case and disable fatal warnings since there's currently no way to avoid the warning(s) Fixes https://bugzilla.gnome.org/show_bug.cgi?id=628567
* tests: Move FooSkippable to public headers to test comments in headersColin Walters2010-09-011-1/+8
|
* tests/scanner: Update annotations and testsColin Walters2010-08-311-4/+8
| | | | | | | | | | | | | First of all, add missing (transfer) annotations that will be required by the new scanner. Other changes: Don't use the (type bitfield) hack; the new scanner will not accept it. Use shifts in the flag constants instead. Use typedefs consistently for structures. Drop scanning of anonymous structure/union members.
* Move alias target to <type>Colin Walters2010-08-311-5/+0
| | | | | | | This makes type parsing more uniform. Delete the typedef for GSList in foo.h - that's not supported anymore, or at least for now.
* Add support for the 'foreign' annotation to g-i-scannerGOBJECT_INTROSPECTION_0_6_12Tomeu Vizoso2010-05-231-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=619450
* Add support for GArrays: add g_type_info_get_array_type() and properly scan ↵Tomeu Vizoso2010-05-041-0/+2
| | | | | | | | GArray args Based on a previous patch by C. Scott Ananian <cscott@litl.com> https://bugzilla.gnome.org/show_bug.cgi?id=581687
* Revert "Add support for GArrays: add g_type_info_get_array_type() and ↵Tomeu Vizoso2010-05-031-2/+0
| | | | | | properly scan GArray args" This reverts commit 87291e08b0fd34b62e1ad9811c174108b38311a9.
* Add support for GArrays: add g_type_info_get_array_type() and properly scan ↵Tomeu Vizoso2010-04-301-0/+2
| | | | | | | | GArray args Based on a previous patch by C. Scott Ananian <cscott@litl.com> https://bugzilla.gnome.org/show_bug.cgi?id=581687
* Better scope in GAsyncReadyCallback/GDestroyNotifyJohan Dahlin2009-12-021-0/+10
| | | | | | | | GAsyncReadyCallback should have use the async scope per default and GDestroyNotify should be notified if the previous parameters are a callback and user data. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=602862
* Make (skip) annotation work everywhereDan Winship2009-11-231-0/+2
| | | | | | | | Previously it only worked for toplevel nodes. Now it works for any node except <field>, since skipping a field would cause the description of the struct layout to be wrong. https://bugzilla.gnome.org/show_bug.cgi?id=602652
* Fix enum prefix stripping to work only up to word boundariesDan Winship2009-11-231-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=602672
* When doing type resolution on a string, treat it as its own ctypeColin Walters2009-10-221-0/+3
| | | | | | | | | | Calling _resolve_param_type on a string instead of Node is fairly unusual, and (as far as I could see) basically only happened in the Array processing code. We were passing None as the ctype in this case, but we might as well try using the name as a ctype too. This fixes using GCallback (and in general any item in an array that comes from an included gir).
* Bug 556628 – (skip) annotationDan Winship2009-08-241-0/+7
| | | | | Adds a (skip) option that can be added to the header of any doc comment to cause that symbol to be skipped in the .gir output
* Some small cosmetic tweaksAndreas Rottmann2009-03-191-3/+3
| | | | | | | | | | | * Fix compiler warnings: - Missing return value in annotation-testing code - Fix two function declarations to have a (void) parameter list -- this is not C++ ;-) * Add tools/g-ir-scanner to .gitignore, as it's now generated
* Bug 575613 - Enum stripping with common prefix, also use "_" consistentlyColin Walters2009-03-171-0/+18
| | | | | | | | | | | | | Some enums have members which have a common prefix which doesn't match that of the enum name, but it also longer than the global namespace prefix. Instead, try stripping the common prefix first, and only if that fails fall back to the global strip. Also, for glib-registered enums we were using the nick, which typically has "-" as a separator. Replace that with "_" for consistency between unregistered enums and registered. utils.py:strip_common_prefix is now unused, delete.
* Bug 565147 - Add (type) annotation to override the C type definitionColin Walters2009-03-161-0/+2
| | | | | | We previously supported (type) on signals only, extend it to all cases. This is useful for a few cases where libraries use a superclass like GtkWidget* for C convenience, where the actual type is a subclass.
* Bug 557383 - Virtual method supportColin Walters2009-03-051-1/+16
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Revert "Bug 557383 - Virtual function support"Colin Walters2009-02-261-5/+1
| | | | | | | This reverts commit 4470a24e8cf3827efaddcfe240c3271cf1a0d6c0. Needs more work as it turns out, we need to figure out the binding story.
* Bug 557383 - Virtual function supportColin Walters2009-02-261-1/+5
| | | | | | | In order to determine whether a method is virtual, by default we look at the class table to find a callback field. This should be fairly reliable, but we may also later need annotations to more finely control this in the case of a name clash with a signal.
* Bug 555964 - Parse floating-point #definesColin Walters2009-02-251-0/+2
| | | | | | Previously we just supported int and string, add double to this. Technically we should probably differentiate between float and double, but it's not likely to be very useful in practice to do so.
* Bug 572790 - Don't register #defines from .c files as constantsColin Walters2009-02-241-0/+4
| | | | | We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
* Bug 561604 - Don't fail on va_list*Colin Walters2009-02-231-0/+1
| | | | | gvariant uses va_list *; we were previously skipping va_list, we should skip indirect variants as well.
* Bug 569633 – Typelib compiler fails with vararg callbacksRober Carr2009-02-101-0/+6
| | | | | | | | | | | 2009-02-10 Rober Carr <carrr@rpi.edu> Bug 569633 – Typelib compiler fails with vararg callbacks * girepository/girparser.c: Also filter out callback functions which take vararg arguments. svn path=/trunk/; revision=1095
* Bug 561360 - If we can't resolve parent class, use GObjectColin Walters2009-02-051-0/+10
| | | | | | This enables us to support "hidden" parent classes. svn path=/trunk/; revision=1087
* Bug 561604 - Add test case for skipping va_listColin Walters2009-02-051-0/+3
| | | | svn path=/trunk/; revision=1086
* Undo revision 1075Robert Carr2009-01-291-6/+0
| | | | svn path=/trunk/; revision=1077
* post_filter_varargs_functions should also filter callbacks. Add tests ofRobert Carr2009-01-291-0/+6
| | | | | | | | * girepository/girparser.c: post_filter_varargs_functions should also filter callbacks. * tests/scanner/foo.h: Add tests of varargs callbacks. svn path=/trunk/; revision=1075
* Bug 562622 – Errordomains missingJohan Dahlin2009-01-221-0/+9
| | | | | | | | | | | | | | | | | | 2009-01-21 Johan Dahlin <jdahlin@async.com.br> Bug 562622 – Errordomains missing * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * tests/scanner/Makefile.am: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.c (foo_error_get_type), (foo_error_quark): * tests/scanner/foo.h: svn path=/trunk/; revision=1057
* Bug 563591 – Flags not recognized when there is no introspection dataJohan Dahlin2009-01-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563591 – Flags not recognized when there is no introspection data * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/giscannermodule.c (type_get_is_bitfield): * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/scannerparser.y: * giscanner/sourcescanner.c (gi_source_type_copy): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: Large parts of this patch was done by Jürg Billeter. svn path=/trunk/; revision=1025
* Bug 563794 - Redo annotation parsing & applyingJohan Dahlin2009-01-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563794 - Redo annotation parsing & applying Thanks to Colin for helping out considerably in landing this. * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/dumper.py: * giscanner/girparser.py: * giscanner/giscannermodule.c (pygi_source_scanner_get_comments), (calc_attrs_length), (pygi_collect_attributes), (init_giscanner): * giscanner/glibtransformer.py: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c (gi_source_symbol_unref), (gi_source_scanner_new), (gi_source_scanner_free), (gi_source_scanner_get_comments): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/xmlwriter.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: * tools/g-ir-scanner: This commit merges the annotation parser rewrite branch. It'll change the annotation parsing to be done completely in python code which will make it easier to do further annotation parsing easier. svn path=/trunk/; revision=1017
* Bug 563469 – Arrays not treated correctly in struct offset calculationAndreas Rottmann2009-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | 2009-01-03 Andreas Rottmann <a.rottmann@gmx.at> Bug 563469 – Arrays not treated correctly in struct offset calculation * tests/scanner/foo.h (FooObject): Added field `some_int'. * tests/scanner/foo-1.0-expected.gir, * tests/scanner/foo-1.0-expected.tgir: Adapted. * giscanner/glibtransformer.py (GLibTransformer._create_gobject): carry over object fields from original (struct) node. (GLibTransformer._pair_class_struct): Don't add fields of the class struct to to the node for the class, they should go under a nested <record> element (see also Bug 551738). This is needed as otherwise offset calculation would not work, as the instance fields are mingled with the class fields without a way to distinguish them. svn path=/trunk/; revision=1000
* Bug 559705 – Missing association between static methods and classesColin Walters2008-11-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 2008-11-25 Colin Walters <walters@verbum.org> Bug 559705 – Missing association between static methods and classes * docs/typelib-format.txt: * girepository/ginfo.c (g_function_info_get_flags): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (g_ir_node_get_size), (g_ir_node_build_typelib): * girepository/girparser.c (start_function): * girepository/gtypelib.c (g_typelib_check_sanity), (validate_header), (validate_function_blob): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibtransformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: svn path=/trunk/; revision=972
* Add test for interface prereqColin Walters2008-11-171-0/+19
| | | | svn path=/trunk/; revision=935
* Bug 560241 - Out-arguments should not be marked as being pointers in all casesColin Walters2008-11-161-0/+7
| | | | svn path=/trunk/; revision=927
* Bug 560308 – g-ir-compiler goes in infinite loop on Gdk-2.0.girTommi Komulainen2008-11-111-0/+6
| | | | | | | | | | | | | | | | 2008-11-11 Tommi Komulainen <tommi.komulainen@iki.fi> Based on patch by Johan Bilien. * giscanner/transformer.py (_create_member, _create_parameter): Resolve types here as well. (_resolve_type_name_1): Try resolving using 'ctype' first since it's least ambiguous. Fixes struct member type resolution with similarly named types, e.g. Gdk.PangoRendererClass and Pango.RendererClass * tests/scanner/foo*: Add test. svn path=/trunk/; revision=887