xtrapinfo.c revision 47cb5690
1/* $XFree86: xc/programs/xtrap/xtrapinfo.c,v 1.1tsi Exp $ */ 2/* 3 * @DEC_COPYRIGHT@ 4 */ 5/* 6 * HISTORY 7 * Log: xtrapinfo.c,v $ 8 * Revision 1.1.4.2 1993/12/14 12:37:24 Kenneth_Miller 9 * ANSI-standardize code and turn client build on 10 * [1993/12/09 20:15:55 Kenneth_Miller] 11 * 12 * Revision 1.1.2.2 1992/04/27 13:51:50 Leela_Obilichetti 13 * initial load of xtrap clients - from silver BL6 pool 14 * [92/04/27 13:49:24 Leela_Obilichetti] 15 * 16 * EndLog$ 17 */ 18/***************************************************************************** 19Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993 by Digital Equipment Corp., 20Maynard, MA 21 22Permission to use, copy, modify, and distribute this software and its 23documentation for any purpose and without fee is hereby granted, 24provided that the above copyright notice appear in all copies and that 25both that copyright notice and this permission notice appear in 26supporting documentation, and that the name of Digital not be 27used in advertising or publicity pertaining to distribution of the 28software without specific, written prior permission. 29 30DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 31ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 32DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 33ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 34WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 35ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 36SOFTWARE. 37 38*****************************************************************************/ 39/* 40 * 41 * CONTRIBUTORS: 42 * 43 * Dick Annicchiarico 44 * Robert Chesler 45 * Dan Coutu 46 * Gene Durso 47 * Marc Evans 48 * Alan Jamison 49 * Mark Henry 50 * Ken Miller 51 * 52 */ 53#include <stdio.h> 54#include <stdlib.h> 55#include <X11/extensions/xtraplib.h> 56#include <X11/extensions/xtraplibp.h> 57 58int 59main(int argc, char *argv[]) 60{ 61 static Widget appW; 62 XtAppContext app; 63 char *tmp = NULL; 64 XETrapGetAvailRep ret_avail; 65 XETC *tc; 66 Display *dpy; 67 68 /* Connect to Server */ 69 appW = XtAppInitialize(&app,"XTrap",NULL,(Cardinal)0L, 70 (int *)&argc, (String *)argv, (String *)NULL, (ArgList)&tmp, 71 (Cardinal)0); 72 dpy = XtDisplay(appW); 73#ifdef DEBUG 74 XSynchronize(dpy, True); 75#endif 76 printf("Display: %s \n", DisplayString(dpy)); 77 if ((tc = XECreateTC(dpy,0L, NULL)) == False) 78 { 79 fprintf(stderr,"%s: could not initialize extension\n",argv[0]); 80 exit(1L); 81 } 82 83 (void)XEGetAvailableRequest(tc,&ret_avail); 84 (void)XEPrintAvail(stdout,&ret_avail); 85 86 (void)XCloseDisplay(dpy); 87 exit(0L); 88} 89