237 {
238#ifdef KISSAT_HAS_COMPRESSION
239#define READ_PIPE(SUFFIX, CMD, SIG) \
240 do { \
241 if (kissat_has_suffix (path, SUFFIX)) { \
242 file->file = read_pipe (CMD, SIG, path); \
243 if (!file->file) \
244 break; \
245 file->close = true; \
246 file->reading = true; \
247 file->compressed = true; \
248 file->path = path; \
249 file->bytes = 0; \
250 return true; \
251 } \
252 } while (0)
253 READ_PIPE (".bz2", "bzip2 -c -d %s", bz2sig);
254 READ_PIPE (".gz", "gzip -c -d %s", gzsig);
255 READ_PIPE (".lzma", "lzma -c -d %s", lzmasig);
256 READ_PIPE (".7z", "7z x -so %s 2>/dev/null", sig7z);
257 READ_PIPE (".xz", "xz -c -d %s", xzsig);
258 READ_PIPE (".Z", "gzip -c -d %s", Zsig);
259#endif
262 return false;
268
269 return true;
270}