-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc.h
32 lines (27 loc) · 964 Bytes
/
misc.h
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
/**********************************************************************
* misc.h - misc function declarations
*
* Copyright 1993, David Nedde
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for any purpose and without fee is granted
* provided that the above copyright notice appears in all copies.
* It is provided "as is" without express or implied warranty.
**********************************************************************/
#ifndef __MISC_H__
#define __MISC_H__
char * get_string(/* char *str */);
char * my_strdup(/* char *str */);
int rand_range(/* min, max*/);
void convert_newlines(/* str*/);
#define ABS(x) ((x) < 0 ? -(x) : (x))
#define SWAP(x,y,type) { type t; t = (x); (x) = (y); (y) = t; }
#undef MIN
#undef MAX
#define MIN(x,y) ((x) > (y) ? (y) : (x))
#define MAX(x,y) ((x) < (y) ? (y) : (x))
#ifndef EXIT_FAILURE
#define EXIT_FAILURE (int)1
#define EXIT_SUCCESS (int)0
#endif
#endif