Fix documentation for storage_get_internal_memory_size and storage_get_external_memor... 33/186533/1 accepted/tizen/unified/20180813.061434 submit/tizen/20180810.063429
authorpr.jung <pr.jung@samsung.com>
Fri, 10 Aug 2018 06:23:02 +0000 (15:23 +0900)
committerpr.jung <pr.jung@samsung.com>
Fri, 10 Aug 2018 06:23:02 +0000 (15:23 +0900)
Change-Id: Ic71b471508ce6598a181775468aaf597e1e1668f
Signed-off-by: pr.jung <pr.jung@samsung.com>
include/storage.h
src/statvfs.c

index 1b3cbec..992497e 100644 (file)
@@ -41,16 +41,18 @@ extern "C" {
 
 
 #include <sys/statvfs.h>
-#include "storage-expand.h"
+#include <storage-expand.h>
 
 
 /**
- * @brief int storage_get_internal_memory_size(struct statvfs *buf).
- * @brief This generic API is used to get the internal memory size.
+ * @brief Gets the internal memory size.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[out] buf A pointer to a statvfs structure
  * @return @c 0 on success,
  *         otherwise a negative error value on failure
+ * @retval #STORAGE_ERROR_NONE Successful
+ * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @par Example:
  * @code
  *     ...
@@ -72,12 +74,14 @@ extern int storage_get_internal_memory_size(struct statvfs *buf);
 
 
 /**
- * @brief int storage_get_external_memory_size(struct statvfs *buf).
- * @brief This generic API is used to get the external memory size.
+ * @brief Gets the external memory size.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[out] buf A pointer to a statvfs structure
  * @return @c 0 on success,
  *         otherwise a negative error value on failure
+ * @retval #STORAGE_ERROR_NONE Successful
+ * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed
  * @par Example:
  * @code
  *     ...
index 0085d49..75c9b03 100644 (file)
@@ -232,13 +232,13 @@ API int storage_get_internal_memory_size(struct statvfs *buf)
 
        if (!buf) {
                _E("input param error");
-               return -EINVAL;
+               return STORAGE_ERROR_INVALID_PARAMETER;
        }
 
        ret = get_memory_size(tzplatform_getenv(TZ_SYS_USER), &temp);
        if (ret || temp.f_bsize == 0) {
                _E("fail to get memory size %d", ret); //LCOV_EXCL_LINE
-               return -errno; //LCOV_EXCL_LINE System Error
+               return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (reserved == 0) {
@@ -255,7 +255,7 @@ API int storage_get_internal_memory_size(struct statvfs *buf)
                temp.f_bavail -= reserved;
 
        memcpy(buf, &temp, sizeof(temp));
-       return 0;
+       return STORAGE_ERROR_NONE;
 }
 
 /* This api is intended for binaries built with __USE_FILE_OFFSET64(_FILE_OFFSET_BITS=64) */
@@ -266,13 +266,13 @@ API int storage_get_internal_memory_size64(struct statvfs *buf)
 
        if (!buf) {
                _E("input param error"); //LCOV_EXCL_LINE
-               return -EINVAL;
+               return STORAGE_ERROR_INVALID_PARAMETER;
        }
 
        ret = statvfs(tzplatform_getenv(TZ_SYS_USER), buf);
        if (ret) {
                _E("fail to get memory size"); //LCOV_EXCL_LINE
-               return -errno; //LCOV_EXCL_LINE System Error
+               return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        if (reserved == 0) {
@@ -287,7 +287,7 @@ API int storage_get_internal_memory_size64(struct statvfs *buf)
                buf->f_bavail = 0;
        else
                buf->f_bavail -= reserved;
-       return 0;
+       return STORAGE_ERROR_NONE;
 }
 
 int mount_check(const char *path)
@@ -325,7 +325,7 @@ int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
        _D("storage_get_external_memory_size");
        if (!buf) {
                _E("input param error");
-               return -EINVAL;
+               return STORAGE_ERROR_INVALID_PARAMETER;
        }
 
        if (path)
@@ -340,7 +340,7 @@ int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
                        goto out_nodev;
                if (ret < 0) {
                        _E("Failed to get external path(%d)", ret); //LCOV_EXCL_LINE
-                       return ret;
+                       return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
                }
        }
 
@@ -350,7 +350,7 @@ int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
        ret = storage_ext_get_statvfs(ext_path, &temp);
        if (ret) {
                _E("fail to get memory size"); //LCOV_EXCL_LINE
-               return ret; //LCOV_EXCL_LINE System Error
+               return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
        memcpy(buf, &temp, sizeof(temp));
@@ -358,7 +358,7 @@ int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
 
 out_nodev:
        memset(buf, 0, sizeof(struct statvfs_32));
-       return 0;
+       return STORAGE_ERROR_NONE;
 }
 
 /* This api is intended for binaries built with __USE_FILE_OFFSET64(_FILE_OFFSET_BITS=64) */
@@ -370,7 +370,7 @@ int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf
        _D("storage_get_external_memory_size64");
        if (!buf) {
                _E("input param error");
-               return -EINVAL;
+               return STORAGE_ERROR_INVALID_PARAMETER;
        }
 
        if (path)
@@ -385,7 +385,7 @@ int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf
                        goto out_nodev;
                if (ret < 0) {
                        _E("Failed to get external path(%d)", ret);
-                       return ret;
+                       return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
                }
        }
 
@@ -396,11 +396,11 @@ int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf
        if (ret) {
        //LCOV_EXCL_START System Error
                _E("fail to get memory size");
-               return -errno;
+               return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        //LCOV_EXCL_STOP
        }
 
-       return 0;
+       return STORAGE_ERROR_NONE;
 
 out_nodev:
        memset(buf, 0, sizeof(struct statvfs));