Commit Graph

1 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 893f56f6b0 include: dix.h: add macros for request handlers and swapping
add some macros for making request handlers easier:

    * REQUEST_HEAD_STRUCT() declares a struct and checks size (assuming
      length field already had been swapped)
    * REQUEST_FIELD_CARD16() swaps a CARD16 (word) if neccessary
    * REQUEST_FIELD_CARD32() swaps a CARD32 (dword) if neccessary

How to use them:

    1. move swapping of lengths field into the SProc*Dispatch() and drop it
       from the individual SProc*()'s
    2. put REQUEST_HEAD_STRUCT() ontop of each Proc*()
    3. add REQUEST_FIELD_*() below, for all fields to be swapped and
       drop their swapping from the SProc*()'s
    4. clean up unnecessary wrappers (SProc*()'s just be just call the
       corresponding Proc*() by now)
    5. let demux SProc just swap length field and call the normal Proc*Dispatch()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-26 11:25:05 +02:00