Initial release of Maemo 5 port of gnuplot
[gnuplot] / src / syscfg.h
1 /*
2  * $Id: syscfg.h,v 1.33.2.1 2007/08/26 06:15:51 sfeam Exp $
3  */
4
5 /* GNUPLOT - syscfg.h */
6
7 /*[
8  * Copyright 1986 - 1993, 1998, 2004   Thomas Williams, Colin Kelley
9  *
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.
15  *
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,
20  * provided you
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
28  *    software.
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.
32  *
33  * This software is provided "as is" without express or implied warranty
34  * to the extent permitted by applicable law.
35 ]*/
36
37 /* This header file provides system dependent definitions. New features
38  * and platforms should be added here.
39  */
40
41 #ifndef SYSCFG_H
42 #define SYSCFG_H
43
44 #ifdef HAVE_CONFIG_H
45 # include "config.h"
46 #endif
47
48 /*
49  * Define operating system dependent constants [default value]:
50  *
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
61  *
62  */
63
64 #if defined(AMIGA_SC_6_1) || defined(AMIGA_AC_5) || defined(__amigaos__)
65 # ifndef __amigaos__
66 #  define OS "Amiga"
67 #  define HELPFILE "S:gnuplot.gih"
68 #  define HOME     "GNUPLOT"
69 #  define SHELL    "NewShell"
70 #  define DIRSEP2  ':'
71 #  define PATHSEP  ';'
72 # endif
73 # ifndef AMIGA
74 #  define AMIGA
75 # endif
76 /* Fake S_IFIFO for SAS/C
77  * See stdfn.h for details
78  */
79 # ifdef AMIGA_SC_6_1
80 #  define S_IFIFO S_IREAD
81 # endif
82 #endif /* Amiga */
83
84 #ifdef ATARI
85 # define OS      "TOS"
86 # define HOME     "GNUPLOT"
87 # define PLOTRC   "gnuplot.ini"
88 # define SHELL    "gulam.prg"
89 # define DIRSEP1  '\\'
90 # ifdef MTOS
91 #  define DIRSEP2 '/'
92 # endif
93 #endif /* Atari */
94 /* FIXME: may need to be ifdef'd for ATARI/MTOS */
95 #ifdef __PUREC__
96 # define sscanf purec_sscanf
97 # define GP_MATHERR purec_matherr
98 #endif
99
100 #ifdef DOS386
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  '\\'
107 # define PATHSEP  ';'
108 #endif /* DOS386 */
109
110 #if defined(__NeXT__) || defined(NEXT)
111 # ifndef NEXT
112 #  define NEXT
113 # endif
114 #endif /* NeXT */
115
116 #ifdef OS2
117 # define OS       "OS/2"
118 # define HELPFILE "gnuplot.gih"
119 # define HOME     "GNUPLOT"
120 # define PLOTRC   "gnuplot.ini"
121 # define SHELL    "c:\\os2\\cmd.exe"
122 # define DIRSEP1  '\\'
123 # define PATHSEP  ';'
124 # define GNUPLOT_HISTORY_FILE "~\\gnuplot_history"
125 #endif /* OS/2 */
126
127 #ifdef OSK
128 # define OS    "OS-9"
129 # define SHELL "/dd/cmds/shell"
130 #endif /* OS-9 */
131
132 #if defined(vms) || defined(VMS)
133 # define OS "VMS"
134 # ifndef VMS
135 #  define VMS
136 # endif
137 # define HOME   "sys$login:"
138 # define PLOTRC "gnuplot.ini"
139 # ifdef NO_GIH
140    /* for show version long */
141 #  define HELPFILE "GNUPLOT$HELP"
142 # endif
143 # if !defined(VAXCRTL) && !defined(DECCRTL)
144 #  define VAXCRTL VAXCRTL_AND_DECCRTL_UNDEFINED
145 #  define DECCRTL VAXCRTL_AND_DECCRTL_UNDEFINED
146 # endif
147 /* avoid some IMPLICITFUNC warnings */
148 # ifdef __DECC
149 #  include <starlet.h>
150 # endif  /* __DECC */
151 #endif /* VMS */
152
153 #if defined(_WINDOWS) || defined(_Windows)
154 # ifndef _Windows
155 #  define _Windows
156 # endif
157 # ifdef WIN32
158 #  define OS "MS-Windows 32 bit"
159 /* introduced by Pedro Mendes, prm@aber.ac.uk */
160 #  define far
161 /* Fix for broken compiler headers
162  * See stdfn.h
163  */
164 #  define S_IFIFO  _S_IFIFO
165 # else
166 #  define OS "MS-Windows"
167 #  ifndef WIN16
168 #   define WIN16
169 #  endif
170 # endif /* WIN32 */
171 # define HOME    "GNUPLOT"
172 # define PLOTRC  "gnuplot.ini"
173 # define SHELL   "\\command.com"
174 # define DIRSEP1 '\\'
175 # define PATHSEP ';'
176 # define GNUPLOT_HISTORY_FILE "~\\gnuplot_history"
177 #endif /* _WINDOWS */
178
179 #if defined(MSDOS) && !defined(_Windows)
180 # if !defined(DOS32) && !defined(DOS16)
181 #  define DOS16
182 # endif
183 /* should this be here ? */
184 # ifdef MTOS
185 #  define OS "TOS & MiNT & MULTITOS & Magic - "
186 # endif /* MTOS */
187 # define OS       "MS-DOS"
188 # undef HELPFILE
189 # define HELPFILE "gnuplot.gih"
190 # define HOME     "GNUPLOT"
191 # define PLOTRC   "gnuplot.ini"
192 # define SHELL    "\\command.com"
193 # define DIRSEP1  '\\'
194 # define PATHSEP  ';'
195 # ifdef __DJGPP__
196 #  define DIRSEP2 '/'
197 # endif
198 # define GNUPLOT_HISTORY_FILE "~\\gnuplot.his"
199 #endif /* MSDOS */
200
201 /* End OS dependent constants; fall-through defaults
202  * for the constants defined above are following.
203  */
204
205 #ifndef OS
206 # define OS "non-recognized OS"
207 #endif
208
209 #ifndef HELPFILE
210 # define HELPFILE "docs/gnuplot.gih"
211 #endif
212
213 #ifndef HOME
214 # define HOME "HOME"
215 #endif
216
217 #ifndef PLOTRC
218 # define PLOTRC ".gnuplot"
219 #endif
220
221 #ifndef SHELL
222 # define SHELL "/bin/sh"    /* used if SHELL env variable not set */
223 #endif
224
225 #ifndef DIRSEP1
226 # define DIRSEP1 '/'
227 #endif
228
229 #ifndef DIRSEP2
230 # define DIRSEP2 NUL
231 #endif
232
233 #ifndef PATHSEP
234 # define PATHSEP ':'
235 #endif
236
237 #ifndef FAQ_LOCATION
238 #define FAQ_LOCATION "http://www.gnuplot.info/faq/"
239 #endif
240
241 #ifndef CONTACT
242 # define CONTACT "http://sourceforge.net/projects/gnuplot"
243 #endif
244
245 #ifndef HELPMAIL
246 # define HELPMAIL "gnuplot-info@lists.sourceforge.net"
247 #endif
248 /* End fall-through defaults */
249
250 /* Need this before any headers are incldued */
251 #ifdef PROTOTYPES
252 # define __PROTO(proto) proto
253 #else
254 # define __PROTO(proto) ()
255 #endif
256
257 /* Atari stuff. Moved here from command.c, plot2d.c, readline.c */
258 #if defined(ATARI) || defined(MTOS)
259 # ifdef __PUREC__
260 #  include <ext.h>
261 #  include <tos.h>
262 #  include <aes.h>
263 # else
264 #  include <osbind.h>
265 #  include <aesbind.h>
266 #  include <support.h>
267 # endif                         /* __PUREC__ */
268 #endif /* ATARI || MTOS */
269
270
271 /* DOS/Windows stuff. Moved here from command.c */
272 #if defined(MSDOS) || defined(DOS386)
273
274 # ifdef DJGPP
275 #  include <dos.h>
276 #  include <dir.h>              /* HBB: for setdisk() */
277 # else
278 #  include <process.h>
279 # endif                         /* !DJGPP */
280
281 # ifdef __ZTC__
282 #  define HAVE_SLEEP 1
283 #  define P_WAIT 0
284
285 # elif defined(__TURBOC__)
286 #  include <dos.h>              /* for sleep() prototype */
287 #  ifndef _Windows
288 #   define HAVE_SLEEP 1
289 #   include <conio.h>
290 #   include <dir.h>            /* setdisk() */
291 #  endif                       /* _Windows */
292 #  ifdef WIN32
293 #   define HAVE_SLEEP 1
294 #  endif
295
296 # else                         /* must be MSC */
297 #  if !defined(__EMX__) && !defined(DJGPP)
298 #   ifdef __MSC__
299 #    include <direct.h>        /* for _chdrive() */
300 #   endif                      /* __MSC__ */
301 #  endif                       /* !__EMX__ && !DJGPP */
302 # endif                        /* !ZTC */
303
304 #endif /* MSDOS */
305
306 /* Watcom's compiler; this should probably be somewhere
307  * in the Windows section
308  */
309 #ifdef __WATCOMC__
310 # include <direct.h>
311 # include <dos.h>
312 # define HAVE_GETCWD 1
313 # define GP_EXCEPTION_NAME _exception
314 #endif
315
316
317 /* Misc platforms */
318 #ifdef apollo
319 # ifndef APOLLO
320 #  define APOLLO
321 # endif
322 # define GPR
323 #endif
324
325 #if defined(APOLLO) || defined(alliant)
326 # undef HAVE_LIMITS_H
327 #endif
328
329 #ifdef sequent
330 # undef HAVE_LIMITS_H
331 # undef HAVE_STRCHR
332 #endif
333
334 #ifdef unixpc
335 # ifndef UNIXPC
336 #  define UNIXPC
337 # endif
338 #endif
339
340 /* HBB 20000416: stuff moved from plot.h to here. It's system-dependent,
341  * so it belongs here, IMHO */
342
343 /* To access curves larger than 64k, MSDOS needs to use huge pointers */
344 #if (defined(__TURBOC__) && defined(MSDOS)) || defined(WIN16)
345 # define GPHUGE huge
346 # define GPFAR far
347 #else /* not TurboC || WIN16 */
348 # define GPHUGE /* nothing */
349 # define GPFAR /* nothing */
350 #endif /* not TurboC || WIN16 */
351
352 #if defined(DOS16) || defined(WIN16)
353 typedef float coordval;         /* memory is tight on PCs! */
354 # define COORDVAL_FLOAT 1
355 #else
356 typedef double coordval;
357 #endif
358
359 /* Set max. number of arguments in a user-defined function */
360 #ifdef DOS16
361 # define MAX_NUM_VAR    3
362 #else
363 # define MAX_NUM_VAR    12
364 #endif
365
366 /* HBB 20010223: Moved VERYLARGE definition to stdfn.h: it can only be
367  * resolved correctly after #include <float.h>, which is done there,
368  * not here. */
369
370 #ifdef VMS
371 # define DEFAULT_COMMENTS_CHARS "#!"
372 # define is_system(c) ((c) == '$')
373 /* maybe configure could check this? */
374 # define BACKUP_FILESYSTEM 1
375 #else /* not VMS */
376 # define DEFAULT_COMMENTS_CHARS "#"
377 # define is_system(c) ((c) == '!')
378 #endif /* not VMS */
379
380 #ifndef RETSIGTYPE
381 /* assume ANSI definition by default */
382 # define RETSIGTYPE void
383 #endif
384
385 #ifndef SIGFUNC_NO_INT_ARG
386 typedef RETSIGTYPE (*sigfunc)__PROTO((int));
387 #else
388 typedef RETSIGTYPE (*sigfunc)__PROTO((void));
389 #endif
390
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
395 #else
396 # define SETJMP(env, save_signals) setjmp(env)
397 # define LONGJMP(env, retval) longjmp(env, retval)
398 # define JMP_BUF jmp_buf
399 #endif
400
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 *
403  */
404 #define generic void
405
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 *
410 #endif
411
412 /* Macros for string concatenation */
413 #ifdef HAVE_STRINGIZE
414 /* ANSI version */
415 # define CONCAT(x,y) x##y
416 # define CONCAT3(x,y,z) x##y##z
417 #else
418 /* K&R version */
419 # define CONCAT(x,y) x/**/y
420 # define CONCAT3(x,y,z) x/**/y/**/z
421 #endif
422
423 /* Windows needs to redefine stdin/stdout functions */
424 #if defined(_Windows) && !defined(WINDOWS_NO_GUI)
425 # include "win/wtext.h"
426 #endif
427
428 #ifndef GP_EXCEPTION_NAME
429 # define GP_EXCEPTION_NAME exception
430 #endif
431
432 #ifndef GP_MATHERR
433 # define GP_MATHERR matherr
434 #endif
435
436 #ifdef HAVE_STRUCT_EXCEPTION_IN_MATH_H
437 # define STRUCT_EXCEPTION_P_X struct GP_EXCEPTION_NAME *x
438 #else
439 # define STRUCT_EXCEPTION_P_X /* nothing */
440 #endif
441
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 !!!
446  */
447 #ifndef GP_INLINE
448 # ifdef __GNUC__
449 #  define GP_INLINE __inline__
450 # else
451 #  define GP_INLINE /*nothing*/
452 # endif
453 #endif
454
455 #if HAVE_STDBOOL_H
456 # include <stdbool.h>
457 #else
458 # if ! HAVE__BOOL
459 #  ifdef __cplusplus
460 typedef bool _Bool;
461 #  else
462 typedef unsigned char _Bool;
463 #  endif
464 # endif
465 # define bool _Bool
466 # define false 0
467 # define true 1
468 # define __bool_true_false_are_defined 1
469 #endif
470
471 #undef TRUE
472 #define TRUE true
473 #undef FALSE
474 #define FALSE false
475
476 #define TBOOLEAN bool
477
478 #endif /* !SYSCFG_H */