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
61
62#define __int16 short /* ??? */
63
64typedef void *(*malloc_func_t)(size_t size);
65typedef void (*mfree_func_t)(void *ptr);
67typedef struct LLQ LLQ;
68typedef struct LLIST LLIST;
69
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
121
125struct LLQ {
126 void *first;
127 void *last;
129};
130
134struct LLIST {
135 void *next;
136 void *prev;
137};
138
140
#define __swilib_begin
Definition doxygen.h:29
#define __swilib_end
Definition doxygen.h:30
mfree_func_t data_mfree
free() for list elements
Definition base.h:128
void * prev
Definition base.h:136
void * first
Pointer to the first element.
Definition base.h:126
void * last
Pointer to the last element.
Definition base.h:127
void * next
Definition base.h:135
DefaultLgpID
Default LGP IDs.
Definition base.h:73
LegacyStructOffsets
Legacy struct fields offsets.
Definition base.h:94
void(* mfree_func_t)(void *ptr)
free()
Definition base.h:65
@ LGP_DOIT_PIC
OK icon.
Definition base.h:86
@ LGP_NULL
Empty LGP.
Definition base.h:85
@ LGP_MENU_PIC
Menu icon.
Definition base.h:87
@ DISPLACE_OF_EDGUI
Definition base.h:112
@ DISPLACE_OF_IDLEGUI_ID
Definition base.h:115
@ DISPLACE_OF_OUTGOINGGUI
Definition base.h:118
@ DISPLACE_OF_USSDREQGUI_ID
Definition base.h:113
@ DISPLACE_OF_IDLECANVAS
Definition base.h:116
@ DISPLACE_OF_EDGUI_ID
Definition base.h:114
@ DISPLACE_OF_INCOMMINGGUI
Definition base.h:117
Linked-List item.
Definition base.h:134
Linked-List header.
Definition base.h:125