]> mj.ucw.cz Git - libucw.git/blob - lib/config.h
37b19867406912e2c5496fb3c97ad04a3e036855
[libucw.git] / lib / config.h
1 /*
2  *      Sherlock Library -- Configuration-Dependent Definitions
3  *
4  *      (c) 1997--2000 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
5  */
6
7 #ifndef _SHERLOCK_CONFIG_H
8 #define _SHERLOCK_CONFIG_H
9
10 /* Version */
11
12 #define SHER_VER "1.3"
13
14 /* Features */
15
16 #define SHERLOCK_CONFIG_REF_WEIGHTS     /* Weighed references */
17 #define SHERLOCK_CONFIG_LARGE_DB        /* Support for DB files >4GB */
18 #define SHERLOCK_CONFIG_LFS             /* Large files on 32-bit systems */
19 #undef  SHERLOCK_CONFIG_LFS_LIBC        /* LFS supported directly by libc */
20
21 /* Types */
22
23 typedef unsigned char byte;             /* exactly 8 bits, unsigned */
24 typedef signed char sbyte;              /* exactly 8 bits, signed */
25 typedef unsigned short word;            /* exactly 16 bits, unsigned */
26 typedef short sword;                    /* exactly 16 bits, signed */
27 typedef unsigned short u16;             /* exactly 16 bits, unsigned */
28 typedef short s16;                      /* exactly 16 bits, signed */
29 typedef unsigned int u32;               /* exactly 32 bits, unsigned */
30 typedef int s32;                        /* exactly 32 bits, signed */
31 typedef unsigned int uns;               /* at least 32 bits */
32 typedef unsigned long long int u64;     /* exactly 64 bits, unsigned */
33 typedef long long int s64;              /* exactly 64 bits, signed */
34 typedef unsigned long addr_int_t;       /* Both integer and address */
35
36 #ifndef NULL
37 #define NULL (void *)0
38 #endif
39
40 typedef u32 oid_t;                      /* Object ID */
41
42 #ifdef SHERLOCK_CONFIG_LFS              /* off_t as passed to file functions */
43 typedef s64 sh_off_t;
44 #define BYTES_PER_FILE_POINTER 5
45 #else
46 typedef int sh_off_t;
47 #define BYTES_PER_FILE_POINTER 4
48 #endif
49
50 #ifdef SHERLOCK_CONFIG_LARGE_DB         /* off_t as present in database files */
51 typedef s64 sh_foff_t;
52 #else
53 typedef s32 sh_foff_t;
54 #endif
55
56 /* CPU characteristics */
57
58 #define CPU_LITTLE_ENDIAN
59 #undef CPU_BIG_ENDIAN
60 #define CPU_CAN_DO_UNALIGNED_WORDS
61 #define CPU_CAN_DO_UNALIGNED_LONGS
62 #define CPU_STRUCT_ALIGN 4
63
64 /* Misc */
65
66 #ifdef __GNUC__
67
68 #undef inline
69 #define NONRET __attribute__((noreturn))
70
71 #else
72
73 #define inline
74 #define NONRET
75
76 #endif
77
78 #endif