summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 559705 – Missing association between static methods and classesColin Walters2008-11-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | svn path=/trunk/; revision=935
* Bug 559706 - interface prequisitesColin Walters2008-11-171-29/+22
| | | | svn path=/trunk/; revision=932
* Bug 560241 - Out-arguments should not be marked as being pointers in all casesColin Walters2008-11-161-9/+17
| | | | svn path=/trunk/; revision=928
* Bug 560419 – Cache includes when parsingOwen Taylor2008-11-121-2/+12
| | | | | | | | Keep track of all modules parsed within a GIrParser, and when a module is referenced a second time, use the existing parsed copy instead of reparsing. svn path=/trunk/; revision=906
* Fix management of ParseContext.includes_modules (#560419)Owen Taylor2008-11-121-3/+8
| | | | | | | Fix some trivial bugs in managing the list of include modules. (Add to module's list twice, not initialized to NULL, not freed.) svn path=/trunk/; revision=905
* Keep aliases and disguised_structures local to each module (#560419)Owen Taylor2008-11-121-69/+69
| | | | | | | | | | | | | When parsing, keep keep a separate hash tables of aliases and 'disguised' flags for each module, and store that on the module. After parsing an include merge the aliases/disguised flags to the including module. Remove 'prefix_aliases' flag and always prefix aliases/disguised structure types when parsing; this simplifies the code considerably. svn path=/trunk/; revision=904
* Only allow one <namespace/> element per <repository/> (#560419)Owen Taylor2008-11-121-1/+23
| | | | | | | | | | | The logic in girparser.c didn't work very well if there were multiple <namespace/> nodes within a single <repository/> (context->namespace was always the overall filename and not the the name specified in the <namespace/> element for one thing; this would cause aliases to be mis-prefixed in include modules.) Also check that the "name" in the <namespace/> node matches the filename. svn path=/trunk/; revision=902
* Add a GirParser object to hold the state of a compilationOwen Taylor2008-11-121-21/+79
| | | | | | | | Add a toplevel GirParser object to hold state that is global across a compilation. Currently just holds the include path, but will eventually also keep a cached list of parsed modules. svn path=/trunk/; revision=901
* Bug 560474 – g-ir-compiler crashes when compiling the glib girJohan Bilien2008-11-121-1/+1
| | | | | | | | | | | 2008-11-12 Johan Bilien <jobi@via.ecp.fr> Bug 560474 – g-ir-compiler crashes when compiling the glib gir * girepository/girparser.c: avoid freeing an uninitialized pointer svn path=/trunk/; revision=891
* Bug 560404 – Prefix types when resolving aliases in included modulesOwen Taylor2008-11-111-7/+27
| | | | | | | * girepository/girparser.c: When resolving aliases in an included module, prefix types before looking them up. svn path=/trunk/; revision=889
* Search provided include dirs before the default directories.Owen Taylor2008-11-111-8/+8
| | | | | | | | | 2008-11-11 Owen Taylor <otaylor@redhat.com> * girepository/girparser.c: Search provided include dirs before the default directories. svn path=/trunk/; revision=885
* girepository/girparser.c: Remove an unused variable.Owen Taylor2008-11-111-1/+0
| | | | svn path=/trunk/; revision=879
* Remove field offsets from g-ir-generate output and test inputsOwen Taylor2008-11-111-6/+0
| | | | | | | | | | | Field offsets are a) architecture dependent so they shouldn't be part of the architecture-independent gir format which is installed in datadir. b) Are architecture-dependent so they shouldn't be in test expected output. Remove field offsets from girs. (Virtual function and discriminator offsets are not removed, as they aren't fully hooked up to the field-offset computation machinery yet.) svn path=/trunk/; revision=877
* Bug 560250 - Fully parse included modulesOwen Taylor2008-11-111-22/+78
| | | | | | | | | | | For some things, like computing structure offsets to put into the typelib we need more than just the aliases from included modules. Do a completel parse of included modules and store in module->included_modules. Also add g_ir_find_node() to find node information from within the active set of modules and their includes. svn path=/trunk/; revision=874
* Bug 560248 – "disguised structures"Owen Taylor2008-11-101-0/+44
| | | | | | | | | | | | | | Certain types like GIConv and GdkAtom are pointers internally but don't look like pointers when referenced. They have the form. typedef struct _X *X; Parse these as structures/records but mark them in the gir with a 'disguised' attribute so that we know that they need special handling. In the typelib treat them like any other structure. svn path=/trunk/; revision=872
* Bug 557786 - support fixed size arraysColin Walters2008-10-251-1/+6
| | | | svn path=/trunk/; revision=814
* Bug 556739 – transfer-ownership attribute should be mandatory in .girTommi Komulainen2008-10-231-14/+12
| | | | | | | | | | | | | | | | | | | | | | | 2008-10-23 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer): * giscanner/transformer.py (_create_parameter, _create_return): * giscanner/girwriter.py (_write_return, _write_parameter): * tools/generate.c (write_callable_info): always write and require "transfer-ownership" for return-values and parameters * tests/boxed.gir: * tests/invoke/testfns-1.0.gir: * tests/object.gir: * tests/scanner/DrawableAdditions.xml: * tests/scanner/GtkFrob-1.0-expected.tgir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/drawable-1.0-expected.tgir: * tests/scanner/drawable-injected-1.0-expected.gir: * tests/scanner/drawable-injected-1.0-expected.tgir: * tests/scanner/foo-1.0-expected.tgir: Updated svn path=/trunk/; revision=797
* fix some build warnings.Lucas Rocha2008-10-221-0/+1
| | | | | | | | | 2008-10-22 Lucas Rocha <lucasr@gnome.org> * girepository/girmodule.c, girepository/gtypelib.c, girepository/girparser.[ch]: fix some build warnings. svn path=/trunk/; revision=783
* Bug 557405 – Use 'allow-none' consistentlyTommi Komulainen2008-10-221-5/+5
| | | | | | | | | | | | | | | | | | 2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * docs/typelib-format.txt: * girepository/ginfo.c (g_arg_info_may_be_null): * girepository/girnode.c (g_ir_node_build_typelib): * girepository/girnode.h (struct _GIrNodeParam): * girepository/girparser.c (start_parameter): * girepository/girwriter.c (function_generate): * girepository/gtypelib.h (ArgBlob): * tests/errors.gir: * tests/function.gir: * tools/generate.c (write_callable_info): Use 'allow-none' consistently throughout svn path=/trunk/; revision=782
* Bug 557241 – "throws" flag for functionsJohan Bilien2008-10-211-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-21 Johan Bilien <jobi@via.ecp.fr> Bug 557241 – "throws" flag for functions * tests/scanner/drawable-1.0-expected.gir, tests/scanner/drawable-injected-1.0-expected.gir, tests/scanner/drawable.[ch]: add simple test for throwing function (has GError ** as last argument) * giscanner/ast.py: add a 'throws' flag to Function * giscanner/glibtransformer.py: if a function's last paramerter is a GError, set the 'throws' flag and remove that parameter * giscanner/girwriter.py: write out the 'throws' attribute * giscanner/girparser.py: support parsing the 'throws' attribute * tests/repository/gitestthrows.c: add a simple test to check the throws flag in a typelib and invoke the function * girepository/ginfo.c, girepository/girnode.[ch], girepository/girnode.h, girepository/girparser.c, girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag * girepository/ginvoke.c: if a function throws, add a GError as last arguments, and propagate the error to the invoker. svn path=/trunk/; revision=773
* Bug 557011 - Add g_object_info_get_abstractColin Walters2008-10-201-1/+5
| | | | svn path=/trunk/; revision=757
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-1/+1
| | | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * girepository/girparser.c (start_parameter): * tests/boxed.gir: * tests/invoke/testfns-1.0.gir: * tools/generate.c (write_callable_info): write 'transfer-ownership' attribute consistently with both return-value and parameter elements svn path=/trunk/; revision=745
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * giscanner/ast.py (Field): add readable and writable properties * giscanner/girparser.py (_parse_field): copy 'readable' and 'writable' attributes * giscanner/transformer.py (_create_member): create fields as read-write * giscanner/glibtransformer.py (_introspect_object, _pair_class_struct): make object instance and class fields read-only * giscanner/girwriter.py (_write_field): * tools/generate.c (write_field_info): write field 'readable' and 'writable' attributes only if non-default (read-only) * girepository/girparser.c (start_field): in the absence of attributes assume fields are read-only * tests/boxed.gir: * tests/struct.gir: remove redundant readable="1" from fields * tests/scanner/foo-1.0-expected.gir: * tests/scanner/utility-1.0-expected.gir: add writable="1" to all record and union fields svn path=/trunk/; revision=743
* Bug 556543 – reduce compiler warningsTommi Komulainen2008-10-161-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 branch 'bug556331-includecleanup'Colin Walters2008-10-161-7/+15
| | | | svn path=/trunk/; revision=724
* Bug 556174 – parse types for lists etc.Tommi Komulainen2008-10-151-12/+15
| | | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556174 – parse types for lists etc. * girepository/girparser.c (end_type_recurse): * tests/boxed.gir: * tools/generate.c (write_type_info, write_field_info, write_callable_info, write_callable_info, write_constant_info, write_property_info): use nested <type>s for lists and hashes svn path=/trunk/; revision=717
* Bug 556400 – Fails to build on OS X 10.4Tommi Komulainen2008-10-151-1/+1
| | | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556400 – Fails to build on OS X 10.4 * configure.ac: check for functions backtrace and backtrace_symbols * girepository/girparser.c (backtrace_stderr): Comment out implementation if the functions are not available. * gcov.mak (clean-gcov, clean-gcno): always call 'find' with a directory for better portability svn path=/trunk/; revision=711
* handle "transfer-ownership" attributeTommi Komulainen2008-10-121-0/+4
| | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (start_return_value): handle "transfer-ownership" attribute svn path=/trunk/; revision=690
* use "container" for container/shallow ownership transfer (not "shallow")Tommi Komulainen2008-10-121-1/+1
| | | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer): * tools/generate.c (write_callable_info): use "container" for container/shallow ownership transfer (not "shallow") svn path=/trunk/; revision=689
* Refactor handling of transfer=none/shallow/full to separate functionTommi Komulainen2008-10-121-26/+32
| | | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer, start_parameter): Refactor handling of transfer=none/shallow/full to separate function svn path=/trunk/; revision=688
* Bug 552858: versioningColin Walters2008-10-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big patch. You should probably remove your installation tree to be cleaner. * docs/typelib-format.txt: Add nsversion entry which holds version of namespace. * girepository/girepository.h: Add 'version' parameter to g_irepository_require. This may be NULL. Normally bindings should pass an explicit version though. * girepository/girepository.c: Lots of infrastructure to support versioning. Add some more documentation. Disallow some usage of NULL namespaces. * girepository/girmodule.c: Add version parameter. * girepository/gtypelib.c: Update header size. * giscanner/ast.py: Add version to Namespace. * giscanner/girparser.py: Parse version attribute from XML, pass to Namespace. * giscanner/girwriter.py: Write out version parameter. * giscanner/transformer.py: Clean up include registration. * tests/*: Add version attribute. * tests/invoke/invoke.c: Don't try looking up test before it's loaded in repository. * tools/generate.c: Output version parameter. * gir/Makefile.am: Add 2.0 version to .gir files. svn path=/trunk/; revision=677
* Remove debug printColin Walters2008-10-021-1/+0
| | | | svn path=/trunk/; revision=644
* Merge branch 'bug552393-varargs'Colin Walters2008-10-021-35/+147
| | | | svn path=/trunk/; revision=643
* Bug 554632: Create type tag for GTypeColin Walters2008-10-021-6/+16
| | | | svn path=/trunk/; revision=641
* Ensure we always have types for container nodesColin Walters2008-09-291-3/+7
| | | | svn path=/trunk/; revision=638
* Rework to use recursive XMLColin Walters2008-09-291-127/+133
| | | | svn path=/trunk/; revision=637
* Remove non-repository types from GIRColin Walters2008-09-251-38/+0
| | | | | | | | | | * giscanner/ast.py: The canonical name is 'utf8', not 'string'. * giscanner/glibast.py: A few more glib type mappings. * girepository/girparser.c: We only parse repository types. * tests/*.gir: Update. svn path=/trunk/; revision=628
* Merge branch 'bug552566-timet/wip'Colin Walters2008-09-231-0/+1
| | | | svn path=/trunk/; revision=624
* Bug 552065: Add deprecation information to GIRColin Walters2008-09-151-10/+10
| | | | | | | | | | | | | * giscanner/ast.py: Add deprecation attributes. * giscanner/girwriter.py: Write out deprecation data. * girepository/girparser.c: Relax parsing; deprecated attribute now includes freeform string. * giscanner/scannerlexer.l: Parse Deprecated. * giscanner/transformer.py: Look for deprecated attribute on functions. * tests/scanner/*: Add a Deprecated test. svn path=/trunk/; revision=603
* Write out and parse full GObject property information (readable, writable, etc)Colin Walters2008-09-081-1/+2
| | | | | | | | | | * girepository/girparser.c: Default to "readable" for properties. * giscanner/ast.py: Add readable, writable etc. * giscanner/girwriter.py: Writ them. * giscanner/glibtransformer.py: Inspect them. * tests/*: Update. svn path=/trunk/; revision=587
* Allow both union and struct to be boxed or notColin Walters2008-09-061-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | * girepository/girnode.c: Allow gtype_name and gtype_init in struct and union. * girepository/girparser.c: Parse glib: boxed bits for both structure and union. * girepository/gtypelib.c: Don't barf if structure is boxed. * giscanner/girparser.py: Parse new XML format. * giscanner/girwriter.py: Write out new XML format. * giscanner/glibast.py: Define new classes which are both Boxed and Struct/Union, as well as an "Other" for everything else. * giscanner/glibtransformer.py: Handle boxed types specially; we try to merge them with a struct/union if one exists, otherwise fall back to generic boxed. * tests/*: Update. * tools/generate.c: Write out new format. svn path=/trunk/; revision=575
* Look in c:type to determine pointer natureColin Walters2008-09-011-16/+19
| | | | | | | * girepository/girparser.c: Look at c:type to determine whether or not an item is a pointer. svn path=/trunk/; revision=571
* Don't lose if we have no includedirsColin Walters2008-08-311-6/+9
| | | | | | | * girepository/girparser.c: Don't lose if we have no includedirs svn path=/trunk/; revision=551
* Put dependencies in typelibs, resolve them when loadingColin Walters2008-08-301-0/+6
| | | | | | | | | | | | | | | | | | | * gir/Makefile.am: Dep on Makefile * girepository/ginfo.c: Print out a nicer error message if we failed to load something. * girepository/girepository.c: Clean up default typelib handling; remove global default_typelib variable. Ensure we handle NULL repository in more places. Support dependency resolution. * tests/Makefile.am: Kill off gobject.gir, it conflicts with the real one. * tests/Object.gir: Depend on GObject. * tools/generate.c: Take --includedir argument to say which directories to search for typelibs. Print out dependencies. svn path=/trunk/; revision=541
* Handle alias chains correctlyColin Walters2008-08-291-5/+20
| | | | | | | | * girepository/girparser.c: Handle chains of aliases across modules by ensuring we fully qualify aliases from includes. svn path=/trunk/; revision=531
* Avoid searching aliases for basic typesColin Walters2008-08-291-34/+55
| | | | | | | * girepository/girparser.c: Don't search aliases for basic types. svn path=/trunk/; revision=529
* Fix type parsing for both GLib case and GLib.ListColin Walters2008-08-291-106/+114
| | | | | | | | | * girepository/girparser.c: Rewrite type parsing to handle both GLib parsing case as well as correctly handling GLib.List and friends. Don't try to treat e.g. ListStore as a List. svn path=/trunk/; revision=527
* Correctly handle GLib.List, GLib.Error etcColin Walters2008-08-291-8/+20
| | | | | | | | | | * girepository/girparser.c: Accept both List (for compiling GLib) and GLib.List (what the scanner generates). * tests/ - Update. * tools/generate.c: Generate canonical form. svn path=/trunk/; revision=522
* Fix --includedir handlingColin Walters2008-08-281-9/+16
| | | | | | | | | | | * tests/scanner/Makefile.am: Pass the right --includedir args. Add a Makefile dep. * tools/compiler.c: Pass includedirs down. * girepository/girparser.c: Actually put includedirs in context, pass down. Fix locate_gir. svn path=/trunk/; revision=514