summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-09 21:00:02 +0800
committerruki <[email protected]>2022-05-09 21:00:02 +0800
commit1c4b7d59a2048adde4108209524cfd515da95564 (patch)
tree6dc2020cb5f2efdc905af5e302e23a1f9d8c1edd /core/src
parentb3e3b7d6d7465abe006b15458701fbc720442b93 (diff)
add compress file
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/engine.c4
-rw-r--r--core/src/xmake/lz4/compress_file.c42
-rw-r--r--core/src/xmake/lz4/decompress_file.c43
-rw-r--r--core/src/xmake/makefile4
4 files changed, 92 insertions, 1 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 397fa1dcc..b6e78970a 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -194,6 +194,8 @@ 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);
+tb_int_t xm_lz4_compress_file(lua_State* lua);
+tb_int_t xm_lz4_decompress_file(lua_State* lua);
// the windows functions
#ifdef TB_CONFIG_OS_WINDOWS
@@ -416,6 +418,8 @@ static luaL_Reg const g_lz4_functions[] =
, { "decompress", xm_lz4_decompress }
, { "block_compress", xm_lz4_block_compress }
, { "block_decompress", xm_lz4_block_decompress }
+, { "compress_file", xm_lz4_compress_file }
+, { "decompress_file", xm_lz4_decompress_file }
, { tb_null, tb_null }
};
diff --git a/core/src/xmake/lz4/compress_file.c b/core/src/xmake/lz4/compress_file.c
new file mode 100644
index 000000000..640072d07
--- /dev/null
+++ b/core/src/xmake/lz4/compress_file.c
@@ -0,0 +1,42 @@
+/*!A cross-platform build utility based on Lua
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright (C) 2015-present, TBOOX Open Source Group.
+ *
+ * @author ruki
+ * @file compress_file.c
+ *
+ */
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * trace
+ */
+#define TB_TRACE_MODULE_NAME "compress_file"
+#define TB_TRACE_MODULE_DEBUG (0)
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * includes
+ */
+#include "prefix.h"
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * implementation
+ */
+tb_int_t xm_lz4_compress_file(lua_State* lua)
+{
+ // check
+ tb_assert_and_check_return_val(lua, 0);
+
+ return 0;
+}
diff --git a/core/src/xmake/lz4/decompress_file.c b/core/src/xmake/lz4/decompress_file.c
new file mode 100644
index 000000000..62d0a0b8b
--- /dev/null
+++ b/core/src/xmake/lz4/decompress_file.c
@@ -0,0 +1,43 @@
+/*!A cross-platform build utility based on Lua
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright (C) 2015-present, TBOOX Open Source Group.
+ *
+ * @author ruki
+ * @file decompress_file.c
+ *
+ */
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * trace
+ */
+#define TB_TRACE_MODULE_NAME "decompress_file"
+#define TB_TRACE_MODULE_DEBUG (0)
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * includes
+ */
+#include "prefix.h"
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * implementation
+ */
+tb_int_t xm_lz4_decompress_file(lua_State* lua)
+{
+ // check
+ tb_assert_and_check_return_val(lua, 0);
+
+ return 0;
+}
+
diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile
index 9de3fe01b..06b188fc9 100644
--- a/core/src/xmake/makefile
+++ b/core/src/xmake/makefile
@@ -137,7 +137,9 @@ xmake_C_FILES += \
lz4/compress \
lz4/decompress \
lz4/block_compress \
- lz4/block_decompress
+ lz4/block_decompress \
+ lz4/compress_file \
+ lz4/decompress_file
iswin =
ifeq ($(PLAT),windows)