summaryrefslogtreecommitdiff
path: root/lib/fstream/compressor.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-15 21:13:56 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-16 09:34:35 +0200
commit183cf393a453cddb689666ce7fb35a97e7f523bf (patch)
tree7f57b466be7fdbe8cae1ad1f5562fa493ad3312b /lib/fstream/compressor.c
parent15431d4fd8de67a03af4ee9cc8e774e1750e9da2 (diff)
Add bzip2 stream compression support
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstream/compressor.c')
-rw-r--r--lib/fstream/compressor.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/fstream/compressor.c b/lib/fstream/compressor.c
index 84a859c..903a5f7 100644
--- a/lib/fstream/compressor.c
+++ b/lib/fstream/compressor.c
@@ -17,6 +17,9 @@ int fstream_compressor_id_from_name(const char *name)
if (strcmp(name, "zstd") == 0)
return FSTREAM_COMPRESSOR_ZSTD;
+ if (strcmp(name, "bzip2") == 0)
+ return FSTREAM_COMPRESSOR_BZIP2;
+
return -1;
}
@@ -31,6 +34,9 @@ const char *fstream_compressor_name_from_id(int id)
if (id == FSTREAM_COMPRESSOR_ZSTD)
return "zstd";
+ if (id == FSTREAM_COMPRESSOR_BZIP2)
+ return "bzip2";
+
return NULL;
}
@@ -49,6 +55,10 @@ bool fstream_compressor_exists(int id)
case FSTREAM_COMPRESSOR_ZSTD:
return true;
#endif
+#ifdef WITH_BZIP2
+ case FSTREAM_COMPRESSOR_BZIP2:
+ return true;
+#endif
default:
break;
}