dsimple.h revision 8fff3f40
1e6232409Smrg/* $Xorg: dsimple.h,v 1.4 2001/02/09 02:05:54 xorgcvs Exp $ */
2e6232409Smrg/*
3e6232409Smrg
4e6232409SmrgCopyright 1993, 1998  The Open Group
5e6232409Smrg
6e6232409SmrgPermission to use, copy, modify, distribute, and sell this software and its
7e6232409Smrgdocumentation for any purpose is hereby granted without fee, provided that
8e6232409Smrgthe above copyright notice appear in all copies and that both that
9e6232409Smrgcopyright notice and this permission notice appear in supporting
10e6232409Smrgdocumentation.
11e6232409Smrg
12e6232409SmrgThe above copyright notice and this permission notice shall be included
13e6232409Smrgin all copies or substantial portions of the Software.
14e6232409Smrg
15e6232409SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16e6232409SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17e6232409SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18e6232409SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19e6232409SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20e6232409SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21e6232409SmrgOTHER DEALINGS IN THE SOFTWARE.
22e6232409Smrg
23e6232409SmrgExcept as contained in this notice, the name of The Open Group shall
24e6232409Smrgnot be used in advertising or otherwise to promote the sale, use or
25e6232409Smrgother dealings in this Software without prior written authorization
26e6232409Smrgfrom The Open Group.
27e6232409Smrg
28e6232409Smrg*/
29e6232409Smrg/* $XFree86: xc/programs/xlsfonts/dsimple.h,v 1.8 2002/12/24 17:43:01 tsi Exp $ */
30e6232409Smrg
31e6232409Smrg/*
328fff3f40Smrg * dsimple.h:      This file contains the definitions needed to use the
338fff3f40Smrg *                 functions in dsimple.c.  It also declares the global
34e6232409Smrg *                 variables dpy, screen, and program_name which are needed to
358fff3f40Smrg *                 use dsimple.c.
36e6232409Smrg *
37e6232409Smrg * Written by Mark Lillibridge.   Last updated 7/1/87
38e6232409Smrg *
39e6232409Smrg * Send bugs, etc. to chariot@athena.mit.edu.
40e6232409Smrg */
41e6232409Smrg
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
52e6232409Smrgextern char *program_name;                   /* Name of this program */
53e6232409Smrgextern Display *dpy;                         /* The current display */
54e6232409Smrgextern int screen;                           /* The current screen */
55e6232409Smrg
56e6232409Smrg#define INIT_NAME program_name=argv[0]        /* use this in main to setup
57e6232409Smrg                                                 program_name */
58e6232409Smrg
598fff3f40Smrg/* Declarations for functions in dsimple.c */
60e6232409Smrg
61e6232409Smrgchar *Malloc(unsigned);
62e6232409Smrgchar *Realloc(char *, int);
63e6232409Smrgvoid Setup_Display_And_Screen(int *, char **);
64e6232409Smrgvoid Close_Display(void);
65e6232409Smrgvoid usage(void);
66e6232409Smrg
67e6232409Smrg#define X_USAGE "[host:display]"              /* X arguments handled by
68e6232409Smrg						 Get_Display_Name */
69e6232409Smrg
70e6232409Smrg#ifdef __GNUC__
71e6232409Smrgvoid Fatal_Error(char *, ...) __attribute__((__noreturn__));
72e6232409Smrg#else
73e6232409Smrgvoid Fatal_Error(char *, ...);
74e6232409Smrg#endif
75