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