PostgreSQL Source Code
git master
|
#include "pg_backup_archiver.h"
Go to the source code of this file.
Macros | |
#define | ZLIB_OUT_SIZE 4096 |
#define | ZLIB_IN_SIZE 4096 |
Typedefs | |
typedef void(* | WriteFunc) (ArchiveHandle *AH, const char *buf, size_t len) |
typedef size_t(* | ReadFunc) (ArchiveHandle *AH, char **buf, size_t *buflen) |
typedef struct CompressorState | CompressorState |
typedef struct cfp | cfp |
Enumerations | |
enum | CompressionAlgorithm { COMPR_ALG_NONE , COMPR_ALG_LIBZ } |
Functions | |
CompressorState * | AllocateCompressor (int compression, WriteFunc writeF) |
void | ReadDataFromArchive (ArchiveHandle *AH, int compression, ReadFunc readF) |
void | WriteDataToArchive (ArchiveHandle *AH, CompressorState *cs, const void *data, size_t dLen) |
void | EndCompressor (ArchiveHandle *AH, CompressorState *cs) |
cfp * | cfopen (const char *path, const char *mode, int compression) |
cfp * | cfopen_read (const char *path, const char *mode) |
cfp * | cfopen_write (const char *path, const char *mode, int compression) |
int | cfread (void *ptr, int size, cfp *fp) |
int | cfwrite (const void *ptr, int size, cfp *fp) |
int | cfgetc (cfp *fp) |
char * | cfgets (cfp *fp, char *buf, int len) |
int | cfclose (cfp *fp) |
int | cfeof (cfp *fp) |
const char * | get_cfp_error (cfp *fp) |
#define ZLIB_IN_SIZE 4096 |
Definition at line 22 of file compress_io.h.
#define ZLIB_OUT_SIZE 4096 |
Definition at line 21 of file compress_io.h.
Definition at line 54 of file compress_io.h.
typedef struct CompressorState CompressorState |
Definition at line 44 of file compress_io.h.
typedef size_t(* ReadFunc) (ArchiveHandle *AH, char **buf, size_t *buflen) |
Definition at line 44 of file compress_io.h.
typedef void(* WriteFunc) (ArchiveHandle *AH, const char *buf, size_t len) |
Definition at line 31 of file compress_io.h.
enum CompressionAlgorithm |
CompressorState* AllocateCompressor | ( | int | compression, |
WriteFunc | writeF | ||
) |
Definition at line 124 of file compress_io.c.
References COMPR_ALG_LIBZ, CompressorState::comprAlg, ParseCompressionOption(), pg_fatal, pg_malloc0(), and CompressorState::writeF.
Referenced by _StartBlob(), and _StartData().
int cfclose | ( | cfp * | fp | ) |
Definition at line 649 of file compress_io.c.
References free_keep_errno(), and cfp::uncompressedfp.
Referenced by _CloseArchive(), _EndBlob(), _EndBlobs(), _EndData(), _LoadBlobs(), _PrintFileData(), and InitArchiveFmt_Directory().
int cfeof | ( | cfp * | fp | ) |
Definition at line 676 of file compress_io.c.
References cfp::uncompressedfp.
Referenced by _LoadBlobs().
int cfgetc | ( | cfp * | fp | ) |
Definition at line 610 of file compress_io.c.
References pg_fatal, READ_ERROR_EXIT, strerror, and cfp::uncompressedfp.
Referenced by _ReadByte().
char* cfgets | ( | cfp * | fp, |
char * | buf, | ||
int | len | ||
) |
Definition at line 638 of file compress_io.c.
References buf, len, and cfp::uncompressedfp.
Referenced by _LoadBlobs().
cfp* cfopen | ( | const char * | path, |
const char * | mode, | ||
int | compression | ||
) |
Definition at line 518 of file compress_io.c.
References free_keep_errno(), mode, pg_fatal, pg_malloc(), snprintf, cfp::uncompressedfp, and Z_DEFAULT_COMPRESSION.
Referenced by cfopen_read(), and cfopen_write().
cfp* cfopen_read | ( | const char * | path, |
const char * | mode | ||
) |
Definition at line 452 of file compress_io.c.
References cfopen(), free_keep_errno(), mode, and psprintf().
Referenced by _LoadBlobs(), _PrintFileData(), and InitArchiveFmt_Directory().
cfp* cfopen_write | ( | const char * | path, |
const char * | mode, | ||
int | compression | ||
) |
Definition at line 489 of file compress_io.c.
References cfopen(), free_keep_errno(), mode, pg_fatal, and psprintf().
Referenced by _CloseArchive(), _StartBlob(), _StartBlobs(), and _StartData().
int cfread | ( | void * | ptr, |
int | size, | ||
cfp * | fp | ||
) |
Definition at line 568 of file compress_io.c.
References errmsg(), pg_fatal, READ_ERROR_EXIT, strerror, and cfp::uncompressedfp.
Referenced by _PrintFileData(), and _ReadBuf().
int cfwrite | ( | const void * | ptr, |
int | size, | ||
cfp * | fp | ||
) |
Definition at line 599 of file compress_io.c.
References cfp::uncompressedfp.
Referenced by _EndBlob(), _WriteBuf(), _WriteByte(), and _WriteData().
void EndCompressor | ( | ArchiveHandle * | AH, |
CompressorState * | cs | ||
) |
Definition at line 201 of file compress_io.c.
References COMPR_ALG_LIBZ, CompressorState::comprAlg, and free.
Referenced by _EndBlob(), and _EndData().
const char* get_cfp_error | ( | cfp * | fp | ) |
Definition at line 687 of file compress_io.c.
References errmsg(), and strerror.
Referenced by _WriteBuf(), _WriteByte(), and _WriteData().
void ReadDataFromArchive | ( | ArchiveHandle * | AH, |
int | compression, | ||
ReadFunc | readF | ||
) |
Definition at line 157 of file compress_io.c.
References COMPR_ALG_LIBZ, COMPR_ALG_NONE, ParseCompressionOption(), pg_fatal, and ReadDataFromArchiveNone().
Referenced by _PrintData().
void WriteDataToArchive | ( | ArchiveHandle * | AH, |
CompressorState * | cs, | ||
const void * | data, | ||
size_t | dLen | ||
) |
Definition at line 179 of file compress_io.c.
References COMPR_ALG_LIBZ, COMPR_ALG_NONE, CompressorState::comprAlg, data, pg_fatal, and WriteDataToArchiveNone().
Referenced by _WriteData().