After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629683 - Documentation comment ignored for callback type
Documentation comment ignored for callback type
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.25.x
Other Linux
: Normal major
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-09-14 17:00 UTC by Philip Withnall
Modified: 2015-02-07 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2010-09-14 17:00:49 UTC
telepathy-glib has the following callback type declared in an introspected header file:

typedef void (*TpConnectionRequestHandlesCb) (TpConnection *connection,
    TpHandleType handle_type,
    guint n_handles, const TpHandle *handles, const gchar * const *ids,
    const GError *error, gpointer user_data, GObject *weak_object);

Its documentation comment is declared in a (separate) introspected C file (though moving the comment into the same header file as the callback type definition doesn't seem to change anything):

/**
 * TpConnectionRequestHandlesCb:
 * @connection: the connection
 * @handle_type: the handle type that was passed to
 *  tp_connection_request_handles()
 * @n_handles: the number of IDs that were passed to
 *  tp_connection_request_handles() on success, or 0 on failure
 * @handles: (element-type uint) (array length=n_handles): the @n_handles
 *  handles corresponding to @ids, in the same order, or %NULL on failure
 * @ids: a copy of the array of @n_handles IDs that was passed to
 *  tp_connection_request_handles() on success, or %NULL on failure
 * @error: %NULL on success, or an error on failure
 * @user_data: the same arbitrary pointer that was passed to
 *  tp_connection_request_handles()
 * @weak_object: the same object that was passed to
 *  tp_connection_request_handles()
 *
 * Signature of the callback called when tp_connection_request_handles()
 * succeeds or fails.
 *
 * On success, the caller has one reference to each handle in @handles, which
 * may be released later with tp_connection_unref_handles(). If not
 * released, the handles will remain valid until @connection becomes invalid
 * (signalled by TpProxy::invalidated).
 *
 * For convenience, the handle type and IDs requested by the caller are
 * passed through to this callback, so the caller does not have to include
 * them in @user_data.
 */

The following GIR XML is generated, which seems to completely ignore both the documentation in the comment and the annotations:

    <callback name="ConnectionRequestHandlesCb" c:type="TelepathyGLibConnectionRequestHandlesCb">
      <return-value transfer-ownership="none">
        <type name="none" c:type="void"/>
      </return-value>
      <parameters>
        <parameter name="connection" transfer-ownership="none">
          <type name="Connection" c:type="TpConnection*"/>
        </parameter>
        <parameter name="handle_type" transfer-ownership="none">
          <type name="HandleType" c:type="TpHandleType"/>
        </parameter>
        <parameter name="n_handles" transfer-ownership="none">
          <type name="guint" c:type="guint"/>
        </parameter>
        <parameter name="handles" transfer-ownership="none">
          <type name="Handle" c:type="TpHandle*"/>
        </parameter>
        <parameter name="ids" transfer-ownership="none">
          <type name="utf8" c:type="gchar**"/>
        </parameter>
        <parameter name="error" transfer-ownership="none">
          <type name="GLib.Error" c:type="GError*"/>
        </parameter>
        <parameter name="user_data" transfer-ownership="none" closure="6">
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
        <parameter name="weak_object" transfer-ownership="none">
          <type name="GObject.Object" c:type="GObject*"/>
        </parameter>
      </parameters>
    </callback>

Additionally, the c:type in the generated XML is wrong (it should have a "Tp" prefix, not a "TelepathyGLib" prefix).
Comment 1 Philip Withnall 2010-09-14 17:02:21 UTC
I should mention that all the callbacks in tp-glib are affected by both problems (documentation comment and annotations ignored, and wrong prefix on c:type).
Comment 2 Colin Walters 2010-09-14 17:10:38 UTC
Should be fixed by:


commit d8c4caf990642050049ba0cff7b6916e01c354da
Author: Colin Walters <walters@verbum.org>
Date:   Tue Sep 14 13:08:50 2010 -0400

    scanner: Add c_type for callbacks
    
    We weren't doing this consistently, which broke nsname != cprefix
    cases.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629683
Comment 3 André Klapper 2015-02-07 16:53:22 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]