1e6232409Smrg/*
2e6232409Smrg
3e6232409SmrgCopyright 1993, 1998  The Open Group
4e6232409Smrg
5e6232409SmrgPermission to use, copy, modify, distribute, and sell this software and its
6e6232409Smrgdocumentation for any purpose is hereby granted without fee, provided that
7e6232409Smrgthe above copyright notice appear in all copies and that both that
8e6232409Smrgcopyright notice and this permission notice appear in supporting
9e6232409Smrgdocumentation.
10e6232409Smrg
11e6232409SmrgThe above copyright notice and this permission notice shall be included
12e6232409Smrgin all copies or substantial portions of the Software.
13e6232409Smrg
14e6232409SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15e6232409SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16e6232409SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17e6232409SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18e6232409SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19e6232409SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20e6232409SmrgOTHER DEALINGS IN THE SOFTWARE.
21e6232409Smrg
22e6232409SmrgExcept as contained in this notice, the name of The Open Group shall
23e6232409Smrgnot be used in advertising or otherwise to promote the sale, use or
24e6232409Smrgother dealings in this Software without prior written authorization
25e6232409Smrgfrom The Open Group.
26e6232409Smrg
27e6232409Smrg*/
28e6232409Smrg
29e6232409Smrg/*
308fff3f40Smrg * dsimple.h:      This file contains the definitions needed to use the
318fff3f40Smrg *                 functions in dsimple.c.  It also declares the global
32e6232409Smrg *                 variables dpy, screen, and program_name which are needed to
338fff3f40Smrg *                 use dsimple.c.
34e6232409Smrg *
35e6232409Smrg * Written by Mark Lillibridge.   Last updated 7/1/87
36e6232409Smrg *
37e6232409Smrg * Send bugs, etc. to chariot@athena.mit.edu.
38e6232409Smrg */
39e6232409Smrg
4094a251fdSmrg#include <X11/Xfuncproto.h>
4194a251fdSmrg
42e6232409Smrg    /* Simple helper macros */
43e6232409Smrg#ifndef MAX
44e6232409Smrg#define MAX(a,b) (((a)>(b))?(a):(b))
45e6232409Smrg#endif /* MAX */
46e6232409Smrg#ifndef MIN
47e6232409Smrg#define MIN(a,b) (((a)<(b))?(a):(b))
48e6232409Smrg#endif /* MIN */
49e6232409Smrg
50e6232409Smrg    /* Global variables used by routines in just_display.c */
51e6232409Smrg
526d1874b2Smrgextern const char *program_name;        /* Name of this program */
536d1874b2Smrgextern Display *dpy;                    /* The current display */
546d1874b2Smrgextern int screen;                      /* The current screen */
55e6232409Smrg
566d1874b2Smrg#define INIT_NAME program_name=argv[0]  /* use this in main to setup
576d1874b2Smrg                                           program_name */
58e6232409Smrg
598fff3f40Smrg/* Declarations for functions in dsimple.c */
60e6232409Smrg
61e6232409Smrgvoid Setup_Display_And_Screen(int *, char **);
62e6232409Smrgvoid Close_Display(void);
636a45684fSmrgvoid usage(const char *errmsg) _X_NORETURN;
64e6232409Smrg
656d1874b2Smrg#define X_USAGE "[host:display]"        /* X arguments handled by
666d1874b2Smrg                                           Get_Display_Name */
67e6232409Smrg
686d1874b2Smrgvoid Fatal_Error(const char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1, 2);
69