summaryrefslogtreecommitdiff
path: root/core/src/xmake/os
diff options
context:
space:
mode:
authorruki <[email protected]>2023-03-04 00:57:05 +0800
committerruki <[email protected]>2023-03-04 00:57:05 +0800
commit95bde15f54e6dfffe5eeeee2a04e697f615e8868 (patch)
tree8996e4ed8b9ec01539b62b4186c088020da84ba4 /core/src/xmake/os
parent9f5e98c4cc256d3321d4d5e23037304e723cdb93 (diff)
improve fscase
Diffstat (limited to 'core/src/xmake/os')
-rw-r--r--core/src/xmake/os/fscase.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/core/src/xmake/os/fscase.c b/core/src/xmake/os/fscase.c
new file mode 100644
index 000000000..917a5dc75
--- /dev/null
+++ b/core/src/xmake/os/fscase.c
@@ -0,0 +1,46 @@
+/*!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 fscase.c
+ *
+ */
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * trace
+ */
+#define TB_TRACE_MODULE_NAME "fscase"
+#define TB_TRACE_MODULE_DEBUG (0)
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * includes
+ */
+#include "prefix.h"
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * implementation
+ */
+tb_int_t xm_os_fscase(lua_State* lua)
+{
+ // check
+ tb_assert_and_check_return_val(lua, 0);
+
+ tb_char_t const* path = luaL_checkstring(lua, 1);
+ tb_check_return_val(path, 0);
+
+ lua_pushinteger(lua, (tb_int_t)tb_file_fscase(path));
+ return 1;
+}