]> mj.ucw.cz Git - moe.git/blob - sherlock/sherlock.h
MOP: Score generator replaced by exporting of points
[moe.git] / sherlock / sherlock.h
1 /*
2  *      Sherlock Library -- Main Include File
3  *
4  *      (c) 1997--2004 Martin Mares <mj@ucw.cz>
5  */
6
7 /*
8  *  This file should be included as the very first include in all
9  *  source files, especially before all OS includes since it sets
10  *  up libc feature macros.
11  */
12
13 #ifndef _SHERLOCK_LIB_H
14 #define _SHERLOCK_LIB_H
15
16 #include "ucw/lib.h"
17
18 #ifdef CONFIG_MAX_CONTEXTS
19 #define CONFIG_CONTEXTS
20 #endif
21
22 /* Version string */
23
24 #define SHER_VER SHERLOCK_VERSION SHERLOCK_VERSION_SUFFIX
25
26 /* Types */
27
28 typedef u32 oid_t;                      /* Object ID */
29
30 #ifdef CONFIG_LARGE_FILES               /* File positions */
31 #define BYTES_PER_O 5
32 #define bgeto(f) bget5(f)
33 #define bputo(f,l) bput5(f,l)
34 #define GET_O(p) GET_U40(p)
35 #define PUT_O(p,x) PUT_U40(p,x)
36 #else
37 #define BYTES_PER_O 4
38 #define bgeto(f) bgetl(f)
39 #define bputo(f,l) bputl(f,l)
40 #define GET_O(p) GET_U32(p)
41 #define PUT_O(p,x) PUT_U32(p,x)
42 #endif
43
44 /* Area ID's */
45
46 #ifdef CONFIG_AREAS
47 typedef u32 area_t;
48 #define AREA_NONE 0
49 #define AREA_ANY ~0U
50 #else
51 typedef struct { } area_t;
52 #define AREA_NONE (area_t){}
53 #define AREA_ANY (area_t){}
54 #endif
55
56 /* An alias for the libucw logging function */
57
58 #define log msg
59
60 #endif