diff options
| author | ruki <[email protected]> | 2016-07-31 18:44:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-31 18:44:18 +0800 |
| commit | de05bd361137a2971875f9ba4d30cea926823913 (patch) | |
| tree | ae2df01a1b269099795aa992593df38f938a485c /core/src | |
| parent | 68b869763491ff6eb97085b8536ef1b7c72fd2bd (diff) | |
try to format errors and add uuid interface
Diffstat (limited to 'core/src')
| -rwxr-xr-x | core/src/xmake/machine.c | 2 | ||||
| -rwxr-xr-x | core/src/xmake/makefile | 1 | ||||
| -rwxr-xr-x | core/src/xmake/os/uuid.c | 50 |
3 files changed, 53 insertions, 0 deletions
diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index b877eb3c1..280069f7b 100755 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -54,6 +54,7 @@ typedef struct __xm_machine_impl_t // the os functions tb_int_t xm_os_find(lua_State* lua); +tb_int_t xm_os_uuid(lua_State* lua); tb_int_t xm_os_isdir(lua_State* lua); tb_int_t xm_os_rmdir(lua_State* lua); tb_int_t xm_os_mkdir(lua_State* lua); @@ -99,6 +100,7 @@ tb_int_t xm_process_close(lua_State* lua); static luaL_Reg const g_os_functions[] = { { "find", xm_os_find } +, { "uuid", xm_os_uuid } , { "isdir", xm_os_isdir } , { "rmdir", xm_os_rmdir } , { "mkdir", xm_os_mkdir } diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile index 4b692eda3..09d0767e1 100755 --- a/core/src/xmake/makefile +++ b/core/src/xmake/makefile @@ -15,6 +15,7 @@ xmake_C_FILES += \ xmake \ machine \ os/find \ + os/uuid \ os/isdir \ os/rmdir \ os/mkdir \ diff --git a/core/src/xmake/os/uuid.c b/core/src/xmake/os/uuid.c new file mode 100755 index 000000000..c30d52815 --- /dev/null +++ b/core/src/xmake/os/uuid.c @@ -0,0 +1,50 @@ +/*!The Make-like Build Utility based on Lua + * + * XMake is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * XMake is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with XMake; + * If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a> + * + * Copyright (C) 2015 - 2016, ruki All rights reserved. + * + * @author ruki + * @file uuid.c + * + */ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * trace + */ +#define TB_TRACE_MODULE_NAME "uuid" +#define TB_TRACE_MODULE_DEBUG (0) + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * implementation + */ +tb_int_t xm_os_uuid(lua_State* lua) +{ + // check + tb_assert_and_check_return_val(lua, 0); + + // get the name + tb_char_t const* name = luaL_checkstring(lua, 1); + tb_used(name); + + + // ok + return 1; +} |
