Created
September 18, 2014 09:37
-
-
Save aarzilli/fcd2a0094f89c29256a9 to your computer and use it in GitHub Desktop.
SetupRequest conundrum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "libxcb-1.11/src/xcb.h" | |
/* | |
gcc testxcb.c libxcb-1.11/src/.libs/libxcb.a -lXau; ./a.out | |
*/ | |
char bytes[] = { ... capture data here...}; | |
int main(void) { | |
xcb_setup_request_t *r = (xcb_setup_request_t *)bytes; | |
printf("name: %s (%d)\n", xcb_setup_request_authorization_protocol_name(r), xcb_setup_request_authorization_protocol_name_length(r)); | |
char *data = xcb_setup_request_authorization_protocol_data(r); | |
int len = xcb_setup_request_authorization_protocol_data_length(r); | |
printf("data (%d):", len); | |
int i; | |
for (i = 0; i < len; ++i) { | |
printf(" %02x", (unsigned char)data[i]); | |
} | |
printf("\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment