3 #include "pkgmgrinfo_basic.h"
6 #define API __attribute__ ((visibility("default")))
9 static void __ps_free_metadata(gpointer data)
11 metadata_x *metadata = (metadata_x *)data;
16 free((void *)metadata->key);
18 free((void *)metadata->value);
19 free((void *)metadata);
22 static void __ps_free_permission(gpointer data)
24 permission_x *permission = (permission_x *)data;
26 if (permission == NULL)
29 free((void *)permission->type);
30 if (permission->value)
31 free((void *)permission->value);
32 free((void *)permission);
35 static void __ps_free_icon(gpointer data)
37 icon_x *icon = (icon_x *)data;
42 free((void *)icon->text);
44 free((void *)icon->lang);
46 free((void *)icon->section);
48 free((void *)icon->size);
50 free((void *)icon->resolution);
52 free((void *)icon->dpi);
56 static void __ps_free_image(gpointer data)
58 image_x *image = (image_x *)data;
63 free((void *)image->text);
65 free((void *)image->lang);
67 free((void *)image->section);
71 static void __ps_free_notification(gpointer data)
73 notification_x *notification = (notification_x *)data;
75 if (notification == NULL)
77 if (notification->text)
78 free((void *)notification->text);
79 if (notification->name)
80 free((void *)notification->name);
81 free((void *)notification);
84 static void __ps_free_compatibility(gpointer data)
86 compatibility_x *compatibility = (compatibility_x *)data;
88 if (compatibility == NULL)
90 if (compatibility->text)
91 free((void *)compatibility->text);
92 if (compatibility->name)
93 free((void *)compatibility->name);
94 free((void *)compatibility);
97 static void __ps_free_plugin_info(gpointer data)
99 plugin_x *plugin = (plugin_x *)data;
104 free((void *)plugin->pkgid);
106 free((void *)plugin->appid);
107 if (plugin->plugin_type)
108 free((void *)plugin->plugin_type);
109 if (plugin->plugin_name)
110 free((void *)plugin->plugin_name);
111 free((void *)plugin);
114 static void __ps_free_res_allowed_packages(gpointer data)
116 res_allowed_package_x *allowed_package = (res_allowed_package_x *)data;
118 if (allowed_package == NULL)
120 g_list_free_full(allowed_package->required_privileges, free);
121 free((void *)allowed_package->allowed_package);
122 free((void *)allowed_package);
125 static void __ps_free_appcontrol(gpointer data)
127 appcontrol_x *appcontrol = (appcontrol_x *)data;
129 if (appcontrol == NULL)
132 if (appcontrol->operation)
133 free((void *)appcontrol->operation);
136 free((void *)appcontrol->uri);
138 if (appcontrol->mime)
139 free((void *)appcontrol->mime);
141 if (appcontrol->visibility)
142 free((void *)appcontrol->visibility);
145 free((void *)appcontrol->id);
147 if (appcontrol->privileges)
148 g_list_free_full(appcontrol->privileges, free);
149 free((void *)appcontrol);
152 static void __ps_free_define(gpointer data)
154 define_x *define = (define_x *)data;
159 free((void *)define->path);
161 g_list_free_full(define->request, free);
163 g_list_free_full(define->allowed, free);
164 free((void *)define);
167 static void __ps_free_datashare(gpointer data)
169 datashare_x *datashare = (datashare_x *)data;
171 if (datashare == NULL)
174 g_list_free_full(datashare->define, __ps_free_define);
176 g_list_free_full(datashare->request, free);
177 free((void *)datashare);
180 static void __ps_free_label(gpointer data)
182 label_x *label = (label_x *)data;
187 free((void *)label->name);
189 free((void *)label->text);
191 free((void *)label->lang);
195 static void __ps_free_author(gpointer data)
197 author_x *author = (author_x *)data;
202 free((void *)author->email);
204 free((void *)author->text);
206 free((void *)author->href);
208 free((void *)author->lang);
209 free((void *)author);
212 static void __ps_free_description(gpointer data)
214 description_x *description = (description_x *)data;
216 if (description == NULL)
218 if (description->name)
219 free((void *)description->name);
220 if (description->text)
221 free((void *)description->text);
222 if (description->lang)
223 free((void *)description->lang);
224 free((void *)description);
227 static void __ps_free_license(gpointer data)
229 license_x *license = (license_x *)data;
234 free((void *)license->text);
236 free((void *)license->lang);
237 free((void *)license);
240 static void __ps_free_splashscreen(gpointer data)
242 splashscreen_x *splashscreen = (splashscreen_x *)data;
244 if (splashscreen == NULL)
246 if (splashscreen->src)
247 free((void *)splashscreen->src);
248 if (splashscreen->type)
249 free((void *)splashscreen->type);
250 if (splashscreen->dpi)
251 free((void *)splashscreen->dpi);
252 if (splashscreen->orientation)
253 free((void *)splashscreen->orientation);
254 if (splashscreen->indicatordisplay)
255 free((void *)splashscreen->indicatordisplay);
256 if (splashscreen->operation)
257 free((void *)splashscreen->operation);
258 if (splashscreen->color_depth)
259 free((void *)splashscreen->color_depth);
260 free((void *)splashscreen);
263 static void __ps_free_privilege(gpointer data)
265 privilege_x *privilege = (privilege_x *)data;
267 if (privilege == NULL)
270 free((void *)privilege->type);
271 if (privilege->value)
272 free((void *)privilege->value);
273 free((void *)privilege);
276 static void __ps_free_appdefined_privilege(gpointer data)
278 appdefined_privilege_x *privilege = (appdefined_privilege_x *)data;
280 if (privilege == NULL)
283 free((void *)privilege->type);
284 if (privilege->value)
285 free((void *)privilege->value);
286 if (privilege->license)
287 free((void *)privilege->license);
288 free((void *)privilege);
291 static void __ps_free_datacontrol(gpointer data)
293 datacontrol_x *datacontrol = (datacontrol_x *)data;
295 if (datacontrol == NULL)
297 if (datacontrol->providerid)
298 free((void *)datacontrol->providerid);
299 if (datacontrol->access)
300 free((void *)datacontrol->access);
301 if (datacontrol->type)
302 free((void *)datacontrol->type);
303 if (datacontrol->trusted)
304 free((void *)datacontrol->trusted);
305 if (datacontrol->privileges)
306 g_list_free_full(datacontrol->privileges, free);
307 free((void *)datacontrol);
310 static void __ps_free_dependency(gpointer data)
312 dependency_x *dependency = (dependency_x *)data;
314 if (dependency == NULL)
316 if (dependency->pkgid)
317 free((void *)dependency->pkgid);
318 if (dependency->depends_on)
319 free((void *)dependency->depends_on);
320 if (dependency->type)
321 free((void *)dependency->type);
322 if (dependency->required_version)
323 free((void *)dependency->required_version);
324 free((void *)dependency);
327 static void __ps_free_res_control(gpointer data)
329 res_control_x *res_control = (res_control_x *)data;
331 if (res_control == NULL)
333 free((void *)res_control->res_type);
334 free((void *)res_control->min_res_version);
335 free((void *)res_control->max_res_version);
336 free((void *)res_control->auto_close);
337 free((void *)res_control);
340 static void __ps_free_application(gpointer data)
342 application_x *application = (application_x *)data;
344 if (application == NULL)
347 if (application->appid)
348 free((void *)application->appid);
349 if (application->component)
350 free((void *)application->component);
351 if (application->exec)
352 free((void *)application->exec);
353 if (application->nodisplay)
354 free((void *)application->nodisplay);
355 if (application->type)
356 free((void *)application->type);
357 if (application->onboot)
358 free((void *)application->onboot);
359 if (application->multiple)
360 free((void *)application->multiple);
361 if (application->autorestart)
362 free((void *)application->autorestart);
363 if (application->taskmanage)
364 free((void *)application->taskmanage);
365 if (application->categories)
366 free((void *)application->categories);
367 if (application->extraid)
368 free((void *)application->extraid);
369 if (application->hwacceleration)
370 free((void *)application->hwacceleration);
371 if (application->screenreader)
372 free((void *)application->screenreader);
373 if (application->mainapp)
374 free((void *)application->mainapp);
375 if (application->recentimage)
376 free((void *)application->recentimage);
377 if (application->launchcondition)
378 free((void *)application->launchcondition);
379 if (application->indicatordisplay)
380 free((void *)application->indicatordisplay);
381 if (application->portraitimg)
382 free((void *)application->portraitimg);
383 if (application->landscapeimg)
384 free((void *)application->landscapeimg);
385 if (application->guestmode_visibility)
386 free((void *)application->guestmode_visibility);
387 if (application->permission_type)
388 free((void *)application->permission_type);
389 if (application->preload)
390 free((void *)application->preload);
391 if (application->submode)
392 free((void *)application->submode);
393 if (application->submode_mainid)
394 free((void *)application->submode_mainid);
395 if (application->process_pool)
396 free((void *)application->process_pool);
397 if (application->installed_storage)
398 free((void *)application->installed_storage);
399 if (application->launch_mode)
400 free((void *)application->launch_mode);
401 if (application->ui_gadget)
402 free((void *)application->ui_gadget);
403 if (application->component_type)
404 free((void *)application->component_type);
405 if (application->package)
406 free((void *)application->package);
407 if (application->support_disable)
408 free((void *)application->support_disable);
409 if (application->tep_name)
410 free((void *)application->tep_name);
411 if (application->zip_mount_file)
412 free((void *)application->zip_mount_file);
413 if (application->root_path)
414 free((void *)application->root_path);
415 if (application->api_version)
416 free((void *)application->api_version);
417 if (application->for_all_users)
418 free((void *)application->for_all_users);
419 if (application->effective_appid)
420 free((void *)application->effective_appid);
421 if (application->is_disabled)
422 free((void *)application->is_disabled);
423 if (application->splash_screen_display)
424 free((void *)application->splash_screen_display);
425 if (application->effectimage_type)
426 free((void *)application->effectimage_type);
427 if (application->package_type)
428 free((void *)application->package_type);
429 if (application->support_ambient)
430 free((void *)application->support_ambient);
431 if (application->alias_appid)
432 free((void *)application->alias_appid);
433 if (application->external_path)
434 free((void *)application->external_path);
435 if (application->package_system)
436 free((void *)application->package_system);
437 if (application->removable)
438 free((void *)application->removable);
439 if (application->package_installed_time)
440 free((void *)application->package_installed_time);
441 if (application->support_mode)
442 free((void *)application->support_mode);
443 if (application->setup_appid)
444 free((void *)application->setup_appid);
445 if (application->locale)
446 free((void *)application->locale);
447 if (application->light_user_switch_mode)
448 free((void *)application->light_user_switch_mode);
451 g_list_free_full(application->label, __ps_free_label);
453 g_list_free_full(application->icon, __ps_free_icon);
455 g_list_free_full(application->image, __ps_free_image);
457 g_list_free_full(application->appcontrol, __ps_free_appcontrol);
459 g_list_free_full(application->category, free);
461 g_list_free_full(application->metadata, __ps_free_metadata);
463 g_list_free_full(application->permission, __ps_free_permission);
464 /*Free LaunchConditions*/
465 g_list_free_full(application->launchconditions, free);
466 /*Free Notification*/
467 g_list_free_full(application->notification, __ps_free_notification);
469 g_list_free_full(application->datashare, __ps_free_datashare);
471 g_list_free_full(application->datacontrol, __ps_free_datacontrol);
472 /*Free BackgroundCategory*/
473 g_list_free_full(application->background_category, free);
474 /*Free SplashScreen*/
475 g_list_free_full(application->splashscreens, __ps_free_splashscreen);
477 g_list_free_full(application->res_control, __ps_free_res_control);
479 free((void *)application);
482 API void pkgmgrinfo_basic_free_application(application_x *application)
484 __ps_free_application(application);
487 API void pkgmgrinfo_basic_free_dependency(dependency_x *dependency)
489 __ps_free_dependency(dependency);
492 API void pkgmgrinfo_basic_free_package(package_x *package)
496 if (package->for_all_users)
497 free((void *)package->for_all_users);
499 free((void *)package->ns);
500 if (package->package)
501 free((void *)package->package);
502 if (package->version)
503 free((void *)package->version);
504 if (package->installlocation)
505 free((void *)package->installlocation);
506 if (package->preload)
507 free((void *)package->preload);
508 if (package->readonly)
509 free((void *)package->readonly);
510 if (package->removable)
511 free((void *)package->removable);
513 free((void *)package->update);
515 free((void *)package->system);
517 free((void *)package->type);
518 if (package->package_size)
519 free((void *)package->package_size);
520 if (package->installed_time)
521 free((void *)package->installed_time);
522 if (package->installed_storage)
523 free((void *)package->installed_storage);
524 if (package->storeclient_id)
525 free((void *)package->storeclient_id);
526 if (package->mainapp_id)
527 free((void *)package->mainapp_id);
528 if (package->package_url)
529 free((void *)package->package_url);
530 if (package->root_path)
531 free((void *)package->root_path);
532 if (package->csc_path)
533 free((void *)package->csc_path);
534 if (package->appsetting)
535 free((void *)package->appsetting);
536 if (package->nodisplay_setting)
537 free((void *)package->nodisplay_setting);
538 if (package->api_version)
539 free((void *)package->api_version);
540 if (package->support_disable)
541 free((void *)package->support_disable);
542 if (package->tep_name)
543 free((void *)package->tep_name);
544 if (package->zip_mount_file)
545 free((void *)package->zip_mount_file);
546 if (package->external_path)
547 free((void *)package->external_path);
548 if (package->support_mode)
549 free((void *)package->support_mode);
550 if (package->use_system_certs)
551 free((void *)package->use_system_certs);
553 free((void *)package->locale);
554 if (package->res_type)
555 free((void *)package->res_type);
556 if (package->res_version)
557 free((void *)package->res_version);
559 free((void *)package->lib);
560 if (package->is_disabled)
561 free((void *)package->is_disabled);
562 if (package->light_user_switch_mode)
563 free((void *)package->light_user_switch_mode);
566 g_list_free_full(package->icon, __ps_free_icon);
568 g_list_free_full(package->label, __ps_free_label);
570 g_list_free_full(package->author, __ps_free_author);
572 g_list_free_full(package->description, __ps_free_description);
574 g_list_free_full(package->license, __ps_free_license);
576 g_list_free_full(package->privileges, __ps_free_privilege);
577 /*Free AppDefined Privileges*/
578 g_list_free_full(package->appdefined_privileges,
579 __ps_free_appdefined_privilege);
580 /*Free Providing AppDefined Privileges*/
581 g_list_free_full(package->provides_appdefined_privileges,
582 __ps_free_appdefined_privilege);
584 g_list_free_full(package->application, __ps_free_application);
585 /*Free Compatibility*/
586 g_list_free_full(package->compatibility, __ps_free_compatibility);
587 /*Free Device profiles*/
588 g_list_free_full(package->deviceprofile, free);
589 /*Free Dependencies*/
590 g_list_free_full(package->dependencies, __ps_free_dependency);
591 /*Free Plugin execution history*/
592 g_list_free_full(package->plugin, __ps_free_plugin_info);
593 /*Free resource allowed packages*/
594 g_list_free_full(package->res_allowed_packages, __ps_free_res_allowed_packages);
596 g_list_free_full(package->metadata, __ps_free_metadata);
597 free((void *)package);