Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

testx.c

Go to the documentation of this file.
00001 
00002 /*
00003  * testx:       See if we can open an X-window.
00004  * Author:      Steve McMillan, Drexel University, August 1995.
00005  */
00006 
00007 #include "../lux/win.h"
00008 #include <stdlib.h>
00009 
00010 main()
00011 {
00012     Display *display;
00013     char *display_name = NULL;
00014     char *disp;
00015 
00016     disp = getenv("DISPLAY");
00017 
00018     if (disp == '\0') {
00019         printf("DISPLAY variable not set.\n");
00020         exit(1);
00021     } else
00022         printf("Checking permission to open X-display %s...", disp);
00023 
00024     if ( (display = XOpenDisplay(display_name)) == NULL ){
00025         printf("denied.\n");
00026         exit(1);
00027     } else {
00028         printf("OK.\n");
00029         exit(0);
00030     }
00031 }

Generated at Sun Feb 24 09:57:19 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001