1/*-------------------------------------------------------------------------
2 *
3 * file_ops.h
4 * Helper functions for operating on files
5 *
6 * Copyright (c) 2013-2019, PostgreSQL Global Development Group
7 *
8 *-------------------------------------------------------------------------
9 */
10#ifndef FILE_OPS_H
11#define FILE_OPS_H
12
13#include "filemap.h"
14
15extern void open_target_file(const char *path, bool trunc);
16extern void write_target_range(char *buf, off_t begin, size_t size);
17extern void close_target_file(void);
18extern void remove_target_file(const char *path, bool missing_ok);
19extern void truncate_target_file(const char *path, off_t newsize);
20extern void create_target(file_entry_t *t);
21extern void remove_target(file_entry_t *t);
22
23extern char *slurpFile(const char *datadir, const char *path, size_t *filesize);
24
25#endif /* FILE_OPS_H */
26