delete dbinfo related APIs & apply seperation of RW/RO location
[platform/core/appfw/pkgmgr-info.git] / parser / pkgmgr_parser.h
index db11167..b0b39f6 100644 (file)
@@ -45,7 +45,7 @@
 
 /* For multi-user support */
 #include <tzplatform_config.h>
-#include "pkgmgr-info-basic.h"
+#include "pkgmgrinfo_basic.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -70,43 +70,49 @@ enum {
 };
 
 /**
- * @fn char *pkgmgr_parser_get_manifest_file(const char *pkgid)
- * @brief      This API gets the manifest file of the package.
+ * @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]  pkgid   pointer to package ID
- * @return     manifest file path on success, NULL on failure
+ * @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
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
  * @pre                None
- * @post               Free the manifest file pointer that is returned by API
+ * @post               None
  * @code
-static int get_manifest_file(const char *pkgid)
+static int parse_manifest_file_for_installation(const char *manifest)
 {
-       char *manifest = NULL;
-       manifest = pkgmgr_parser_get_manifest_file(pkgid);
-       if (manifest == NULL)
+       int ret = 0;
+       ret = pkgmgr_parser_parse_manifest_for_installation(manifest, NULL);
+       if (ret)
                return -1;
-       printf("Manifest File Path is %s\n", manifest);
-       free(manifest);
        return 0;
 }
  * @endcode
  */
-char *pkgmgr_parser_get_manifest_file(const char *pkgid);
-char *pkgmgr_parser_get_usr_manifest_file(const char *pkgid, uid_t uid);
+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[]);
+int pkgmgr_parser_process_manifest_x_for_installation(manifest_x* mfx, const char *manifest);
+int pkgmgr_parser_process_usr_manifest_x_for_installation(manifest_x* mfx, const char *manifest, 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.
+ * @fn int pkgmgr_parser_update_tep(const char* pkgid, const char * tep_path)
+ * @fn int pkgmgr_parser_usr_update_tep(const char* pkgid, const char* tep_path, uid_t uid)
+ * @brief      This API updates tep path information stored 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]  pkgid   pointer to package ID
+  * @param[in]tep_path pointer to path of TEP 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
  * @retval     PMINFO_R_EINVAL invalid argument
@@ -114,18 +120,18 @@ char *pkgmgr_parser_get_usr_manifest_file(const char *pkgid, uid_t uid);
  * @pre                None
  * @post               None
  * @code
-static int parse_manifest_file_for_installation(const char *manifest)
+static int update_tep_info_for_upgrade(const char *pkgid, const char *tep_path)
 {
        int ret = 0;
-       ret = pkgmgr_parser_parse_manifest_for_installation(manifest, NULL);
+       ret = pkgmgr_parser_update_tep(pkgid, tep_path);
        if (ret)
                return -1;
        return 0;
 }
  * @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[]);
+int pkgmgr_parser_update_tep(const char* pkgid, const char* tep_path);
+int pkgmgr_parser_usr_update_tep(const char* pkgid, const char* tep_path, uid_t uid);
 
 /**
  * @fn int pkgmgr_parser_parse_usr_manifest_for_upgrade(const char *manifest,  uid_t uid, char *const tagv[])
@@ -157,6 +163,9 @@ static int parse_manifest_file_for_upgrade(const char *manifest)
  */
 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[]);
+int pkgmgr_parser_process_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest);
+int pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest_x* mfx, const char *manifest, uid_t uid);
+
 /**
  * @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[])
@@ -187,6 +196,9 @@ static int parse_manifest_file_for_uninstallation(const char *manifest)
  */
 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[]);
+int pkgmgr_parser_process_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest);
+int pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest_x* mfx, const char *manifest, uid_t uid);
+
 /**
  * @fn int pkgmgr_parser_parse_manifest_for_preload()
  * @fn int pkgmgr_parser_parse_usr_manifest_for_preload(uid_t uid)