diff options
| author | bellard <bellard> | 2003-10-04 21:25:32 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2003-10-04 21:25:32 +0000 |
| commit | 9890ea1233a1caf84782a0ab364622a8444e0519 (patch) | |
| tree | 48bf2d06c42ac7432207a1d0c579263b9a1144b6 /ex4.c | |
| parent | feed3262c91df6e491e3f529192acdcc6a72f157 (diff) | |
| download | tinycc-9890ea1233a1caf84782a0ab364622a8444e0519.tar.gz tinycc-9890ea1233a1caf84782a0ab364622a8444e0519.tar.bz2 | |
added examples
Diffstat (limited to 'ex4.c')
| -rwxr-xr-x | ex4.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#!./tcc -run -L/usr/X11R6/lib -lX11 +#include <stdlib.h> +/* Yes, TCC can use X11 too ! */ +#include <stdio.h> +#include <X11/Xlib.h> + +int main(int argc, char **argv) +{ + Display *display; + Screen *screen; + + display = XOpenDisplay(""); + if (!display) { + fprintf(stderr, "Could not open X11 display\n"); + exit(1); + } + printf("X11 display opened.\n"); + screen = XScreenOfDisplay(display, 0); + printf("width = %d\nheight = %d\ndepth = %d\n", + screen->width, + screen->height, + screen->root_depth); + XCloseDisplay(display); + return 0; +} |
