Skip to content

Commit

Permalink
向用户所暴露的接口
Browse files Browse the repository at this point in the history
  • Loading branch information
luohaha committed Jun 10, 2016
1 parent 5353077 commit 80d7eec
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions core/user.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "el.h"

el_loop *el_loop_new() {
return loop_create();
}

event *el_event_new(int fd, int flags, cb_func cb, void *arg) {
set_nonblock(fd); //must be no block io
return event_init(fd, flags, cb, arg);
}

void el_event_add(el_loop *loop, event *e) {
event_list_put(loop->active_events, e);
loop->event_count++;
kqueue_add(loop, e);
}

int el_loop_run(el_loop *loop) {
return loop_run(loop);
}

0 comments on commit 80d7eec

Please sign in to comment.