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
21 class compress_zstd
:public compress
24 compress_zstd (io_stream
*); /* decompress (read) only */
25 virtual ssize_t
read (void *buffer
, size_t len
);
26 virtual ssize_t
write (const void *buffer
, size_t len
); /* not implemented */
27 virtual ssize_t
peek (void *buffer
, size_t len
);
28 virtual off_t
tell (); /* not implemented */
29 virtual off_t
seek (off_t where
, io_stream_seek_t whence
);
31 virtual const char *next_file_name () { return NULL
; };
32 virtual int set_mtime (time_t);
33 virtual time_t get_mtime ();
34 virtual mode_t
get_mode ();
35 virtual size_t get_size () {return 0;};
36 virtual ~compress_zstd ();
37 static bool is_zstd (void *buffer
, size_t len
);
38 virtual void release_original(); /* give up ownership of original io_stream */
51 ZSTD_outBuffer out_block
;
55 char eof
; /* True = found end of compressed data. */
56 ZSTD_inBuffer in_block
;
64 struct private_data
*state
;
67 #endif /* SETUP_COMPRESS_ZSTD_H */