Merge remote-tracking branch 'origin/tizen_3.0' into tizen
[platform/core/system/libstorage.git] / include / storage-internal.h
1 /*
2  * storage
3  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19 #ifndef __STORAGE_INTERNAL_H__
20 #define __STORAGE_INTERNAL_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 /**
28  * @addtogroup CAPI_SYSTEM_STORAGE_MODULE
29  * @{
30  */
31
32 #include <tizen.h>
33 #include "storage.h"
34
35 #define STORAGE_ERROR_NO_DEVICE TIZEN_ERROR_NO_SUCH_DEVICE
36
37 /**
38  * @brief Get the mount path for the primary partition of sdcard.
39  *
40  * @since_tizen 3.0
41  *
42  * @remarks You must release the path using free() after use
43  *
44  * @param[out] storage_id The storage id
45  * @param[out] path The mount path of sdcard primary partition.
46  *
47  * @return @c 0 on success,
48  *         otherwise a negative error value
49  *
50  * @retval #STORAGE_ERROR_NONE               Successful
51  * @retval #STORAGE_ERROR_INVALID_PARAMETER  Invalid parameter
52  * @retval #STORAGE_ERROR_NO_DEVICE          No such device
53  */
54 int storage_get_primary_sdcard(int *storage_id, char **path);
55
56 /**
57  * @brief Get the type and the kind of external device for given storage id.
58  *
59  * @since_tizen 3.0
60  *
61  * @param[in] storage_id The storage id
62  * @param[out] storage type (internal, external).
63  * @param[out] the kind of storage device for external type (sdcard, usb).
64  *
65  * @return @c 0 on success,
66  *         otherwise a negative error value
67  *
68  * @retval #STORAGE_ERROR_NONE               Successful
69  * @retval #STORAGE_ERROR_INVALID_PARAMETER  Invalid parameter
70  * @retval #STORAGE_ERROR_OUT_OF_MEMORY      Out of memory
71  * @retval #STORAGE_ERROR_NOT_SUPPORTED      Storage not supported
72  * @retval #STORAGE_ERROR_NO_DEVICE          No such device
73  */
74 int storage_get_type_dev(int storage_id, storage_type_e *type, storage_dev_e *dev);
75
76 int storage_get_compat_internal_path(const char* origin, int len, char* compat);
77 int storage_get_origin_internal_path(const char* compat, int len, char* origin);
78
79 /**
80  * @}
81  */
82
83 #ifdef __cplusplus
84 }
85 #endif
86 #endif /* __STORAGE_INTERNAL_H__ */