SWILIB API (X75)    
Loading...
Searching...
No Matches
csm.h
Go to the documentation of this file.
1#pragma once
2
12#ifndef __IN_SWILIB__
13#include "base.h"
14#include "wstring.h"
15#include "gbs.h"
16#endif
17
19
20#define NAMECSM_MAGIC1 ((malloc_func_t) 0x55AACCCC)
21#define NAMECSM_MAGIC2 ((mfree_func_t) 0x3333AA55)
23typedef struct CSM_DESC CSM_DESC;
24typedef struct CSM_RAM CSM_RAM;
25typedef struct CSMQ CSMQ;
26typedef struct CSMROOT CSMROOT;
27typedef struct MMICMD MMICMD;
28
36
40struct CSM_RAM {
41 void *next;
42 void *prev;
44 int id;
45 int state;
46 int unk1;
47 int unk2;
49};
50
54struct CSM_DESC {
55 int (*onMessage)(CSM_RAM *, GBS_MSG *);
56 void (*onCreate)(CSM_RAM *);
57#ifdef NEWSGOLD
58 int zero1;
59 int zero2;
60 int zero3;
61 int zero4;
62#endif
63 void (*onClose)(CSM_RAM *);
66 const int *states;
67};
68
72#ifdef NEWSGOLD
73struct CSMQ {
74 int id;
76 LLQ csm;
77 LLQ cmd;
78 LLQ csm_background;
79};
80#else
93#endif
94
103
107struct MMICMD {
108#ifdef NEWSGOLD
109 void *next;
110 void *prev;
111 int flag1;
112 int parent_id;
113 int prio;
114 int (*proc)(CSMQ *, void *);
115 CSMQ *csm_q;
116 int id;
117 int flag2;
118#else
119 void *next;
120 void *prev;
121 char flag1;
123 int (*proc)(CSMQ *, void *);
126#endif
127};
128
133__swi_begin(0x8106)
135__swi_end(0x8106, CSM_root, ());
136
144__swi_begin(0x107)
145int CreateCSM(const CSM_DESC *descr, const void *csm, int unk)
146__swi_end(0x107, CreateCSM, (descr, csm, unk));
147
153__swi_begin(0x108)
155__swi_end(0x108, FindCSMbyID, (id));
156
163__swi_begin(0x142)
164CSM_RAM *FindCSM(CSMQ *csm_q, int id)
165__swi_end(0x142, FindCSM, (csm_q, id));
166
171__swi_begin(0x1FC)
172void CloseCSM(int id)
173__swi_end(0x1FC, CloseCSM, (id));
174
176
#define __swilib_begin
Definition doxygen.h:29
#define __swi_end(number, func, call)
Definition doxygen.h:33
#define __swi_begin(number)
Definition doxygen.h:32
#define __swilib_end
Definition doxygen.h:30
void * next
Next command.
Definition csm.h:119
char flag1
Definition csm.h:121
CSMQ * csm_q
CSM queue.
Definition csm.h:124
int unk2
Definition csm.h:47
int datasize
Size of the CSM with custom payload.
Definition csm.h:64
int unk1
Definition csm.h:87
short cepid
Definition csm.h:91
CSM_RAM * current_msg_processing_csm
Active CSM.
Definition csm.h:83
int(* onMessage)(CSM_RAM *, GBS_MSG *)
Callback for GBS messages.
Definition csm.h:55
CSM_DESC * constr
CSM description.
Definition csm.h:43
int under_idle_id
Unknown CSM ID.
Definition csm.h:99
void * next
Pointer to the next CSM_RAM.
Definition csm.h:41
int unk2
Definition csm.h:89
void(* onClose)(CSM_RAM *)
CSM destructor.
Definition csm.h:63
int(* proc)(CSMQ *, void *)
Command handler.
Definition csm.h:123
void * prev
Pointer to the prev CSM_RAM.
Definition csm.h:42
CSM_RAM * cmd_csm
CSM.
Definition csm.h:125
int state
CSM state, see CSMState.
Definition csm.h:45
LLQ cmd
Definition csm.h:85
LLQ gui_ll
Linked list of the GUI in this CSM.
Definition csm.h:48
void * prev
Prev command.
Definition csm.h:120
CSMQ * csm_q
Lists of the CSM.
Definition csm.h:101
int id
CSM ID.
Definition csm.h:44
int statesize
Set to 1.
Definition csm.h:65
void(* onCreate)(CSM_RAM *)
CSM constructor.
Definition csm.h:56
void * methods
Definition csm.h:88
int unk
Definition csm.h:86
int parent_id
Previous CSM ID or -1.
Definition csm.h:122
void * tmr
Definition csm.h:90
LLQ csm
CSM Linked-List.
Definition csm.h:84
int id
Definition csm.h:82
int unk1
Definition csm.h:46
const int * states
Pointer to the int minus11 = -11;
Definition csm.h:66
int idle_id
Idle CMS ID.
Definition csm.h:100
CSM_RAM * FindCSM(CSMQ *csm_q, int id)
Find CSM by ID in the given list.
CSMROOT * CSM_root()
Get the CSM root.
void CloseCSM(int id)
Close CSM by ID.
CSM_RAM * FindCSMbyID(int id)
Find CSM by ID.
int CreateCSM(const CSM_DESC *descr, const void *csm, int unk)
Create new CSM.
CSMState
States of the CSM.
Definition csm.h:32
@ CSM_STATE_OPEN
CSM created.
Definition csm.h:33
@ CSM_STATE_CLOSED
CSM closed.
Definition csm.h:34
CSM description.
Definition csm.h:54
CSM object.
Definition csm.h:40
Lists of the CSM.
Definition csm.h:81
Root of the all CSM.
Definition csm.h:98
MMI command for safe and seq operations with CSM.
Definition csm.h:107
GBS Message.
Definition gbs.h:112
Linked-List header.
Definition base.h:125
#define const
Definition zconf.h:115