Move function definition to aul header
[platform/core/appfw/aul-1.git] / include / aul_running_context.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #ifndef __AUL_RUNNING_CONTEXT_H__
19 #define __AUL_RUNNING_CONTEXT_H__
20
21 #include <stdint.h>
22 #include <aul.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @brief The AUL running context handle.
30  * @since_tizen 5.5
31  */
32 typedef struct aul_running_context_s *aul_running_context_h;
33
34 /**
35  * @brief Creates the running context handle.
36  * @since_tizen 5.5
37  *
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
44  *
45  * @remarks This function is only available for platform level signed applications.
46  */
47 int aul_running_context_create(const char *app_id,
48                 const char *inst_id,
49                 const char *comp_id,
50                 aul_running_context_h *handle);
51
52 /**
53  * @brief Destroyes the running context handle.
54  * @since_tizen 5.5
55  *
56  * @param[in]   handle          The running context handle
57  * @return      @c 0 on success,
58  *              otherwise a negative error value
59  */
60 int aul_running_context_destroy(aul_running_context_h handle);
61
62 /**
63  * @brief Gets the application ID.
64  * @since_tizen 5.5
65  * @remarks The @a app_id MUST NOT be released using free().
66  *          It's released when the runnning context handle is released.
67  *
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
72  */
73 int aul_running_context_get_app_id(aul_running_context_h handle,
74                 const char **app_id);
75
76 /**
77  * @brief Gets the instance ID.
78  * @since_tizen 5.5
79  * @remarks The @a inst_id MUST NOT be release using free().
80  *          It's released when the running context handle is released.
81  *
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
86  */
87 int aul_running_context_get_inst_id(aul_running_context_h handle,
88                 const char **inst_id);
89
90 /**
91  * @brief Gets the process ID.
92  * @since_tizen 5.5
93  *
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
98  */
99 int aul_running_context_get_pid(aul_running_context_h handle,
100                 int *pid);
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif /* __AUL_RUNNING_CONTEXT_H__ */