]> mj.ucw.cz Git - libucw.git/blob - lib/config.h
Added support for indexing/searching by custom attributes.
[libucw.git] / lib / config.h
1 /*
2  *      Sherlock -- Configuration-Dependent Definitions
3  *
4  *      (c) 1997--2002 Martin Mares <mj@ucw.cz>
5  */
6
7 #ifndef _SHERLOCK_CONFIG_H
8 #define _SHERLOCK_CONFIG_H
9
10 /* Configuration switches */
11
12 #include "lib/autoconf.h"
13
14 /* Version */
15
16 #define SHER_VER "2.2a" SHER_SUFFIX
17
18 /* Paths */
19
20 #define DEFAULT_CONFIG "cf/sherlock"
21
22 /* Types */
23
24 typedef unsigned char byte;             /* exactly 8 bits, unsigned */
25 typedef signed char sbyte;              /* exactly 8 bits, signed */
26 typedef unsigned short word;            /* exactly 16 bits, unsigned */
27 typedef short sword;                    /* exactly 16 bits, signed */
28 typedef unsigned short u16;             /* exactly 16 bits, unsigned */
29 typedef short s16;                      /* exactly 16 bits, signed */
30 typedef unsigned int u32;               /* exactly 32 bits, unsigned */
31 typedef int s32;                        /* exactly 32 bits, signed */
32 typedef unsigned int uns;               /* at least 32 bits */
33 typedef unsigned long long int u64;     /* exactly 64 bits, unsigned */
34 typedef long long int s64;              /* exactly 64 bits, signed */
35 typedef unsigned long addr_int_t;       /* Both integer and address */
36 typedef unsigned int sh_time_t;         /* Timestamp */
37
38 #ifndef NULL
39 #define NULL (void *)0
40 #endif
41
42 typedef u32 oid_t;                      /* Object ID */
43
44 /* Custom stuff */
45
46 #include "lib/custom.h"
47
48 /* Data types and functions for accessing file positions */
49
50 #ifdef SHERLOCK_CONFIG_LARGE_DB
51 typedef s64 sh_off_t;
52 #define BYTES_PER_O 5
53 #define BYTES_PER_P 8
54 #define bgeto(f) bget5(f)
55 #define bputo(f,l) bput5(f,l)
56 #define bgetp(f) bgetq(f)
57 #define bputp(f,l) bputq(f,l)
58 #define GET_O(p) GET_U40(p)
59 #define GET_P(p) GET_U64(p)
60 #else
61 typedef s32 sh_off_t;
62 #define BYTES_PER_O 4
63 #define BYTES_PER_P 4
64 #define bgeto(f) bgetl(f)
65 #define bputo(f,l) bputl(f,l)
66 #define bgetp(f) bgetl(f)
67 #define bputp(f,l) bputl(f,l)
68 #define GET_O(p) GET_U32(p)
69 #define GET_P(p) GET_U32(p)
70 #endif
71
72 /* Misc */
73
74 #ifdef __GNUC__
75
76 #undef inline
77 #define NONRET __attribute__((noreturn))
78 #define UNUSED __attribute__((unused))
79 #define CONSTRUCTOR __attribute__((constructor))
80 #define PACKED __attribute__((packed))
81
82 #else
83 #error This program requires the GNU C compiler.
84 #endif
85
86 #endif