Re: A problem about reading the source code

Uli Schlachter <[email protected]> Fri, 29 Dec 2023 14:00:41 +0100
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <[email protected]>
Hi starcold,

Am 29.12.23 um 09:37 schrieb starcold14:
> Hi=EF=BC=8C
> I'm a newbie and don't know much about libxcb,

There is xcb/proto and libxcb. proto contains a XML description of the=20
X11 protocol and libxcb uses this XML to generate C code.

> and I'm currently having a
> problem where when I want to find a function named xcb_grab_pointer_rep=
ly, I
> can't find it in the code from
> gitlab(https://gitlab.freedesktop.org/xorg/lib/libxcb
> <https://gitlab.freedesktop.org/xorg/lib/libxcb>) using the grep tool.

You can find he XML specification for GrabPointer here: [0]

[0]:=20
https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/blob/1388374c7149114=
888a6a5cd6e9bf6ad4b42adf8/src/xproto.xml#L2585-2596

When you build libxcb from source, the appropriate C code is then=20
generated. You won't find much helpful in there. This is the generated=20
code for xcb_grab_pointer_reply():

xcb_grab_pointer_reply_t *
xcb_grab_pointer_reply (xcb_connection_t           *c,
                         xcb_grab_pointer_cookie_t   cookie  /**< */,
                         xcb_generic_error_t       **e)
{
     return (xcb_grab_pointer_reply_t *) xcb_wait_for_reply(c,=20
cookie.sequence, e);
}

Cheers,
Uli
--=20
=E2=80=9CSome people are worth melting for.=E2=80=9D - Olaf