update
[tinycc.git] / ex4.c
blob3a3fed720f6c0d833a351ad5bb1fbf1090259153
1 #!./tcc -run -L/usr/X11R6/lib -lX11
2 #include <stdlib.h>
3 /* Yes, TCC can use X11 too ! */
4 #include <stdio.h>
5 #include <X11/Xlib.h>
7 int main(int argc, char **argv)
9 Display *display;
10 Screen *screen;
12 display = XOpenDisplay("");
13 if (!display) {
14 fprintf(stderr, "Could not open X11 display\n");
15 exit(1);
17 printf("X11 display opened.\n");
18 screen = XScreenOfDisplay(display, 0);
19 printf("width = %d\nheight = %d\ndepth = %d\n",
20 screen->width,
21 screen->height,
22 screen->root_depth);
23 XCloseDisplay(display);
24 return 0;