aboutsummaryrefslogtreecommitdiff
path: root/lib/fstream/compressor.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-14 20:25:10 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-16 09:34:35 +0200
commit15431d4fd8de67a03af4ee9cc8e774e1750e9da2 (patch)
treef5386db24f3901e86d3aaae10042d4f9181a6b32 /lib/fstream/compressor.c
parent76b06f71078e2eea7def3d1c15cdb103dec785ed (diff)
Add zstd stream compressor implementation to libfstream
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 b8f9c6b..84a859c 100644
--- a/lib/fstream/compressor.c
+++ b/lib/fstream/compressor.c
@@ -14,6 +14,9 @@ int fstream_compressor_id_from_name(const char *name)
if (strcmp(name, "xz") == 0)
return FSTREAM_COMPRESSOR_XZ;
+ if (strcmp(name, "zstd") == 0)
+ return FSTREAM_COMPRESSOR_ZSTD;
+
return -1;
}
@@ -25,6 +28,9 @@ const char *fstream_compressor_name_from_id(int id)
if (id == FSTREAM_COMPRESSOR_XZ)
return "xz";
+ if (id == FSTREAM_COMPRESSOR_ZSTD)
+ return "zstd";
+
return NULL;
}
@@ -39,6 +45,10 @@ bool fstream_compressor_exists(int id)
case FSTREAM_COMPRESSOR_XZ:
return true;
#endif
+#ifdef WITH_ZSTD
+ case FSTREAM_COMPRESSOR_ZSTD:
+ return true;
+#endif
default:
break;
}