summaryrefslogtreecommitdiffstats
path: root/src/misc/util/util_hack.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-02-20 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2006-02-20 08:01:00 -0800
commit8eef7f8326e715ea4e9e84f46487cf4657601c25 (patch)
tree03a394e5a245bd3c0ed0b6397275c5b029adfb41 /src/misc/util/util_hack.h
parent77d7377442c28fd5c65144d7ea23938600967b2b (diff)
downloadabc-8eef7f8326e715ea4e9e84f46487cf4657601c25.tar.gz
abc-8eef7f8326e715ea4e9e84f46487cf4657601c25.tar.bz2
abc-8eef7f8326e715ea4e9e84f46487cf4657601c25.zip
Version abc60220
Diffstat (limited to 'src/misc/util/util_hack.h')
-rw-r--r--src/misc/util/util_hack.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/misc/util/util_hack.h b/src/misc/util/util_hack.h
new file mode 100644
index 00000000..57914c47
--- /dev/null
+++ b/src/misc/util/util_hack.h
@@ -0,0 +1,87 @@
+/**CFile****************************************************************
+
+ FileName [util_hack.h]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [This file is used to simulate the presence of "util.h".]
+
+ Synopsis [External declarations.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: util_hack.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#ifndef __UTIL_HACK_H__
+#define __UTIL_HACK_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <time.h>
+#include <math.h>
+
+#define EXTERN extern
+#define NIL(type) ((type *) 0)
+#define random rand
+#define srandom srand
+
+#define util_cpu_time Extra_CpuTime
+#define getSoftDataLimit Extra_GetSoftDataLimit
+#define util_getopt_reset Extra_UtilGetoptReset
+#define util_getopt Extra_UtilGetopt
+#define util_print_time Extra_UtilPrintTime
+#define util_strsav Extra_UtilStrsav
+#define util_tilde_expand Extra_UtilTildeExpand
+#define util_file_search Extra_UtilFileSearch
+#define MMoutOfMemory Extra_UtilMMoutOfMemory
+
+#define util_optarg globalUtilOptarg
+#define util_optind globalUtilOptind
+
+#ifndef ARGS
+# ifdef __STDC__
+# define ARGS(args) args
+# else
+# define ARGS(args) ()
+# endif
+#endif
+
+#ifndef ABS
+# define ABS(a) ((a) < 0 ? -(a) : (a))
+#endif
+
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
+#define FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
+#define REALLOC(type, obj, num) \
+ (obj) ? ((type *) realloc((char *) obj, sizeof(type) * (num))) : \
+ ((type *) malloc(sizeof(type) * (num)))
+
+extern long Extra_CpuTime();
+extern int Extra_GetSoftDataLimit();
+extern void Extra_UtilGetoptReset();
+extern int Extra_UtilGetopt( int argc, char *argv[], char *optstring );
+extern char * Extra_UtilPrintTime( long t );
+extern char * Extra_UtilStrsav( char *s );
+extern char * Extra_UtilTildeExpand( char *fname );
+extern char * Extra_UtilFileSearch( char *file, char *path, char *mode );
+
+extern char * globalUtilOptarg;
+extern int globalUtilOptind;
+
+#endif