From e98287527714fea8575ac5273372a9dc6e278a19 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 12 Sep 2011 08:30:22 +0000 Subject: [PATCH] more useless ecore-con functions: ecore_con_server_fd_get and ecore_con_client_fd_get SVN revision: 63344 --- legacy/ecore/ChangeLog | 4 ++++ legacy/ecore/src/lib/ecore_con/Ecore_Con.h | 24 ++++++++++++++++++++++ legacy/ecore/src/lib/ecore_con/ecore_con.c | 23 +++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 24744cba20..87d5b96c1e 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -287,3 +287,7 @@ * Add ecore_thread_main_loop_begin and ecore_thread_main_loop_end. Usefull to protect EFL call from another thread. +2011-09-12 Mike Blumenkrantz + + * Add ecore_con_server_fd_get, ecore_con_client_fd_get for manipulating + server file descriptors. diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h index e6653e12b9..645e835c4f 100644 --- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h +++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h @@ -957,6 +957,30 @@ EAPI void ecore_con_server_timeout_set(Ecore_Con_Server *svr, doubl */ EAPI double ecore_con_server_timeout_get(Ecore_Con_Server *svr); +/** + * Get the fd that the server is connected to + * + * @param svr The server object + * @return The fd, or -1 on failure + * + * This function returns the fd which is used by the underlying server connection. + * It should not be tampered with unless you REALLY know what you are doing. + * @note This function is only valid for servers created with ecore_con_server_connect() + * @since 1.1 + */ +EAPI int ecore_con_server_fd_get(Ecore_Con_Server *svr); + +/** + * Get the fd that the client is connected to + * + * @param cl The client object + * @return The fd, or -1 on failure + * + * This function returns the fd which is used by the underlying client connection. + * It should not be tampered with unless you REALLY know what you are doing. + * @since 1.1 + */ +EAPI int ecore_con_client_fd_get(Ecore_Con_Client *cl); /** * @} */ diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c index 7f46c5ddff..0d2657e620 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c @@ -888,6 +888,29 @@ ecore_con_client_flush(Ecore_Con_Client *cl) _ecore_con_client_flush(cl); } +EAPI int +ecore_con_server_fd_get(Ecore_Con_Server *svr) +{ + if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) + { + ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __func__); + return -1; + } + if (svr->created) return -1; + return ecore_main_fd_handler_fd_get(svr->fd_handler); +} + +EAPI int +ecore_con_client_fd_get(Ecore_Con_Client *cl) +{ + if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) + { + ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __func__); + return -1; + } + return ecore_main_fd_handler_fd_get(cl->fd_handler); +} + /** * @} */