74static void gzip_pfree(
void *opaque,
void *address);
109 streamer->pathname =
pstrdup(pathname);
113 streamer->gzfile =
gzopen(pathname,
"wb");
114 if (streamer->gzfile ==
NULL)
115 pg_fatal(
"could not create compressed file \"%s\": %m",
124 int fd =
dup(fileno(file));
127 pg_fatal(
"could not duplicate stdout: %m");
130 if (streamer->gzfile ==
NULL)
131 pg_fatal(
"could not open output file: %m");
135 pg_fatal(
"could not set compression level %d: %s",
138 return &streamer->base;
140 pg_fatal(
"this build does not support compression with %s",
"gzip");
167 pg_fatal(
"could not write to compressed file \"%s\": %s",
191 pg_fatal(
"could not close compressed file \"%s\": %m",
248 streamer->base.bbs_next =
next;
252 zs = &streamer->zstream;
255 zs->next_out = (
uint8 *) streamer->base.bbs_buffer.data;
256 zs->avail_out = streamer->base.bbs_buffer.maxlen;
269 pg_fatal(
"could not initialize compression library");
271 return &streamer->base;
273 pg_fatal(
"this build does not support compression with %s",
"gzip");
300 while (
zs->avail_in > 0)
static void astreamer_free(astreamer *streamer)
static void astreamer_content(astreamer *streamer, astreamer_member *member, const char *data, int len, astreamer_archive_context context)
static void astreamer_finalize(astreamer *streamer)
astreamer_archive_context
astreamer * astreamer_gzip_decompressor_new(astreamer *next)
astreamer * astreamer_gzip_writer_new(char *pathname, FILE *file, pg_compress_specification *compress)
#define Assert(condition)
int errmsg(const char *fmt,...)
#define palloc0_object(type)
#define pg_log_error(...)
char * pstrdup(const char *in)
void pfree(void *pointer)
static int fd(const char *x, int i)
void initStringInfo(StringInfo str)
void(* content)(astreamer *streamer, astreamer_member *member, const char *data, int len, astreamer_archive_context context)
StringInfoData bbs_buffer