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