From: Junghyun Yeon Date: Sat, 12 Mar 2016 04:39:44 +0000 (+0900) Subject: fix and add some prototype to suppress build warnings X-Git-Tag: accepted/tizen/common/20160317.155414^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F61991%2F2;p=platform%2Fcore%2Fappfw%2Fslp-pkgmgr.git fix and add some prototype to suppress build warnings Change-Id: Ib62e03d5ac11ae4e9ed8c40014f6433d9fd94703 Signed-off-by: Junghyun Yeon --- diff --git a/comm/pkgmgr_installer.c b/comm/pkgmgr_installer.c index f523476..16cdd4a 100644 --- a/comm/pkgmgr_installer.c +++ b/comm/pkgmgr_installer.c @@ -538,7 +538,7 @@ API int pkgmgr_installer_set_request_type(pkgmgr_installer *pi, int request_type return 0; } -API int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, char *session_id) +API int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, const char *session_id) { if (pi == NULL || session_id == NULL) return -1; diff --git a/comm/pkgmgr_installer.h b/comm/pkgmgr_installer.h index aaa3856..07b02bb 100644 --- a/comm/pkgmgr_installer.h +++ b/comm/pkgmgr_installer.h @@ -583,6 +583,49 @@ int main(int argc, char **argv) int pkgmgr_installer_get_is_preload(pkgmgr_installer *pi); /** + @brief Send a app status signal + @pre None + @post None + @see None + @param[in] pi pkgmgr_installer object + @param[in] pkg_type package type: "deb", "jar", "wgt", ... + @param[in] pkgid package id + @param[in] appid application id + @param[in] key Signal key + @param[in] val Signal value + @return Operation result + @retval 0 on success + @retval -errno on failure + @code +#include +void send_app_singal(uid_t uid, int request_type, int req_id, + const char *pkg_type, const char *pkgid, const char *appid, + const char *key, const char *val) +{ + pkgmgr_installer *pi; + int r = 0; + + pi = pkgmgr_installer_new(); + if(!pi) return -1; + + if (pkgmgr_installer_set_uid(pi, uid)) + goto CLEANUP_RET; + if (pkgmgr_installer_set_request_type(pi, request_type)) + goto CLEANUP_RET; + if ((pkgmgr_installer_set_session_id(pi, req_id)) + goto CLEANUP_RET; + pkgmgr_installer_send_app_signal(pi, pkg_type, pkgid, appid, key, val); + +} + @endcode + */ +int pkgmgr_installer_send_app_signal(pkgmgr_installer *pi, + const char *pkg_type, + const char *pkgid, + const char *appid, + const char *key, const char *val); + +/** @brief Send a process status signal @pre None @post None @@ -700,7 +743,7 @@ int pkgmgr_installer_set_request_type(pkgmgr_installer *pi, int request_type); * @param[in] session_id session ID to be set * @return 0 if success, error code(<0) if fail\n */ -int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, char *session_id); +int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, const char *session_id); /** * @brief This API creates the certinfo handle.