diff options
| author | ruki <[email protected]> | 2022-05-08 17:29:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-08 17:29:38 +0800 |
| commit | 4045ac9d0c0e49c04794e2f8a253e81d6d29287c (patch) | |
| tree | 44c41fbf94263e8faa63c7cb40f7c0002f19bbdc /core/src/xmake/engine.c | |
| parent | 27cc34ff877909993cc5de57b7ac7cff6a13b771 (diff) | |
add lz4 modules
Diffstat (limited to 'core/src/xmake/engine.c')
| -rw-r--r-- | core/src/xmake/engine.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 1a74387d2..397fa1dcc 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -189,6 +189,12 @@ tb_int_t xm_hash_md5(lua_State* lua); tb_int_t xm_base64_encode(lua_State* lua); tb_int_t xm_base64_decode(lua_State* lua); +// the lz4 functions +tb_int_t xm_lz4_compress(lua_State* lua); +tb_int_t xm_lz4_decompress(lua_State* lua); +tb_int_t xm_lz4_block_compress(lua_State* lua); +tb_int_t xm_lz4_block_decompress(lua_State* lua); + // the windows functions #ifdef TB_CONFIG_OS_WINDOWS tb_int_t xm_winos_cp_info(lua_State* lua); @@ -403,6 +409,16 @@ static luaL_Reg const g_base64_functions[] = , { tb_null, tb_null } }; +// the lz4 functions +static luaL_Reg const g_lz4_functions[] = +{ + { "compress", xm_lz4_compress } +, { "decompress", xm_lz4_decompress } +, { "block_compress", xm_lz4_block_compress } +, { "block_decompress", xm_lz4_block_decompress } +, { tb_null, tb_null } +}; + // the string functions static luaL_Reg const g_string_functions[] = { @@ -948,6 +964,9 @@ xm_engine_ref_t xm_engine_init(tb_char_t const* name, xm_engine_lni_initalizer_c // bind hash functions xm_lua_register(engine->lua, "hash", g_hash_functions); + // bind lz4 functions + xm_lua_register(engine->lua, "lz4", g_lz4_functions); + // bind base64 functions xm_lua_register(engine->lua, "base64", g_base64_functions); |
