diff options
Diffstat (limited to 'apps/tagdb/config.h')
-rw-r--r-- | apps/tagdb/config.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/tagdb/config.h b/apps/tagdb/config.h new file mode 100644 index 0000000000..86461349e3 --- /dev/null +++ b/apps/tagdb/config.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef __CONFIG_H // Include me only once | ||
2 | #define __CONFIG_H | ||
3 | |||
4 | // DEBUGF will print in debug mode: | ||
5 | #ifdef DEBUG | ||
6 | #define DEBUGF(...) fprintf (stderr, __VA_ARGS__) | ||
7 | #define DEBUGT(...) fprintf (stdout, __VA_ARGS__) | ||
8 | #else //DEBUG | ||
9 | #define DEBUGF(...) | ||
10 | #endif //DEBUG | ||
11 | |||
12 | |||
13 | #define OS_LINUX // architecture: LINUX, ROCKBOX, WINDOWS | ||
14 | #define ROCKBOX_LITTLE_ENDIAN // we are intel... little-endian | ||
15 | |||
16 | |||
17 | #ifdef ROCKBOX_LITTLE_ENDIAN | ||
18 | #define BE32(_x_) ((( (_x_) & 0xff000000) >> 24) | \ | ||
19 | (( (_x_) & 0x00ff0000) >> 8) | \ | ||
20 | (( (_x_) & 0x0000ff00) << 8) | \ | ||
21 | (( (_x_) & 0x000000ff) << 24)) | ||
22 | #define BE16(_x_) ( (( (_x_) & 0xff00) >> 8) | (( (_x_) & 0x00ff) << 8)) | ||
23 | #else | ||
24 | #define BE32(_x_) _x_ | ||
25 | #define BE16(_x_) _x_ | ||
26 | #endif | ||
27 | |||
28 | #include <stdint.h> | ||
29 | |||
30 | #define ERR_NONE 0 // no error | ||
31 | #define ERR_NOTFOUND -1 // entry not found | ||
32 | #define ERR_MALLOC 1 // memory allocation failed | ||
33 | #define ERR_FILE 2 // file operation failed | ||
34 | #define ERR_INVALID 3 // something is invalid | ||
35 | #define ERR_NO_INPLACE_UPDATE 4 // can't update in this place | ||
36 | |||
37 | #include <assert.h> | ||
38 | |||
39 | #endif | ||