2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "pkgmgr-info.h"
21 #include "pkgmgrinfo_debug.h"
22 #include "pkgmgrinfo_private.h"
24 API int pkgmgrinfo_compinfo_get_appid(pkgmgrinfo_compinfo_h handle,
27 retvm_if(handle == NULL, PMINFO_R_EINVAL, "compinfo handle is NULL");
28 retvm_if(appid == NULL, PMINFO_R_EINVAL, "appid is NULL");
29 pkgmgr_compinfo_x *info = (pkgmgr_compinfo_x *)handle;
31 if (info->comp_info == NULL || info->appid == NULL)
32 return PMINFO_R_ERROR;
39 API int pkgmgrinfo_compinfo_get_compid(pkgmgrinfo_compinfo_h handle,
42 retvm_if(handle == NULL, PMINFO_R_EINVAL, "compinfo handle is NULL");
43 retvm_if(compid == NULL, PMINFO_R_EINVAL, "compid is NULL");
44 pkgmgr_compinfo_x *info = (pkgmgr_compinfo_x *)handle;
46 if (info->comp_info == NULL || info->comp_info->id == NULL)
47 return PMINFO_R_ERROR;
49 *compid = info->comp_info->id;
54 API int pkgmgrinfo_compinfo_get_type(pkgmgrinfo_compinfo_h handle,
57 retvm_if(handle == NULL, PMINFO_R_EINVAL, "compinfo handle is NULL");
58 retvm_if(type == NULL, PMINFO_R_EINVAL, "type is NULL");
59 pkgmgr_compinfo_x *info = (pkgmgr_compinfo_x *)handle;
61 if (info->comp_info == NULL || info->comp_info->type == NULL)
62 return PMINFO_R_ERROR;
64 *type = info->comp_info->type;
69 API int pkgmgrinfo_compinfo_get_launch_mode(pkgmgrinfo_compinfo_h handle,
70 const char **launch_mode)
72 retvm_if(handle == NULL, PMINFO_R_EINVAL, "compinfo handle is NULL");
73 retvm_if(launch_mode == NULL, PMINFO_R_EINVAL, "type is NULL");
74 pkgmgr_compinfo_x *info = (pkgmgr_compinfo_x *)handle;
76 if (info->comp_info == NULL || info->comp_info->launch_mode == NULL)
77 return PMINFO_R_ERROR;
79 *launch_mode = info->comp_info->launch_mode;