aboutsummaryrefslogtreecommitdiff
path: root/graphics/vcg/files/globals.h
blob: 445f4a5cbbbfd566721651784f47cb8852d533a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
/* SCCS-info %W% %E% */

/*--------------------------------------------------------------------*/
/*                                                                    */
/*              VCG : Visualization of Compiler Graphs                */
/*              --------------------------------------                */
/*                                                                    */
/*   file:         globals.h                                          */
/*   version:      1.00.00                                            */
/*   creation:     1.4.1993                                           */
/*   author:       I. Lemke  (...-Version 0.99.99)                    */
/*                 G. Sander (Version 1.00.00-...)                    */
/*                 Universitaet des Saarlandes, 66041 Saarbruecken    */
/*                 ESPRIT Project #5399 Compare                       */
/*   description:  Global definitions and setup                       */
/*   status:       in work                                            */
/*                                                                    */
/*--------------------------------------------------------------------*/

/*
 *   Copyright (C) 1993--1995 by Georg Sander, Iris Lemke, and
 *                               the Compare Consortium
 *
 *  This program and documentation is free software; you can redistribute
 *  it under the terms of the  GNU General Public License as published by
 *  the  Free Software Foundation;  either version 2  of the License,  or
 *  (at your option) any later version.
 *
 *  This  program  is  distributed  in  the hope that it will be useful,
 *  but  WITHOUT ANY WARRANTY;  without  even  the  implied  warranty of
 *  MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE.  See  the
 *  GNU General Public License for more details.
 *
 *  You  should  have  received a copy of the GNU General Public License
 *  along  with  this  program;  if  not,  write  to  the  Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  The software is available per anonymous ftp at ftp.cs.uni-sb.de.
 *  Contact  sander@cs.uni-sb.de  for additional information.
 */


/* $Log: globals.h,v $
/* Revision 1.1.1.1  1995/02/19 09:25:43  hsu
/* vcg - a visualization tool for compiler graphs
/*
/* Submitted by:	Philippe Charnier <charnier@lirmm.fr>
/*
# Revision 3.7  1994/11/23  14:50:47  sander
# #include <limits.h> added to get MAX_INT and MIN_INT.
#
# Revision 3.6  1994/08/08  16:01:47  sander
# Attributes xraster, xlraster, yraster added.
#
# Revision 3.5  1994/08/02  15:36:12  sander
# CHECKNODE option added to allow tracing of properties
# of one single node. For debugging only.
#
# Revision 3.4  1994/06/07  14:09:59  sander
# Splines implemented.
# HP-UX, Linux, AIX, Sun-Os, IRIX compatibility tested.
# The tool is now ready to be distributed.
#
# Revision 3.3  1994/05/16  08:56:03  sander
# shape attribute (boxes, rhombs, ellipses, triangles) added.
#
# Revision 3.2  1994/03/02  11:48:54  sander
# Layoutalgoritms mindepthslow, maxdepthslow, minindegree, ... mandegree
# added.
# Anchors and nearedges are not anymore allowed to be intermixed.
# Escapes in strings are now allowed.
#
# Revision 3.1  1994/03/01  10:59:55  sander
# Copyright and Gnu Licence message added.
# Problem with "nearedges: no" and "selfloops" solved.
#
# Revision 1.2  1994/01/21  19:43:42  sander
# New started with release 1.2 from the scratch.
# Old and useless comments removed.
#
 *
 */

/*   This file contains the setup of the tool for the C compiler.
 *   It is included into every other C file.
 *   Please adapt corresponding to your configuration.
 */

#ifndef GLOBALS_H
#define	GLOBALS_H

/*------------- Please change according to your configuration --------*/

/*   Ansi C compiler or K&R C compiler ?
 *   Mainly, this causes to use prototypes or not. Note that the Suntool
 *   include files on some systems are Non-Ansi and may cause confusion.
 *   See the corresponding comments in the Makefile.
 *   Ansi C compiler set __STDC__, but Non-Ansi compilers may set this, too.
 *   Thus we use our own flag ANSI_C.
 */

/* #ifdef __STDC__==1
 * #define ANSI_C
 * #endif
 */

/* #define ANSI_C */
/* #undef  ANSI_C */
#define ANSI_C

/*   The Gnu CC sometimes does not have a standard library.
 *   In this case, the include files might be wrong.
 *   To get fewer messages on -Wall, define NO_STDINCLUDES
 *   with Gnu CC.
 */

#undef NO_STDINCLUDES


/*   User Signals available or not ?
 *   Unix provides signals SIGUSR1 and SIGUSR2 (30, 31), which are used
 *   to control animations from external. If signal() or free signals are
 *   not available (e.g. on Non-Unix systems), then undefine USR_SIGNAL.
 */

#define USR_SIGNAL
/* #undef  USR_SIGNAL */


/* Good quicksort available or not ?
 * If there exist a good randomized quicksort `qsort' in the library,
 * please use it. But if the quicksort in the library is slow, or not
 * randomized, define OWN_QUICKSORT. We often have to sort presorted
 * arrays.
 * Note: If OWN_QUICKSORT is defined, not all calls of `qsort' are
 * exchanged, but only the critical ones.
 */

/* #undef OWN_QUICKSORT  */
#define OWN_QUICKSORT


/*   Window system Sunview or X11 ?
 *   Sunview is fast, but does not support remote window displaying.
 *   X11 (R5) is a little bit slower, but supports remote display.
 *   Do not define both !!!
 */

/* #define SUNVIEW */
/* #undef  X11     */
/* #undef  SUNVIEW */
/* #define X11     */
#define X11


/*   Required alignment for structs (power of 2). IALIGN is the appropriate
 *   bit mask to generate the alignment. Because we use floats in structs,
 *   mostly an alignment of 8 is appropriate.
 */

#ifndef ALIGN
/* #define ALIGN  8 */
#define ALIGN  8
#endif

#ifndef IALIGN
#define IALIGN (ALIGN-1)
#endif


/*   Memory block size for memory allocation in bytes. The allocation
 *   mechanism allocates blocks of this size, and dynamically increases
 *   the number of blocks, if more memory is necessary.
 *   Do not set the blocksize too small. For instance the tool does not
 *   work with blockssize less than 1 KB. Propose for good performance:
 *   256 KB minimal.
 */

/* Blocks of 1 Megabyte */

/* #define MEMBLOCKSIZE 1048576 */
#define MEMBLOCKSIZE 1048576


/*   The default font for X11. Not needed at the Sunview installation.
 *   Please insert an appropriate font of about 14 to 17 dot size.
 */

#ifdef X11
#define VCG_DEFAULT_FONT "-*-courier-*-*-*--14-*-*-*-*-*-*-*"
#endif


/*   Whether the input focus grab is actively or not.
 *   If NOINPUTFOCUS, the VCG tool does not grab actively the input
 *   focus. Depending on the window manager, this may cause that
 *   the keypresses are ignored afterwards, unless the mouse pointer
 *   is once moved out of the window and back into it.
 *   On the other side, some installations cause a fatal error or
 *   strange behaviour, if the VCG tool actively grabs the input
 *   focus.
 *   The conservative definement is #define NOINPUTFOCUS.
 */

#ifdef X11
#define NOINPUTFOCUS
#endif


/*   Debugging On or Off ?
 *   We have three kinds of debugging:
 *      a) Behaviour tracing: a lot of messages nearly on every
 *         function entry are produced if DEBUG is switched on.
 *      b) Assertion checking: only if an assertion fails, an
 *         appropriate message is produced.
 *      c) Node tracing: This is basically the same as the behaviour
 *	   tracing. At each function entry, the status of a node
 *	   will be printed. This happens if CHECKNODE is defined.
 *	   See step0 for the selection of the node to be traced.
 *   Behaviour or node tracing is only needed in very serious cases.
 *   The macros "debuggingmessage" can be redefined to do some special
 *   tests on every entry.
 *   Assertion checking can always be done, because it is silent
 *   as long as no error occurs. But it consumes runtime.
 *   This all can also be defined in the head of a module before
 *   #include "globals.h", to debug only this module.
 */

/* for internal debugging */
#undef DEBUG
#undef CHECKNODE
/* for assertion checking at runtime */
#define CHECK_ASSERTIONS


/*
 *  If you prefer the system assert.h, then define ASSERT_AVAIL.
 */

/* #define ASSERT_AVAIL   */
#undef  ASSERT_AVAIL

/*  Check and printout the timing of phases.
 *  If CHECK_TIMING is defined, time measurement is done at some
 *  critical points. This is only for me, to fine tune the
 *  preformance. (GS)
 */

#undef CHECK_TIMING

/*---------------------------- End of Changes ------------------------*/

/* Maximal and minimal positive integer */

#include <limits.h>

#ifndef MAXINT
#ifdef INT_MAX
#define MAXINT  INT_MAX
#else
#define MAXINT  32767
#endif
#endif

#ifndef MININT
#ifdef INT_MIN
#define MININT  INT_MIN
#else
#define MININT  -32767
#endif
#endif

#ifndef MAXLONG
#ifdef LONG_MAX
#define MAXLONG LONG_MAX
#else
#define MAXLONG 32767
#endif
#endif

#ifndef MINLONG
#ifdef LONG_MIN
#define MINLONG LONG_MIN
#else
#define MINLONG -32767
#endif
#endif


/* Prototype support */

#ifdef ANSI_C
#define	_PP(x) x
#else
#define	_PP(x) ()
#endif

#ifndef NULL
#define NULL	0
#endif

/* Aix CC and OSF does not understand const's */

#ifdef OSF 
#define const
#endif
#ifdef AIXCC
#define const
#endif

/* Default Window system is X11 */

#ifdef SUNVIEW
#ifdef X11
#undef SUNVIEW
#endif
#else
#ifndef X11
#define X11
#endif
#endif

#ifdef X11
#define FAST_X11_DRAWING
#endif

/* Debugging messages */

#ifdef DEBUG
#define debugmessage(a,b) {FPRINTF(stderr,"Debug: %s %s\n",a,b);}
#else
#define debugmessage(a,b) /**/
#endif

#ifdef CHECKNODE
#define DEBUG
#undef debugmessage
#define debugmessage(a,b) { \
	FPRINTF(stderr,"Debug: %s %s &",a,b); \
	if (debug_checknode)  \
		FPRINTF(stderr,"Checknode: |%s|\n",NTITLE(debug_checknode)); \
	FPRINTF(stderr,"\n"); \
}
#endif

/* Assertions */

#ifndef CHECK_ASSERTIONS
#define NDEBUG
#endif
#ifdef DEBUG
#undef NDEBUG
#endif

#ifdef ASSERT_AVAIL
#include <assert.h>
#else
# ifndef NDEBUG
# define assert(ex)  {if (!(ex)) {\
   FPRINTF(stderr,"Assertion failed: file \"%s\", line %d\n",\
         __FILE__, __LINE__); \
   FPRINTF(stderr,"This is a bug! Please contact sander@cs.uni-sb.de !\n");\
   exit(1);}}
# else
# define assert(ex)
# endif
# endif


/* To make lint happy */

#define PRINTF  (void)printf
#define FPRINTF (void)fprintf
#define SPRINTF (void)sprintf
#define FCLOSE  (void)fclose
#define FFLUSH  (void)fflush
#define FREE    (void)free

/* To make ANSI C compiler with -Wall more happy */

#ifdef ANSI_C
#ifdef NO_STDINCLUDES
int    fprintf(FILE *stream, const char *format, ...);
int    printf(const char *format, ...);
int    scanf(const char *format, ...);
int    atoi(char *x);
double atof(char *x);
int    islower(int s);
int    isupper(int s);
int    tolower(int s);
int    toupper(int s);
void   bcopy(void *b1,void *b2,int length);
int    fputs(const char *s, FILE *stream);
size_t fwrite(const void *ptr, size_t s, size_t n, FILE *stream);
int    fclose(FILE *stream);
FILE  *fopen(const char *filename, const char *mode);
void   system(char *string);
int    fflush(FILE *stream);
int    getppid(void);
#ifdef X11
char   *getwd(char pn[]);
#endif
int    fgetc(FILE *stream);
#endif
#endif

#define gstoint(x) ((int)(x))
#ifdef HPUX
#define alloca(x) (malloc(x))
#define getwd(h)  (getcwd(h,MAXPATHLEN-1))
#endif

#ifdef VMS
#define alloca(x) (malloc(x))
#endif

/*--------------------------------------------------------------------*/

#endif /* GLOBALS_H */