diff options
| author | ruki <[email protected]> | 2019-12-13 00:54:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-12-12 23:29:13 +0800 |
| commit | 48c503cbca85ecea9e2ef9b5215f2e5c99c8bb24 (patch) | |
| tree | feffd02ceb2904d256f5216a93c09a5f500c9c62 /core/src/xmake/io | |
| parent | 880b3b96f8222a027b0387bd1bfbbd793267d5a6 (diff) | |
add poller.support
Diffstat (limited to 'core/src/xmake/io')
| -rw-r--r-- | core/src/xmake/io/poller_support.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/core/src/xmake/io/poller_support.c b/core/src/xmake/io/poller_support.c new file mode 100644 index 000000000..b3b349242 --- /dev/null +++ b/core/src/xmake/io/poller_support.c @@ -0,0 +1,51 @@ +/*!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 - 2019, TBOOX Open Source Group. + * + * @author ruki + * @file poller_support.c + * + */ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * trace + */ +#define TB_TRACE_MODULE_NAME "poller_support" +#define TB_TRACE_MODULE_DEBUG (0) + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#include "poller.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +// io.poller_support(events) +tb_int_t xm_io_poller_support(lua_State* lua) +{ + // check + tb_assert_and_check_return_val(lua, 0); + + // get events + tb_size_t events = (tb_size_t)luaL_checknumber(lua, 1); + + // support events for poller + lua_pushboolean(lua, tb_poller_support(xm_io_poller(), events)); + return 1; +} + |
