summaryrefslogtreecommitdiff
path: root/girepository/girepository.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "libgirepository: Refuse to run in setuid applications"Colin Walters2015-12-091-13/+0
| | | | | | | | | | | | This reverts commit 98bb6c91b710a95efe4cfeb303daeec3381b9c98. It breaks programs simply executed *transitively* from a setuid binary like the dbus daemon launch helper. https://bugzilla.redhat.com/show_bug.cgi?id=1285991 Conflicts: girepository/girepository.c
* girepository: Fix memory leak in g_irepository_get_dependencies()Garrett Regier2015-11-201-3/+5
| | | | | | The transitive_dependencies GHashTable was being leaked. https://bugzilla.gnome.org/show_bug.cgi?id=758448
* girepository: Add missing includeColin Walters2015-09-261-0/+1
| | | | For previous commit.
* libgirepository: Refuse to run in setuid applicationsColin Walters2015-09-241-0/+12
| | | | | | | | We know of at least one privilege escalation path via `GI_TYPELIB_PATH`. I don't want to audit for others. If someone shows up with a use case we can talk. https://bugzilla.gnome.org/show_bug.cgi?id=755472
* girepository: Remove "optimization" for found prefixesJasper St. Pierre2015-07-271-11/+0
| | | | | | | | | | | | | | | This optimization is bugged and broken in the case of certain libraries. GNOME uses a lot of prefixes with "G", so we'll almost always have found the prefix. This is specifically a problem for something like GXml.xDocument, which uses a type name starting with a lower-case letter, which fools the prefix logic, but we're also fooled by the "G" appearing in GLib and Gio. A more sophisticated version of this check would have three passes: check prefix with type-case, check prefix without type-case, global search, but this is an edge case and it doesn't feel worth it to write.
* scanner/girepository: remove GdkRectangle->CairoRectangleInt automatic ↵Lionel Landwerlin2015-05-111-12/+0
| | | | | | conversion https://bugzilla.gnome.org/show_bug.cgi?id=748832
* Fix docs for g_irepository_get_shared_library()Garrett Regier2015-03-101-5/+6
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=744536 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* girepository: Add g_irepository_get_immediate_dependencies()Philip Withnall2015-02-161-7/+110
| | | | | | | | | | | | | | | | g_irepository_get_dependencies() is supposed to return the transitive closure of all dependencies of the given namespace. However, it just loads the dependencies field from the typelib, which is supposed to only list immediate dependencies. Introduce a new g_irepository_get_immediate_dependencies() which does this, and rewrite g_irepository_get_dependencies() to build the transitive closure of all its namespace dependencies. This does not require loading any new typelibs, as the transitive closure of dependencies should already have been loaded by g_irepository_require() or g_irepository_load_typelib(). https://bugzilla.gnome.org/show_bug.cgi?id=743782
* girepository: Fix NULL return from g_irepository_get_dependencies()Philip Withnall2015-02-161-1/+9
| | | | | | | If a typelib had no dependencies, g_irepository_get_dependencies() would return NULL, rather than an empty NULL-terminated vector. https://bugzilla.gnome.org/show_bug.cgi?id=743782
* girepository: Include config.h First in All SourcesChun-wei Fan2014-07-071-3/+2
| | | | | | | | | This includes config.h in all the C-sources of girepository so that we can get the correct export directive from config.h during compile time and therefore export the symbols as necessary, like what GLib and GTK+ is currently doing. https://bugzilla.gnome.org/show_bug.cgi?id=732669
* docs: fix up reference docs a bitDieter Verfaillie2013-10-101-30/+75
| | | | | | | | | | | | | - require GTK-Doc 1.19 - remove sgml mode - automatically generate gi.types (needs GTK-Doc 1.19) - fix https://bugzilla.gnome.org/show_bug.cgi?id=700025 [WIP] - rearange sections a bit [WIP] - add gi-building, gi-programming sections [WIP] - mark missing docs with TODO, which is only marginaly better than nothing but at least can be grepped :) https://bugzilla.gnome.org/show_bug.cgi?id=571648
* girepository: remove glib-compatDieter Verfaillie2013-10-091-1/+0
| | | | | We depend on glib-2.0 >= 2.36.0, so no need to keep a 2.22.X compatibility symbol around...
* Optimize g_irepository_find_by_gtypeDaniel Drake2013-04-081-34/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | When g_irepository_find_by_gtype() doesn't succeed on a simple prefix match (the current 'fastpass' mechanism), it ends up taking a considerable amount of CPU time, traversing the contents of all typelibs. I imagine that the reasons to have the exhaustive search fallback are not as strong as they used to be. For example, the case mentioned (Clutter including Cogl) no longer seems to be true. Also, typelibs (as generated by g-ir-scanner) now provide comma-separated C prefix info for cases when the typelib includes introspection info for multiple prefixes. For example, the Sugar typelib has a c_prefix string of Sugar,EggSM,Gsm,Acme. So I imagine there are not many remaining justified cases where the exhaustive search is needed. With that in mind, I found two ways to optimize this function: 1. Support comma-separated C prefixes 2. Don't bother with an exhaustive search if we did find a typelib claiming support for the prefix. For example, if we're looking for GdkDeviceManagerXI2 (currently non-introspectable) and we already found typelib files providing the 'Gdk' prefix that didn't offer this, lets not bother with the exhaustive search, we aren't going to find anything.
* repo: Drop deprecated GStaticMutex usageColin Walters2012-12-171-6/+6
| | | | In favor of GOnce, since we just want initialize-once semantics.
* Make introspection compile with -Wall -WerrorJohan Dahlin2012-04-091-2/+0
| | | | | Address all gcc warnings, -Werror is not enabled yet but at least -Wall -Werror passes on my machine.
* Fix malformed GTK-Doc comment blocks:Dieter Verfaillie2012-04-051-3/+3
| | | | | | | | | | | | | | | | | - 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
* Plug memory leak in lazy typelibs hash tableJesse van den Kieboom2012-02-051-1/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=669317
* Add Emacs mode lines to C sourcesColin Walters2012-02-031-2/+2
|
* repository: Fix g_irepository_get_c_prefix()Colin Walters2011-09-211-1/+1
| | | | | | It was returning the wrong data. https://bugzilla.gnome.org/show_bug.cgi?id=659749
* Windows port: compute GOBJECT_INTROSPECTION_LIBDIR at runtime.Dieter Verfaillie2011-09-071-0/+33
| | | | | | | | | | | Otherwise, we fail to properly locate the typelibs, because on Windows the value of GOBJECT_INTROSPECTION_LIBDIR depends on where Glib has been installed. Due to the nature of how we handle software that depends on Glib on Windows (it is recommended that each program bundles it's private copy), we're working in a "multi-prefixed" environment. Hence the value computed at build time will most likely not even exist at runtime. https://bugzilla.gnome.org/show_bug.cgi?id=620566
* Add g_irepository_find_by_error_domain()Dan Winship2011-08-121-0/+83
| | | | | | | | Add a method to look up a GIEnumInfo given its associated error quark. Based on a patch from Colin Walters. https://bugzilla.gnome.org/show_bug.cgi?id=602516
* Deprecate ErrorDomainDan Winship2011-08-121-2/+0
| | | | | | | | | | | | | | The previous ErrorDomain blob was never actually scanned or used, and it was kind of a lame API conceptually. To keep some compatibility, rather than removing the enumeration values, rename them to _INVALID, and don't bump the typelib version. This should in theory allow a new libgirepository to read an old typelib. Based on a patch from Colin Walters https://bugzilla.gnome.org/show_bug.cgi?id=602516
* girepository: fix some doc comment syntaxDan Winship2011-08-121-6/+6
|
* Add support for gunichar in typelibColin Walters2010-11-121-0/+2
| | | | | | | Some API such as gtk_text_iter_get_char returns an individual "gunichar"; we should support this. https://bugzilla.gnome.org/show_bug.cgi?id=633197
* Fix regression in g_irepository_get_infoColin Walters2010-10-211-2/+4
| | | | | | | Commit f97cc8687469f25752f79275 broke the lookup in g_irepository_get_info; the passed offset is 0-based, then we convert it to 1-based (and then back to 0 later...which needs to be fixed).
* girepository: Refactor lookup codeColin Walters2010-10-181-146/+69
| | | | | | | | | | | This is a cleanup patch in preparation for future indexing patches. The lookup code was a mess trying to mash in the 3 different cases of name, GType, and index into one mega-function. Split it up properly, and move the core typelib internal-scanning bits into gitypelib.c where it belongs.
* Fix memory leak.Pavel Holejsovsky2010-09-251-2/+8
|
* Update annotations for GIRepository.Repository.Pavel Holejsovsky2010-09-151-13/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=628753
* [girepository] Document GIStructInfo & GIUnionInfoPavel Holejsovsky2010-09-051-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=628753
* girepository: Call init_globals()Colin Walters2010-09-021-11/+13
| | | | | This fixes the search path initialization if g_irepository_require is called first thing.
* [GIRepository] Rename GTypelib to GITypelibJohan Dahlin2010-08-311-27/+27
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* [girepository] Add a couple of missing transferJohan Dahlin2010-08-311-7/+16
|
* Use GLib types consistentlyColin Walters2010-08-311-11/+11
| | | | | | | | | Rather than have the scanner/parser handle both e.g. "glong" and "long", simply use the GLib types everywhere. This commit adds TYPE_LONG_LONG and TYPE_LONG_DOUBLE to the scanner types; however, rather than add them to the typelib, they're just marked as not-introspectable.
* Fix warning when using g_irepository_enumerate_version()Steve Frécinaux2010-08-181-3/+6
| | | | | | The reason for the warning was that g_irepository_get_version() expects the typelib to be already loaded, but enumerate_version() can be called on typelibs that are not.
* Include the loaded version in g_irepository_enumerate_versions()Steve Frécinaux2010-08-181-2/+13
| | | | | | | | | | | | | | | | | | | Logically speaking, the already loaded version of a namespace is part of the currently available versions, and can be forgotten if we only consider the versions available in GI_TYPELIB_PATH, as it could have been loaded using g_irepository_require_private(). As a side effect, it meant that bindings relying on enumerate_version() (like pygobject) were not able to require private versions through their classical requirement scheme. This patch fixes it by adding the loaded version to the unsorted list of available versions returned by g_irepository_enumerate_versions() This patch also uses g_list_prepend() instead of g_list_append() in that function. https://bugzilla.gnome.org/show_bug.cgi?id=625983
* [girepository] Fix up error printingColin Walters2010-08-171-2/+9
| | | | | | | We didn't show the right error message if we failed to find the symbol; fix this by removing error printing from the middle of the dumper, and add it correctly to the toplevel dump entry point.
* Do not leak typelibs with wrong header info.GOBJECT_INTROSPECTION_0_9_3Steve Frécinaux2010-08-031-0/+2
| | | | | | | Previously the typelibs that were loaded but whose header information weren't right were just leaked. https://bugzilla.gnome.org/show_bug.cgi?id=625672
* Add new API g_typelib_require_private()Steve Frécinaux2010-08-031-35/+88
| | | | | | | This is equivalent to g_typelib_require() but intended for use with private typelibs, which get loaded from the provided directory. https://bugzilla.gnome.org/show_bug.cgi?id=625672
* [girepository] Update documentationJohan Dahlin2010-07-281-2/+12
|
* [GIRepository] Rename g_irepository_enumerateJohan Dahlin2010-07-281-8/+9
| | | | Rename it to g_irepository_enumerate_versions
* Add g_info_type_to_string (GIInfoType type)Tomeu Vizoso2010-07-281-0/+56
|
* Add g_irepository_enumerateColin Walters2010-07-271-14/+57
| | | | This will be used for pygobject to enumerate namespaces.
* [girepository] Include path to file in typelib load failure errorColin Walters2010-07-221-3/+13
| | | | This makes version conflicts more obvious.
* [girepository] Fix ordering in override_search_pathFlorian Müllner2010-07-151-0/+3
| | | | | | Entries in the GI_TYPELIB_PATH environment variable are added to the global search path in reverse order - instead, add entries in the same order in which they are specified.
* [girepository] Actually verify header of loaded typelibs in ↵Colin Walters2010-07-141-1/+3
| | | | | | | | g_irepository_require Take a GError * for typelib loading code, validate the header. This fixes bizarre errors from gjs where g_irepository_require would happily load old typelibs.
* Don't include machine-dependent integral types in the typelibColin Walters2010-07-091-18/+0
| | | | | | | | | | | | | | | | | | | | Previously we had both e.g. GI_TYPE_TAG_LONG and GI_TYPE_TAG_INT64, but in fact the typelib is already machine-specific, so it makes sense to just encode this as a fixed type. The .gir remains abstract. We also remove size_t from the typelib; one would never want to treat it differently than an integer. time_t is removed as well; while bindings like gjs had special handling to turn it into e.g. a JS Date object, I don't think we should encourage people to use these POSIX types in their API. Use GTimeVal or the like instead. Because the typelib is now really machine-specific, we need to remove the -expected.tgirs from git. (We could potentially add a check which wasn't just a literal diff later) https://bugzilla.gnome.org/show_bug.cgi?id=623774
* [girepository] Move GICallableInfo out of ginfo.chJohan Dahlin2010-06-051-4/+4
|
* [gtypelib.ch] Rename to gitypelib.chJohan Dahlin2010-05-311-1/+1
| | | | | Rename gtypelib.h -> gitypelib-internal.h and rename gtypelib.c to gitypelib.c
* [girepository] Use g_sliceJohan Dahlin2010-05-201-3/+3
| | | | | | Use g_slice to allocate instead of g_new(x, 1); It uses a memory pool internally and should be faster, especially for GBaseInfo/GRealInfo, structs which are tiny.
* [girepository] Document most of the structsJohan Dahlin2010-05-181-1/+1
|