10 #ifndef ABC__misc__espresso__util_old_h
11 #define ABC__misc__espresso__util_old_h
20 #ifndef _ANSI_C_SOURCE
21 #define _ANSI_C_SOURCE
25 #if defined(__STDC__) || defined(sprite) || defined(_IBMR2) || defined(__osf__)
29 #if defined(_IBMR2) && !defined(__STDC__)
42 #define NIL(type) ((type *) 0)
51 #define ALLOC(type, num) \
52 ((type *) malloc(sizeof(type) * (num)))
53 #define REALLOC(type, obj, num) \
54 (obj) ? ((type *) realloc((char *) obj, sizeof(type) * (num))) : \
55 ((type *) malloc(sizeof(type) * (num)))
57 ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
63 #define ALLOC(type, num) \
64 ((type *) MMalloc((long) sizeof(type) * (long) (num)))
65 #define REALLOC(type, obj, num) \
66 ((type *) MMrealloc((char *) (obj), (long) sizeof(type) * (long) (num)))
68 ((obj) ? (free((void *) (obj)), (obj) = 0) : 0)
73 #if defined(ultrix) || defined(SABER) || defined(aiws) || defined(__hpux) || defined(__STDC__) || defined(apollo)
74 #define VOID_HACK void
86 #if !defined(__STDC__) && !defined(sprite) && !defined(_IBMR2) && !defined(__osf__)
98 #include <sys/types.h>
101 #if defined(_SIZE_T_)
114 #if defined(__STDC__) || defined(sprite) || defined(_IBMR2) || defined(__osf__) || defined(sunos4) || defined(__hpux)
135 extern double atof();
139 #if defined(ultrix3) || defined(sunos4) || defined(_IBMR2) || defined(__STDC__)
140 #define SIGNAL_FN void
143 #define SIGNAL_FN int
148 #if defined(__STDC__) || defined(sprite)
151 #if defined(ultrix4) || defined(__hpux)
154 #if defined(_IBMR2) || defined(__osf__)
173 #define random() lrand48()
174 #define srandom(a) srand48(a)
175 #define bzero(a,b) memset(a, 0, b)
177 #if !defined(__osf__) && !defined(linux)
211 # define assert(ex) {ex;}
213 # define assert(ex) {\
215 (void) fprintf(stderr,\
216 "Assertion failed: file %s, line %d\n\"%s\"\n",\
217 __FILE__, __LINE__, "ex");\
218 (void) fflush(stdout);\
226 (void) fprintf(stderr, "Fatal error: file %s, line %d\n%s\n",\
227 __FILE__, __LINE__, why);\
228 (void) fflush(stdout);\
237 #define ALLOC(type, num) (((type *) 0) + (num))
238 #define REALLOC(type, obj, num) ((obj) + (num))
250 #define ABS(a) ((a) < 0 ? -(a) : (a))
253 #define MAX(a,b) ((a) > (b) ? (a) : (b))
256 #define MIN(a,b) ((a) < (b) ? (a) : (b))
267 EXTERN void util_print_cpu_stats
ARGS((FILE *));
272 EXTERN char *util_file_search
ARGS((
char *,
char *,
char *));
273 EXTERN int util_pipefork
ARGS((
char **, FILE **, FILE **,
int *));
275 EXTERN int util_save_image
ARGS((
char *,
char *));
278 EXTERN char *util_tilde_expand
ARGS((
char *));
279 EXTERN char *util_tempnam
ARGS((
char *,
char *));
283 #define ptime() util_cpu_time()
284 #define print_time(t) util_print_time(t)
293 #define HUGE 8.9884656743115790e+307
295 #define HUGE_VAL HUGE
298 #define MAXINT (1 << 30)
EXTERN long getSoftDataLimit()
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
EXTERN void MMout_of_memory ARGS((long))
#define ABC_NAMESPACE_HEADER_END