Chuanlong Du
2021-Jul-29 22:08 UTC
[fdo] Can anyone help me understand xGetImageReply in libx11?
I read the source code of the file?GetImage.c in libX11?but got confused by?line 66?(see screenshot below for convenience). I couldn't find the definition of xGetImageReply anywhere in the code. What is the value of rep.length after execution of line 66?? -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/freedesktop/attachments/20210729/924ea90c/attachment-0001.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: 1627596262245blob.jpg Type: image/png Size: 193031 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/freedesktop/attachments/20210729/924ea90c/attachment-0001.png>
Alan Coopersmith
2021-Jul-30 17:31 UTC
[fdo] Can anyone help me understand xGetImageReply in libx11?
Questions about X11 are better handled on the X.Org mailing lists at https://www.x.org/wiki/XorgMailingLists/ than the generic freedesktop list. On 7/29/21 3:08 PM, Chuanlong Du wrote:> I read the source code of the file GetImage.c in libX11 > <https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/GetImage.c>?but got > confused by line 66 > <https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/GetImage.c#L66>?(see > screenshot below for convenience). I couldn't find the definition of > xGetImageReply anywhere in the code.Since the xGetImageReply structure is part of the protocol between the client and server, it's defined in the separate xorgproto package so both libX11 and the Xserver can share the definition and ensure it's always in sync between both sides. You can see its definition at: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/master/include/X11/Xproto.h#L713-724> What is the value of rep.length after execution of line 66?Undefined, as that just declares the variable without initializing it. It won't be set until the XReply call at line 85 writes the reply received from the X server into that structure. -- -Alan Coopersmith- alan.coopersmith at oracle.com Oracle Solaris Engineering - https://blogs.oracle.com/alanc