Reorganize headers again

This commit is contained in:
Nils O. Selåsdal
2012-11-15 18:26:03 +01:00
parent 4dca24953f
commit 61eda493bf
23 changed files with 2341 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#ifndef IO_MUX_IMPL_H_
#define IO_MUX_IMPL_H_
#include "iomux.h"
#include "ucore_timers.h"
/** struct for IOMux implementations */
struct IOMux {
/* TImer instance */
struct UCTimers timers;
/* Current time. Updated before calling run_impl, and updated
* by iomux_timers_run
*/
struct timeval now;
/* Used by mux implementations to hold their own data/instance */
void *instance;
/** Run one iteration of the mux.
* The mux implementation must honor the timeout, if given.
* The mux implementation must call iomux_timers_run after the
* polling has occured (or if it's polling times out)
*
* @param mux The IOMux instance
* @param timeout absolute time of a timeout - after which timers should run.
* If timeout is NULL, no timeout should be set on the poll.
*/
int (*run_impl)(struct IOMux *mux, struct timeval *timeout);
/* Deallocate the instance specific part of the IOMux */
void (*delete_impl)(struct IOMux *mux);
/** Register an IOMuxFD for events*/
int (*register_fd_impl)(struct IOMux *mux, struct IOMuxFD *fd);
/** Unregister an IOMuxFD */
int (*unregister_fd_impl)(struct IOMux *mux, struct IOMuxFD *fd);
/** Update an IOMuxFD (due to its events ('what') has changed*/
int (*update_events_impl)(struct IOMux *mux, struct IOMuxFD *fd);
};
int iomux_select_init(struct IOMux *mux);
int iomux_epoll_init(struct IOMux *mux);
int iomux_timers_run(struct IOMux *mux);
#endif