Update copyright for 2022
[pgsql.git] / src / bin / pg_rewind / file_ops.h
blob54a853bd42ae5faa88359143aa48e73b24dd1c9e
1 /*-------------------------------------------------------------------------
3 * file_ops.h
4 * Helper functions for operating on files
6 * Copyright (c) 2013-2022, PostgreSQL Global Development Group
8 *-------------------------------------------------------------------------
9 */
10 #ifndef FILE_OPS_H
11 #define FILE_OPS_H
13 #include "filemap.h"
15 extern void open_target_file(const char *path, bool trunc);
16 extern void write_target_range(char *buf, off_t begin, size_t size);
17 extern void close_target_file(void);
18 extern void remove_target_file(const char *path, bool missing_ok);
19 extern void truncate_target_file(const char *path, off_t newsize);
20 extern void create_target(file_entry_t *t);
21 extern void remove_target(file_entry_t *t);
22 extern void sync_target_dir(void);
24 extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
26 typedef void (*process_file_callback_t) (const char *path, file_type_t type, size_t size, const char *link_target);
27 extern void traverse_datadir(const char *datadir, process_file_callback_t callback);
29 #endif /* FILE_OPS_H */