summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
Commit message (Collapse)AuthorAgeFilesLines
* giscanner: fix description field storage in .gir filesDieter Verfaillie2013-10-081-1/+2
| | | | | | | | | | | | | | | | | | GTK-Doc description fields for tags can contain multiple lines and even multiple paragraphs. Whitespace cannot be preserved in XML attributes, so we move the "deprecated" description text into a "<doc-deprecated />" element right next to where we already have the "<doc />" element. Keep the "deprecated" attribute around for backwards compatibility though, but set its value to "1" (analogous to the "writable", "contruct", etc attributes) if the annotated symbol is marked as deprecated. While at it, add <doc-version /> and <doc-stability /> which was not yet available in the .gir files... This takes care of the "Since:", "Stability:" and "Deprecated:" GTK-Doc tags. Nothing needs to be done for the "Returns:" tag as as we already write a "<doc />" child element on "<return-value />".
* Use case insensitive compare for signal "when" attributeSimon Feltman2013-10-051-2/+2
| | | | | | | | Update parser to use g_ascii_strcasecmp instead of strcmp. This fixes incorrect flags being set when the incomming gir is using lowercase values for the "when" attribute. https://bugzilla.gnome.org/show_bug.cgi?id=709462
* girparser: Also honor legacy c:prefixColin Walters2013-04-151-0/+3
| | | | | | | vala generates this, and we need to honor it now that we're using the c:prefix as an optimization when searching for gtypes. https://bugzilla.gnome.org/697759
* girparser: Serialize and read back the instance_parameterJasper St. Pierre2013-02-011-0/+5
| | | | | | | | g-ir-doc-tool wants to use the instance parameter to read docs and the parameter name, so it needs to be shuttled through the GIR. https://bugzilla.gnome.org/show_bug.cgi?id=693040
* girparser: Clean up passthrough handlingJasper St. Pierre2013-02-011-6/+4
| | | | | | | Instead of remembering to have to set unknown_depth, smarten up state_switch to do it for us. https://bugzilla.gnome.org/show_bug.cgi?id=693040
* girparser: Move <doc> handling to passthroughJasper St. Pierre2013-02-011-27/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=693040
* girepository: gchar is a signed typeMartin Pitt2013-01-111-1/+2
| | | | | | | gchar is signed, not unsigned. Add "guchar" alias as unsigned for completeness (but usually it appears as guint8). https://bugzilla.gnome.org/show_bug.cgi?id=691524
* girepository: Remove C99ism and other updatesChun-wei Fan2012-10-271-6/+27
| | | | | | | | | | -Make code using libgirepository_internals relocatable on Windows, like what is done in the GTK+ stack, and the girepository DLL. -Remove C99isms -"interface" is a reserved keyword on certain compilers, so change that to "giinterface" https://bugzilla.gnome.org/show_bug.cgi?id=681820
* repository: Ensure error is set if we're parsing a malformed fileJean Bréfort2012-02-171-4/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=661951
* Add Emacs mode lines to C sourcesColin Walters2012-02-031-1/+2
|
* girepository: Add GI_VFUNC_THROWSColin Walters2012-02-031-0/+7
| | | | | | | | Virtual functions can definitely throw an error. Right now the scanner omits the GError parameter for them and adds throws="1", but g-ir-compiler ignores this. https://bugzilla.gnome.org/show_bug.cgi?id=669332
* parser: prevents a segfault when _g_ir_parser_parse_string returns NULL ↵Alberto Ruiz2011-10-181-0/+5
| | | | | | | | | | error was not set. Noticed the segmentation fault while using Vala to generate a .gir, a bug has been filed tomake sure Vala doesn't export gir symbols outside of a namespace (see https://bugzilla.gnome.org/show_bug.cgi?id=661952) https://bugzilla.gnome.org/show_bug.cgi?id=661951
* Fix g_type_info_is_pointer() for overriden types of arguments.Pavel Holejsovsky2011-09-121-0/+4
| | | | | | | | | Algorithm which detects whether argument type is pointer checks for trailing '*' characters in c:type .gir elements. This failed if ctype is either 'gpointer' or 'gconstpointer'. Add specific check for gpointer/gconstpointer types when deducing pointerness of the type. https://bugzilla.gnome.org/show_bug.cgi?id=658848
* Allow enums and bitfields to have static methodsTorsten Schönfeld2011-08-161-0/+17
| | | | | | | | | | | | | This uses the same backcompat machinery that was introduced for static methods for non-class types, so this change does not break users of the existing presentations. New libgirepository API: g_enum_info_get_n_methods g_enum_info_get_method https://bugzilla.gnome.org/show_bug.cgi?id=656499
* Switch to storing string form of error quarksDan Winship2011-08-121-0/+4
| | | | | | | | | | | | | | | | Instead of storing the name of the function to call to get the error quark, store the string form of the error quark, which we derive from the introspection binary during scanning. Update EnumBlob and GIEnumInfo to include the new information. This will allow determining a back-mapping from error quark to error domain without having to dlsym() and call all the known error quark functions. Based on earlier patches from Owen Taylor and Maxim Ermilov. https://bugzilla.gnome.org/show_bug.cgi?id=602516
* Deprecate ErrorDomainDan Winship2011-08-121-78/+3
| | | | | | | | | | | | | | 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
* Add support for the (skip) annotation on parameters or return valuesDavid Zeuthen2011-05-131-0/+14
| | | | | | | | This was discussed in bug 649657. https://bugzilla.gnome.org/show_bug.cgi?id=649657 Signed-off-by: David Zeuthen <davidz@redhat.com>
* girparser: use c:identifier-prefixes instead of c:prefixSerkan Kaba2011-03-261-1/+1
| | | | | | | | This bug was introduced with http://git.gnome.org/browse/gobject-introspection/commit/?id=36aa515f1036978ced8d4ffb808260844f7229e0 due to rename of c:prefix to c:identifier-prefixes. https://bugzilla.gnome.org/show_bug.cgi?id=640264
* Add "c:identifier" attribute to GIrNodeValue (for flags and enum values).GOBJECT_INTROSPECTION_0_10_3Laszlo Pandy2011-02-231-0/+6
| | | | | | | | | | | | | | | Flags and enums with a GType have a value_nick and value_name strings available in the class struct. But for flags and enums without GType, we need to get this information from introspection. g_base_info_get_name() gives the string for value_nick. In the GIR, the attribute "c:identifier" is the string neede for value_name. This patch adds the "c:identifier" from GIR to the typelib for all flags and enum values. It can be retireved using g_base_info_get_attribute(info, "c:identifier"). https://bugzilla.gnome.org/show_bug.cgi?id=642757
* Fix argument name of MISSING_ATTRIBUTE macro ('ctx' => 'context').Laszlo Pandy2011-02-171-1/+1
| | | | | | | The argument was called 'ctx' but the macro was using 'context'. This wasn't causing the build to fail because the variable 'context' was already defined in all the scopes where this macro was used.
* Add support for g[u]intptr in scanner and girwriter.Pavel Holejsovsky2011-01-131-3/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=634838
* Don't emit shadowed methods into the typelibAndreas Rottmann2010-12-071-1/+4
| | | | Ignore shadowed methods when parsing the GIR.
* girepository: Consistently prefix internal functions with _Colin Walters2010-11-161-48/+48
| | | | | This should better avoid them being exported. Rename girepository-parser.la to girepository-internals.la for clarity.
* Add support for gunichar in typelibColin Walters2010-11-121-1/+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
* Handle enumerations with the full range of signed and unsigned valuesOwen W. Taylor2010-11-011-5/+5
| | | | | | | | | | | | | The C compiler will pick an enumeration type that accomodates the specified values for the enumeration, so ignoring 64-bit enumerations, we can have enumeration values from MININT32 to MAXUINT32. To handle this properly: - Use gint64 for holding eumeration values when scanning - Add a 'unsigned_value' bit to ValueBlob so we can distinguish the int32 vs. uint32 cases in the typelib - Change the return value of g_value_info_get_value() to gint64. https://bugzilla.gnome.org/show_bug.cgi?id=629704
* Actually do something about fundamentals when parsing a .girTomeu Vizoso2010-09-291-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=630710
* typelib compiler: Passthrough <doc> at any pointColin Walters2010-09-141-1/+1
| | | | This should have been in the previous commit.
* [VFuncBlob] Unknown struct offset should be 0xFFFFSteve Frécinaux2010-09-061-1/+1
| | | | | | | | | | | | Documentation says about g_vfunc_get_offset(): "Obtain the offset of the function pointer in the class struct. The value 0xFFFF indicates that the struct offset is unknown." But g-ir-compiler did set the value to 0 when the offset is unknown. This patch fixes it. https://bugzilla.gnome.org/show_bug.cgi?id=628270
* scanner: Fix previous rename-to handling commitColin Walters2010-09-031-1/+1
|
* scanner: Fix rename-to handlingColin Walters2010-09-031-0/+5
| | | | | We were writing the attributes backwards. Also actually use the attribute in the typelib generation.
* Major rewriteColin Walters2010-08-311-38/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the first big changes in this rewrite is changing the Type object to have separate target_fundamental and target_giname properties, rather than just being strings. Previously in the scanner, it was awful because we used heuristics around strings. The ast.py is refactored so that not everything is a Node - that was a rather useless abstraction. Now, only things which can have a GIName are Node. E.g. Type and Field are no longer Node. More things were merged from glibast.py into ast.py, since it isn't a very useful split. transformer.py gains more intelligence and will e.g. turn GLib.List into a List() object earlier. The namespace processing is a lot cleaner now; since we parse the included .girs, we know the C prefix for each namespace, and have functions to parse both C type names (GtkFooBar) and symbols gtk_foo_bar into their symbols cleanly. Type resolution is much, much saner because we know Type(target_giname=Gtk.Foo) maps to the namespace Gtk. glibtransformer.py now just handles the XML processing from the dump, and a few miscellaneous things. The major heavy lifting now lives in primarytransformer.py, which is a combination of most of annotationparser.py and half of glibtransformer.py. annotationparser.py now literally just parses annotations; it's no longer in the business of e.g. guessing transfer too. finaltransformer.py is a new file which does post-analysis for "introspectability" mainly. girparser.c is fixed for some introspectable=0 processing.
* Use GLib types consistentlyColin Walters2010-08-311-29/+29
| | | | | | | | | 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.
* Move alias target to <type>Colin Walters2010-08-311-27/+72
| | | | | | | This makes type parsing more uniform. Delete the typedef for GSList in foo.h - that's not supported anymore, or at least for now.
* [gircompiler] Clean up parsingColin Walters2010-08-171-37/+60
| | | | | | | | | | | | | | We never actually include multiple modules in the compiler, so just nuke that. Also rather than passing around GIrModule consistently pass around a GIrTypelibBuild structure which has various things. This lets us maintain a stack there which we can walk for better error messages. Also, fix up the node lookup in giroffsets.c; previously it didn't really handle includes correctly. We really need to switch to always using Foo.Bar (i.e. GIName) names internally...
* [girparser] Cleanly pass through c:includeColin Walters2010-08-171-0/+13
|
* Don't include machine-dependent integral types in the typelibColin Walters2010-07-091-13/+56
| | | | | | | | | | | | | | | | | | | | 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
* Remove trailing whitespaceJohan Dahlin2010-07-091-1/+1
|
* Add support for non-GObject fundamental objectsJohan Dahlin2010-07-091-0/+19
| | | | | | | | | | | | | | This patch adds support for instantiable fundamental object types, which are not GObject based. This is mostly interesting for being able to support GstMiniObject's which are extensivly used in GStreamer. Includes a big test case to the Everything module (inspired by GstMiniObject) which should be used by language bindings who wishes to test this functionallity. This patch increases the size of the typelib and breaks compatibility with older typelibs. https://bugzilla.gnome.org/show_bug.cgi?id=568913
* Move doc to toplevel element, write <any> for unknown containersColin Walters2010-07-081-0/+27
| | | | | | | | | Moving to <doc> allows us to better preserve whitespace. XML has no facility for whitespace-preserving attributes. Second, for arrays and lists, both types with unknown element_type can occur in the current scanner; it's least wrong if we write out an <any> type.
* Allow attributes on parameters and return valuesDavid Zeuthen2010-06-241-1/+8
| | | | | | | | | | | | | | | | | | Any annotation where the key has a dot in the name will go into the attribute list. For example * @arg: (foo.bar baz): some arg the parameter @arg will get the attribute with key foo.bar and value baz. This also works for. * Returns: (foo.bar2 baz2): the return value Also add tests for this new feature. See https://bugzilla.gnome.org/show_bug.cgi?id=571548 Signed-off-by: David Zeuthen <davidz@redhat.com>
* [girparser] Remove backtrace()Colin Walters2010-06-221-29/+0
| | | | | It's not useful; we never got good info from it, and modern operating systems ship with crash catching systems.
* Support introspectable=no attribute, add warnings frameworkColin Walters2010-06-171-794/+687
| | | | | | | | | | | | | | | | | | This work allows us to move closer to replacing gtk-doc, among other things. We add a generic attribute "introspectable", and inside the typelib compiler if we see "introspectable=no", we don't put it in the typelib. This replaces the hackish pre-filter for varargs with a much more generic mechanism. The varargs is now handled in the scanner, and we emit introspectable=no for them. Add generic metadata to Node with references to file/line/column, which currently comes from symbols. Add scanner options --warn-all and --warn-error. https://bugzilla.gnome.org/show_bug.cgi?id=621570
* More explicitly document how we'll use the version= attribute on repositoryColin Walters2010-06-171-1/+6
| | | | | | I want to start bumping it on incompatible .gir changes. https://bugzilla.gnome.org/show_bug.cgi?id=621895
* Revert "Support introspectable=no attribute, add warnings framework"Johan Dahlin2010-06-171-686/+793
| | | | This reverts commit 074192b89c6afcdd7f062f03989972e44334b8bf.
* Support introspectable=no attribute, add warnings frameworkColin Walters2010-06-161-793/+686
| | | | | | | | | | | | | | | | This work allows us to move closer to replacing gtk-doc, among other things. We add a generic attribute "introspectable", and inside the typelib compiler if we see "introspectable=no", we don't put it in the typelib. This replaces the hackish pre-filter for varargs with a much more generic mechanism. The varargs is now handled in the scanner, and we emit introspectable=no for them. Add generic metadata to Node with references to file/line/column, which currently comes from symbols. Add scanner options --Wall and --Werror.
* [girparser] Annotate return transfer for public APIJohan Dahlin2010-06-121-2/+2
|
* Use a default value for transfer-ownership in properties.Tomeu Vizoso2010-06-081-4/+7
|
* Support the (transfer) annotation for properties.Tomeu Vizoso2010-06-081-0/+42
| | | | | | | | | | | | * girepository/*: Add g_property_info_get_ownership_transfer() and write the transfer attribute of properties into the typelib. * giscanner/*: Parse the (transfer) annotation and write it into the .gir. * tools/generate.c: Read the transfer annotation for properties and write to the .tgir. https://bugzilla.gnome.org/show_bug.cgi?id=620484
* Philip, you didn't write all of thisJohan Dahlin2010-06-081-0/+1
|
* Fix marshalling of GStrv.GOBJECT_INTROSPECTION_0_6_13Tomeu Vizoso2010-06-021-0/+3
| | | | | | | | | | | | | | | | | | * gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and as struct fields. * girepository/giroffsets.c: Correctly compute the size of structs with array fields * girepository/girparser.c: Set is_pointer to FALSE for arrays with fixed size that are inside structs. * giscanner/glibtransformer.py: Special case GStrv as arrays of utf8. * giscanner/annotationparser.py: Make full transfer the default for arrays of char* returned by functions. https://bugzilla.gnome.org/show_bug.cgi?id=620170