27 lines
615 B
C
27 lines
615 B
C
#ifndef UCORE_WQUEUE_H_
|
|
#define UCORE_WQUEUE_H_
|
|
|
|
#include "mbuf.h"
|
|
#include "iomux.h"
|
|
|
|
typedef int (*wqueue_write_cb)(struct IOMux *mux, struct IOMuxFD *fd, struct MBuf *mbuf);
|
|
typedef int (*wqueue_read_cb)(struct IOMux *mux, struct IOMuxFD *fd);
|
|
|
|
struct UCWQueue {
|
|
struct IOMuxFD fd;
|
|
struct TailQ queue;
|
|
struct IOMux *mux;
|
|
wqueue_read_cb read_cb;
|
|
wqueue_write_cb write_cb;
|
|
|
|
unsigned int queue_len;
|
|
};
|
|
|
|
void uc_wqueue_init(struct UCWQueue *wqueue, struct IOMux *mux);
|
|
|
|
int uc_wqueue_clear(struct UCWQueue *wqueue);
|
|
|
|
int uc_wqueue_enqueue(struct UCWQueue *wqueue, struct MBuf *mbuf);
|
|
|
|
#endif
|