fix doxygen comments
[platform/core/api/application.git] / app_common / app_path.c
1 /*
2  * Copyright (c) 2014 - 2016 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 #include <string.h>
18 #include <aul.h>
19 #include <tizen_error.h>
20
21 #include "app_types.h"
22
23 #define _STRDUP(s) ((s) ? strdup(s) : NULL)
24
25 char *app_get_data_path(void)
26 {
27         const char *buf = aul_get_app_data_path();
28         return _STRDUP(buf);
29 }
30
31 char *app_get_cache_path(void)
32 {
33         const char *buf = aul_get_app_cache_path();
34         return _STRDUP(buf);
35 }
36
37 char *app_get_resource_path(void)
38 {
39         const char *buf = aul_get_app_resource_path();
40         return _STRDUP(buf);
41 }
42
43 char *app_get_shared_data_path(void)
44 {
45         int ret;
46         char *path = NULL;
47
48         ret = aul_get_app_shared_data_path(&path);
49         if (ret == AUL_R_OK && path)
50                 set_last_result(APP_ERROR_NONE);
51         else if (ret == AUL_R_EREJECTED)
52                 set_last_result(APP_ERROR_NOT_SUPPORTED);
53         else
54                 set_last_result(APP_ERROR_OUT_OF_MEMORY);
55
56         return path;
57 }
58
59 char *app_get_shared_resource_path(void)
60 {
61         const char *buf = aul_get_app_shared_resource_path();
62         return _STRDUP(buf);
63 }
64
65 char *app_get_shared_trusted_path(void)
66 {
67         const char *buf = aul_get_app_shared_trusted_path();
68         return _STRDUP(buf);
69 }
70
71 char *app_get_external_data_path(void)
72 {
73         const char *buf = aul_get_app_external_data_path();
74         return _STRDUP(buf);
75 }
76
77 char *app_get_external_cache_path(void)
78 {
79         const char *buf = aul_get_app_external_cache_path();
80         return _STRDUP(buf);
81 }
82
83 char *app_get_external_shared_data_path(void)
84 {
85         const char *buf = aul_get_app_external_shared_data_path();
86         return _STRDUP(buf);
87 }
88
89 char *app_get_tep_resource_path(void)
90 {
91         const char *buf = aul_get_app_tep_resource_path();
92         return _STRDUP(buf);
93 }
94