[ Previous | Next | Contents | Glossary | Home | Search ]
x11 R6 Technical Reference

_XReply Extension Function

Purpose

Flushes the output buffer, waits for a reply packet, and copies the contents into the specified Reply parameter.

Library

Enhanced X-Windows Library (libX11.a)

C Syntax

Status _XReply(DisplayPtr, Reply, Extra, Discard)
Display *DisplayPtr;
xReply *Reply;
int Extra;
Bool Discard;

Description

The _XReply extension function flushes the output buffer, waits for a reply packet, and copies the contents into the specified Reply parameter. If other events arrive during this time, the _XReply extension function queues these events for later use.

Most reply structures are 32 bytes long; therefore, the Extra parameter is usually the value of 0. In the Core protocol, only the following are longer than 32 bytes: the GetWindowAttributes, QueryFont, QueryKeymap, and GetKeyboardControl reply structures.

If a reply is not followed by variable-length data, use the _XReply extension function as follows:

_XReply (DisplayPtr, (xReply *)&Rep, 0, xTrue);
*ret1 = rep.ret1;
*ret2 = rep.ret2;
*ret3 = rep.ret3;
UnlockDisplay(dpy);
SyncHandle();
return (rep.ret4);}

If a reply has variable-length data, change the Discard parameter from xTrue value to xFalse value and use the _XRead extension function to read the variable-length data.

Parameters

Discard Specifies a Boolean value that tells the _XReply extension function to discard any additional bytes beyond those it was told to read. The Discard parameter can be one of the following values:
xFalse The reply structure is followed by additional variable-length data, such as a list or string.
xTrue There is no variable-length data.
DisplayPtr Specifies the display structure.
Extra Specifies the number of additional bytes (beyond sizeof(xReply) = 32bytes ) in the reply structure. This is the number of words expected after the reply.
Reply Specifies the reply structure.

Return Values

True Indicates a reply was received successfully.
False Indicates the reply was not successful. An XError message accompanies this value.

Related Information

Using Extensions in AIXwindows in AIX Version 4.3 AIXwindows Programming Guide.

The GetKeyboardControl protocol request, GetWindowAttributes protocol request, QueryFont protocol request, and the QueryKeymap protocol request.

AIXwindows Overview for Programmers in AIX Version 4.3 AIXwindows Programming Guide.


[ Previous | Next | Contents | Glossary | Home | Search ]