nethercote | 5912c81 | 2004-02-15 15:38:08 +0000 | [diff] [blame] | 1 | /* This file is part of hp2ps, a graph drawer for memory profiles. |
| 2 | Copyright (C) 2002 The University Court of the University of Glasgow. |
| 3 | This program is governed by the license contained in the file LICENSE. */ |
| 4 | |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 5 | #ifndef MAIN_H |
| 6 | #define MAIN_H |
| 7 | |
| 8 | //#include "config.h" |
| 9 | |
| 10 | #ifdef __STDC__ |
| 11 | #define PROTO(x) x |
| 12 | #else |
| 13 | #define PROTO(x) () |
| 14 | #endif |
| 15 | |
| 16 | /* our own ASSERT macro (for C) */ |
| 17 | #ifndef DEBUG |
| 18 | #define ASSERT(predicate) /*nothing*/ |
| 19 | |
| 20 | #else |
| 21 | void _ghcAssert PROTO((char *, unsigned int)); |
| 22 | |
| 23 | #define ASSERT(predicate) \ |
| 24 | if (predicate) \ |
| 25 | /*null*/; \ |
| 26 | else \ |
| 27 | _ghcAssert(__FILE__, __LINE__) |
| 28 | #endif |
| 29 | |
| 30 | /* partain: some ubiquitous types: floatish & intish. |
| 31 | Dubious to use float/int, but that is what it used to be... |
| 32 | (WDP 95/03) |
| 33 | */ |
| 34 | typedef double floatish; |
| 35 | typedef double doublish; /* higher precision, if anything; little used */ |
| 36 | typedef int boolish; |
| 37 | |
| 38 | /* Use "long long" if we have it: the numbers in profiles can easily |
| 39 | * overflow 32 bits after a few seconds execution. |
| 40 | */ |
| 41 | #define HAVE_LONG_LONG 1 // --added by njn, because config.h removed |
| 42 | |
| 43 | #ifdef HAVE_LONG_LONG |
| 44 | typedef long long int intish; |
| 45 | #else |
| 46 | typedef long int intish; |
| 47 | #endif |
| 48 | |
| 49 | extern intish nsamples; |
| 50 | extern intish nmarks; |
| 51 | extern intish nidents; |
| 52 | |
| 53 | extern floatish maxcombinedheight; |
| 54 | extern floatish areabelow; |
| 55 | extern floatish epsfwidth; |
| 56 | |
| 57 | extern floatish xrange; |
| 58 | extern floatish yrange; |
| 59 | |
| 60 | extern floatish auxxrange; |
| 61 | extern floatish auxyrange; |
| 62 | |
| 63 | extern boolish eflag; |
| 64 | extern boolish gflag; |
| 65 | extern boolish yflag; |
| 66 | extern boolish bflag; |
| 67 | extern boolish sflag; |
| 68 | extern int mflag; |
| 69 | extern boolish tflag; |
| 70 | extern boolish cflag; |
| 71 | |
| 72 | extern char *programname; |
| 73 | |
| 74 | extern char *hpfile; |
| 75 | extern char *psfile; |
| 76 | extern char *auxfile; |
| 77 | |
| 78 | extern FILE *hpfp; |
| 79 | extern FILE *psfp; |
| 80 | extern FILE *g_auxfp; |
| 81 | |
| 82 | #endif /* MAIN_H */ |