diff options
| author | ruki <[email protected]> | 2024-04-02 23:00:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-02 12:02:11 +0800 |
| commit | d517f38cc8db6530192b7d61916f89be66cb7a8b (patch) | |
| tree | 203d76b5b331a4fc808446ef49a58a56656120d4 | |
| parent | a86468f8c55a3ef487529c84dcee435c67b20e95 (diff) | |
format code
| -rw-r--r-- | tests/projects/xmake_cli/hello/src/lni/main.c | 14 | ||||
| -rw-r--r-- | xmake/templates/c/xmake.cli/project/src/lni/main.c | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/tests/projects/xmake_cli/hello/src/lni/main.c b/tests/projects/xmake_cli/hello/src/lni/main.c index 3067e9b39..f2bb87325 100644 --- a/tests/projects/xmake_cli/hello/src/lni/main.c +++ b/tests/projects/xmake_cli/hello/src/lni/main.c @@ -1,21 +1,19 @@ #include <xmake/xmake.h> -static tb_int_t lni_test_hello(lua_State* lua) -{ +static tb_int_t lni_test_hello(lua_State* lua) { lua_pushliteral(lua, "hello xmake!"); return 1; } -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) -{ - static luaL_Reg const lni_test_funcs[] = - { + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) { + static luaL_Reg const lni_test_funcs[] = { {"hello", lni_test_hello} , {tb_null, tb_null} }; xm_engine_register(engine, "test", lni_test_funcs); } -tb_int_t main(tb_int_t argc, tb_char_t** argv) -{ + +tb_int_t main(tb_int_t argc, tb_char_t** argv) { tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null}; return xm_engine_run("hello", argc, argv, taskargv, lni_initalizer); } diff --git a/xmake/templates/c/xmake.cli/project/src/lni/main.c b/xmake/templates/c/xmake.cli/project/src/lni/main.c index 57f3b6715..7d16d50b9 100644 --- a/xmake/templates/c/xmake.cli/project/src/lni/main.c +++ b/xmake/templates/c/xmake.cli/project/src/lni/main.c @@ -1,21 +1,19 @@ #include <xmake/xmake.h> -static tb_int_t lni_test_hello(lua_State* lua) -{ +static tb_int_t lni_test_hello(lua_State* lua) { lua_pushliteral(lua, "hello xmake!"); return 1; } -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) -{ - static luaL_Reg const lni_test_funcs[] = - { + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) { + static luaL_Reg const lni_test_funcs[] = { {"hello", lni_test_hello} , {tb_null, tb_null} }; xm_engine_register(engine, "test", lni_test_funcs); } -tb_int_t main(tb_int_t argc, tb_char_t** argv) -{ + +tb_int_t main(tb_int_t argc, tb_char_t** argv) { tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null}; return xm_engine_run("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); } |
