storage: Remove profile version from header files
[platform/core/system/libstorage.git] / include / storage.h
1 /*
2  * storage
3  * Copyright (c) 2012 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_H__
20 #define __STORAGE_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 /**
28  * @file storage.h
29  * @ingroup FRAMEWORK/SYSTEM
30  * @brief This file contains the API for the status of devices.
31  * @author TIZEN
32  * @date 2013-02-15
33  * @version 0.1
34  */
35
36
37  /**
38  * @addtogroup CAPI_SYSTEM_STORAGE_MODULE
39  * @{
40  */
41
42
43 #include <sys/statvfs.h>
44 #include <storage-expand.h>
45
46
47 /**
48  * @brief Gets the internal memory size.
49  * @since_tizen 2.3
50  * @param[out] buf A pointer to a statvfs structure
51  * @return @c 0 on success,
52  *         otherwise a negative error value on failure
53  * @retval #STORAGE_ERROR_NONE Successful
54  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
55  * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
56  * @par Example:
57  * @code
58  *      ...
59  *  struct statvfs s;
60  *      if (storage_get_internal_memory_size(&s) < 0)
61  *      dlog_print(DLOG_DEBUG, LOG_TAG, "Fail to get internal memory size");
62  *      else
63  *              dlog_print(DLOG_DEBUG, LOG_TAG, "Total mem : %lf, Avail mem : %lf",
64  *                              (double)s.f_frsize*s.f_blocks, (double)s.f_bsize*s.f_bavail);
65  *      ...
66  * @endcode
67  */
68 #ifdef __USE_FILE_OFFSET64
69 #define storage_get_internal_memory_size storage_get_internal_memory_size64
70 extern int storage_get_internal_memory_size64(struct statvfs *buf);
71 #else
72 extern int storage_get_internal_memory_size(struct statvfs *buf);
73 #endif
74
75
76 /**
77  * @brief Gets the external memory size.
78  * @since_tizen 2.3
79  * @param[out] buf A pointer to a statvfs structure
80  * @return @c 0 on success,
81  *         otherwise a negative error value on failure
82  * @retval #STORAGE_ERROR_NONE Successful
83  * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
84  * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
85  * @par Example:
86  * @code
87  *      ...
88  *  struct statvfs s;
89  *      if (storage_get_external_memory_size(&s) < 0)
90  *              dlog_print(DLOG_DEBUG, LOG_TAG, "Fail to get external memory size");
91  *      else
92  *              dlog_print(DLOG_DEBUG, LOG_TAG, "Total mem : %lf, Avail mem : %lf",
93  *                              (double)s.f_frsize*s.f_blocks, (double)s.f_bsize*s.f_bavail);
94  *      ...
95  * @endcode
96  */
97 #ifdef __USE_FILE_OFFSET64
98 #ifdef __REDIRECT_NTH
99 extern int __REDIRECT_NTH(storage_get_external_memory_size,
100                                 (struct statvfs *buf), storage_get_external_memory_size64)
101         __nonnull((1));
102 #else
103 #define storage_get_external_memory_size storage_get_external_memory_size64
104 #endif
105 extern int storage_get_external_memory_size64(struct statvfs *buf);
106 #else
107 extern int storage_get_external_memory_size(struct statvfs *buf);
108 #endif
109
110
111 /**
112  * @}
113  */
114
115 #ifdef __cplusplus
116 }
117 #endif
118 #endif