From 406ed5efac68af31c3cc7a0e7401ebf4dd419804 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 14 Sep 2014 17:42:08 -0400 Subject: Add compression API --- doc/lua_api.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/lua_api.txt') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 37477b60a..805b63f6a 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1763,6 +1763,18 @@ minetest.deserialize(string) -> table ^ Example: deserialize('return { ["foo"] = "bar" }') -> {foo='bar'} ^ Example: deserialize('print("foo")') -> nil (function call fails) ^ error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value) +minetest.compress(data, method, ...) -> compressed_data +^ Compress a string of data. +^ `method` is a string identifying the compression method to be used. +^ Supported compression methods: +^ Deflate (zlib): "deflate" +^ `...` indicates method-specific arguments. Currently defined arguments are: +^ Deflate: `level` - Compression level, 0-9 or nil. +minetest.decompress(compressed_data, method, ...) -> data +^ Decompress a string of data (using ZLib). +^ See documentation on minetest.compress() for supported compression methods. +^ currently supported. +^ `...` indicates method-specific arguments. Currently, no methods use this. minetest.is_protected(pos, name) -> bool ^ This function should be overridden by protection mods and should be used to check if a player can interact at a position. -- cgit v1.2.3