summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorJonas M. Gastal <jgastal@profusion.mobi>2012-03-21 14:14:50 +0000
committerJonas M. Gastal <jgastal@profusion.mobi>2012-03-21 14:14:50 +0000
commit49ed7d364a98af60404e5bea073328f11d595465 (patch)
tree68951bfb52ee0fe3746e6d822d0fc1f34e1997ac /legacy/ecore/src/lib/ecore/ecore_main.c
parent5900e0c9530260a82cf1d50276f0eb9459bd0f43 (diff)
Ecore FD handler docs.
SVN revision: 69540
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index 8f438bd326..587c83be24 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -964,39 +964,6 @@ ecore_main_loop_select_func_get(void)
964 return main_loop_select; 964 return main_loop_select;
965} 965}
966 966
967/**
968 * Adds a callback for activity on the given file descriptor.
969 *
970 * @p func will be called during the execution of @ref ecore_main_loop_begin
971 * when the file descriptor is available for reading, or writing, or both.
972 *
973 * Normally when @p func returns ECORE_CALLBACK_CANCEL, it indicates that the
974 * handler should be marked for deletion (identical to calling @ref ecore_main_fd_handler_del).
975 * However, if the @p buf_func is supplied, then the return value from the @p func indicates that
976 * @p func should be called repeatedly until it returns ECORE_CALLBACK_CANCEL.
977 *
978 * @p buf_func is called during event loop handling to check if data that has
979 * been read from the file descriptor is in a buffer and is available to
980 * read. Some systems (notably xlib) handle their own buffering, and would
981 * otherwise not work with select(). These systems should use a @p buf_func.
982 * This is a most annoying hack, only ecore_x uses it, so refer to that for
983 * an example. NOTE - @p func should probably return ECORE_CALLBACK_RENEW always if
984 * @p buf_func is used, to avoid confusion with the other return value
985 * semantics.
986 *
987 * @param fd The file descriptor to watch.
988 * @param flags To watch it for read (@c ECORE_FD_READ) and/or
989 * (@c ECORE_FD_WRITE) write ability. @c ECORE_FD_ERROR
990 *
991 * @param func The callback function.
992 * @param data The data to pass to the callback.
993 * @param buf_func The function to call to check if any data has been
994 * buffered and already read from the fd. Can be @c NULL.
995 * @param buf_data The data to pass to the @p buf_func function.
996 * @return A fd handler handle if successful. @c NULL otherwise.
997 * @note This function CANNOT be used for reading/writing to regular files!
998 * @ingroup Ecore_FD_Handler_Group
999 */
1000EAPI Ecore_Fd_Handler * 967EAPI Ecore_Fd_Handler *
1001ecore_main_fd_handler_add(int fd, 968ecore_main_fd_handler_add(int fd,
1002 Ecore_Fd_Handler_Flags flags, 969 Ecore_Fd_Handler_Flags flags,
@@ -1078,20 +1045,6 @@ ecore_main_win32_handler_add(void *h __UNUSED__,
1078 1045
1079#endif 1046#endif
1080 1047
1081/**
1082 * Marks an FD handler for deletion.
1083 * @param fd_handler The FD handler.
1084 * @return The data pointer set using @ref ecore_main_fd_handler_add,
1085 * for @p fd_handler on success. @c NULL otherwise.
1086 * @ingroup Ecore_FD_Handler_Group
1087 * This function marks an fd handler to be deleted during an iteration of the main loop.
1088 * It does NOT close the associated fd!
1089 *
1090 * @note If the underlying fd is already closed ecore may complain if the main loop
1091 * is using epoll internally, and also in some rare cases this may cause
1092 * crashes and instability. Remember to delete your fd handlers before the
1093 * fds they listen to are closed.
1094 */
1095EAPI void * 1048EAPI void *
1096ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler) 1049ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
1097{ 1050{
@@ -1135,24 +1088,6 @@ ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler __UNUSED__)
1135 1088
1136#endif 1089#endif
1137 1090
1138/**
1139 * @brief Set the prepare callback with data for a given #Ecore_Fd_Handler
1140 *
1141 * @param fd_handler The fd handler
1142 * @param func The prep function
1143 * @param data The data to pass to the prep function
1144 *
1145 * This function will be called prior to any fd handler's callback function
1146 * (even the other fd handlers), before entering the main loop select function.
1147 *
1148 * @note Once a prepare callback is set for a fd handler, it cannot be changed.
1149 * You need to delete the fd handler and create a new one, to set another
1150 * callback.
1151 * @note You probably don't need this function. It is only necessary for very
1152 * uncommon cases that need special behavior.
1153 *
1154 * @ingroup Ecore_FD_Handler_Group
1155 */
1156EAPI void 1091EAPI void
1157ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, 1092ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
1158 Ecore_Fd_Prep_Cb func, 1093 Ecore_Fd_Prep_Cb func,
@@ -1176,12 +1111,6 @@ unlock:
1176 _ecore_unlock(); 1111 _ecore_unlock();
1177} 1112}
1178 1113
1179/**
1180 * Retrieves the file descriptor that the given handler is handling.
1181 * @param fd_handler The given FD handler.
1182 * @return The file descriptor the handler is watching.
1183 * @ingroup Ecore_FD_Handler_Group
1184 */
1185EAPI int 1114EAPI int
1186ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler) 1115ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler)
1187{ 1116{
@@ -1201,15 +1130,6 @@ unlock:
1201 return fd; 1130 return fd;
1202} 1131}
1203 1132
1204/**
1205 * Return if read, write or error, or a combination thereof, is active on the
1206 * file descriptor of the given FD handler.
1207 * @param fd_handler The given FD handler.
1208 * @param flags The flags, @c ECORE_FD_READ, @c ECORE_FD_WRITE or
1209 * @c ECORE_FD_ERROR to query.
1210 * @return #EINA_TRUE if any of the given flags are active. #EINA_FALSE otherwise.
1211 * @ingroup Ecore_FD_Handler_Group
1212 */
1213EAPI Eina_Bool 1133EAPI Eina_Bool
1214ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, 1134ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler,
1215 Ecore_Fd_Handler_Flags flags) 1135 Ecore_Fd_Handler_Flags flags)
@@ -1232,12 +1152,6 @@ unlock:
1232 return ret; 1152 return ret;
1233} 1153}
1234 1154
1235/**
1236 * Set what active streams the given FD handler should be monitoring.
1237 * @param fd_handler The given FD handler.
1238 * @param flags The flags to be watching.
1239 * @ingroup Ecore_FD_Handler_Group
1240 */
1241EAPI void 1155EAPI void
1242ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, 1156ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
1243 Ecore_Fd_Handler_Flags flags) 1157 Ecore_Fd_Handler_Flags flags)