Add description for the declaration of the file utils 77/273477/2
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 6 Apr 2022 06:58:55 +0000 (15:58 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 6 Apr 2022 07:23:44 +0000 (16:23 +0900)
Change-Id: Ia8367863a59fd3f31738fa62db1d0618c4e8ba5a
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/libcommon/file.h

index 31df8fa..7154494 100644 (file)
 
 #include <stdarg.h>
 
+/**
+ * @brief Open file, read and close
+ *
+ * @param[in] file File name
+ * @param[in] len Length of buffer
+ * @param[out] buf Buffer that stores read data
+ *
+ * @return read length if read was successful else negative error value
+ */
 int sys_read_buf(char *file, char *buf, int len);
+
+/**
+ * @brief Open file, write and close
+ *
+ * @param[in] file File name
+ * @param[out] buf Buffer that stores data to write
+ *
+ * @return zero on success otherwise negative error value
+ */
 int sys_write_buf(char *file, char *buf);
+
+/**
+ * @brief Read integer from file
+ *
+ * @param[in] fname File name
+ * @param[out] val integer value that read from file
+ *
+ * @return read length if reading integer was successful else negative error value
+ */
 int sys_get_int(char *fname, int *val);
+
+/**
+ * @brief Read string from file
+ *
+ * @param[in] fname File name
+ * @param[in] len String length
+ * @param[out] str Buffer
+ *
+ * @return zero on success otherwise negative error value
+ */
 int sys_get_str(char *fname, char *str, int len);
+
+/**
+ * @brief Write integer to file
+ *
+ * @param[in] fname File name
+ * @param[in] val Integer value to write
+ *
+ * @return zero on success otherwise negative error value
+ */
 int sys_set_int(char *fname, int val);
+
+/**
+ * @brief Write string to file
+ *
+ * @param[in] fname File name
+ * @param[out] val String to write
+ *
+ * @return zero on success otherwise negative error value
+ */
 int sys_set_str(char *fname, char *val);
+
+/**
+ * @brief Parse format from /proc/cmdline
+ *
+ * @param[in] format Format string
+ * @param[out] ... Variable argument
+ *
+ * @return zero if cannot read else the number of matched and assigned items
+ */
 int libsys_parse_cmdline_scanf(const char *format, ...);
 
 #endif /* __LIBCOMMON_FILE_H__ */