瀏覽代碼

HV_EXPORT hio_events hio_revents

ithewei 5 年之前
父節點
當前提交
f8ad665a9e
共有 2 個文件被更改,包括 13 次插入3 次删除
  1. 8 0
      event/hevent.c
  2. 5 3
      event/hloop.h

+ 8 - 0
event/hevent.c

@@ -13,6 +13,14 @@ int hio_error(hio_t* io) {
     return io->error;
 }
 
+int hio_events(hio_t* io) {
+    return io->events;
+}
+
+int hio_revents(hio_t* io) {
+    return io->revents;
+}
+
 struct sockaddr* hio_localaddr(hio_t* io) {
     return io->localaddr;
 }

+ 5 - 3
event/hloop.h

@@ -203,9 +203,11 @@ HV_EXPORT int    hio_add(hio_t* io, hio_cb cb, int events DEFAULT(HV_READ));
 HV_EXPORT int    hio_del(hio_t* io, int events DEFAULT(HV_RDWR));
 
 // hio_t fields
-HV_EXPORT int hio_fd    (hio_t* io);
-HV_EXPORT int hio_error (hio_t* io);
-HV_EXPORT hio_type_e hio_type(hio_t* io);
+HV_EXPORT int hio_fd      (hio_t* io);
+HV_EXPORT int hio_error   (hio_t* io);
+HV_EXPORT int hio_events  (hio_t* io);
+HV_EXPORT int hio_revents (hio_t* io);
+HV_EXPORT hio_type_e       hio_type     (hio_t* io);
 HV_EXPORT struct sockaddr* hio_localaddr(hio_t* io);
 HV_EXPORT struct sockaddr* hio_peeraddr (hio_t* io);