Numworks Epsilon
1.4.1
Graphing Calculator Operating System
sqliteInt.h
Go to the documentation of this file.
1
#ifndef LIB_SQLITEINT_H
2
#define LIB_SQLITEINT_H
3
4
/* This header files allows the standalone compilation of mem5.c from SQLite.
5
* That file provides a tested implementation of malloc/free/realloc. */
6
7
#define sqlite3GlobalConfig HeapConfig
8
#include <
liba/include/private/memconfig.h
>
9
10
/* SQLite wants to use its own integer types. Let's define them based from the
11
* stdint ones */
12
13
#include <
stdint.h
>
14
typedef
uint64_t
u64
;
15
typedef
uint8_t
u8
;
16
typedef
uint32_t
u32
;
17
typedef
int64_t
sqlite3_int64
;
18
19
/* Mem5 uses memcpy */
20
#include <string.h>
21
22
/* Define a bunch of macros used by SQLite */
23
24
#define SQLITE_ENABLE_MEMSYS5 1
25
#define SQLITE_WSD
26
#define GLOBAL(t,v) v
27
#define sqlite3_log(...) ((void)0)
28
#define ALWAYS(X) (X)
29
#define UNUSED_PARAMETER(x) ((void)0)
30
#define SQLITE_OK 0
31
32
/* Completly ignore asserts: one of them contains a modulo, which our platform
33
* doesn't support in hardware. This therefore translates to a __aeabi_idivmod
34
* call, which we do not provide. */
35
#define assert(x) ((void)0)
36
37
// Ignore SQLite testing code
38
#define testcase(x) ((void)0)
39
40
41
/* SQLite provides a mutex facility, and uses it to protect its memory
42
* allocations. We don't need thread-safety for now so let's just neuter the
43
* mutexes */
44
typedef
void
sqlite3_mutex
;
45
#define sqlite3_mutex_enter(x) ((void)0)
46
#define sqlite3_mutex_leave(x) ((void)0)
47
#define sqlite3MutexAlloc(x) ((void *)0)
48
49
/* This one is dangerous, but needed: memsys5Malloc and co are defined as static
50
* but we will want to use them all around (after renaming them to their
51
* standard names). So let's just remove any static. Warning: this could break
52
* static variables. Luckily, there are none. */
53
#define static
54
55
/* SQLite exports its memory methods in a struct. We don't need it since we've
56
* renamed them to standard names anyway. So let's just make it build. */
57
typedef
void
**
sqlite3_mem_methods
;
58
59
#endif
u8
uint8_t u8
Definition:
sqliteInt.h:15
sqlite3_mem_methods
void ** sqlite3_mem_methods
Definition:
sqliteInt.h:57
uint8_t
unsigned char uint8_t
Definition:
stdint.h:4
memconfig.h
uint32_t
unsigned int uint32_t
Definition:
stdint.h:6
uint64_t
unsigned long long uint64_t
Definition:
stdint.h:7
u64
uint64_t u64
Definition:
sqliteInt.h:14
stdint.h
sqlite3_int64
int64_t sqlite3_int64
Definition:
sqliteInt.h:17
int64_t
signed long long int64_t
Definition:
stdint.h:12
u32
uint32_t u32
Definition:
sqliteInt.h:16
sqlite3_mutex
void sqlite3_mutex
Definition:
sqliteInt.h:44
epsilon
liba
src
external
sqlite
sqliteInt.h
Generated by
1.8.14