1 /*
2  *  ADF Library. (C) 1997-2002 Laurent Clevy
3  *
4  *  adf_defs.h
5  *
6  *  $Id$
7  *
8  *
9  *  This file is part of ADFLib.
10  *
11  *  ADFLib is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 2 of the License, or
14  *  (at your option) any later version.
15  *
16  *  ADFLib is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with Foobar; if not, write to the Free Software
23  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24  *
25  */
26 
27 
28 #ifndef _ADF_DEFS_H
29 #define _ADF_DEFS_H 1
30 
31 #define ADFLIB_VERSION "0.7.11a"
32 #define ADFLIB_DATE "January 20th, 2007"
33 
34 #define SECTNUM int32_t
35 #define RETCODE int32_t
36 
37 #define TRUE    1
38 #define FALSE   0
39 
40 #include <stdint.h>
41 #define ULONG   uint32_t
42 #define USHORT  uint16_t
43 #define UCHAR   uint8_t
44 #define BOOL    int
45 
46 
47 /* defines max and min */
48 
49 #ifndef max
50 #define max(a,b)        (a)>(b) ? (a) : (b)
51 #endif
52 #ifndef min
53 #define min(a,b)        (a)<(b) ? (a) : (b)
54 #endif
55 
56 
57 /* (*byte) to (*short) and (*byte) to (*long) conversion */
58 
59 #define Short(p) ((p)[0]<<8 | (p)[1])
60 #define Long(p) (Short(p)<<16 | Short(p+2))
61 
62 
63 /* swap short and swap long macros for little endian machines */
64 
65 #define swapShort(p) ((p)[0]<<8 | (p)[1])
66 #define swapLong(p) (swapShort(p)<<16 | swapShort(p+2))
67 
68 
69 
70 #endif /* _ADF_DEFS_H */
71 /*##########################################################################*/
72