move iomux_impl.h to src/ dir, it's an implementation detail
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "ucore/iomux_impl.h"
|
||||
#include "iomux_impl.h"
|
||||
|
||||
//epoll (linux specific) IO mux.
|
||||
//We stuff the struct IOMuxFD pointer in the event.data.ptr slot
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@
|
||||
#include <string.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ucore/iomux_impl.h>
|
||||
#include "ucore/clock.h"
|
||||
#include "iomux_impl.h"
|
||||
|
||||
|
||||
//dispatchers for the IOMux implementations */
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef IO_MUX_IMPL_H_
|
||||
#define IO_MUX_IMPL_H_
|
||||
|
||||
#include "ucore/iomux.h"
|
||||
#include "ucore/timers.h"
|
||||
/** struct for IOMux implementations */
|
||||
struct IOMux {
|
||||
|
||||
/* TImer instance */
|
||||
struct UCTimers timers;
|
||||
|
||||
/**
|
||||
* Clock used for driving timers, and
|
||||
* providing timeouts for the mux
|
||||
*/
|
||||
struct UCoreClock *uclock;
|
||||
|
||||
|
||||
/* 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
|
||||
|
||||
+1
-1
@@ -5,8 +5,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include "ucore/iomux_impl.h"
|
||||
#include "ucore/utils.h"
|
||||
#include "iomux_impl.h"
|
||||
|
||||
#define IOMUX_GROW_CHUNK (32)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user