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.
18 #ifndef __AUL_RUNNING_CONTEXT_H__
19 #define __AUL_RUNNING_CONTEXT_H__
29 * @brief The AUL running context handle.
32 typedef struct aul_running_context_s *aul_running_context_h;
35 * @brief Creates the running context handle.
38 * @param[in] app_id The application ID
39 * @param[in] inst_id The instance ID
40 * @param[in] comp_id The component ID
41 * @param[out] handle The running context handle of the given IDs
42 * @return @c 0 on success,
43 * otherwise a negative error value
45 * @remarks This function is only available for platform level signed applications.
47 int aul_running_context_create(const char *app_id,
50 aul_running_context_h *handle);
53 * @brief Destroyes the running context handle.
56 * @param[in] handle The running context handle
57 * @return @c 0 on success,
58 * otherwise a negative error value
60 int aul_running_context_destroy(aul_running_context_h handle);
63 * @brief Gets the application ID.
65 * @remarks The @a app_id MUST NOT be released using free().
66 * It's released when the runnning context handle is released.
68 * @param[in] handle The running context handle
69 * @param[out] app_id The application ID
70 * @return @c 0 on success,
71 * otherwise a negative error value
73 int aul_running_context_get_app_id(aul_running_context_h handle,
77 * @brief Gets the instance ID.
79 * @remarks The @a inst_id MUST NOT be release using free().
80 * It's released when the running context handle is released.
82 * @param[in] handle The running context handle
83 * @param[out] inst_id The instance ID
84 * @return @c 0 on success,
85 * otherwise a negative error value
87 int aul_running_context_get_inst_id(aul_running_context_h handle,
88 const char **inst_id);
91 * @brief Gets the process ID.
94 * @param[in] handle The running context handle
95 * @param[out] pid The process ID
96 * @return @c 0 on success,
97 * otherwise a negative error value
99 int aul_running_context_get_pid(aul_running_context_h handle,
106 #endif /* __AUL_RUNNING_CONTEXT_H__ */