diff options
| author | TitanSnow <[email protected]> | 2017-05-08 10:38:11 +0800 |
|---|---|---|
| committer | TitanSnow <[email protected]> | 2017-05-08 10:38:11 +0800 |
| commit | f949546b3f58c852edf08bd6fc0be97831d04fef (patch) | |
| tree | add50258400a02f96aed008fc7976ba04d22739c | |
| parent | c143606586fe8e2303b4801fde89359caa773f16 (diff) | |
features -> build_configuration
| -rw-r--r-- | core/src/xmake/machine.c | 4 | ||||
| -rw-r--r-- | core/src/xmake/makefile | 2 | ||||
| -rw-r--r-- | core/src/xmake/os/build_configuration.c (renamed from core/src/xmake/os/features.c) | 17 |
3 files changed, 15 insertions, 8 deletions
diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index 16c3176f6..09ed217f0 100644 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -80,7 +80,7 @@ tb_int_t xm_os_getenv(lua_State* lua); tb_int_t xm_os_emptydir(lua_State* lua); tb_int_t xm_os_strerror(lua_State* lua); tb_int_t xm_os_getwinsize(lua_State* lua); -tb_int_t xm_os_features(lua_State* lua); +tb_int_t xm_os_build_configuration(lua_State* lua); // the path functions tb_int_t xm_path_relative(lua_State* lua); @@ -132,7 +132,7 @@ static luaL_Reg const g_os_functions[] = , { "emptydir", xm_os_emptydir } , { "strerror", xm_os_strerror } , { "getwinsize", xm_os_getwinsize} -, { "features", xm_os_features } +, { "build_configuration", xm_os_build_configuration} , { tb_null, tb_null } }; diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile index 67f648a01..b3b90f965 100644 --- a/core/src/xmake/makefile +++ b/core/src/xmake/makefile @@ -36,7 +36,7 @@ xmake_C_FILES += \ os/emptydir \ os/strerror \ os/getwinsize \ - os/features \ + os/build_configuration \ path/relative \ path/absolute \ path/translate \ diff --git a/core/src/xmake/os/features.c b/core/src/xmake/os/build_configuration.c index 33bd9ba75..55dc837c4 100644 --- a/core/src/xmake/os/features.c +++ b/core/src/xmake/os/build_configuration.c @@ -19,14 +19,14 @@ * Copyright (C) 2015 - 2017, TBOOX Open Source Group. * * @author TitanSnow - * @file features.c + * @file build_configuration.c * */ /* ////////////////////////////////////////////////////////////////////////////////////// * trace */ -#define TB_TRACE_MODULE_NAME "features" +#define TB_TRACE_MODULE_NAME "build_configuration" #define TB_TRACE_MODULE_DEBUG (0) /* ////////////////////////////////////////////////////////////////////////////////////// @@ -38,8 +38,8 @@ * implementation */ -// get features -tb_int_t xm_os_features(lua_State* lua) +// get build_configuration +tb_int_t xm_os_build_configuration(lua_State* lua) { // features const char* features_table[] = { @@ -49,7 +49,11 @@ tb_int_t xm_os_features(lua_State* lua) tb_null }; - // new array + // configuration table + lua_newtable(lua); + lua_pushstring(lua, "features"); + + // array for features lua_newtable(lua); // insert @@ -59,6 +63,9 @@ tb_int_t xm_os_features(lua_State* lua) lua_rawseti(lua, -2, p - features_table + 1); } + // set back to table + lua_settable(lua, -3); + // ok return 1; } |
