Go to the source code of this file.
◆ astreamer_gzip_decompressor_new()
Definition at line 236 of file astreamer_gzip.c.
237{
238#ifdef HAVE_LIBZ
241
243
247
248 streamer->base.bbs_next =
next;
250
252
253
254 zs = &streamer->zstream;
257 zs->next_out = (
uint8 *) streamer->base.bbs_buffer.data;
258 zs->avail_out = streamer->base.bbs_buffer.maxlen;
259
260
261
262
263
264
265
266
267
268
269
271 pg_fatal(
"could not initialize compression library");
272
273 return &streamer->base;
274#else
275 pg_fatal(
"this build does not support compression with %s",
"gzip");
277#endif
278}
#define Assert(condition)
#define palloc0_object(type)
void enlargeStringInfo(StringInfo str, int needed)
void initStringInfo(StringInfo str)
References Assert, enlargeStringInfo(), fb(), initStringInfo(), next, palloc0_object, and pg_fatal.
Referenced by create_archive_verifier(), CreateBackupStreamer(), and init_archive_reader().
◆ astreamer_gzip_writer_new()
Definition at line 99 of file astreamer_gzip.c.
101{
102#ifdef HAVE_LIBZ
104
108
109 streamer->pathname =
pstrdup(pathname);
110
112 {
113 streamer->gzfile =
gzopen(pathname,
"wb");
114 if (streamer->gzfile ==
NULL)
115 pg_fatal(
"could not create compressed file \"%s\": %m",
116 pathname);
117 }
118 else
119 {
120
121
122
123
124 int fd =
dup(fileno(file));
125
127 pg_fatal(
"could not duplicate stdout: %m");
128
130 if (streamer->gzfile ==
NULL)
131 pg_fatal(
"could not open output file: %m");
132 }
133
135 pg_fatal(
"could not set compression level %d: %s",
137
138 return &streamer->base;
139#else
140 pg_fatal(
"this build does not support compression with %s",
"gzip");
142#endif
143}
char * pstrdup(const char *in)
static int fd(const char *x, int i)
References fb(), fd(), pg_compress_specification::level, palloc0_object, pg_fatal, and pstrdup().
Referenced by CreateBackupStreamer().