4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
24 #ifndef __PKGMGRINFO_BASIC_H__
25 #define __PKGMGRINFO_BASIC_H__
27 #define DEFAULT_LOCALE "No Locale"
28 #define PKG_STRING_LEN_MAX 1024
29 #define PKGMGR_PARSER_EMPTY_STR ""
31 typedef struct metadata_x {
34 struct metadata_x *prev;
35 struct metadata_x *next;
38 typedef struct privilege_x {
40 struct privilege_x *prev;
41 struct privilege_x *next;
44 typedef struct privileges_x {
45 struct privilege_x *privilege;
46 struct privileges_x *prev;
47 struct privileges_x *next;
50 typedef struct permission_x {
53 struct permission_x *prev;
54 struct permission_x *next;
57 typedef struct icon_x {
63 const char *resolution;
68 typedef struct image_x {
77 typedef struct allowed_x {
80 struct allowed_x *prev;
81 struct allowed_x *next;
84 typedef struct request_x {
86 struct request_x *prev;
87 struct request_x *next;
90 typedef struct define_x {
92 struct allowed_x *allowed;
93 struct request_x *request;
94 struct define_x *prev;
95 struct define_x *next;
98 typedef struct datashare_x {
99 struct define_x *define;
100 struct request_x *request;
101 struct datashare_x *prev;
102 struct datashare_x *next;
105 typedef struct description_x {
109 struct description_x *prev;
110 struct description_x *next;
113 typedef struct registry_x {
116 struct registry_x *prev;
117 struct registry_x *next;
120 typedef struct database_x {
123 struct database_x *prev;
124 struct database_x *next;
127 typedef struct layout_x {
130 struct layout_x *prev;
131 struct layout_x *next;
134 typedef struct label_x {
138 struct label_x *prev;
139 struct label_x *next;
142 typedef struct author_x {
147 struct author_x *prev;
148 struct author_x *next;
151 typedef struct license_x {
154 struct license_x *prev;
155 struct license_x *next;
158 typedef struct operation_x {
161 struct operation_x *prev;
162 struct operation_x *next;
165 typedef struct uri_x {
172 typedef struct mime_x {
179 typedef struct subapp_x {
182 struct subapp_x *prev;
183 struct subapp_x *next;
186 typedef struct condition_x {
189 struct condition_x *prev;
190 struct condition_x *next;
193 typedef struct notification_x {
196 struct notification_x *prev;
197 struct notification_x *next;
200 typedef struct appsvc_x {
202 struct operation_x *operation;
205 struct subapp_x *subapp;
206 struct appsvc_x *prev;
207 struct appsvc_x *next;
210 typedef struct category_x{
212 struct category_x *prev;
213 struct category_x *next;
216 typedef struct launchconditions_x {
218 struct condition_x *condition;
219 struct launchconditions_x *prev;
220 struct launchconditions_x *next;
221 } launchconditions_x;
223 typedef struct compatibility_x {
226 struct compatibility_x *prev;
227 struct compatibility_x *next;
230 typedef struct deviceprofile_x {
233 struct deviceprofile_x *prev;
234 struct deviceprofile_x *next;
237 typedef struct resolution_x {
238 const char *mimetype;
239 const char *urischeme;
240 struct resolution_x *prev;
241 struct resolution_x *next;
244 typedef struct capability_x {
245 const char *operationid;
247 struct resolution_x *resolution;
248 struct capability_x *prev;
249 struct capability_x *next;
252 typedef struct datacontrol_x {
253 const char *providerid;
256 struct datacontrol_x *prev;
257 struct datacontrol_x *next;
260 typedef struct uiapplication_x {
263 const char *ambient_support;
264 const char *nodisplay;
265 const char *multiple;
266 const char *taskmanage;
269 const char *categories;
271 const char *hwacceleration;
272 const char *screenreader;
275 const char *recentimage;
276 const char *launchcondition;
277 const char *indicatordisplay;
278 const char *portraitimg;
279 const char *landscapeimg;
280 const char *effectimage_type;
281 const char *guestmode_visibility;
282 const char *app_component;
283 const char *permission_type;
284 const char *component_type;
287 const char *submode_mainid;
288 const char *installed_storage;
289 const char *process_pool;
290 const char *autorestart;
292 const char *multi_instance;
293 const char *multi_instance_mainid;
294 const char *multi_window;
295 const char *support_disable;
296 const char *ui_gadget;
297 const char *removable;
298 const char *support_mode;
299 const char *support_feature;
300 const char *satui_label;
301 const char *package_type;
302 const char *package_system;
303 const char *package_installed_time;
304 struct label_x *label;
306 struct image_x *image;
307 struct appsvc_x *appsvc;
308 struct category_x *category;
309 struct metadata_x *metadata;
310 struct permission_x *permission;
311 struct launchconditions_x *launchconditions;
312 struct notification_x *notification;
313 struct datashare_x *datashare;
314 struct datacontrol_x *datacontrol;
315 struct uiapplication_x *prev;
316 struct uiapplication_x *next;
319 typedef struct serviceapplication_x {
323 const char *autorestart;
327 const char *permission_type;
328 struct label_x *label;
330 struct appsvc_x *appsvc;
331 struct category_x *category;
332 struct metadata_x *metadata;
333 struct permission_x *permission;
334 struct datacontrol_x *datacontrol;
335 struct launchconditions_x *launchconditions;
336 struct notification_x *notification;
337 struct datashare_x *datashare;
338 struct serviceapplication_x *prev;
339 struct serviceapplication_x *next;
340 } serviceapplication_x;
342 typedef struct daemon_x {
345 struct daemon_x *prev;
346 struct daemon_x *next;
349 typedef struct theme_x {
352 struct theme_x *prev;
353 struct theme_x *next;
356 typedef struct font_x {
363 typedef struct ime_x {
370 typedef struct manifest_x {
371 const char *package; /**< package name*/
372 const char *version; /**< package version*/
373 const char *installlocation; /**< package install location*/
374 const char *ns; /**<name space*/
375 const char *removable; /**< package removable flag*/
376 const char *preload; /**< package preload flag*/
377 const char *readonly; /**< package readonly flag*/
378 const char *update; /**< package update flag*/
379 const char *appsetting; /**< package app setting flag*/
380 const char *system; /**< package system flag*/
381 const char *type; /**< package type*/
382 const char *package_size; /**< package size for external installation*/
383 const char *package_total_size; /**< package size for total*/
384 const char *package_data_size; /**< package size for data*/
385 const char *installed_time; /**< installed time after finishing of installation*/
386 const char *installed_storage; /**< package currently installed storage*/
387 const char *storeclient_id; /**< id of store client for installed package*/
388 const char *mainapp_id; /**< app id of main application*/
389 const char *package_url; /**< app id of main application*/
390 const char *root_path; /**< package root path*/
391 const char *csc_path; /**< package csc path*/
392 const char *nodisplay_setting; /**< package no display setting menu*/
393 const char *support_disable; /**< package support disable flag*/
394 const char *mother_package; /**< package is mother package*/
395 const char *support_mode; /**< package support mode*/
396 const char *support_reset; /**< package support reset*/
397 const char *use_reset; /**< package use reset*/
398 const char *groupid; /**< package groupid*/
399 const char *hash; /**<manifest file's hash */
400 struct icon_x *icon; /**< package icon*/
401 struct label_x *label; /**< package label*/
402 struct author_x *author; /**< package author*/
403 struct description_x *description; /**< package description*/
404 struct license_x *license; /**< package license*/
405 struct privileges_x *privileges; /**< package privileges*/
406 struct uiapplication_x *uiapplication; /**< package's ui application*/
407 struct serviceapplication_x *serviceapplication; /**< package's service application*/
408 struct daemon_x *daemon; /**< package daemon*/
409 struct theme_x *theme; /**< package theme*/
410 struct font_x *font; /**< package font*/
411 struct ime_x *ime; /**< package ime*/
412 struct compatibility_x *compatibility; /**< package compatibility*/
413 struct deviceprofile_x *deviceprofile; /**< package device profile*/
417 * @brief List definitions.
418 * All lists are doubly-linked, the last element is stored to list pointer,
419 * which means that lists must be looped using the prev pointer, or by
420 * calling LISTHEAD first to go to start in order to use the next pointer.
424 * @brief Convinience Macro to add node in list
427 #define LISTADD(list, node) \
429 (node)->prev = (list); \
430 if (list) (node)->next = (list)->next; \
431 else (node)->next = NULL; \
432 if (list) (list)->next = (node); \
437 * @brief Convinience Macro to add one node to another node
439 #define NODEADD(node1, node2) \
441 (node2)->prev = (node1); \
442 (node2)->next = (node1)->next; \
443 if ((node1)->next) (node1)->next->prev = (node2); \
444 (node1)->next = (node2); \
448 * @brief Convinience Macro to concatenate two lists
450 #define LISTCAT(list, first, last) \
451 if ((first) && (last)) { \
452 (first)->prev = (list); \
457 * @brief Convinience Macro to delete node from list
459 #define LISTDEL(list, node) \
461 if ((node)->prev) (node)->prev->next = (node)->next; \
462 if ((node)->next) (node)->next->prev = (node)->prev; \
463 if (!((node)->prev) && !((node)->next)) (list) = NULL; \
467 * @brief Convinience Macro to get list head
469 #define LISTHEAD(list, node) \
470 for ((node) = (list); (node)->prev; (node) = (node)->prev)
472 #define SAFE_LISTHEAD(list, node) do { \
474 for ((node) = (list); (node)->prev; (node) = (node)->prev); \
480 * @brief Convinience Macro to get list tail
482 #define LISTTAIL(list, node) \
483 for ((node) = (list); (node)->next; (node) = (node)->next)
485 #define FREE_AND_STRDUP(from, to) do { \
486 if (to) free((void *)to); \
487 if (from) to = strdup(from); \
491 * @brief Convinience Macro to free pointer
493 #define FREE_AND_NULL(ptr) do { \
500 void _pkgmgrinfo_basic_free_manifest_x(manifest_x *mfx);
502 char* pkgmgrinfo_basic_generate_hash_for_file(const char* file);
504 #endif /* __PKGMGRINFO_BASIC_H__ */