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