90 bool supported =
false;
108 return psprintf(
_(
"this build does not support compression with %s"),
166 int suffixlen = strlen(suffix);
168 if (filenamelen < suffixlen)
171 return memcmp(&
filename[filenamelen - suffixlen],
180 int save_errno = errno;
222 *fname =
psprintf(
"%s.%s", path, ext);
223 return (
access(*fname, F_OK) == 0);
261 if (
stat(path, &st) == 0)
#define Assert(condition)
void InitCompressFileHandleGzip(CompressFileHandle *CFH, const pg_compress_specification compression_spec)
void InitCompressorGzip(CompressorState *cs, const pg_compress_specification compression_spec)
static void free_keep_errno(void *p)
static int hasSuffix(const char *filename, const char *suffix)
bool EndCompressFileHandle(CompressFileHandle *CFH)
char * supports_compression(const pg_compress_specification compression_spec)
CompressorState * AllocateCompressor(const pg_compress_specification compression_spec, ReadFunc readF, WriteFunc writeF)
void EndCompressor(ArchiveHandle *AH, CompressorState *cs)
CompressFileHandle * InitDiscoverCompressFileHandle(const char *path, const char *mode)
CompressFileHandle * InitCompressFileHandle(const pg_compress_specification compression_spec)
static bool check_compressed_file(const char *path, char **fname, char *ext)
size_t(* ReadFunc)(ArchiveHandle *AH, char **buf, size_t *buflen)
void(* WriteFunc)(ArchiveHandle *AH, const char *buf, size_t len)
void InitCompressFileHandleLZ4(CompressFileHandle *CFH, const pg_compress_specification compression_spec)
void InitCompressorLZ4(CompressorState *cs, const pg_compress_specification compression_spec)
void InitCompressorNone(CompressorState *cs, const pg_compress_specification compression_spec)
void InitCompressFileHandleNone(CompressFileHandle *CFH, const pg_compress_specification compression_spec)
void InitCompressorZstd(CompressorState *cs, const pg_compress_specification compression_spec)
void InitCompressFileHandleZstd(CompressFileHandle *CFH, const pg_compress_specification compression_spec)
const char * get_compress_algorithm_name(pg_compress_algorithm algorithm)
void * pg_malloc0(size_t size)
char * pg_strdup(const char *in)
static PgChecksumMode mode
char * psprintf(const char *fmt,...)
bool(* open_func)(const char *path, int fd, const char *mode, CompressFileHandle *CFH)
bool(* close_func)(CompressFileHandle *CFH)
void(* end)(ArchiveHandle *AH, CompressorState *cs)
pg_compress_algorithm algorithm