summaryrefslogtreecommitdiff
path: root/girepository
Commit message (Collapse)AuthorAgeFilesLines
* Bug 563998 – Cache the GIBaseInfo for GTypesJohan Bilien2008-12-101-0/+18
| | | | | | | | | | | | 2008-12-10 Johan Bilien <jobi@via.ecp.fr> Bug 563998 – Cache the GIBaseInfo for GTypes * girepository/girepository.c (g_irepository_find_by_gtype): add a cache of GType -> GIBaseInfo. svn path=/trunk/; revision=991
* Fix memory leak; unref type info we created, not field infoColin Walters2008-12-011-2/+2
| | | | | | | We expect callers to own the FieldInfo, we should not unref it. However we should unref the type info we accessed. svn path=/trunk/; revision=981
* Bug 559705 – Missing association between static methods and classesColin Walters2008-11-256-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove debug printColin Walters2008-11-251-1/+0
| | | | svn path=/trunk/; revision=971
* Bug 561137 - support multiple repositoriesColin Walters2008-11-254-22/+93
| | | | | | | | | | This change makes us stop calling g_irepository_get_default inside ginfo.c, which won't work for non-default repositories. Change GIBaseInfo to not only keep track of its source repository, we hold a reference. This makes memmgt much clearer. svn path=/trunk/; revision=970
* Remove a warning, be less verbose on error on fundamental types.Johan Dahlin2008-11-241-1/+5
| | | | | | | | | | 2008-11-24 Johan Dahlin <jdahlin@async.com.br> * girepository/gdump.c (dump_type): Remove a warning, be less verbose on error on fundamental types. svn path=/trunk/; revision=963
* Use sizeof() instead of hard-coding struct sizesColin Walters2008-11-181-8/+8
| | | | svn path=/trunk/; revision=946
* Add a comment about keeping hardcoded numbers in g_typelib_check_sanityColin Walters2008-11-181-0/+8
| | | | svn path=/trunk/; revision=945
* Add "storage type" to the typelib data for enumsOwen Taylor2008-11-187-14/+172
| | | | | | | | | | | | | | | | | | | | | In order to set and get enum and flag fields in structures, we need to know the integral type that the enumeration is stored as. We are already computing that at compile time in order to compute struct offsets, so the easiest thing to do is to save that in the typelib. * docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob and compute and save it at compile time. * girepository/girepository.h girepository/ginfo.c: Add g_enum_info_get_storage_type(). * girepository/gfield.c: Implement reading and writing enum and flags fields based on the storage type. http://bugzilla.gnome.org/show_bug.cgi?id=561296 svn path=/trunk/; revision=944
* Ensure we always call init_globalsColin Walters2008-11-171-6/+5
| | | | svn path=/trunk/; revision=938
* g_irepository_get_default is (transfer none)Colin Walters2008-11-171-1/+1
| | | | svn path=/trunk/; revision=937
* Bug 559706 - Interface prerequisitesColin Walters2008-11-171-1/+5
| | | | svn path=/trunk/; revision=936
* Add test for interface prereqColin Walters2008-11-171-1/+1
| | | | svn path=/trunk/; revision=935
* Bug 559706 - interface prequisitesColin Walters2008-11-172-30/+28
| | | | svn path=/trunk/; revision=932
* Respect is_pointer in serialize_type()Owen Taylor2008-11-161-2/+4
| | | | | | | | | | | Add a '*' to the serialization for the cases where we set is_pointer in the type blob we write out depending on node->is_pointer. Don't add the '*' in the cases where is_pointer is set or not set in a fixed fashion. http://bugzilla.gnome.org/show_bug.cgi?id=561087 svn path=/trunk/; revision=931
* Bug 560825 – Add size and alignment to typelibOwen Taylor2008-11-166-18/+70
| | | | | | | | | | | | | | | | Include the size and alignment of structures and unions in the typelib, and add getter methods to retrieve them from GIStructInfo/GIUnionInfo. * docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c girepository/girmodule.c girepository/gtypelib.c: Add size and alignment to StructBlob and UnionBlob. * girepository/ginfo.c girepository/girepository.h: Add g_[struct|union]_get[size|alignment](). * test/offsets/gen-gitestoffsets: Test overall structure size and alignment. svn path=/trunk/; revision=930
* Bug 552371 – implement struct field get/setOwen Taylor2008-11-163-0/+315
| | | | | | | | Add convenience functions g_field_info_set_field() and g_field_info_get_field() to set and get fields based on the offsets in GIFieldInfo. svn path=/trunk/; revision=929
* 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 557788 - Return types for constructors in generated typelib bogusColin Walters2008-11-131-1/+5
| | | | svn path=/trunk/; revision=920
* girepository/girffi.c: Fix "Unexpected time for time_t" message.Owen Taylor2008-11-131-1/+1
| | | | svn path=/trunk/; revision=919
* Remove processing msgColin Walters2008-11-131-1/+0
| | | | svn path=/trunk/; revision=915
* Add new files from last commitColin Walters2008-11-131-0/+386
| | | | svn path=/trunk/; revision=913
* g_irepository_dump implementationColin Walters2008-11-133-2/+33
| | | | svn path=/trunk/; revision=911
* 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-123-71/+123
| | | | | | | | | | | | | 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-122-31/+94
| | | | | | | | 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
* Fix minor memory leak.Tommi Komulainen2008-11-121-1/+2
| | | | | | | | | 2008-11-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girepository.c (find_namespace_latest): Fix minor memory leak. svn path=/trunk/; revision=899
* Change the element type from utf8 to filename Special case filenameJohan Dahlin2008-11-122-2/+3
| | | | | | | | | | | | 2008-11-12 Johan Dahlin <jdahlin@async.com.br> * girepository/girepository.c: Change the element type from utf8 to filename * girepository/girnode.c (g_ir_node_build_typelib): Special case filename equally to utf8 here. svn path=/trunk/; revision=895
* Add a g_irepository_get_search_path, so we can access the search pathsJohan Dahlin2008-11-122-0/+16
| | | | | | | | | | | | 2008-11-12 Johan Dahlin <jdahlin@async.com.br> * girepository/girepository.c (g_irepository_get_search_path): * girepository/girepository.h: Add a g_irepository_get_search_path, so we can access the search paths from runtime. svn path=/trunk/; revision=893
* 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
* Compute field offsets and overall size for object structuresOwen Taylor2008-11-112-0/+24
| | | | | | | | | | | | | | | 2008-11-11 Owen Taylor <otaylor@redhat.com> Compute field offsets and overall size for object structures Bug 560326 – Fails to build Gtk-2.0.typelib with "Unexpected non-pointer field of type object in structure" Do basic computation of field offsets for objects and interfaces; this doesn't attempt to address all of the "mess" for virtual functions described in Bug 560281. svn path=/trunk/; revision=888
* 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
* Include fully-qualified names in all error messages.Owen Taylor2008-11-111-18/+26
| | | | | | | | | 2008-11-11 Owen Taylor <otaylor@redhat.com> * girepository/giroffsets.c: Include fully-qualified names in all error messages. svn path=/trunk/; revision=884
* Fail gracefully with an informative error message when recursion isOwen Taylor2008-11-111-5/+29
| | | | | | | | | | 2008-11-11 Owen Taylor <otaylor@redhat.com> * girepository/giroffsets.c: Fail gracefully with an informative error message when recursion is encountered when computing a structure size. svn path=/trunk/; revision=882
* 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 560252 - Compute field offsets before writing typelibOwen Taylor2008-11-114-1/+436
| | | | | | | | | | | | | | | | | girnode.h: Store the total size and alignment for GIrNodeStruct/Boxed/Union. giroffset.c: New file implementing computation of structure field offsets. girnode.c: Compute structure field offsets before writing types into the typelib. docs/typelib-format.txt: Document that a field offset of 0xFFFF means "unknown". Also fix description of the discriminator_offset field for unions. svn path=/trunk/; revision=876
* Bug 560250 - Fully parse included modulesOwen Taylor2008-11-115-22/+177
| | | | | | | | | | | 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
* Split g_ir_ffi_get_ffi_type() out from ginvoke.cOwen Taylor2008-11-114-72/+139
| | | | | | | | | | Extract a function to convert GITypeTag to ffi_type from the internals of ginvoke.c. This will be useful in figure out structure alignment. Also fix handling of gsize and time_t to be portable. (Add a check to configure.ac to figure out the width of time_t.) svn path=/trunk/; revision=873
* Bug 560248 – "disguised structures"Owen Taylor2008-11-102-0/+45
| | | | | | | | | | | | | | 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
* Don't use nested scope local variable for errorColin Walters2008-11-051-4/+3
| | | | svn path=/trunk/; revision=864
* Bug 557898 – Fails to build on OSX 10.4Tommi Komulainen2008-11-011-5/+0
| | | | | | | | | | | | 2008-11-01 Tommi Komulainen <tommi.komulainen@iki.fi> * configure.ac: Check for $shrext_cmds that should be implicitly available if you're using libtool >= 2.0. If undefined, call libtool --config explicitly to get its value. * girepository/gtypelib.c: Remove special case for (non-)Darwin systems as unneeded. svn path=/trunk/; revision=859
* Bug 558068 – when invoking a method, offset the in arguments by one, notJohan Bilien2008-10-271-1/+1
| | | | | | | | | | | | | | | 2008-10-27 Johan Bilien <jobi@via.ecp.fr> Bug 558068 – when invoking a method, offset the in arguments by one, not the out * tests/invoke/invoke.c, tests/invoke/testfns.c, tests/invoke/testfns-1.0.gir: Add testing of method and constructor. * girepository/ginvoke.c: do not offset the index of given out arguments by one for methods, "this" is provided as in argument only. svn path=/trunk/; revision=820
* Bug 557791 – g_irepository_require() could return a GTypelib *Colin Walters2008-10-252-9/+10
| | | | svn path=/trunk/; revision=816
* Bug 557786 - support fixed size arraysColin Walters2008-10-256-4/+44
| | | | svn path=/trunk/; revision=814
* Bug 557076 - move typelibs to $libdirColin Walters2008-10-251-8/+8
| | | | svn path=/trunk/; revision=813
* Be quiet, do not warn about unhandled members.Johan Dahlin2008-10-241-3/+5
| | | | | | | | | | 2008-10-24 Johan Dahlin <johan@gnome.org> * girepository/girnode.c (g_ir_node_check_unhandled_members): Be quiet, do not warn about unhandled members. svn path=/trunk/; revision=811