#include <libxml/xmlreader.h>
+/* For multi-user support */
+#include <tzplatform_config.h>
+
#ifdef __cplusplus
extern "C" {
#endif
#define DEFAULT_LOCALE "No Locale"
#define PKG_PARSERLIB "parserlib:"
-#define PKG_PARSER_CONF_PATH "/usr/etc/package-manager/parser_path.conf"
+#define PKG_PARSER_CONF_PATH SYSCONFDIR "/package-manager/parser_path.conf"
#define PKG_STRING_LEN_MAX 1024
+#define PKGMGR_PARSER_EMPTY_STR ""
+#define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
+
+/**
+ * @brief API return values
+ */
+enum {
+ PM_PARSER_R_EINVAL = -2, /**< Invalid argument */
+ PM_PARSER_R_ERROR = -1, /**< General error */
+ PM_PARSER_R_OK = 0 /**< General success */
+};
+
/**
* @brief List definitions.
* All lists are doubly-linked, the last element is stored to list pointer,
} appsvc_x;
typedef struct appcontrol_x {
- const char *text;
- struct operation_x *operation;
- struct uri_x *uri;
- struct mime_x *mime;
- struct subapp_x *subapp;
+ const char *operation;
+ const char *uri;
+ const char *mime;
struct appcontrol_x *prev;
struct appcontrol_x *next;
} appcontrol_x;
typedef struct datacontrol_x {
const char *providerid;
- struct capability_x *capability;
+ const char *access;
+ const char *type;
struct datacontrol_x *prev;
struct datacontrol_x *next;
} datacontrol_x;
const char *categories;
const char *extraid;
const char *hwacceleration;
+ const char *screenreader;
const char *mainapp;
const char *package;
const char *recentimage;
const char *permission_type;
const char *component_type;
const char *preload;
+ const char *submode;
+ const char *submode_mainid;
+ const char *launch_mode;
struct label_x *label;
struct icon_x *icon;
struct image_x *image;
struct launchconditions_x *launchconditions;
struct notification_x *notification;
struct datashare_x *datashare;
+ struct datacontrol_x *datacontrol;
struct uiapplication_x *prev;
struct uiapplication_x *next;
+
} uiapplication_x;
typedef struct serviceapplication_x {
} ime_x;
typedef struct manifest_x {
+ const char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only*/
const char *package; /**< package name*/
const char *version; /**< package version*/
const char *installlocation; /**< package install location*/
const char *readonly; /**< package readonly flag*/
const char *update; /**< package update flag*/
const char *appsetting; /**< package app setting flag*/
+ const char *system; /**< package system flag*/
const char *type; /**< package type*/
const char *package_size; /**< package size for external installation*/
const char *installed_time; /**< installed time after finishing of installation*/
const char *root_path; /**< package root path*/
const char *csc_path; /**< package csc path*/
const char *nodisplay_setting; /**< package no display setting menu*/
+ const char *api_version; /**< minimum version of API package using*/
struct icon_x *icon; /**< package icon*/
struct label_x *label; /**< package label*/
struct author_x *author; /**< package author*/
struct deviceprofile_x *deviceprofile; /**< package device profile*/
} manifest_x;
+/*enum uid_value {
+ ROOT,
+ GLOBAL,
+ USER
+};*/
+
+/**uid check
+ *
+ */
+/* int check_uid(uid_t uid)
+ {
+ switch(uid)
+ {
+ case GLOBAL_USER: return GLOBAL;
+ case 0: return ROOT;
+ default: goto user; break;
+ }
+user:
+cf getdbpath
+*/
+
+
/**
* @fn char *pkgmgr_parser_get_manifest_file(const char *pkgid)
* @brief This API gets the manifest file of the package.
* @endcode
*/
char *pkgmgr_parser_get_manifest_file(const char *pkgid);
+char *pkgmgr_parser_get_usr_manifest_file(const char *pkgid, uid_t uid);
/**
* @fn int pkgmgr_parser_parse_manifest_for_installation(const char *manifest, char *const tagv[])
+ * @fn int pkgmgr_parser_parse_usr_manifest_for_installation(const char *manifest, uid_t uid, char *const tagv[])
* @brief This API parses the manifest file of the package after installation and stores the data in DB.
*
* @par This API is for package-manager installer backends.
* @par Sync (or) Async : Synchronous API
*
* @param[in] manifest pointer to package manifest file
+ * @param[in] uid the addressee user id of the instruction
* @param[in] tagv array of xml tags or NULL
* @return 0 if success, error code(<0) if fail
* @retval PMINFO_R_OK success
* @endcode
*/
int pkgmgr_parser_parse_manifest_for_installation(const char *manifest, char *const tagv[]);
+int pkgmgr_parser_parse_usr_manifest_for_installation(const char *manifest, uid_t uid, char *const tagv[]);
/**
+ * @fn int pkgmgr_parser_parse_usr_manifest_for_upgrade(const char *manifest, uid_t uid, char *const tagv[])
* @fn int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *const tagv[])
* @brief This API parses the manifest file of the package after upgrade and stores the data in DB.
*
* @par Sync (or) Async : Synchronous API
*
* @param[in] manifest pointer to package manifest file
+ * @param[in] uid the addressee user id of the instruction
* @param[in] tagv array of xml tags or NULL
* @return 0 if success, error code(<0) if fail
* @retval PMINFO_R_OK success
* @endcode
*/
int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *const tagv[]);
-
+int pkgmgr_parser_parse_usr_manifest_for_upgrade(const char *manifest, uid_t uid, char *const tagv[]);
/**
* @fn int pkgmgr_parser_parse_manifest_for_uninstallation(const char *manifest, char *const tagv[])
+ * @fn int pkgmgr_parser_parse_usr_manifest_for_uninstallation(const char *manifest, uid_t uid, char *const tagv[])
* @brief This API parses the manifest file of the package after uninstallation and deletes the data from DB.
*
* @par This API is for package-manager installer backends.
* @par Sync (or) Async : Synchronous API
*
* @param[in] manifest pointer to package manifest file
+ * @param[in] uid the addressee user id of the instruction
* @param[in] tagv array of xml tags or NULL
* @return 0 if success, error code(<0) if fail
* @retval PMINFO_R_OK success
* @endcode
*/
int pkgmgr_parser_parse_manifest_for_uninstallation(const char *manifest, char *const tagv[]);
+int pkgmgr_parser_parse_usr_manifest_for_uninstallation(const char *manifest, uid_t uid, char *const tagv[]);
+/**
+ * @fn int pkgmgr_parser_parse_manifest_for_preload()
+ * @fn int pkgmgr_parser_parse_usr_manifest_for_preload(uid_t uid)
+ * @brief This API update preload information to DB.
+ *
+ * @par This API is for package-manager installer backends.
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre None
+ * @post None
+ * @code
+static int parser_parse_manifest_for_preload()
+{
+ int ret = 0;
+ ret = pkgmgr_parser_parse_manifest_for_preload();
+ if (ret)
+ return -1;
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgr_parser_parse_manifest_for_preload();
+int pkgmgr_parser_parse_usr_manifest_for_preload(uid_t uid);
/**
* @fn int pkgmgr_parser_check_manifest_validation(const char *manifest)
/**
* @fn manifest_x *pkgmgr_parser_process_manifest_xml(const char *manifest)
+ * @fn manifest_x *pkgmgr_parser_usr_process_manifest_xml(const char *manifest, uid_t uid)
* @brief This API parses the manifest file and stores all the data in the manifest structure.
*
* @par This API is for package-manager installer backends.
* @par Sync (or) Async : Synchronous API
*
* @param[in] manifest pointer to package manifest file
+ * @param[in] uid the addressee user id of the instruction
* @return manifest pointer on success, NULL on failure
* @pre None
* @post pkgmgr_parser_free_manifest_xml()
* @endcode
*/
manifest_x *pkgmgr_parser_process_manifest_xml(const char *manifest);
-
-/**
- * @fn manifest_x *pkgmgr_parser_get_manifest_info(const char *pkigid)
- * @brief This API gets the manifest info from DB and stores all the data in the manifest structure.
- *
- * @par This API is for package-manager installer backends.
- * @par Sync (or) Async : Synchronous API
- *
- * @param[in] pkgid package id for package
- * @return manifest pointer on success, NULL on failure
- * @pre None
- * @post pkgmgr_parser_free_manifest_xml()
- * @code
-static int get_manifest_info(const char *pkgid)
-{
- manifest_x *mfx = NULL
- mfx = pkgmgr_parser_get_manifest_info(pkgid);
- if (mfx == NULL)
- return -1;
- printf("Parsing Manifest Success\n");
- pkgmgr_parser_free_manifest_xml(mfx);
- return 0;
-}
- * @endcode
- */
-manifest_x *pkgmgr_parser_get_manifest_info(const char *pkigid);
-
-/* These APIs are intended to call parser directly */
-typedef int (*ps_iter_fn) (const char *tag, int type, void *userdata);
-
-int pkgmgr_parser_has_parser(const char *tag, int *type);
-int pkgmgr_parser_get_list(ps_iter_fn iter_fn, void *data);
+manifest_x *pkgmgr_parser_usr_process_manifest_xml(const char *manifest, uid_t uid);
/**
* @fn int pkgmgr_parser_run_parser_for_installation(xmlDocPtr docPtr, const char *tag, const char *pkgid)
*/
int pkgmgr_parser_run_parser_for_uninstallation(xmlDocPtr docPtr, const char *tag, const char *pkgid);
+
+
/**
* @fn int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
+ * @fn int pkgmgr_parser_create_usr_desktop_file(manifest_x *mfx, uid_t uid)
* @brief This API generates the application desktop file
*
* @par This API is for package-manager installer backends.
* @par Sync (or) Async : Synchronous API
*
* @param[in] mfx manifest pointer
+ * @param[in] uid the addressee user id of the instruction
* @return 0 if success, error code(<0) if fail
* @retval PMINFO_R_OK success
* @retval PMINFO_R_EINVAL invalid argument
* @endcode
*/
int pkgmgr_parser_create_desktop_file(manifest_x *mfx);
+int pkgmgr_parser_create_usr_desktop_file(manifest_x *mfx, uid_t uid);
/** @} */
#ifdef __cplusplus