]> git.donarmstrong.com Git - biopieces.git/blob - code_c/Maasha/src/inc/common.h
453e80d718677f4b524b74ef07f50965fae0011b
[biopieces.git] / code_c / Maasha / src / inc / common.h
1 /* Including standard libraries */
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include <string.h>
6 #include <unistd.h>
7 #include <ctype.h>
8 #include <math.h>
9 #include <assert.h>
10 #include <errno.h>
11
12 typedef unsigned char uchar;
13 typedef unsigned short ushort;
14 typedef char bool;
15
16 #define TRUE 1
17 #define FALSE 0
18
19 /* Macros for determining min or max of two given values. */
20 #define MAX( a, b ) a < b ? b : a
21 #define MIN( a, b ) a > b ? b : a
22
23 /* Macros for abs and int functions. */
24 #define ABS( x ) ( ( x ) < 0 ) ? -( x ) : ( x )
25 #define INT( x ) ( int ) x
26
27 /* Neat debug macro. */
28 #define DEBUG_EXIT 0
29 #define die assert( DEBUG_EXIT )
30
31
32 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ARRAYS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
33
34
35 /* Binary search an array of integers for an integer value. */
36 bool binary_search_array( int *array, int array_size, int val );
37
38
39 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> MISC <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
40
41
42 /* Return a binary number as a string of 1's and 0's. */
43 char *bits2string( uint bin );
44
45
46 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
47
48