2 * Copyright (c) 2018, Cygwin
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
14 #ifndef SETUP_COMPRESS_ZSTD_H
15 #define SETUP_COMPRESS_ZSTD_H
20 class compress_zstd
:public compress
23 compress_zstd (io_stream
*); /* decompress (read) only */
24 virtual ssize_t
read (void *buffer
, size_t len
);
25 virtual ssize_t
write (const void *buffer
, size_t len
); /* not implemented */
26 virtual ssize_t
peek (void *buffer
, size_t len
);
27 virtual long tell (); /* not implemented */
28 virtual int seek (long where
, io_stream_seek_t whence
);
30 virtual const char *next_file_name () { return NULL
; };
31 virtual int set_mtime (time_t);
32 virtual time_t get_mtime ();
33 virtual mode_t
get_mode ();
34 virtual size_t get_size () {return 0;};
35 virtual ~compress_zstd ();
36 static bool is_zstd (void *buffer
, size_t len
);
37 virtual void release_original(); /* give up ownership of original io_stream */
50 ZSTD_outBuffer out_block
;
54 char eof
; /* True = found end of compressed data. */
55 ZSTD_inBuffer in_block
;
63 struct private_data
*state
;
66 #endif /* SETUP_COMPRESS_ZSTD_H */