diff options
| author | ruki <[email protected]> | 2019-11-06 00:43:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-11-05 22:23:24 +0800 |
| commit | 8e6b73d2016fd3a3bf658698e4eb10f82fbcc6f7 (patch) | |
| tree | 36ad703480f39117dfc6f60515b911c0f8190b2b /core/src/xmake/io | |
| parent | 3d8d86c9056c2ed4ba57e61ff0030f2749c847aa (diff) | |
register poller apis
Diffstat (limited to 'core/src/xmake/io')
| -rw-r--r-- | core/src/xmake/io/poller_wait.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/core/src/xmake/io/poller_wait.c b/core/src/xmake/io/poller_wait.c new file mode 100644 index 000000000..e43a70bff --- /dev/null +++ b/core/src/xmake/io/poller_wait.c @@ -0,0 +1,55 @@ +/*!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_wait.c + * + */ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * trace + */ +#define TB_TRACE_MODULE_NAME "poller_wait" +#define TB_TRACE_MODULE_DEBUG (0) + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#include "poller.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +// io.poller_wait(sock, events) +tb_int_t xm_io_poller_wait(lua_State* lua) +{ + // check + tb_assert_and_check_return_val(lua, 0); + + // is user data? + if (!lua_isuserdata(lua, 1)) + return 0; + + // get socket + tb_socket_ref_t sock = (tb_socket_ref_t)lua_touserdata(lua, 1); + tb_check_return_val(sock, 0); + + // TODO + return 0; +} + |
