summaryrefslogtreecommitdiff
path: root/src/checkpoint.h
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-16 14:54:24 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-17 12:39:19 +0900
commitf71c7a145a4c840baff1d34e9d2c3d9e2f26d74e (patch)
tree0931150b21c7e9e883437dccc212c4206c43db5f /src/checkpoint.h
parent4e895bb72e035c7c5034dd8beca7c8497413ad9e (diff)
add checkpoint.c and .h
Diffstat (limited to 'src/checkpoint.h')
-rw-r--r--src/checkpoint.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/checkpoint.h b/src/checkpoint.h
new file mode 100644
index 0000000..8bbb738
--- /dev/null
+++ b/src/checkpoint.h
@@ -0,0 +1,16 @@
+#ifndef _CHECKPOINT_H_
+#define _CHECKPOINT_H_
+
+#include <pool.h>
+
+/* checkpoint_save() stores states to a checkponint file (pathname) */
+int checkpoint_save(const char *pathname, int dir, char *remote_host, pool *path_pool,
+ pool *chunk_pool);
+
+/* checkpoint_load() reads a checkpoint file (pathname). If path_pool
+ * and chunk_pool are NULL, This function fills only *remote and *dir.
+ */
+int checkpoint_load(const char *pathname, char *remote, size_t len, int *dir,
+ pool *path_pool, pool *chunk_pool);
+
+#endif /* _CHECKPOINT_H_ */