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 <sys/types.h>
29 * @brief The AUL Service information handle.
31 * @remarks This API is only for App Framework internally.
33 typedef void *aul_svc_info_h;
36 * @brief Creates the AUL Service information handle.
39 * @param[in] b The bundle object
40 * @param[out] h The AUL Service information handle
41 * @return @c 0 on success,
42 * otherwise a negative error value
43 * @retval #AUL_SVC_RET_OK Successful
44 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
45 * @retval #AUL_SVC_RET_ERROR Out of memory
47 int aul_svc_info_create(bundle *b, aul_svc_info_h *h);
50 * @brief Gets the operation to be performed.
53 * @param[in] h The AUL Service information handle
54 * @param[out] operation The operation to be performed
55 * @return @c 0 on success,
56 * otherwise a negative error value
57 * @retval #AUL_SVC_RET_OK Successful
58 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
59 * @retval #AUL_SVC_RET_ERROR Out of memory
61 int aul_svc_info_get_operation(aul_svc_info_h h, char **operation);
64 * @brief Gets the URI of the data.
67 * @param[in] h The AUL Service information handle
68 * @param[out] uri The URI of the data
69 * @return @c 0 on success,
70 * otherwise a negative error value
71 * @retval #AUL_SVC_RET_OK Successful
72 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
73 * @retval #AUL_SVC_RET_ERROR Out of memory
75 int aul_svc_info_get_uri(aul_svc_info_h h, char **uri);
78 * @brief Gets the scheme of the URI.
81 * @param[in] h The AUL Service information handle
82 * @param[out] uri_scheme The scheme of the URI
83 * @return @c 0 on success,
84 * otherwise a negative error value
85 * @retval #AUL_SVC_RET_OK Successful
86 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
87 * @retval #AUL_SVC_RET_ERROR Out of memory
89 int aul_svc_info_get_uri_scheme(aul_svc_info_h h, char **uri_scheme);
92 * @brief Gets the host of the URI.
95 * @param[in] h The AUL Service information handle
96 * @param[out] uri_host The host of the URI
97 * @return @c 0 on success,
98 * otherwise a negative error value
99 * @retval #AUL_SVC_RET_OK Successful
100 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
101 * @retval #AUL_SVC_RET_ERROR Out of memory
103 int aul_svc_info_get_uri_host(aul_svc_info_h h, char **uri_host);
106 * @brief Gets the explicit MIME type of the data.
109 * @param[in] h The AUL Service information handle
110 * @param[out] mime The explicit MIME type of the data
111 * @return @c 0 on success,
112 * otherwise a negative error value
113 * @retval #AUL_SVC_RET_OK Successful
114 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
115 * @retval #AUL_SVC_RET_ERROR Out of memory
117 int aul_svc_info_get_mime(aul_svc_info_h h, char **mime);
120 * @brief Gets the type of the MIME type.
123 * @param[in] h The AUL Service information handle
124 * @param[out] mime_type The type of the MIME type
125 * @return @c 0 on success,
126 * otherwise a negative error value
127 * @retval #AUL_SVC_RET_OK Successful
128 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
129 * @retval #AUL_SVC_RET_ERROR Out of memory
131 int aul_svc_info_get_mime_type(aul_svc_info_h h, char **mime_type);
134 * @brief Gets the subtype of the MIME type.
137 * @param[in] h The AUL Service information handle
138 * @param[out] mime_subtype The subtype of the MIME type
139 * @return @c 0 on success,
140 * otherwise a negative error value
141 * @retval #AUL_SVC_RET_OK Successful
142 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
143 * @retval #AUL_SVC_RET_ERROR Out of memory
145 int aul_svc_info_get_mime_subtype(aul_svc_info_h h, char **mime_subtype);
148 * @brief Destroys the AUL Service information handle.
151 * @param[in] h The AUL Service information handle
152 * @return @c 0 on success,
153 * otherwise a negative error value
154 * @retval #AUL_SVC_RET_OK Successful
155 * @retval #AUL_SVC_RET_EINVAL Invalid parameter
157 int aul_svc_info_destroy(aul_svc_info_h h);
160 * @brief Resolves the app control.
162 * @remarks The @appid_array should be released using aul_svc_free_appid_array().
164 * @param[in] b The bundle object
165 * @param[in] uid The user ID
166 * @param[out] appid_array The array pointer of the appid
167 * @param[out] len The array length
168 * @return @c 0 on success,
169 * otherwise a negative error value
170 * @remarks This API is only for App Framework internally.
171 * @see aul_svc_free_appid_array()
173 int aul_svc_resolve(bundle *b, uid_t uid, char ***appid_array,
177 * @brief Gets an array of application ID.
179 * @remarks The @appid_array should be released using aul_svc_free_appid_array().
181 * @param[in] b The bundle object
182 * @param[in] uid The user ID
183 * @param[out] appid_array The array pointer of the appid
184 * @param[out] len The array length
185 * @return @c 0 on success,
186 * otherwise a negative error value
187 * @remarks This API is only for App Framework internally.
188 * @see aul_svc_free_appid_array()
190 int aul_svc_get_appid_array(bundle *b, uid_t uid, char ***appid_array,
194 * @brief Release an array of application ID.
197 * @param[in] appid_array The array pointer of the appid
198 * @param[in] len The array length
199 * @remarks This API is only for App Framework internally.
201 void aul_svc_free_appid_array(char **appid_array, unsigned int len);