FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiUserData.c @ 181:8f6e2ae69a6b
mmiUserData.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 19 Jan 2021 04:42:34 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
180:6b5d787d9ade | 181:8f6e2ae69a6b |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 | 2 |
3 CONDAT (UK) | 3 CONDAT (UK) |
4 | 4 |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 | 6 |
7 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
8 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
14 $Module: MMI | 14 $Module: MMI |
15 $File: MmiUserData.c | 15 $File: MmiUserData.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 22/02/01 | 19 $Date: 22/02/01 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 | 24 |
25 | 25 |
26 | |
27 ******************************************************************************** | 26 ******************************************************************************** |
28 | 27 |
29 $History: MmiUserData.c | 28 $History: MmiUserData.c |
30 | 29 |
31 25/10/00 Original Condat(UK) BMI version. | 30 25/10/00 Original Condat(UK) BMI version. |
32 | 31 |
33 $End | 32 $End |
34 | 33 |
35 *******************************************************************************/ | 34 *******************************************************************************/ |
36 | 35 |
110 * If NULL is returned, either <window> was invalid or a new user data | 109 * If NULL is returned, either <window> was invalid or a new user data |
111 * element could not be created. | 110 * element could not be created. |
112 */ | 111 */ |
113 void *userDataHndSet( MfwHnd window, UserKey key, void *data) | 112 void *userDataHndSet( MfwHnd window, UserKey key, void *data) |
114 { | 113 { |
115 if( window == NULL ) { return NULL; } | 114 if( window == NULL ) { return NULL; } |
116 | 115 |
117 return userDataWinSet( (MfwWin *)((MfwHdr *)window)->data, key, data); | 116 return userDataWinSet( (MfwWin *)((MfwHdr *)window)->data, key, data); |
118 } | 117 } |
119 | 118 |
120 | 119 |
121 void *userDataWinSet( MfwWin *window, UserKey key, void *data) | 120 void *userDataWinSet( MfwWin *window, UserKey key, void *data) |
122 { | 121 { |
159 * If NULL is returned, either <window> was invalid or no user data | 158 * If NULL is returned, either <window> was invalid or no user data |
160 * with <key> existed. | 159 * with <key> existed. |
161 */ | 160 */ |
162 void *userDataHndGet( MfwHnd window, UserKey key) | 161 void *userDataHndGet( MfwHnd window, UserKey key) |
163 { | 162 { |
164 if( window == NULL ) { return NULL; } | 163 if( window == NULL ) { return NULL; } |
165 | 164 |
166 return userDataWinGet( (MfwWin *)((MfwHdr *)window)->data, key); | 165 return userDataWinGet( (MfwWin *)((MfwHdr *)window)->data, key); |
167 } | 166 } |
168 | 167 |
169 | 168 |
170 void *userDataWinGet( MfwWin *window, UserKey key) | 169 void *userDataWinGet( MfwWin *window, UserKey key) |
171 { | 170 { |
172 UserDataLink thisOne; | 171 UserDataLink thisOne; |
173 | 172 |
174 if( window == NULL ) { return NULL; } | 173 if( window == NULL ) { return NULL; } |
175 | 174 |
176 thisOne = userDataFind( (UserDataLink)window->user, key); | 175 thisOne = userDataFind( (UserDataLink)window->user, key); |
177 | 176 |
178 if( thisOne == NULL ) { return NULL; } | 177 if( thisOne == NULL ) { return NULL; } |
179 | 178 |
180 return thisOne->data; | 179 return thisOne->data; |
181 } | 180 } |
182 | 181 |
183 | 182 |
184 /* | 183 /* |
185 * Deletes the user data for <window> with <key>, and returns the | 184 * Deletes the user data for <window> with <key>, and returns the |
187 * If NULL is returned, either <window> was invalid or no user data | 186 * If NULL is returned, either <window> was invalid or no user data |
188 * with <key> existed. | 187 * with <key> existed. |
189 */ | 188 */ |
190 void *userDataHndDelete( MfwHnd window, UserKey key) | 189 void *userDataHndDelete( MfwHnd window, UserKey key) |
191 { | 190 { |
192 if( window == NULL ) { return NULL; } | 191 if( window == NULL ) { return NULL; } |
193 | 192 |
194 return userDataWinDelete( (MfwWin *)((MfwHdr *)window)->data, key); | 193 return userDataWinDelete( (MfwWin *)((MfwHdr *)window)->data, key); |
195 } | 194 } |
196 | 195 |
197 | 196 |
198 void *userDataWinDelete( MfwWin *window, UserKey key) | 197 void *userDataWinDelete( MfwWin *window, UserKey key) |
199 { | 198 { |
214 | 213 |
215 previous = userDataPrevious( (UserDataLink)window->user, doomed); | 214 previous = userDataPrevious( (UserDataLink)window->user, doomed); |
216 | 215 |
217 if( previous == NULL ) // <doomed> is the first element in the list. | 216 if( previous == NULL ) // <doomed> is the first element in the list. |
218 { | 217 { |
219 window->user = (void *)doomed->next; | 218 window->user = (void *)doomed->next; |
220 } | 219 } |
221 else | 220 else |
222 { | 221 { |
223 previous->next = doomed->next; | 222 previous->next = doomed->next; |
224 } | 223 } |
226 FREE_MEMORY( (void *)doomed, sizeof(UserDataElement)); | 225 FREE_MEMORY( (void *)doomed, sizeof(UserDataElement)); |
227 | 226 |
228 return oldData; | 227 return oldData; |
229 } | 228 } |
230 } | 229 } |
231 |