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_application(gpointer data)
239 application_x *application = (application_x *)data;
240 if (application == NULL)
243 if (application->appid)
244 free((void *)application->appid);
245 if (application->component)
246 free((void *)application->component);
247 if (application->exec)
248 free((void *)application->exec);
249 if (application->nodisplay)
250 free((void *)application->nodisplay);
251 if (application->type)
252 free((void *)application->type);
253 if (application->onboot)
254 free((void *)application->onboot);
255 if (application->multiple)
256 free((void *)application->multiple);
257 if (application->autorestart)
258 free((void *)application->autorestart);
259 if (application->taskmanage)
260 free((void *)application->taskmanage);
261 if (application->enabled)
262 free((void *)application->enabled);
263 if (application->categories)
264 free((void *)application->categories);
265 if (application->extraid)
266 free((void *)application->extraid);
267 if (application->hwacceleration)
268 free((void *)application->hwacceleration);
269 if (application->screenreader)
270 free((void *)application->screenreader);
271 if (application->mainapp)
272 free((void *)application->mainapp);
273 if (application->recentimage)
274 free((void *)application->recentimage);
275 if (application->launchcondition)
276 free((void *)application->launchcondition);
277 if (application->indicatordisplay)
278 free((void *)application->indicatordisplay);
279 if (application->portraitimg)
280 free((void *)application->portraitimg);
281 if (application->landscapeimg)
282 free((void *)application->landscapeimg);
283 if (application->guestmode_visibility)
284 free((void *)application->guestmode_visibility);
285 if (application->permission_type)
286 free((void *)application->permission_type);
287 if (application->preload)
288 free((void *)application->preload);
289 if (application->submode)
290 free((void *)application->submode);
291 if (application->submode_mainid)
292 free((void *)application->submode_mainid);
293 if (application->process_pool)
294 free((void *)application->process_pool);
295 if (application->installed_storage)
296 free((void *)application->installed_storage);
297 if (application->launch_mode)
298 free((void *)application->launch_mode);
299 if (application->ui_gadget)
300 free((void *)application->ui_gadget);
301 if (application->component_type)
302 free((void *)application->component_type);
303 if (application->package)
304 free((void *)application->package);
305 if (application->support_disable)
306 free((void *)application->support_disable);
307 if (application->tep_name)
308 free((void *)application->tep_name);
309 if (application->zip_mount_file)
310 free((void *)application->zip_mount_file);
311 if (application->root_path)
312 free((void *)application->root_path);
313 if (application->api_version)
314 free((void *)application->api_version);
315 if (application->for_all_users)
316 free((void *)application->for_all_users);
317 if (application->effective_appid)
318 free((void *)application->effective_appid);
319 if (application->is_disabled)
320 free((void *)application->is_disabled);
321 if (application->splash_screen_display)
322 free((void *)application->splash_screen_display);
323 if (application->effectimage_type)
324 free((void *)application->effectimage_type);
325 if (application->package_type)
326 free((void *)application->package_type);
327 if (application->ambient_support)
328 free((void *)application->ambient_support);
329 if (application->alias_appid)
330 free((void *)application->alias_appid);
331 if (application->external_path)
332 free((void *)application->external_path);
335 g_list_free_full(application->label, __ps_free_label);
337 g_list_free_full(application->icon, __ps_free_icon);
339 g_list_free_full(application->image, __ps_free_image);
341 g_list_free_full(application->appcontrol, __ps_free_appcontrol);
343 g_list_free_full(application->category, free);
345 g_list_free_full(application->metadata, __ps_free_metadata);
347 g_list_free_full(application->permission, __ps_free_permission);
348 /*Free LaunchConditions*/
349 g_list_free_full(application->launchconditions, free);
350 /*Free Notification*/
351 g_list_free_full(application->notification, __ps_free_notification);
353 g_list_free_full(application->datashare, __ps_free_datashare);
355 g_list_free_full(application->datacontrol, __ps_free_datacontrol);
356 /*Free BackgroundCategory*/
357 g_list_free_full(application->background_category, free);
358 /*Free SplashScreen*/
359 g_list_free_full(application->splashscreens, __ps_free_splashscreen);
361 g_list_free_full(application->support_sizes, __ps_free_support_size);
363 free((void *)application);
366 API void pkgmgrinfo_basic_free_application(application_x *application)
368 __ps_free_application(application);
371 API void pkgmgrinfo_basic_free_package(package_x *package)
375 if (package->for_all_users)
376 free((void *)package->for_all_users);
378 free((void *)package->ns);
379 if (package->package)
380 free((void *)package->package);
381 if (package->version)
382 free((void *)package->version);
383 if (package->installlocation)
384 free((void *)package->installlocation);
385 if (package->preload)
386 free((void *)package->preload);
387 if (package->readonly)
388 free((void *)package->readonly);
389 if (package->removable)
390 free((void *)package->removable);
392 free((void *)package->update);
394 free((void *)package->system);
396 free((void *)package->type);
397 if (package->package_size)
398 free((void *)package->package_size);
399 if (package->installed_time)
400 free((void *)package->installed_time);
401 if (package->installed_storage)
402 free((void *)package->installed_storage);
403 if (package->storeclient_id)
404 free((void *)package->storeclient_id);
405 if (package->mainapp_id)
406 free((void *)package->mainapp_id);
407 if (package->package_url)
408 free((void *)package->package_url);
409 if (package->root_path)
410 free((void *)package->root_path);
411 if (package->csc_path)
412 free((void *)package->csc_path);
413 if (package->appsetting)
414 free((void *)package->appsetting);
415 if (package->nodisplay_setting)
416 free((void *)package->nodisplay_setting);
417 if (package->api_version)
418 free((void *)package->api_version);
419 if (package->support_disable)
420 free((void *)package->support_disable);
421 if (package->tep_name)
422 free((void *)package->tep_name);
423 if (package->zip_mount_file)
424 free((void *)package->zip_mount_file);
425 if (package->external_path)
426 free((void *)package->external_path);
429 g_list_free_full(package->icon, __ps_free_icon);
431 g_list_free_full(package->label, __ps_free_label);
433 g_list_free_full(package->author, __ps_free_author);
435 g_list_free_full(package->description, __ps_free_description);
437 g_list_free_full(package->license, __ps_free_license);
439 g_list_free_full(package->privileges, free);
441 g_list_free_full(package->application, __ps_free_application);
442 /*Free Compatibility*/
443 g_list_free_full(package->compatibility, __ps_free_compatibility);
444 /*Free Device profiles*/
445 g_list_free_full(package->deviceprofile, free);
446 free((void*)package);