summaryrefslogtreecommitdiffstats
path: root/src/bin/pg_rewind/file_ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_rewind/file_ops.h')
-rw-r--r--src/bin/pg_rewind/file_ops.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h
new file mode 100644
index 0000000..025f241
--- /dev/null
+++ b/src/bin/pg_rewind/file_ops.h
@@ -0,0 +1,25 @@
+/*-------------------------------------------------------------------------
+ *
+ * file_ops.h
+ * Helper functions for operating on files
+ *
+ * Copyright (c) 2013-2020, PostgreSQL Global Development Group
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef FILE_OPS_H
+#define FILE_OPS_H
+
+#include "filemap.h"
+
+extern void open_target_file(const char *path, bool trunc);
+extern void write_target_range(char *buf, off_t begin, size_t size);
+extern void close_target_file(void);
+extern void remove_target_file(const char *path, bool missing_ok);
+extern void truncate_target_file(const char *path, off_t newsize);
+extern void create_target(file_entry_t *t);
+extern void remove_target(file_entry_t *t);
+
+extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
+
+#endif /* FILE_OPS_H */