aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fileop.h
diff options
context:
space:
mode:
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2022-07-22 03:20:44 +0900
committerNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2022-08-05 00:36:26 +0900
commit86f13970718ef5e0758ac4edfe7da2c354d19668 (patch)
tree5b70cbda20b2e50efc7eb1e63f16f0e8d57a905f /lib/fileop.h
parent079a02e20320e8018d1b2c879c759e4b5c9d30fb (diff)
Reformat code
The librefop define the coding style using clang-format. This patch reformat code using clang-format. Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> Change-Id: I6f6647317f2916c583ca68e1259da2e08a989657
Diffstat (limited to 'lib/fileop.h')
-rw-r--r--lib/fileop.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/fileop.h b/lib/fileop.h
index d005fd5..207d2c8 100644
--- a/lib/fileop.h
+++ b/lib/fileop.h
@@ -7,10 +7,11 @@
#ifndef REFOP_FILEOP_H
#define REFOP_FILEOP_H
//-----------------------------------------------------------------------------
+#include <librefop.h>
+#include <linux/limits.h>
#include <stdbool.h>
-#include <stdint.h>
#include <stddef.h>
-#include <linux/limits.h>
+#include <stdint.h>
//-----------------------------------------------------------------------------
#ifdef __cplusplus
@@ -18,31 +19,30 @@ extern "C" {
#endif
//-----------------------------------------------------------------------------
struct __attribute__((packed)) s_refop_file_header_v1 {
- uint32_t magic; /* 4 *//**< Magic code */
- uint32_t version; /* 8 *//**< Data format version */
- uint32_t version_inv; /* 12 *//**< Data format version (inversion value) */
- uint16_t crc16; /* 14 *//**< Data block crc */
- uint16_t crc16_inv; /* 16 *//**< Data block crc (inversion value) */
- uint64_t size; /* 24 *//**< Data block size */
- uint64_t size_inv; /* 32 *//**< Data block size (inversion value) */
+ uint32_t magic; /* 4 */ /**< Magic code */
+ uint32_t version; /* 8 */ /**< Data format version */
+ uint32_t version_inv; /* 12 */ /**< Data format version (inversion value) */
+ uint16_t crc16; /* 14 */ /**< Data block crc */
+ uint16_t crc16_inv; /* 16 */ /**< Data block crc (inversion value) */
+ uint64_t size; /* 24 */ /**< Data block size */
+ uint64_t size_inv; /* 32 */ /**< Data block size (inversion value) */
};
-#define REFOP_FILE_HEADER_MAGIC ((uint32_t)0x96962323)
-#define REFOP_FILE_HEADER_VERSION_V1 ((uint32_t)0x00000001)
+#define REFOP_FILE_HEADER_MAGIC ((uint32_t) 0x96962323)
+#define REFOP_FILE_HEADER_VERSION_V1 ((uint32_t) 0x00000001)
typedef struct s_refop_file_header_v1 s_refop_file_header;
struct refop_halndle {
- char latestfile[PATH_MAX];
- char backupfile1[PATH_MAX];
- char newfile[PATH_MAX];
- char basedir[PATH_MAX];
+ char latestfile[PATH_MAX]; /**< Internal buffer for the latest file name */
+ char backupfile1[PATH_MAX]; /**< Internal buffer for the backup file name */
+ char newfile[PATH_MAX]; /**< Internal buffer for the new file name */
+ char basedir[PATH_MAX]; /**< Internal buffer for the file operation base dir */
};
//-----------------------------------------------------------------------------
int refop_new_file_write(refop_handle_t handle, uint8_t *data, int64_t bufsize);
int refop_file_rotation(refop_handle_t handle);
-
int refop_file_pickup(refop_handle_t handle, uint8_t *data, int64_t bufsize, int64_t *readsize);
//-----------------------------------------------------------------------------