diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-15 01:32:49 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-10-02 22:16:08 -0700 |
commit | 95a96dbdc483d9dc6371f52a9e41771a64d23aed (patch) | |
tree | 53119d09cf830c4846d6247b65e66b6a69e1e47d /print11.c | |
parent | 9a8ad93043569c2717bd88f0264e0d3a28b56a74 (diff) | |
download | xscope-95a96dbdc483d9dc6371f52a9e41771a64d23aed.tar.gz |
Create PrintPropertyValues function for property requests
Currently used for core protocol window properties, but will be
used for extensions that have similar property handling requests
in the future.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'print11.c')
-rw-r--r-- | print11.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1402,9 +1402,9 @@ GetAtomNameReply(const unsigned char *buf) void ChangeProperty(FD fd, const unsigned char *buf) { - long n; - short unit; - long type; + uint32_t n; + uint8_t unit; + uint32_t type; /* Request ChangeProperty is opcode 18 */ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeProperty */ @@ -1423,10 +1423,7 @@ ChangeProperty(FD fd, const unsigned char *buf) unit = IByte(&buf[16]) / 8; printfield(buf, 20, 4, CARD32, "length of data"); n = ILong(&buf[20]); - if (type == 31 /* string */ ) - PrintString8(&buf[24], n * unit, "data"); - else - PrintBytes(&buf[24], n * unit, "data"); + PrintPropertyValues(&buf[24], type, unit, n, "data"); } void @@ -1482,10 +1479,7 @@ GetPropertyReply(const unsigned char *buf) PrintField(buf, 12, 4, CARD32, "bytes-after"); printfield(buf, 16, 4, CARD32, "length of value"); n = ILong(&buf[16]); - if (type == 31 /* string */ ) - PrintString8(&buf[32], n * unit, "value"); - else - PrintBytes(&buf[32], n * unit, "value"); + PrintPropertyValues(&buf[32], type, unit, n, "value"); } void |