source: trunk/athena/bin/xversion/xversion.c @ 8168

Revision 8168, 980 bytes checked in by epeisach, 29 years ago (diff)
Do not include X11/copyright.h for any platform. It does not exist in R5
Line 
1/* Copyright    Massachusetts Institute of Technology    1985   */
2
3/*
4 * This program determines which X server is likely to be running by
5 * attempting to connect to the X socket.
6 *
7 * $Header: /afs/dev.mit.edu/source/repository/athena/bin/xversion/xversion.c,v 1.4 1995-12-05 01:32:45 epeisach Exp $
8 */
9
10static char *rcsid = "$Header: /afs/dev.mit.edu/source/repository/athena/bin/xversion/xversion.c,v 1.4 1995-12-05 01:32:45 epeisach Exp $";
11
12#include <X11/Xlib.h>
13#include <stdio.h>
14 
15main(argc,argv)
16int argc;
17char *argv[];
18{
19    int full_version = 0;               /* Full protocol version number? */
20    Display *dpy;
21
22    if (--argc)
23        if (!strcmp(*++argv, "-r"))
24            full_version = 1;
25   
26    /* X11 requires connection information */
27    if ((dpy = XOpenDisplay(NULL)) != NULL) {
28        printf((full_version ? "X%dR%d\n" : "%d\n" ),
29               ProtocolVersion(dpy),
30               VendorRelease(dpy));
31        XCloseDisplay( dpy );
32        exit( 0 );
33    }
34
35    printf( "?unknown\n" );
36    exit( 1 );
37}
Note: See TracBrowser for help on using the repository browser.