PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <sys/stat.h>
#include <unistd.h>
#include "compress_gzip.h"
#include "compress_io.h"
#include "compress_lz4.h"
#include "compress_none.h"
#include "compress_zstd.h"
#include "pg_backup_utils.h"
Go to the source code of this file.
Functions | |
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) |
static int | hasSuffix (const char *filename, const char *suffix) |
static void | free_keep_errno (void *p) |
CompressFileHandle * | InitCompressFileHandle (const pg_compress_specification compression_spec) |
static bool | check_compressed_file (const char *path, char **fname, char *ext) |
CompressFileHandle * | InitDiscoverCompressFileHandle (const char *path, const char *mode) |
bool | EndCompressFileHandle (CompressFileHandle *CFH) |
CompressorState* AllocateCompressor | ( | const pg_compress_specification | compression_spec, |
ReadFunc | readF, | ||
WriteFunc | writeF | ||
) |
Definition at line 124 of file compress_io.c.
References pg_compress_specification::algorithm, InitCompressorGzip(), InitCompressorLZ4(), InitCompressorNone(), InitCompressorZstd(), PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, PG_COMPRESSION_NONE, PG_COMPRESSION_ZSTD, pg_malloc0(), CompressorState::readF, and CompressorState::writeF.
Referenced by _PrintData(), _StartData(), and _StartLO().
|
static |
Definition at line 220 of file compress_io.c.
References free_keep_errno(), and psprintf().
Referenced by InitDiscoverCompressFileHandle().
bool EndCompressFileHandle | ( | CompressFileHandle * | CFH | ) |
Definition at line 289 of file compress_io.c.
References CompressFileHandle::close_func, free_keep_errno(), and CompressFileHandle::private_data.
Referenced by _CloseArchive(), _EndData(), _EndLO(), _EndLOs(), _LoadLOs(), _PrintFileData(), CloseArchive(), InitArchiveFmt_Directory(), and RestoreOutput().
void EndCompressor | ( | ArchiveHandle * | AH, |
CompressorState * | cs | ||
) |
Definition at line 149 of file compress_io.c.
References CompressorState::end, and pg_free().
Referenced by _EndData(), _EndLO(), and _PrintData().
|
static |
Definition at line 179 of file compress_io.c.
References free.
Referenced by check_compressed_file(), EndCompressFileHandle(), and InitDiscoverCompressFileHandle().
|
static |
Definition at line 164 of file compress_io.c.
References filename.
Referenced by InitDiscoverCompressFileHandle().
CompressFileHandle* InitCompressFileHandle | ( | const pg_compress_specification | compression_spec | ) |
Definition at line 195 of file compress_io.c.
References pg_compress_specification::algorithm, InitCompressFileHandleGzip(), InitCompressFileHandleLZ4(), InitCompressFileHandleNone(), InitCompressFileHandleZstd(), PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, PG_COMPRESSION_NONE, PG_COMPRESSION_ZSTD, and pg_malloc0().
Referenced by _allocAH(), _CloseArchive(), _StartData(), _StartLO(), _StartLOs(), InitDiscoverCompressFileHandle(), and SetOutput().
CompressFileHandle* InitDiscoverCompressFileHandle | ( | const char * | path, |
const char * | mode | ||
) |
Definition at line 241 of file compress_io.c.
References pg_compress_specification::algorithm, Assert, check_compressed_file(), free_keep_errno(), hasSuffix(), InitCompressFileHandle(), mode, CompressFileHandle::open_func, PG_BINARY_R, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, PG_COMPRESSION_NONE, PG_COMPRESSION_ZSTD, pg_strdup(), and stat.
Referenced by _LoadLOs(), _PrintFileData(), and InitArchiveFmt_Directory().
char* supports_compression | ( | const pg_compress_specification | compression_spec | ) |
Definition at line 88 of file compress_io.c.
References _, pg_compress_specification::algorithm, get_compress_algorithm_name(), PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, PG_COMPRESSION_NONE, PG_COMPRESSION_ZSTD, and psprintf().
Referenced by main(), ReadHead(), and RestoreArchive().