summaryrefslogtreecommitdiffstats
path: root/include/librefop.h
diff options
context:
space:
mode:
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2022-07-21 06:02:36 +0900
committerNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2022-08-02 01:01:32 +0900
commit6bf3f5a870a28c7989a24ab6ae3040c650f84897 (patch)
treee4b3aeffaa96f9238e207d12c66071cfe9b50acf /include/librefop.h
parenta34f8913fbe3fc82ed32754ec6976d1a6f7904e6 (diff)
Rename library and header filename to librefop
Previously this library name is libredundancyfileop, but it's too long for use. This patch rename library for libredundancyfileop to librefop. Bug-AGL: SPEC-4500 Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> Change-Id: I450c31cfe36f246489f9198e4cf2cfd6e85cb0ab
Diffstat (limited to 'include/librefop.h')
-rw-r--r--include/librefop.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/librefop.h b/include/librefop.h
new file mode 100644
index 0000000..896494a
--- /dev/null
+++ b/include/librefop.h
@@ -0,0 +1,57 @@
+/**
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * @file librefop.h
+ * @brief Interface header for the redundancy file operation library
+ */
+#ifndef LIBREDUNDANCY_FILEOP_H
+#define LIBREDUNDANCY_FILEOP_H
+//-----------------------------------------------------------------------------
+#include <stdbool.h>
+#include <stdint.h>
+
+//-----------------------------------------------------------------------------
+#ifdef __cplusplus
+extern "C" {
+#endif
+//-----------------------------------------------------------------------------
+/**
+ * Error code and type definition
+ * @enum refop_error_t
+ */
+typedef enum refop_error {
+ //! This operation was succeeded.
+ REFOP_SUCCESS = 0,
+
+ //! This operation was succeeded within recovery.
+ REFOP_RECOVER = 1,
+
+ //! The target file/directroy was nothing.
+ REFOP_NOENT = -1,
+
+ //! This operation was failed. Because all recovery method was failed.
+ REFOP_BROAKEN = -2,
+
+ //! Argument error.
+ REFOP_ARGERROR = -3,
+
+ //! Internal operation was failed such as no memory, no disk space and etc.
+ REFOP_SYSERROR = -100,
+
+} refop_error_t;
+//-----------------------------------------------------------------------------
+typedef struct refop_halndle *refop_handle_t;
+
+//-----------------------------------------------------------------------------
+refop_error_t refop_create_redundancy_handle(refop_handle_t *handle, const char *directry, const char *filename);
+refop_error_t refop_release_redundancy_handle(refop_handle_t handle);
+refop_error_t refop_set_redundancy_data(refop_handle_t handle, uint8_t *data, int64_t datasize);
+refop_error_t refop_get_redundancy_data(refop_handle_t handle, uint8_t *data, int64_t datasize, int64_t *getsize);
+refop_error_t refop_remove_redundancy_data(refop_handle_t handle);
+
+//-----------------------------------------------------------------------------
+#ifdef __cplusplus
+}
+#endif
+//-----------------------------------------------------------------------------
+#endif //#ifndef LIBREDUNDANCY_FILEOP_H