2 * $Id: syscfg.h,v 1.33.2.1 2007/08/26 06:15:51 sfeam Exp $
5 /* GNUPLOT - syscfg.h */
8 * Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley
10 * Permission to use, copy, and distribute this software and its
11 * documentation for any purpose with or without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and
13 * that both that copyright notice and this permission notice appear
14 * in supporting documentation.
16 * Permission to modify the software is granted, but not the right to
17 * distribute the complete modified source code. Modifications are to
18 * be distributed as patches to the released version. Permission to
19 * distribute binaries produced by compiling modified sources is granted,
21 * 1. distribute the corresponding source modifications from the
22 * released version in the form of a patch file along with the binaries,
23 * 2. add special version identification to distinguish your version
24 * in addition to the base release version number,
25 * 3. provide your name and address as the primary contact for the
26 * support of your modified version, and
27 * 4. retain our contact information in regard to use of the base
29 * Permission to distribute the released version of the source code along
30 * with corresponding source modifications in the form of a patch file is
31 * granted with same provisions 2 through 4 for binary distributions.
33 * This software is provided "as is" without express or implied warranty
34 * to the extent permitted by applicable law.
37 /* This header file provides system dependent definitions. New features
38 * and platforms should be added here.
49 * Define operating system dependent constants [default value]:
51 * OS: [""] Name of OS; only required if system has no uname(2) call
52 * HELPFILE: ["docs/gnuplot.gih"] Location of helpfile - overridden by Makefile
53 * HOME: ["HOME"] Name of environment variable which points to
54 * the directory where gnuplot's config file is found.
55 * PLOTRC: [".gnuplot"] Name of the gnuplot startup file.
56 * SHELL: ["/bin/sh"] Name, and in some cases, full path to the shell
57 * that is used to run external commands.
58 * DIRSEP1: ['/'] Primary character which separates path components.
59 * DIRSEP2: ['\0'] Secondary character which separates path components.
60 * PATHSEP: [':'] Character which separates path names
64 #if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5) || defined(__amigaos__)
67 # define HELPFILE "S:gnuplot.gih"
68 # define HOME "GNUPLOT"
69 # define SHELL "NewShell"
76 /* Fake S_IFIFO for SAS/C
77 * See stdfn.h for details
80 # define S_IFIFO S_IREAD
86 # define HOME "GNUPLOT"
87 # define PLOTRC "gnuplot.ini"
88 # define SHELL "gulam.prg"
94 /* FIXME: may need to be ifdef'd for ATARI/MTOS */
96 # define sscanf purec_sscanf
97 # define GP_MATHERR purec_matherr
101 # define OS "DOS 386"
102 # define HELPFILE "gnuplot.gih"
103 # define HOME "GNUPLOT"
104 # define PLOTRC "gnuplot.ini"
105 # define SHELL "\\command.com"
106 # define DIRSEP1 '\\'
110 #if defined(__NeXT__) || defined(NEXT)
118 # define HELPFILE "gnuplot.gih"
119 # define HOME "GNUPLOT"
120 # define PLOTRC "gnuplot.ini"
121 # define SHELL "c:\\os2\\cmd.exe"
122 # define DIRSEP1 '\\'
124 # define GNUPLOT_HISTORY_FILE "~\\gnuplot_history"
129 # define SHELL "/dd/cmds/shell"
132 #if defined(vms) || defined(VMS)
137 # define HOME "sys$login:"
138 # define PLOTRC "gnuplot.ini"
140 /* for show version long */
141 # define HELPFILE "GNUPLOT$HELP"
143 # if !defined(VAXCRTL) && !defined(DECCRTL)
144 # define VAXCRTL VAXCRTL_AND_DECCRTL_UNDEFINED
145 # define DECCRTL VAXCRTL_AND_DECCRTL_UNDEFINED
147 /* avoid some IMPLICITFUNC warnings */
149 # include <starlet.h>
153 #if defined(_WINDOWS) || defined(_Windows)
158 # define OS "MS-Windows 32 bit"
159 /* introduced by Pedro Mendes, prm@aber.ac.uk */
161 /* Fix for broken compiler headers
164 # define S_IFIFO _S_IFIFO
166 # define OS "MS-Windows"
171 # define HOME "GNUPLOT"
172 # define PLOTRC "gnuplot.ini"
173 # define SHELL "\\command.com"
174 # define DIRSEP1 '\\'
176 # define GNUPLOT_HISTORY_FILE "~\\gnuplot_history"
177 #endif /* _WINDOWS */
179 #if defined(MSDOS) && !defined(_Windows)
180 # if !defined(DOS32) && !defined(DOS16)
183 /* should this be here ? */
185 # define OS "TOS & MiNT & MULTITOS & Magic - "
189 # define HELPFILE "gnuplot.gih"
190 # define HOME "GNUPLOT"
191 # define PLOTRC "gnuplot.ini"
192 # define SHELL "\\command.com"
193 # define DIRSEP1 '\\'
198 # define GNUPLOT_HISTORY_FILE "~\\gnuplot.his"
201 /* End OS dependent constants; fall-through defaults
202 * for the constants defined above are following.
206 # define OS "non-recognized OS"
210 # define HELPFILE "docs/gnuplot.gih"
218 # define PLOTRC ".gnuplot"
222 # define SHELL "/bin/sh" /* used if SHELL env variable not set */
238 #define FAQ_LOCATION "http://www.gnuplot.info/faq/"
242 # define CONTACT "http://sourceforge.net/projects/gnuplot"
246 # define HELPMAIL "gnuplot-info@lists.sourceforge.net"
248 /* End fall-through defaults */
250 /* Need this before any headers are incldued */
252 # define __PROTO(proto) proto
254 # define __PROTO(proto) ()
257 /* Atari stuff. Moved here from command.c, plot2d.c, readline.c */
258 #if defined(ATARI) || defined(MTOS)
265 # include <aesbind.h>
266 # include <support.h>
267 # endif /* __PUREC__ */
268 #endif /* ATARI || MTOS */
271 /* DOS/Windows stuff. Moved here from command.c */
272 #if defined(MSDOS) || defined(DOS386)
276 # include <dir.h> /* HBB: for setdisk() */
278 # include <process.h>
282 # define HAVE_SLEEP 1
285 # elif defined(__TURBOC__)
286 # include <dos.h> /* for sleep() prototype */
288 # define HAVE_SLEEP 1
290 # include <dir.h> /* setdisk() */
291 # endif /* _Windows */
293 # define HAVE_SLEEP 1
296 # else /* must be MSC */
297 # if !defined(__EMX__) && !defined(DJGPP)
299 # include <direct.h> /* for _chdrive() */
300 # endif /* __MSC__ */
301 # endif /* !__EMX__ && !DJGPP */
306 /* Watcom's compiler; this should probably be somewhere
307 * in the Windows section
312 # define HAVE_GETCWD 1
313 # define GP_EXCEPTION_NAME _exception
325 #if defined(APOLLO) || defined(alliant)
326 # undef HAVE_LIMITS_H
330 # undef HAVE_LIMITS_H
340 /* HBB 20000416: stuff moved from plot.h to here. It's system-dependent,
341 * so it belongs here, IMHO */
343 /* To access curves larger than 64k, MSDOS needs to use huge pointers */
344 #if (defined(__TURBOC__) && defined(MSDOS)) || defined(WIN16)
347 #else /* not TurboC || WIN16 */
348 # define GPHUGE /* nothing */
349 # define GPFAR /* nothing */
350 #endif /* not TurboC || WIN16 */
352 #if defined(DOS16) || defined(WIN16)
353 typedef float coordval; /* memory is tight on PCs! */
354 # define COORDVAL_FLOAT 1
356 typedef double coordval;
359 /* Set max. number of arguments in a user-defined function */
361 # define MAX_NUM_VAR 3
363 # define MAX_NUM_VAR 12
366 /* HBB 20010223: Moved VERYLARGE definition to stdfn.h: it can only be
367 * resolved correctly after #include <float.h>, which is done there,
371 # define DEFAULT_COMMENTS_CHARS "#!"
372 # define is_system(c) ((c) == '$')
373 /* maybe configure could check this? */
374 # define BACKUP_FILESYSTEM 1
376 # define DEFAULT_COMMENTS_CHARS "#"
377 # define is_system(c) ((c) == '!')
381 /* assume ANSI definition by default */
382 # define RETSIGTYPE void
385 #ifndef SIGFUNC_NO_INT_ARG
386 typedef RETSIGTYPE (*sigfunc)__PROTO((int));
388 typedef RETSIGTYPE (*sigfunc)__PROTO((void));
391 #ifdef HAVE_SIGSETJMP
392 # define SETJMP(env, save_signals) sigsetjmp(env, save_signals)
393 # define LONGJMP(env, retval) siglongjmp(env, retval)
394 # define JMP_BUF sigjmp_buf
396 # define SETJMP(env, save_signals) setjmp(env)
397 # define LONGJMP(env, retval) longjmp(env, retval)
398 # define JMP_BUF jmp_buf
401 /* generic pointer type. For old compilers this has to be changed to char *,
402 * but I don't know if there are any CC's that support void and not void *
406 /* HBB 20010720: removed 'sortfunc' --- it's no longer used */
407 /* FIXME HBB 20010720: Where is SORTFUNC_ARGS supposed to be defined? */
408 #ifndef SORTFUNC_ARGS
409 #define SORTFUNC_ARGS const generic *
412 /* Macros for string concatenation */
413 #ifdef HAVE_STRINGIZE
415 # define CONCAT(x,y) x##y
416 # define CONCAT3(x,y,z) x##y##z
419 # define CONCAT(x,y) x/**/y
420 # define CONCAT3(x,y,z) x/**/y/**/z
423 /* Windows needs to redefine stdin/stdout functions */
424 #if defined(_Windows) && !defined(WINDOWS_NO_GUI)
425 # include "win/wtext.h"
428 #ifndef GP_EXCEPTION_NAME
429 # define GP_EXCEPTION_NAME exception
433 # define GP_MATHERR matherr
436 #ifdef HAVE_STRUCT_EXCEPTION_IN_MATH_H
437 # define STRUCT_EXCEPTION_P_X struct GP_EXCEPTION_NAME *x
439 # define STRUCT_EXCEPTION_P_X /* nothing */
442 /* if GP_INLINE has not yet been defined, set to __inline__ for gcc,
443 * nothing. I'd prefer that any other compilers have the defn in
444 * the makefile, rather than having a huge list of compilers here.
445 * But gcc is sufficiently ubiquitous that I'll allow it here !!!
449 # define GP_INLINE __inline__
451 # define GP_INLINE /*nothing*/
456 # include <stdbool.h>
462 typedef unsigned char _Bool;
468 # define __bool_true_false_are_defined 1
476 #define TBOOLEAN bool
478 #endif /* !SYSCFG_H */