mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 10:14:52 +00:00
dix: add WriteRpcbufToClient()
Adding convenience function for writing out rpc buffer contents to client and clear the buffer (free it's memory) afterwards. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
f5062223ec
commit
84b8ac1b33
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
#include "dix/rpcbuf_priv.h"
|
||||
|
||||
#include "include/callback.h"
|
||||
#include "include/cursor.h"
|
||||
@@ -689,4 +690,18 @@ static inline ClientPtr dixLookupXIDOwner(XID xid)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief write rpc buffer to client and then clear it
|
||||
*
|
||||
* @param pClient the client to write buffer to
|
||||
* @param rpcbuf the buffer whose contents will be written
|
||||
* @return the result of WriteToClient() call
|
||||
*/
|
||||
static inline int WriteRpcbufToClient(ClientPtr pClient,
|
||||
x_rpcbuf_t *rpcbuf) {
|
||||
int ret = WriteToClient(pClient, rpcbuf->wpos, rpcbuf->buffer);
|
||||
x_rpcbuf_clear(rpcbuf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* _XSERVER_DIX_PRIV_H */
|
||||
|
||||
Reference in New Issue
Block a user