dsimple.h revision ff7e0acc
1ff7e0accSmrg/* $Xorg: dsimple.h,v 1.4 2001/02/09 02:05:54 xorgcvs Exp $ */
2ff7e0accSmrg/*
3ff7e0accSmrg
4ff7e0accSmrgCopyright 1993, 1998  The Open Group
5ff7e0accSmrg
6ff7e0accSmrgPermission to use, copy, modify, distribute, and sell this software and its
7ff7e0accSmrgdocumentation for any purpose is hereby granted without fee, provided that
8ff7e0accSmrgthe above copyright notice appear in all copies and that both that
9ff7e0accSmrgcopyright notice and this permission notice appear in supporting
10ff7e0accSmrgdocumentation.
11ff7e0accSmrg
12ff7e0accSmrgThe above copyright notice and this permission notice shall be included
13ff7e0accSmrgin all copies or substantial portions of the Software.
14ff7e0accSmrg
15ff7e0accSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16ff7e0accSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17ff7e0accSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18ff7e0accSmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19ff7e0accSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20ff7e0accSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21ff7e0accSmrgOTHER DEALINGS IN THE SOFTWARE.
22ff7e0accSmrg
23ff7e0accSmrgExcept as contained in this notice, the name of The Open Group shall
24ff7e0accSmrgnot be used in advertising or otherwise to promote the sale, use or
25ff7e0accSmrgother dealings in this Software without prior written authorization
26ff7e0accSmrgfrom The Open Group.
27ff7e0accSmrg
28ff7e0accSmrg*/
29ff7e0accSmrg/* $XFree86: xc/programs/xlsfonts/dsimple.h,v 1.8 2002/12/24 17:43:01 tsi Exp $ */
30ff7e0accSmrg
31ff7e0accSmrg/*
32ff7e0accSmrg * Just_display.h: This file contains the definitions needed to use the
33ff7e0accSmrg *                 functions in just_display.c.  It also declares the global
34ff7e0accSmrg *                 variables dpy, screen, and program_name which are needed to
35ff7e0accSmrg *                 use just_display.c.
36ff7e0accSmrg *
37ff7e0accSmrg * Written by Mark Lillibridge.   Last updated 7/1/87
38ff7e0accSmrg *
39ff7e0accSmrg * Send bugs, etc. to chariot@athena.mit.edu.
40ff7e0accSmrg */
41ff7e0accSmrg
42ff7e0accSmrg    /* Simple helper macros */
43ff7e0accSmrg#ifndef MAX
44ff7e0accSmrg#define MAX(a,b) (((a)>(b))?(a):(b))
45ff7e0accSmrg#endif /* MAX */
46ff7e0accSmrg#ifndef MIN
47ff7e0accSmrg#define MIN(a,b) (((a)<(b))?(a):(b))
48ff7e0accSmrg#endif /* MIN */
49ff7e0accSmrg
50ff7e0accSmrg    /* Global variables used by routines in dsimple.c */
51ff7e0accSmrg
52ff7e0accSmrgextern char *program_name;                   /* Name of this program */
53ff7e0accSmrgextern Display *dpy;                         /* The current display */
54ff7e0accSmrgextern int screen;                           /* The current screen */
55ff7e0accSmrg
56ff7e0accSmrg#define INIT_NAME program_name=argv[0]        /* use this in main to setup
57ff7e0accSmrg                                                 program_name */
58ff7e0accSmrg
59ff7e0accSmrg    /* Declaritions for functions in dsimple.c */
60ff7e0accSmrg
61ff7e0accSmrgchar *Get_Display_Name(int *, char **);
62ff7e0accSmrgDisplay *Open_Display(char *);
63ff7e0accSmrgvoid Setup_Display_And_Screen(int *, char **);
64ff7e0accSmrgvoid Close_Display(void);
65ff7e0accSmrgWindow Select_Window_Args(int *, char **);
66ff7e0accSmrgvoid usage(void);
67ff7e0accSmrg
68ff7e0accSmrg#define X_USAGE "[host:display]"              /* X arguments handled by
69ff7e0accSmrg						 Get_Display_Name */
70ff7e0accSmrg
71ff7e0accSmrg/*
72ff7e0accSmrg * Other_stuff.h: Definitions of routines in other_stuff.
73ff7e0accSmrg *
74ff7e0accSmrg * Written by Mark Lillibridge.   Last updated 7/1/87
75ff7e0accSmrg *
76ff7e0accSmrg * Send bugs, etc. to chariot@athena.mit.edu.
77ff7e0accSmrg */
78ff7e0accSmrg
79ff7e0accSmrgWindow Select_Window(Display *);
80ff7e0accSmrgWindow Window_With_Name(Display *, Window, char *);
81ff7e0accSmrg#ifdef __GNUC__
82ff7e0accSmrgvoid Fatal_Error(char *, ...) __attribute__((__noreturn__));
83ff7e0accSmrg#else
84ff7e0accSmrgvoid Fatal_Error(char *, ...);
85ff7e0accSmrg#endif
86