summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.c
Commit message (Collapse)AuthorAgeFilesLines
* scanner: Fix get_symbols/comments to maintain the scanner listsSimon Feltman2014-01-021-2/+16
| | | | | | | | | | | | Use g_slist_copy prior to returning the lists run through g_slist_reverse. This preserves the source scanners internally held lists where previously they would only point to a single element after a call, leaking memory and breaking subsequent calls. Note the functions as (transfer container) and use g_slist_free after calls in the Python bindings. Add new unittest file: test_sourcescanner.py for isolated unittesting of the SourceScanner. https://bugzilla.gnome.org/show_bug.cgi?id=581525
* scanner: Support boolean constantsFlorian Müllner2013-11-291-0/+3
| | | | | | | | Aliasing TRUE or FALSE is not very common, but done occasionally for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are self-explanatory, unlike the "raw" booleans. https://bugzilla.gnome.org/show_bug.cgi?id=719566
* sourcescanner: Removed unused struct_or_union_or_enum_table fieldStef Walter2013-10-211-12/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=710560
* giscanner: Respect __GI_SCANNER__ when scanning for macrosStef Walter2013-10-211-0/+23
| | | | | | | | | When scanning for macros respect ifdefs of __GI_SCANNER__ in the various header files. Only #ifdef and #ifndef are supported. If __GI_SCANNER__ appears in plain #if statements, a warning is printed. https://bugzilla.gnome.org/show_bug.cgi?id=698367
* giscanner: speed up SourceScanner().parse_files()Dieter Verfaillie2013-10-171-31/+14
| | | | | | | | | | | | | | | | | | | Was looking around a bit and noticed about 2/3 of g-ir-scanner time is spent in SourceScanner().parse_files(). Some profiling quickly shows most of that 2/3 is used by gi_source_scanner_add_symbol() where it creates a whole bunch of GFile instances just to compare paths and throw them away again. With this a scanner instance now maintains a hash table of GFile instances instead of a list of file names, so comparing those paths can be reduced to a fast g_hash_table_contains() call. This makes "g-ir-scanner <whole_bunch_of_options> --output Gtk-3.0.gir" complete in about 10 seconds on my box instead of about 30 seconds (both best of 3 runs). https://bugzilla.gnome.org/show_bug.cgi?id=710320
* Revert "sourcescanner: Avoid scanning files when doing a macro scan"Dieter Verfaillie2013-10-171-16/+11
| | | | | | | This reverts commit 77fcc8fa47d63f58b2c3f6216a0493e42f6d44b3. Will be not needed in about 2 patches... https://bugzilla.gnome.org/show_bug.cgi?id=710320
* Revert "sourcescanner: Do some fast path checks on the filename"Dieter Verfaillie2013-10-171-5/+0
| | | | | | | | | This reverts commit 8c0ca4717d834a6c578579656683c55ea22a06f4. The "fast" path doesn't seem to work at all. Testing shows creating Gtk-3.0.gir still takes about 30 seconds with this (even on a Linux box)... https://bugzilla.gnome.org/show_bug.cgi?id=710320
* sourcescanner: Do some fast path checks on the filenameJasper St. Pierre2013-10-151-0/+5
| | | | | | Going through the VFS layer is substantially slower, so check against the base filenames first. This speeds things up on case-sensitive filesystems.
* sourcescanner: Avoid scanning files when doing a macro scanJasper St. Pierre2013-10-151-11/+16
| | | | We already know the condition will be TRUE.
* sourcescanner: Copy over the unsignedness as wellJasper St. Pierre2013-02-181-0/+1
|
* sourcescanner: Make sure to mark constants as setJasper St. Pierre2013-02-181-3/+7
| | | | This fixes complex constants.
* sourcescanner: Fix issues with double constants in the copyJasper St. Pierre2013-02-181-1/+1
|
* sourcescanner: Fix symbolic references in enum membersJasper St. Pierre2013-02-161-0/+20
| | | | | | | We need to copy the source symbols, otherwise we'll overwrite their values. This isn't good. https://bugzilla.gnome.org/show_bug.cgi?id=693939
* Compare filenames using g_file_equal()Johan Dahlin2012-04-091-1/+11
| | | | | | Makes it work on case-sensitive file systems such as HFS+. https://bugzilla.gnome.org/show_bug.cgi?id=667405
* Fix symbols being reported in invalid filesStef Walter2011-08-101-6/+3
| | | | | | | | | | | * Due to the way that flex/bison works, the symbols were being added to the scanner after additional lines are parsed. * If these lines are #line directives, then scanner->current_filename can change between when the symbol is parsed and when it's added. * Change so that symbol gets filename when parsing rather than when being added to the scanner. https://bugzilla.gnome.org/show_bug.cgi?id=650200
* Save the line number of a source commentJohan Dahlin2010-09-191-1/+9
|
* [sourcescanner] Support for line numbers on SymbolAlan Knowles2010-05-251-1/+2
| | | | | Add line numbers to symbols, which can be useful in later stages of the scanner.
* Bug 572790 - Don't register #defines from .c files as constantsColin Walters2009-02-241-0/+6
| | | | | We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
* Bug 563591 – Flags not recognized when there is no introspection dataJohan Dahlin2009-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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-29/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Relicense the giscanner library under LGPLv2+. This has been approved byJohan Dahlin2008-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-11-04 Johan Dahlin <jdahlin@async.com.br> * giscanner/__init__.py: * giscanner/ast.py: * giscanner/cachestore.py: * giscanner/cgobject.py: * giscanner/girparser.py: * giscanner/girwriter.py: * giscanner/giscannermodule.c: * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/libtoolimporter.py: * giscanner/minixpath.py: * giscanner/odict.py: * giscanner/sourcescanner.c: * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/utils.py: * giscanner/xmlwriter.py: * COPYING: Relicense the giscanner library under LGPLv2+. This has been approved by all contributors. svn path=/trunk/; revision=862
* Bug 557786 - support fixed size arraysColin Walters2008-10-251-1/+3
| | | | svn path=/trunk/; revision=814
* Bug 556543 – reduce compiler warningsTommi Komulainen2008-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556543 – reduce compiler warnings * girepository/ginfo.c: * girepository/girepository.c (register_internal, count_interfaces, find_interface, find_namespace_version, parse_version, g_irepository_require): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (init_stats, dump_stats, _g_irnode_init_stats, _g_irnode_dump_stats, g_ir_node_can_have_member): * girepository/girparser.c (firstpass_end_element_handler, locate_gir, parse_basic, parse_type_internal, resolve_aliases, start_alias, start_type, end_type_top, parse_include, cleanup, post_filter): * girepository/gtypelib.c (validate_function_blob, validate_enum_blob): * giscanner/giscannermodule.c (directive_get_options, type_get_child_list): * giscanner/scannerlexer.l (parse_gtkdoc): * giscanner/scannerparser.y (ctype_free): * giscanner/sourcescanner.c: * giscanner/sourcescanner.h (gi_source_scanner_parse_macros): * tests/types/gitesttypes.c: * tools/compiler.c (main): * tools/generate.c (write_repository): Remove unused variables and code, add missing includes, declarations and case statements. svn path=/trunk/; revision=730
* Merge in the gir-compiler branch. Thanks to Philip and Colin for theirJohan Dahlin2008-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-08 Johan Dahlin <johan@gnome.org> * girepository/gtypelib.c (validate_header): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/sourcescanner.c (gi_source_symbol_ref), (gi_source_symbol_unref): * tests/array.test: * tests/boxed.test: * tests/constant.test: * tests/enum.test: * tests/errors.test: * tests/function.test: * tests/gobject.test: * tests/interface.test: * tests/invoke/Makefile.am: * tests/invoke/testfns.xml: * tests/object.test: * tests/parser/Makefile.am: * tests/roundtrips.sh: * tests/struct.test: * tests/types.test: * tests/union.test: * tests/xref1.test: * tests/xref2.test: * tools/Makefile.am: * tools/compiler.c (main): * tools/generate.c (write_callable_info), (write_function_info), (write_repository): * tools/gidlmodule.c: * tools/gidlmodule.h: * tools/gidlnode.c: * tools/gidlnode.h: * tools/gidlparser.c: * tools/gidlparser.h: * tools/gidlwriter.c: * tools/gidlwriter.h: * tools/scanner.c (create_node_from_gtype), (create_node_from_ctype), (g_igenerator_process_properties), (g_igenerator_process_signals), (g_igenerator_create_object), (g_igenerator_create_interface), (g_igenerator_create_boxed), (g_igenerator_create_enum), (g_igenerator_create_flags), (g_igenerator_process_function_symbol), (g_igenerator_process_unregistered_struct_typedef), (g_igenerator_process_struct_typedef), (g_igenerator_process_union_typedef), (g_igenerator_process_enum_typedef), (g_igenerator_process_function_typedef), (g_igenerator_process_constant), (g_igenerator_process_symbols), (g_igenerator_add_module), (g_igenerator_add_include_idl): Merge in the gir-compiler branch. Thanks to Philip and Colin for their help. svn path=/trunk/; revision=325
* Add support for source/header annotations.Johan Dahlin2008-04-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | 2008-04-24 Johan Dahlin <jdahlin@async.com.br> * giscanner/gidlwriter.py: * giscanner/girwriter.py: * giscanner/giscannermodule.c (directive_get_name), (directive_get_value), (directive_get_options), (symbol_get_directives), (symbol_set_directives), (pygi_source_scanner_parse_file), (pygi_source_scanner_lex_filename), (pygi_source_scanner_get_directives), (init_giscanner): * giscanner/sourcescanner.c (gi_source_scanner_get_directives): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/treebuilder.py: * tools/g-ir-scanner: Add support for source/header annotations. svn path=/trunk/; revision=224
* Add simple pre-processor using subprocess and a PIPE. Change theJohan Dahlin2008-03-271-0/+1
| | | | | | | | | | | | | | | 2008-03-27 Johan Dahlin <johan@gnome.org> * giscanner/giscannermodule.c: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c: * tools/g-ir-scanner: Add simple pre-processor using subprocess and a PIPE. Change the parse_file apis to accept a file descriptor. svn path=/trunk/; revision=169
* Add constants and wrap a few more SymbolType fieldsJohan Dahlin2008-03-251-1/+1
| | | | | | | | | | | | | 2008-03-25 Johan Dahlin <johan@gnome.org> * giscanner/__init__.py: * giscanner/giscannermodule.c: * giscanner/sourcescanner.c: * giscanner/sourcescanner.h: Add constants and wrap a few more SymbolType fields svn path=/trunk/; revision=166
* Move the scanner to a separate library.Johan Dahlin2008-03-251-0/+288
2008-03-25 Johan Dahlin <johan@gnome.org> * Makefile.am: * configure.ac: * giscanner/Makefile.am: * giscanner/sourcescanner.c: * giscanner/sourcescanner.h: * tools/Makefile.am: * tools/grealpath.h: * tools/sourcescanner.c: * tools/sourcescanner.h: Move the scanner to a separate library. svn path=/trunk/; revision=164