summaryrefslogtreecommitdiff
path: root/core/src/xmake/engine.c
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-21 20:36:09 +0800
committerruki <[email protected]>2022-05-21 20:36:09 +0800
commitae7779636e29044be207d26d22a8cd27a223605d (patch)
treecc8da80bddf803579e4218e2102de84b9cc18986 /core/src/xmake/engine.c
parente4c3aa1c047d68a49de392307075b60f411e1950 (diff)
add bloom filter in core
Diffstat (limited to 'core/src/xmake/engine.c')
-rw-r--r--core/src/xmake/engine.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 3c0597977..992fb0cca 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -206,6 +206,10 @@ tb_int_t xm_lz4_decompress_stream_read(lua_State* lua);
tb_int_t xm_lz4_decompress_stream_write(lua_State* lua);
tb_int_t xm_lz4_decompress_stream_close(lua_State* lua);
+// the bloom filter functions
+tb_int_t xm_bloom_filter_open(lua_State* lua);
+tb_int_t xm_bloom_filter_close(lua_State* lua);
+
// the windows functions
#ifdef TB_CONFIG_OS_WINDOWS
tb_int_t xm_winos_cp_info(lua_State* lua);
@@ -441,6 +445,14 @@ static luaL_Reg const g_lz4_functions[] =
, { tb_null, tb_null }
};
+// the bloom filter functions
+static luaL_Reg const g_bloom_filter_functions[] =
+{
+ { "open", xm_bloom_filter_open }
+, { "close", xm_bloom_filter_close }
+, { tb_null, tb_null }
+};
+
// the string functions
static luaL_Reg const g_string_functions[] =
{
@@ -989,6 +1001,9 @@ xm_engine_ref_t xm_engine_init(tb_char_t const* name, xm_engine_lni_initalizer_c
// bind lz4 functions
xm_lua_register(engine->lua, "lz4", g_lz4_functions);
+ // bind bloom filter functions
+ xm_lua_register(engine->lua, "bloom_filter", g_bloom_filter_functions);
+
// bind base64 functions
xm_lua_register(engine->lua, "base64", g_base64_functions);