GNOME Bugzilla – Bug 556628
IntrospectionSkip annotation
Last modified: 2015-02-07 16:47:36 UTC
For implementing --fail-unbindable (bug 554919), we need a way for C authors to annotate special C API so that it doesn't appear in introspection. This dovetails with the Shadows: annotation patch (bug 556475). A better name other than "IntrospectionSkip" would be welcome, too. The thought here is you'd say: /** myobj_foo: * @obj: Object * @data: arbitrary C data pointer * * IntrospectionSkip: */ void myobj_foo (MyObj *obj, void * data) { } /** myobj_foo_buf: * @obj: Object * @data: (array length=len): byte array * @len: length * * Shadows: myobj_foo */ void myobj_foo_buf(MyObj *obj, guchar *data, int len) { }
Created attachment 131563 [details] [review] Bug 556628 – (skip) annotation Adds a (skip) option that can be added to the header of any doc comment to cause that symbol to be skipped in the .gir output
I implemented this using the style of the (type bitfield) annotation from bug 573332. Eg: /** * foo_skip_me: (skip) * @fs: a #FooSkippable * * Does something that's only interesting from C and should not be * exposed to language bindings. */ With the () syntax, it's more obvious that this is something to do with introspection, so it seemed like we could remove "introspection" from the name and still have it be clear, right? Not sure if I actually implemented skipping at the best spot... one possible problem is that it doesn't do any dependency analysis, so you can end up outputting broken girs (eg, in the example above, if I'd marked the FooSkippable type as (skip), but didn't skip foo_skip_me()).
Looks great; pushed, thankns!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]