-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutils.h
More file actions
44 lines (32 loc) · 964 Bytes
/
utils.h
File metadata and controls
44 lines (32 loc) · 964 Bytes
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
/********************************************************************
$RCSfile: utils.h,v $
$Author: alexvk $
$Revision: 1.1 $
$Date: 1997/10/15 02:54:41 $
********************************************************************/
#ifndef UTILS_INCLUDED
#define UTILS_INCLUDED
typedef double VECTOR;
#define TRUE 1
#define FALSE 0
#define true 1
#define false 0
#ifndef ABS
#define ABS(x) ((x) > 0) ? (x) : -(x)
#endif
#ifndef MAX
#define MAX(x,y) ((x) > (y)) ? (x) : (y)
#endif
#define TIMER(str,f) { long start = clock(); f; printf("%s took %.4f seconds\n", str, (clock() - start) / 1000000.0); }
#ifdef DEBUG
#define Dbg(x) if (DbgFlag) x
#define Dbg2(x,y) if (DbgFlag) x,y
#else /* DEBUG */
#define Dbg(x)
#define Dbg2(x,y)
#endif /* DEBUG */
typedef int (*CMPFUN)(const void*, const void*);
extern int DbgFlag;
extern void* a_calloc(size_t n1, size_t n2);
extern size_t TotalMemGet();
#endif /* UTILS_INCLUDED */