]> mj.ucw.cz Git - libucw.git/blob - lib/config.h
bugfixes
[libucw.git] / lib / config.h
1 /*
2  *      UCW Library -- Configuration-Dependent Definitions
3  *
4  *      (c) 1997--2004 Martin Mares <mj@ucw.cz>
5  *      (c) 2006 Robert Spalek <robert@ucw.cz>
6  *
7  *      This software may be freely distributed and used according to the terms
8  *      of the GNU Lesser General Public License.
9  */
10
11 #ifndef _UCW_CONFIG_H
12 #define _UCW_CONFIG_H
13
14 /* Configuration switches */
15
16 #include "lib/autoconf.h"
17
18 /* Types */
19
20 typedef unsigned char byte;             /* exactly 8 bits, unsigned */
21 typedef signed char sbyte;              /* exactly 8 bits, signed */
22 typedef unsigned char u8;               /* exactly 8 bits, unsigned */
23 typedef signed char s8;                 /* exactly 8 bits, signed */
24 typedef unsigned short word;            /* exactly 16 bits, unsigned */
25 typedef short sword;                    /* exactly 16 bits, signed */
26 typedef unsigned short u16;             /* exactly 16 bits, unsigned */
27 typedef short s16;                      /* exactly 16 bits, signed */
28 typedef unsigned int u32;               /* exactly 32 bits, unsigned */
29 typedef int s32;                        /* exactly 32 bits, signed */
30 typedef unsigned int uns;               /* at least 32 bits */
31 typedef unsigned long long int u64;     /* exactly 64 bits, unsigned */
32 typedef long long int s64;              /* exactly 64 bits, signed */
33 typedef unsigned long addr_int_t;       /* Both integer and address */
34 typedef unsigned int sh_time_t;         /* Timestamp */
35
36 #ifndef NULL
37 #define NULL (void *)0
38 #endif
39
40 #ifdef CONFIG_LFS                       /* File positions */
41 typedef s64 sh_off_t;
42 #else
43 typedef s32 sh_off_t;
44 #endif
45
46 #ifdef CPU_64BIT_POINTERS
47 #define BYTES_PER_P 8
48 #define bgetp(f) bgetq(f)
49 #define bputp(f,l) bputq(f,l)
50 #define GET_P(p) GET_U64(p)
51 #define PUT_P(p,x) PUT_U64(p,x)
52 #else
53 #define BYTES_PER_P 4
54 #define bgetp(f) bgetl(f)
55 #define bputp(f,l) bputl(f,l)
56 #define GET_P(p) GET_U32(p)
57 #define PUT_P(p,x) PUT_U32(p,x)
58 #endif
59
60 #endif