14#ifndef __WSUTIL_FILE_COMPRESSED_H__
15#define __WSUTIL_FILE_COMPRESSED_H__
26 WS_FILE_GZIP_COMPRESSED,
27 WS_FILE_ZSTD_COMPRESSED,
28 WS_FILE_LZ4_COMPRESSED,
29 WS_FILE_UNKNOWN_COMPRESSION,
32WS_DLL_PUBLIC ws_compression_type
33ws_name_to_compression_type(
const char *name);
35WS_DLL_PUBLIC ws_compression_type
36ws_extension_to_compression_type(
const char *ext);
39ws_can_write_compression_type(ws_compression_type compression_type);
41WS_DLL_PUBLIC
const char *
42ws_compression_type_description(ws_compression_type compression_type);
44WS_DLL_PUBLIC
const char *
45ws_compression_type_extension(ws_compression_type compression_type);
47WS_DLL_PUBLIC
const char *
48ws_compression_type_name(ws_compression_type compression_type);
51ws_get_all_compression_type_extensions_list(
void);
54ws_get_all_output_compression_type_names_list(
void);
67ws_cwstream_open(
const char *filename, ws_compression_type ctype,
int *err);
70ws_cwstream_fdopen(
int fd, ws_compression_type ctype,
int *err);
73ws_cwstream_open_stdout(ws_compression_type ctype,
int *err);
77ws_cwstream_write(
ws_cwstream* pfile,
const uint8_t* data,
size_t data_length,
78 uint64_t *bytes_written,
int *err);
91#if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG)
93typedef struct gzip_writer *GZWFILE_T;
95WS_DLL_PUBLIC GZWFILE_T gzwfile_open(
const char *path);
96WS_DLL_PUBLIC GZWFILE_T gzwfile_fdopen(
int fd);
97WS_DLL_PUBLIC
unsigned gzwfile_write(GZWFILE_T state,
const void *buf,
unsigned len);
98WS_DLL_PUBLIC
int gzwfile_flush(GZWFILE_T state);
99WS_DLL_PUBLIC
int gzwfile_close(GZWFILE_T state);
100WS_DLL_PUBLIC
int gzwfile_geterr(GZWFILE_T state);
104typedef struct lz4_writer *LZ4WFILE_T;
106WS_DLL_PUBLIC LZ4WFILE_T lz4wfile_open(
const char *path);
107WS_DLL_PUBLIC LZ4WFILE_T lz4wfile_fdopen(
int fd);
108WS_DLL_PUBLIC
size_t lz4wfile_write(LZ4WFILE_T state,
const void *buf,
size_t len);
109WS_DLL_PUBLIC
int lz4wfile_flush(LZ4WFILE_T state);
110WS_DLL_PUBLIC
int lz4wfile_close(LZ4WFILE_T state);
111WS_DLL_PUBLIC
int lz4wfile_geterr(LZ4WFILE_T state);
Definition file_compressed.c:159