Переглянути джерело

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);