/usr/include/cudd/util.h is in libpolybori-dev 0.5~rc1-2.1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /* $Id: util.h,v 1.4 2008/07/08 21:41:15 alexanderdreyer Exp $ */
#ifndef UTIL_H
#define UTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__GNUC__)
# define UTIL_INLINE __inline__
# if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
# define UTIL_UNUSED __attribute__ ((unused))
# else
# define UTIL_UNUSED
# endif
#else
# define UTIL_INLINE
# define UTIL_UNUSED
#endif
#ifndef SIZEOF_VOID_P
#define SIZEOF_VOID_P 4
#endif
#ifndef SIZEOF_INT
#define SIZEOF_INT 4
#endif
#ifndef SIZEOF_LONG
#define SIZEOF_LONG 4
#endif
#if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
typedef long util_ptrint;
#else
typedef int util_ptrint;
#endif
/* #define USE_MM */ /* choose libmm.a as the memory allocator */
/* these are too entrenched to get away with changing the name */
#define strsav util_strsav
#include <unistd.h>
extern char *optarg;
extern int optind, opterr;
#define NIL(type) ((type *) 0)
#if defined(USE_MM) || defined(MNEMOSYNE)
/*
* assumes the memory manager is either libmm.a or libmnem.a
* libmm.a:
* - allows malloc(0) or realloc(obj, 0)
* - catches out of memory (and calls MMout_of_memory())
* - catch free(0) and realloc(0, size) in the macros
* libmnem.a:
* - reports memory leaks
* - is used in conjunction with the mnemalyse postprocessor
*/
#ifdef MNEMOSYNE
#include "mnemosyne.h"
#define ALLOC(type, num) \
((num) ? ((type *) malloc(sizeof(type) * (num))) : \
((type *) malloc(sizeof(long))))
#else
#define ALLOC(type, num) \
((type *) malloc(sizeof(type) * (num)))
#endif
#define REALLOC(type, obj, num) \
(obj) ? ((type *) realloc((char *) obj, sizeof(type) * (num))) : \
((type *) malloc(sizeof(type) * (num)))
#define FREE(obj) \
((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
#else
/*
* enforce strict semantics on the memory allocator
* - when in doubt, delete the '#define USE_MM' above
*/
#define ALLOC(type, num) \
((type *) MMalloc((long) sizeof(type) * (long) (num)))
#define REALLOC(type, obj, num) \
((type *) MMrealloc((char *) (obj), (long) sizeof(type) * (long) (num)))
#define FREE(obj) \
((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
#endif
/* Ultrix (and SABER) have 'fixed' certain functions which used to be int */
#if defined(ultrix) || defined(SABER) || defined(aiws) || defined(hpux) || defined(apollo) || defined(__osf__) || defined(__SVR4) || defined(__GNUC__)
#define VOID_OR_INT void
#define VOID_OR_CHAR void
#else
#define VOID_OR_INT int
#define VOID_OR_CHAR char
#endif
/* No machines seem to have much of a problem with these */
#include <stdio.h>
#include <ctype.h>
/* Some machines fail to define some functions in stdio.h */
#if !defined(__STDC__) && !defined(__cplusplus)
extern FILE *popen(), *tmpfile();
extern int pclose();
#endif
/* most machines don't give us a header file for these */
#if (defined(__STDC__) || defined(__cplusplus) || defined(ultrix)) && !defined(MNEMOSYNE) || defined(__SVR4)
# include <stdlib.h>
#else
# ifndef _IBMR2
extern VOID_OR_INT abort(), exit();
# endif
# if !defined(MNEMOSYNE) && !defined(_IBMR2)
extern VOID_OR_INT free (void *);
extern VOID_OR_CHAR *malloc(), *realloc();
# endif
extern char *getenv();
extern int system();
extern double atof();
#endif
/* some call it strings.h, some call it string.h; others, also have memory.h */
#if defined(__STDC__) || defined(__cplusplus) || defined(_IBMR2) || defined(ultrix)
#include <string.h>
#else
/* ANSI C string.h -- 1/11/88 Draft Standard */
extern char *strcpy(), *strncpy(), *strcat(), *strncat(), *strerror();
extern char *strpbrk(), *strtok(), *strchr(), *strrchr(), *strstr();
extern int strcoll(), strxfrm(), strncmp(), strlen(), strspn(), strcspn();
extern char *memmove(), *memccpy(), *memchr(), *memcpy(), *memset();
extern int memcmp(), strcmp();
#endif
#ifdef __STDC__
#include <assert.h>
#else
#ifndef NDEBUG
#define assert(ex) {\
if (! (ex)) {\
(void) fprintf(stderr,\
"Assertion failed: file %s, line %d\n\"%s\"\n",\
__FILE__, __LINE__, "ex");\
(void) fflush(stdout);\
abort();\
}\
}
#else
#define assert(ex) ;
#endif
#endif
#define fail(why) {\
(void) fprintf(stderr, "Fatal error: file %s, line %d\n%s\n",\
__FILE__, __LINE__, why);\
(void) fflush(stdout);\
abort();\
}
#ifdef lint
#undef putc /* correct lint '_flsbuf' bug */
#undef ALLOC /* allow for lint -h flag */
#undef REALLOC
#define ALLOC(type, num) (((type *) 0) + (num))
#define REALLOC(type, obj, num) ((obj) + (num))
#endif
/* These arguably do NOT belong in util.h */
#define ABS(a) ((a) < 0 ? -(a) : (a))
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef USE_MM
extern char *MMalloc (long);
extern void MMout_of_memory (long);
extern void (*MMoutOfMemory) (long);
extern char *MMrealloc (char *, long);
#endif
extern long util_cpu_time (void);
extern int util_getopt (int, char **, char *);
extern void util_getopt_reset (void);
extern char *util_path_search (char *);
extern char *util_file_search (char *, char *, char *);
extern int util_pipefork (char **, FILE **, FILE **, int *);
extern void util_print_cpu_stats (FILE *);
extern char *util_print_time (unsigned long);
extern int util_save_image (char *, char *);
extern char *util_strsav (char *);
extern char *util_tilde_expand (char *);
extern void util_restart (char *, char *, int);
/* util_getopt() global variables (ack !) */
extern int util_optind;
extern char *util_optarg;
extern long getSoftDataLimit (void);
#ifdef __cplusplus
}
#endif
#endif /* UTIL_H */
|