SWILIB API (X75)
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1
#pragma once
2
8
#define __SWILIB__
9
10
#include <stdint.h>
11
#include <stddef.h>
12
#include <stdbool.h>
13
14
#if defined(__ICCARM__) || defined(SWILIB_INCLUDE_ALL) || defined(SWILIB_PATCH_SDK)
15
#define SWILIB_LIBC
16
#define SWILIB_LIBPNG
17
#define SWILIB_ZLIB
18
#define SWILIB_OPENSSL
19
#endif
20
21
#if defined(__ICCARM__) && !defined(SWILIB_MODERN)
// Compatibility with IAR code.
22
#define SWILIB_LEGACY_COMPAT
23
#endif
24
25
#if defined(SWILIB_PATCH_SDK)
26
#include <swilib-values.h>
27
28
#if defined(__GNUC__)
29
#include "
compiler/gcc_patch.h
"
30
#else
31
#error Unknown compiler!
32
#endif
33
#else
34
#if defined(SWILIB_LINUX_SIMULATOR)
35
#include "
compiler/gcc_linux.h
"
36
#elif defined(DOXYGEN)
37
#include "
compiler/doxygen.h
"
38
#elif defined(__ICCARM__)
39
#include "
compiler/iar.h
"
40
#elif defined(__GNUC__)
41
#include "
compiler/gcc.h
"
42
#else
43
#error Unknown compiler!
44
#endif
45
#endif
46
47
/* Compatibility with old defines */
48
#ifdef __NO_LIBC
49
#define SWILIB_LIBC
50
#endif
51
52
#ifdef __SIE_LIBZ
53
#define SWILIB_ZLIB
54
#endif
55
56
#ifdef __SWILIB_PNG__
57
#define SWILIB_LIBPNG
58
#endif
59
60
__swilib_begin
61
62
#define __int16 short
/* ??? */
63
64
typedef
void
*(*malloc_func_t)(
size_t
size);
65
typedef
void (*
mfree_func_t
)(
void
*ptr);
67
typedef
struct
LLQ
LLQ
;
68
typedef
struct
LLIST
LLIST
;
69
73
enum
DefaultLgpID
{
74
#ifdef NEWSGOLD
75
LGP_NULL
= 0x7FFFFFFF,
76
LGP_DOIT_PIC
= 0x7FFFC0FB,
77
LGP_PLAY_PIC = 0x7FFFC0FF,
78
LGP_PAUSE_PIC = 0x7FFFC100,
79
LGP_STOP_PIC = 0x7FFFC101,
80
LGP_CHANGE_PIC = 0x7FFFC10D,
81
LGP_MENU_PIC
= 0x7FFFC10E,
82
LGP_EDIT_PIC = 0x7FFFC10F,
83
LGP_SAVE_PIC = 0x7FFFC113,
84
#else
85
LGP_NULL
= 0x7FFF,
86
LGP_DOIT_PIC
= 0x4E48,
87
LGP_MENU_PIC
= 0x4E4A,
88
#endif
89
};
90
94
enum
LegacyStructOffsets
{
95
#ifdef NEWSGOLD
96
#ifdef ELKA
97
DISPLACE_OF_EDGUI
= 0x90,
98
DISPLACE_OF_USSDREQGUI_ID
= 0x44,
99
DISPLACE_OF_EDGUI_ID
= 0x4C,
100
DISPLACE_OF_IDLEGUI_ID
= 0x2C,
101
DISPLACE_OF_IDLECANVAS
= 0x20,
102
#else
103
DISPLACE_OF_EDGUI
= 0x88,
104
DISPLACE_OF_USSDREQGUI_ID
= 0x44,
105
DISPLACE_OF_EDGUI_ID
= 0x4C,
106
DISPLACE_OF_IDLEGUI_ID
= 0x2C,
107
DISPLACE_OF_IDLECANVAS
= 0x18,
108
#endif
109
DISPLACE_OF_INCOMMINGGUI
= 0x34,
110
DISPLACE_OF_OUTGOINGGUI
= 0x30,
111
#else
112
DISPLACE_OF_EDGUI
= 0x50,
113
DISPLACE_OF_USSDREQGUI_ID
= 0x40,
114
DISPLACE_OF_EDGUI_ID
= 0x4C,
115
DISPLACE_OF_IDLEGUI_ID
= 0x28,
116
DISPLACE_OF_IDLECANVAS
= 0x14,
117
DISPLACE_OF_INCOMMINGGUI
= 0x30,
118
DISPLACE_OF_OUTGOINGGUI
= 0x2C,
119
#endif
120
};
121
125
struct
LLQ
{
126
void
*
first
;
127
void
*
last
;
128
mfree_func_t
data_mfree
;
129
};
130
134
struct
LLIST
{
135
void
*
next
;
136
void
*
prev
;
137
};
138
139
__swilib_end
140
doxygen.h
__swilib_begin
#define __swilib_begin
Definition
doxygen.h:29
__swilib_end
#define __swilib_end
Definition
doxygen.h:30
gcc.h
gcc_linux.h
gcc_patch.h
LLQ::data_mfree
mfree_func_t data_mfree
free() for list elements
Definition
base.h:128
LLIST::prev
void * prev
Definition
base.h:136
LLQ::first
void * first
Pointer to the first element.
Definition
base.h:126
LLQ::last
void * last
Pointer to the last element.
Definition
base.h:127
LLIST::next
void * next
Definition
base.h:135
DefaultLgpID
DefaultLgpID
Default LGP IDs.
Definition
base.h:73
LegacyStructOffsets
LegacyStructOffsets
Legacy struct fields offsets.
Definition
base.h:94
mfree_func_t
void(* mfree_func_t)(void *ptr)
free()
Definition
base.h:65
LGP_DOIT_PIC
@ LGP_DOIT_PIC
OK icon.
Definition
base.h:86
LGP_NULL
@ LGP_NULL
Empty LGP.
Definition
base.h:85
LGP_MENU_PIC
@ LGP_MENU_PIC
Menu icon.
Definition
base.h:87
DISPLACE_OF_EDGUI
@ DISPLACE_OF_EDGUI
Definition
base.h:112
DISPLACE_OF_IDLEGUI_ID
@ DISPLACE_OF_IDLEGUI_ID
Definition
base.h:115
DISPLACE_OF_OUTGOINGGUI
@ DISPLACE_OF_OUTGOINGGUI
Definition
base.h:118
DISPLACE_OF_USSDREQGUI_ID
@ DISPLACE_OF_USSDREQGUI_ID
Definition
base.h:113
DISPLACE_OF_IDLECANVAS
@ DISPLACE_OF_IDLECANVAS
Definition
base.h:116
DISPLACE_OF_EDGUI_ID
@ DISPLACE_OF_EDGUI_ID
Definition
base.h:114
DISPLACE_OF_INCOMMINGGUI
@ DISPLACE_OF_INCOMMINGGUI
Definition
base.h:117
LLIST
Linked-List item.
Definition
base.h:134
LLQ
Linked-List header.
Definition
base.h:125
iar.h
include
swilib
base.h
Generated by
1.11.0