3 #include "pkgmgrinfo_basic.h"
4 #include "pkgmgrinfo_private.h"
6 static void __ps_free_metadata(gpointer data)
8 metadata_x *metadata = (metadata_x *)data;
12 free((void *)metadata->key);
14 free((void *)metadata->value);
15 free((void*)metadata);
18 static void __ps_free_permission(gpointer data)
20 permission_x *permission = (permission_x *)data;
21 if (permission == NULL)
24 free((void *)permission->type);
25 if (permission->value)
26 free((void *)permission->value);
27 free((void*)permission);
30 static void __ps_free_icon(gpointer data)
32 icon_x *icon = (icon_x *)data;
36 free((void *)icon->text);
38 free((void *)icon->lang);
40 free((void *)icon->name);
42 free((void *)icon->section);
44 free((void *)icon->size);
46 free((void *)icon->resolution);
48 free((void *)icon->dpi);
52 static void __ps_free_image(gpointer data)
54 image_x *image = (image_x *)data;
58 free((void *)image->text);
60 free((void *)image->lang);
62 free((void *)image->name);
64 free((void *)image->section);
68 static void __ps_free_notification(gpointer data)
70 notification_x *notification = (notification_x *)data;
71 if (notification == NULL)
73 if (notification->text)
74 free((void *)notification->text);
75 if (notification->name)
76 free((void *)notification->name);
77 free((void*)notification);
80 static void __ps_free_compatibility(gpointer data)
82 compatibility_x *compatibility = (compatibility_x *)data;
83 if (compatibility == NULL)
85 if (compatibility->text)
86 free((void *)compatibility->text);
87 if (compatibility->name)
88 free((void *)compatibility->name);
89 free((void*)compatibility);
92 static void __ps_free_datacontrol(gpointer data)
94 datacontrol_x *datacontrol = (datacontrol_x *)data;
95 if (datacontrol == NULL)
97 if (datacontrol->providerid)
98 free((void *)datacontrol->providerid);
99 if (datacontrol->access)
100 free((void *)datacontrol->access);
101 if (datacontrol->type)
102 free((void *)datacontrol->type);
103 free((void*)datacontrol);
106 static void __ps_free_appcontrol(gpointer data)
108 appcontrol_x *appcontrol = (appcontrol_x *)data;
109 if (appcontrol == NULL)
112 if (appcontrol->operation)
113 free((void *)appcontrol->operation);
116 free((void *)appcontrol->uri);
118 if (appcontrol->mime)
119 free((void *)appcontrol->mime);
120 free((void*)appcontrol);
123 static void __ps_free_define(gpointer data)
125 define_x *define = (define_x *)data;
130 free((void *)define->path);
132 g_list_free_full(define->request, free);
134 g_list_free_full(define->allowed, free);
138 static void __ps_free_datashare(gpointer data)
140 datashare_x *datashare = (datashare_x *)data;
141 if (datashare == NULL)
144 g_list_free_full(datashare->define, __ps_free_define);
146 g_list_free_full(datashare->request, free);
147 free((void*)datashare);
150 static void __ps_free_label(gpointer data)
152 label_x *label = (label_x *)data;
156 free((void *)label->name);
158 free((void *)label->text);
160 free((void *)label->lang);
164 static void __ps_free_author(gpointer data)
166 author_x *author = (author_x *)data;
170 free((void *)author->email);
172 free((void *)author->text);
174 free((void *)author->href);
176 free((void *)author->lang);
180 static void __ps_free_description(gpointer data)
182 description_x *description = (description_x *)data;
183 if (description == NULL)
185 if (description->name)
186 free((void *)description->name);
187 if (description->text)
188 free((void *)description->text);
189 if (description->lang)
190 free((void *)description->lang);
191 free((void*)description);
194 static void __ps_free_license(gpointer data)
196 license_x *license = (license_x *)data;
200 free((void *)license->text);
202 free((void *)license->lang);
203 free((void*)license);
206 static void __ps_free_application(gpointer data)
208 application_x *application = (application_x *)data;
209 if (application == NULL)
212 if (application->appid)
213 free((void *)application->appid);
214 if (application->component)
215 free((void *)application->component);
216 if (application->exec)
217 free((void *)application->exec);
218 if (application->nodisplay)
219 free((void *)application->nodisplay);
220 if (application->type)
221 free((void *)application->type);
222 if (application->onboot)
223 free((void *)application->onboot);
224 if (application->multiple)
225 free((void *)application->multiple);
226 if (application->autorestart)
227 free((void *)application->autorestart);
228 if (application->taskmanage)
229 free((void *)application->taskmanage);
230 if (application->enabled)
231 free((void *)application->enabled);
232 if (application->categories)
233 free((void *)application->categories);
234 if (application->extraid)
235 free((void *)application->extraid);
236 if (application->hwacceleration)
237 free((void *)application->hwacceleration);
238 if (application->screenreader)
239 free((void *)application->screenreader);
240 if (application->mainapp)
241 free((void *)application->mainapp);
242 if (application->recentimage)
243 free((void *)application->recentimage);
244 if (application->launchcondition)
245 free((void *)application->launchcondition);
246 if (application->indicatordisplay)
247 free((void *)application->indicatordisplay);
248 if (application->portraitimg)
249 free((void *)application->portraitimg);
250 if (application->landscapeimg)
251 free((void *)application->landscapeimg);
252 if (application->guestmode_visibility)
253 free((void *)application->guestmode_visibility);
254 if (application->permission_type)
255 free((void *)application->permission_type);
256 if (application->preload)
257 free((void *)application->preload);
258 if (application->submode)
259 free((void *)application->submode);
260 if (application->submode_mainid)
261 free((void *)application->submode_mainid);
262 if (application->process_pool)
263 free((void *)application->process_pool);
264 if (application->installed_storage)
265 free((void *)application->installed_storage);
266 if (application->launch_mode)
267 free((void *)application->launch_mode);
268 if (application->ui_gadget)
269 free((void *)application->ui_gadget);
270 if (application->component_type)
271 free((void *)application->component_type);
272 if (application->package)
273 free((void *)application->package);
274 if (application->support_disable)
275 free((void *)application->support_disable);
278 g_list_free_full(application->label, __ps_free_label);
280 g_list_free_full(application->icon, __ps_free_icon);
282 g_list_free_full(application->image, __ps_free_image);
284 g_list_free_full(application->appcontrol, __ps_free_appcontrol);
286 g_list_free_full(application->category, free);
288 g_list_free_full(application->metadata, __ps_free_metadata);
290 g_list_free_full(application->permission, __ps_free_permission);
291 /*Free LaunchConditions*/
292 g_list_free_full(application->launchconditions, free);
293 /*Free Notification*/
294 g_list_free_full(application->notification, __ps_free_notification);
296 g_list_free_full(application->datashare, __ps_free_datashare);
298 g_list_free_full(application->datacontrol, __ps_free_datacontrol);
299 /*Free BackgroundCategory*/
300 g_list_free_full(application->background_category, free);
301 free((void *)application);
304 API void pkgmgrinfo_basic_free_application(application_x *application)
306 __ps_free_application(application);
309 API void pkgmgrinfo_basic_free_package(package_x *package)
313 if (package->for_all_users)
314 free((void *)package->for_all_users);
316 free((void *)package->ns);
317 if (package->package)
318 free((void *)package->package);
319 if (package->version)
320 free((void *)package->version);
321 if (package->installlocation)
322 free((void *)package->installlocation);
323 if (package->preload)
324 free((void *)package->preload);
325 if (package->readonly)
326 free((void *)package->readonly);
327 if (package->removable)
328 free((void *)package->removable);
330 free((void *)package->update);
332 free((void *)package->system);
334 free((void *)package->type);
335 if (package->package_size)
336 free((void *)package->package_size);
337 if (package->installed_time)
338 free((void *)package->installed_time);
339 if (package->installed_storage)
340 free((void *)package->installed_storage);
341 if (package->storeclient_id)
342 free((void *)package->storeclient_id);
343 if (package->mainapp_id)
344 free((void *)package->mainapp_id);
345 if (package->package_url)
346 free((void *)package->package_url);
347 if (package->root_path)
348 free((void *)package->root_path);
349 if (package->csc_path)
350 free((void *)package->csc_path);
351 if (package->appsetting)
352 free((void *)package->appsetting);
353 if (package->nodisplay_setting)
354 free((void *)package->nodisplay_setting);
355 if (package->api_version)
356 free((void *)package->api_version);
357 if (package->support_disable)
358 free((void *)package->support_disable);
359 if (package->tep_name)
360 free((void *)package->tep_name);
363 g_list_free_full(package->icon, __ps_free_icon);
365 g_list_free_full(package->label, __ps_free_label);
367 g_list_free_full(package->author, __ps_free_author);
369 g_list_free_full(package->description, __ps_free_description);
371 g_list_free_full(package->license, __ps_free_license);
373 g_list_free_full(package->privileges, free);
375 g_list_free_full(package->application, __ps_free_application);
376 /*Free Compatibility*/
377 g_list_free_full(package->compatibility, __ps_free_compatibility);
378 /*Free Device profiles*/
379 g_list_free_full(package->deviceprofile, free);
380 free((void*)package);