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->section);
42 free((void *)icon->size);
44 free((void *)icon->resolution);
46 free((void *)icon->dpi);
50 static void __ps_free_image(gpointer data)
52 image_x *image = (image_x *)data;
56 free((void *)image->text);
58 free((void *)image->lang);
60 free((void *)image->section);
64 static void __ps_free_notification(gpointer data)
66 notification_x *notification = (notification_x *)data;
67 if (notification == NULL)
69 if (notification->text)
70 free((void *)notification->text);
71 if (notification->name)
72 free((void *)notification->name);
73 free((void*)notification);
76 static void __ps_free_compatibility(gpointer data)
78 compatibility_x *compatibility = (compatibility_x *)data;
79 if (compatibility == NULL)
81 if (compatibility->text)
82 free((void *)compatibility->text);
83 if (compatibility->name)
84 free((void *)compatibility->name);
85 free((void*)compatibility);
88 static void __ps_free_datacontrol(gpointer data)
90 datacontrol_x *datacontrol = (datacontrol_x *)data;
91 if (datacontrol == NULL)
93 if (datacontrol->providerid)
94 free((void *)datacontrol->providerid);
95 if (datacontrol->access)
96 free((void *)datacontrol->access);
97 if (datacontrol->type)
98 free((void *)datacontrol->type);
99 free((void*)datacontrol);
102 static void __ps_free_appcontrol(gpointer data)
104 appcontrol_x *appcontrol = (appcontrol_x *)data;
105 if (appcontrol == NULL)
108 if (appcontrol->operation)
109 free((void *)appcontrol->operation);
112 free((void *)appcontrol->uri);
114 if (appcontrol->mime)
115 free((void *)appcontrol->mime);
116 free((void*)appcontrol);
119 static void __ps_free_define(gpointer data)
121 define_x *define = (define_x *)data;
126 free((void *)define->path);
128 g_list_free_full(define->request, free);
130 g_list_free_full(define->allowed, free);
134 static void __ps_free_datashare(gpointer data)
136 datashare_x *datashare = (datashare_x *)data;
137 if (datashare == NULL)
140 g_list_free_full(datashare->define, __ps_free_define);
142 g_list_free_full(datashare->request, free);
143 free((void*)datashare);
146 static void __ps_free_label(gpointer data)
148 label_x *label = (label_x *)data;
152 free((void *)label->name);
154 free((void *)label->text);
156 free((void *)label->lang);
160 static void __ps_free_author(gpointer data)
162 author_x *author = (author_x *)data;
166 free((void *)author->email);
168 free((void *)author->text);
170 free((void *)author->href);
172 free((void *)author->lang);
176 static void __ps_free_description(gpointer data)
178 description_x *description = (description_x *)data;
179 if (description == NULL)
181 if (description->name)
182 free((void *)description->name);
183 if (description->text)
184 free((void *)description->text);
185 if (description->lang)
186 free((void *)description->lang);
187 free((void*)description);
190 static void __ps_free_license(gpointer data)
192 license_x *license = (license_x *)data;
196 free((void *)license->text);
198 free((void *)license->lang);
199 free((void*)license);
202 static void __ps_free_splashscreen(gpointer data)
204 splashscreen_x *splashscreen = (splashscreen_x *)data;
205 if (splashscreen == NULL)
207 if (splashscreen->src)
208 free((void *)splashscreen->src);
209 if (splashscreen->type)
210 free((void *)splashscreen->type);
211 if (splashscreen->dpi)
212 free((void *)splashscreen->dpi);
213 if (splashscreen->orientation)
214 free((void *)splashscreen->orientation);
215 if (splashscreen->indicatordisplay)
216 free((void *)splashscreen->indicatordisplay);
217 if (splashscreen->operation)
218 free((void *)splashscreen->operation);
219 if (splashscreen->color_depth)
220 free((void *)splashscreen->color_depth);
221 free((void *)splashscreen);
225 static void __ps_free_support_size(gpointer data)
227 support_size_x *support_size = (support_size_x *)data;
228 if (support_size == NULL)
230 if (support_size->preview)
231 free((void *)support_size->preview);
232 if (support_size->size)
233 free((void *)support_size->size);
234 free((void *)support_size);
237 static void __ps_free_privilege(gpointer data)
239 privilege_x *privilege = (privilege_x *)data;
241 free((void *)privilege->type);
242 if (privilege->value)
243 free((void *)privilege->value);
244 free((void *)privilege);
247 static void __ps_free_application(gpointer data)
249 application_x *application = (application_x *)data;
250 if (application == NULL)
253 if (application->appid)
254 free((void *)application->appid);
255 if (application->component)
256 free((void *)application->component);
257 if (application->exec)
258 free((void *)application->exec);
259 if (application->nodisplay)
260 free((void *)application->nodisplay);
261 if (application->type)
262 free((void *)application->type);
263 if (application->onboot)
264 free((void *)application->onboot);
265 if (application->multiple)
266 free((void *)application->multiple);
267 if (application->autorestart)
268 free((void *)application->autorestart);
269 if (application->taskmanage)
270 free((void *)application->taskmanage);
271 if (application->enabled)
272 free((void *)application->enabled);
273 if (application->categories)
274 free((void *)application->categories);
275 if (application->extraid)
276 free((void *)application->extraid);
277 if (application->hwacceleration)
278 free((void *)application->hwacceleration);
279 if (application->screenreader)
280 free((void *)application->screenreader);
281 if (application->mainapp)
282 free((void *)application->mainapp);
283 if (application->recentimage)
284 free((void *)application->recentimage);
285 if (application->launchcondition)
286 free((void *)application->launchcondition);
287 if (application->indicatordisplay)
288 free((void *)application->indicatordisplay);
289 if (application->portraitimg)
290 free((void *)application->portraitimg);
291 if (application->landscapeimg)
292 free((void *)application->landscapeimg);
293 if (application->guestmode_visibility)
294 free((void *)application->guestmode_visibility);
295 if (application->permission_type)
296 free((void *)application->permission_type);
297 if (application->preload)
298 free((void *)application->preload);
299 if (application->submode)
300 free((void *)application->submode);
301 if (application->submode_mainid)
302 free((void *)application->submode_mainid);
303 if (application->process_pool)
304 free((void *)application->process_pool);
305 if (application->installed_storage)
306 free((void *)application->installed_storage);
307 if (application->launch_mode)
308 free((void *)application->launch_mode);
309 if (application->ui_gadget)
310 free((void *)application->ui_gadget);
311 if (application->component_type)
312 free((void *)application->component_type);
313 if (application->package)
314 free((void *)application->package);
315 if (application->support_disable)
316 free((void *)application->support_disable);
317 if (application->tep_name)
318 free((void *)application->tep_name);
319 if (application->zip_mount_file)
320 free((void *)application->zip_mount_file);
321 if (application->root_path)
322 free((void *)application->root_path);
323 if (application->api_version)
324 free((void *)application->api_version);
325 if (application->for_all_users)
326 free((void *)application->for_all_users);
327 if (application->effective_appid)
328 free((void *)application->effective_appid);
329 if (application->is_disabled)
330 free((void *)application->is_disabled);
331 if (application->splash_screen_display)
332 free((void *)application->splash_screen_display);
333 if (application->effectimage_type)
334 free((void *)application->effectimage_type);
335 if (application->package_type)
336 free((void *)application->package_type);
337 if (application->ambient_support)
338 free((void *)application->ambient_support);
339 if (application->alias_appid)
340 free((void *)application->alias_appid);
341 if (application->external_path)
342 free((void *)application->external_path);
343 if (application->package_system)
344 free((void *)application->package_system);
345 if (application->removable)
346 free((void *)application->removable);
347 if (application->package_installed_time)
348 free((void *)application->package_installed_time);
351 g_list_free_full(application->label, __ps_free_label);
353 g_list_free_full(application->icon, __ps_free_icon);
355 g_list_free_full(application->image, __ps_free_image);
357 g_list_free_full(application->appcontrol, __ps_free_appcontrol);
359 g_list_free_full(application->category, free);
361 g_list_free_full(application->metadata, __ps_free_metadata);
363 g_list_free_full(application->permission, __ps_free_permission);
364 /*Free LaunchConditions*/
365 g_list_free_full(application->launchconditions, free);
366 /*Free Notification*/
367 g_list_free_full(application->notification, __ps_free_notification);
369 g_list_free_full(application->datashare, __ps_free_datashare);
371 g_list_free_full(application->datacontrol, __ps_free_datacontrol);
372 /*Free BackgroundCategory*/
373 g_list_free_full(application->background_category, free);
374 /*Free SplashScreen*/
375 g_list_free_full(application->splashscreens, __ps_free_splashscreen);
377 g_list_free_full(application->support_sizes, __ps_free_support_size);
379 free((void *)application);
382 API void pkgmgrinfo_basic_free_application(application_x *application)
384 __ps_free_application(application);
387 API void pkgmgrinfo_basic_free_package(package_x *package)
391 if (package->for_all_users)
392 free((void *)package->for_all_users);
394 free((void *)package->ns);
395 if (package->package)
396 free((void *)package->package);
397 if (package->version)
398 free((void *)package->version);
399 if (package->installlocation)
400 free((void *)package->installlocation);
401 if (package->preload)
402 free((void *)package->preload);
403 if (package->readonly)
404 free((void *)package->readonly);
405 if (package->removable)
406 free((void *)package->removable);
408 free((void *)package->update);
410 free((void *)package->system);
412 free((void *)package->type);
413 if (package->package_size)
414 free((void *)package->package_size);
415 if (package->installed_time)
416 free((void *)package->installed_time);
417 if (package->installed_storage)
418 free((void *)package->installed_storage);
419 if (package->storeclient_id)
420 free((void *)package->storeclient_id);
421 if (package->mainapp_id)
422 free((void *)package->mainapp_id);
423 if (package->package_url)
424 free((void *)package->package_url);
425 if (package->root_path)
426 free((void *)package->root_path);
427 if (package->csc_path)
428 free((void *)package->csc_path);
429 if (package->appsetting)
430 free((void *)package->appsetting);
431 if (package->nodisplay_setting)
432 free((void *)package->nodisplay_setting);
433 if (package->api_version)
434 free((void *)package->api_version);
435 if (package->support_disable)
436 free((void *)package->support_disable);
437 if (package->tep_name)
438 free((void *)package->tep_name);
439 if (package->zip_mount_file)
440 free((void *)package->zip_mount_file);
441 if (package->external_path)
442 free((void *)package->external_path);
445 g_list_free_full(package->icon, __ps_free_icon);
447 g_list_free_full(package->label, __ps_free_label);
449 g_list_free_full(package->author, __ps_free_author);
451 g_list_free_full(package->description, __ps_free_description);
453 g_list_free_full(package->license, __ps_free_license);
455 g_list_free_full(package->privileges, __ps_free_privilege);
457 g_list_free_full(package->application, __ps_free_application);
458 /*Free Compatibility*/
459 g_list_free_full(package->compatibility, __ps_free_compatibility);
460 /*Free Device profiles*/
461 g_list_free_full(package->deviceprofile, free);
462 free((void*)package);