Functions | |
EAPI Ecore_Fd_Handler * | ecore_main_fd_handler_add (int fd, Ecore_Fd_Handler_Flags flags, int(*func)(void *data, Ecore_Fd_Handler *fd_handler), const void *data, int(*buf_func)(void *buf_data, Ecore_Fd_Handler *fd_handler), const void *buf_data) |
Adds a callback for activity on the given file descriptor. | |
EAPI void * | ecore_main_fd_handler_del (Ecore_Fd_Handler *fd_handler) |
Deletes the given FD handler. | |
EAPI int | ecore_main_fd_handler_fd_get (Ecore_Fd_Handler *fd_handler) |
Retrieves the file descriptor that the given handler is handling. | |
EAPI int | ecore_main_fd_handler_active_get (Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) |
Return if read, write or error, or a combination thereof, is active on the file descriptor of the given FD handler. | |
EAPI void | ecore_main_fd_handler_active_set (Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) |
Set what active streams the given FD handler should be monitoring. |
EAPI int ecore_main_fd_handler_active_get | ( | Ecore_Fd_Handler * | fd_handler, | |
Ecore_Fd_Handler_Flags | flags | |||
) |
Return if read, write or error, or a combination thereof, is active on the file descriptor of the given FD handler.
fd_handler | The given FD handler. | |
flags | The flags, ECORE_FD_READ , ECORE_FD_WRITE or ECORE_FD_ERROR to query. |
1
if any of the given flags are active. 0
otherwise. EAPI void ecore_main_fd_handler_active_set | ( | Ecore_Fd_Handler * | fd_handler, | |
Ecore_Fd_Handler_Flags | flags | |||
) |
Set what active streams the given FD handler should be monitoring.
fd_handler | The given FD handler. | |
flags | The flags to be watching. |
EAPI Ecore_Fd_Handler* ecore_main_fd_handler_add | ( | int | fd, | |
Ecore_Fd_Handler_Flags | flags, | |||
int(*)(void *data, Ecore_Fd_Handler *fd_handler) | func, | |||
const void * | data, | |||
int(*)(void *buf_data, Ecore_Fd_Handler *fd_handler) | buf_func, | |||
const void * | buf_data | |||
) |
Adds a callback for activity on the given file descriptor.
func
will be called during the execution of ecore_main_loop_begin when the file descriptor is available for reading, or writing, or both.
Normally the return value from the func
is "zero means this handler is finished and can be deleted" as is usual for handler callbacks. However, if the buf_func
is supplied, then the return value from the func
is "non zero means the handler should be called again in a tight loop".
buf_func
is called during event loop handling to check if data that has been read from the file descriptor is in a buffer and is available to read. Some systems (notably xlib) handle their own buffering, and would otherwise not work with select(). These systems should use a buf_func
. This is a most annoying hack, only ecore_x uses it, so refer to that for an example. NOTE - func
should probably return "one" always if buf_func
is used, to avoid confusion with the other return walue semantics.
fd | The file descriptor to watch. | |
flags | To watch it for read (ECORE_FD_READ ) and/or (ECORE_FD_WRITE ) write ability. ECORE_FD_ERROR | |
func | The callback function. | |
data | The data to pass to the callback. | |
buf_func | The function to call to check if any data has been buffered and already read from the fd. Can be NULL . | |
buf_data | The data to pass to the buf_func function. |
NULL
otherwise. EAPI void* ecore_main_fd_handler_del | ( | Ecore_Fd_Handler * | fd_handler | ) |
Deletes the given FD handler.
fd_handler | The given FD handler. |
fd_handler
on success. NULL
otherwise. EAPI int ecore_main_fd_handler_fd_get | ( | Ecore_Fd_Handler * | fd_handler | ) |
Retrieves the file descriptor that the given handler is handling.
fd_handler | The given FD handler. |