Use x_rpcbuf_t for reply payload assembly, and X_SEND_REPLY_WITH_RPCBUF()
for sending out the whole reply.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpbuf_t instead of raw buffer for assembling and byte-swapping
indicator map payload.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since no consumer of this rpcbuf is writing directly to the underlying
buffer space anymore, there's no need to explicitly make room.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use generic macro for sending out final reply.
Also dropping our own unnecessary size payload computation - rpcbuf
already giving us this value.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The `RECTANGLE` PDU is pretty common, so it's good to have a helper for
writing this, so it doesn't need to be open-coded everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This is writing the contents of source rpcbuf into the target one,
pads it and finally clears the source buffer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Now that we're entirely operating on x_rpcbuf_t, we can use generic
macro for the whole final write out, including setting standard
reply header fields.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Instead of operating on a raw buffer, use x_rpcbuf_t to assemble the
compat map payload.
ProcXkbGetCompatMap() now can directly operate on generic x_rpcbuf_t
and doesn't need it's own private buffer management.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The amount of data written by XkbAssembleMap() is already known rpcbuf,
so no need for additionally computing this our own anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Add a helper for writing pascal-type strings: the counter is written
as CARD16, then followed by the string characters (w/o zero), and
finally everything padded up to full protocol units.
This encoding is used in various places throughout the Xserver,
eg. in xkb.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, and X_SEND_REPLY_WITH_RPCBUF()
for sending out the whole replies.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
We need to call bytes_to_int32() instead of pad_to_int32(),
otherwise our computation is totally broken.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Move the declaration of the reply struct down to after the payload has
been finally assembled, so we don't need extra payload size compuation
anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since the x_rpcbuf already knows how much had been written, there's no
need for extra payload size computation anymore - just pick the number
of written bytes from the x_rpcbuf.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
use x_rpcbuf_t operations for constructing the reply payload, so we don't
need to do the byte-swapping explicitly anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Second step of migrating ProcVidModeGetAllModeLines() to x_rpcbuf_t:
Let it's callees also use x_rpcbuf_t operations, instead of raw pointers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
First step of migration to x_rpcbuf: create a buffer with enough room for
the already calculated payload size and pass the raw buffer pointer to
our callees as we used to do with the calloc()ed one.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
We've been adding the individual sub-packet's payload bytes *after*
the swapping, which is leading to totally wrong sizes.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Adding helper safe_strlen() that's also checking for NULL pointer
and returning 0 in this case.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This macro is sending a reply header struct and rpcbuf payload
all in one shot. It also automatically computes the payload lengths
as well as also filling common fields like `type` and `sequenceNumber`
A typical call site looks like this:
> int ProcFooRequest(ClientPtr client) {
>
> [ ... ]
>
> X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
> return Success;
> }
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>