summaryrefslogtreecommitdiff
path: root/doc/en
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-09-27 20:49:12 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-09-27 20:49:12 +0200
commit26e6fdc64561d7575b3c937a9bb4f39cc8c0954f (patch)
tree7792b2f0824875006f1de4998056aa047e8eb008 /doc/en
parente7b6e8c60f0001c4b228bda570ec0d1b7dc3a739 (diff)
downloadweechat-26e6fdc64561d7575b3c937a9bb4f39cc8c0954f.zip
api: add function file_compress
Diffstat (limited to 'doc/en')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index b6093fd52..e3c416e0b 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -4189,6 +4189,47 @@ if (weechat_file_copy ("/tmp/test.txt", "/path/to/test2.txt"))
[NOTE]
This function is not available in scripting API.
+==== file_compress
+
+_WeeChat ≥ 3.7._
+
+Compress a file with gzip or zstd.
+
+Prototype:
+
+[source,c]
+----
+int weechat_file_compress (const char *from, const char *to,
+ const char *compressor, int compression_level);
+----
+
+Arguments:
+
+* _from_: source file
+* _to_: destination file
+* _compressor_: the compressor to use, one of:
+** _gzip_: gzip compression
+** _zstd_: zstandard compression
+* _compression_level_: compression level, between 1 (fast, low compression) to
+ 100 (slow, best compression)
+
+Return value:
+
+* 1 if OK, 0 if error
+
+C example:
+
+[source,c]
+----
+if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
+{
+ /* OK */
+}
+----
+
+[NOTE]
+This function is not available in scripting API.
+
[[util]]
=== Util