PostgreSQL Source Code git master
Loading...
Searching...
No Matches
basebackup_gzip.c File Reference
#include "postgres.h"
#include "backup/basebackup_sink.h"
Include dependency graph for basebackup_gzip.c:

Go to the source code of this file.

Functions

bbsinkbbsink_gzip_new (bbsink *next, pg_compress_specification *compress)
 

Function Documentation

◆ bbsink_gzip_new()

bbsink * bbsink_gzip_new ( bbsink next,
pg_compress_specification compress 
)

Definition at line 66 of file basebackup_gzip.c.

67{
68#ifndef HAVE_LIBZ
71 errmsg("gzip compression is not supported by this build")));
72 return NULL; /* keep compiler quiet */
73#else
75 int compresslevel;
76
77 Assert(next != NULL);
78
79 compresslevel = compress->level;
80 Assert((compresslevel >= 1 && compresslevel <= 9) ||
82
84 *((const bbsink_ops **) &sink->base.bbs_ops) = &bbsink_gzip_ops;
85 sink->base.bbs_next = next;
86 sink->compresslevel = compresslevel;
87
88 return &sink->base;
89#endif
90}
static int32 next
Definition blutils.c:225
#define Assert(condition)
Definition c.h:943
int errcode(int sqlerrcode)
Definition elog.c:874
#define ERROR
Definition elog.h:40
#define ereport(elevel,...)
Definition elog.h:152
#define palloc0_object(type)
Definition fe_memutils.h:75
static char * errmsg
static int compresslevel
static int fb(int x)

References Assert, compresslevel, ereport, errcode(), errmsg, ERROR, fb(), pg_compress_specification::level, next, and palloc0_object.

Referenced by SendBaseBackup().