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