Commit 9dea60166d6c1e4344feb33d28cbd9a787ce7551

Thomas de Grivel 2017-06-28T02:38:30

move struct and union definitions to grovel-epoll

diff --git a/cffi-epoll.lisp b/cffi-epoll.lisp
index 0fc2aee..b4bdea0 100644
--- a/cffi-epoll.lisp
+++ b/cffi-epoll.lisp
@@ -33,16 +33,6 @@
        (unwind-protect (let ((,fdvar ,fd)) ,@body)
          (unistd:close ,fd)))))
 
-(defcunion epoll-data
-  (ptr :pointer)
-  (fd :int)
-  (u32 uint32-t)
-  (u64 uint64-t))
-
-(defcstruct epoll-event
-  (events uint32-t)
-  (data (:union epoll-data)))
-
 (defcfun ("epoll_ctl" c-epoll-ctl) :int
   (epfd :int)
   (op :int)
diff --git a/grovel-epoll.lisp b/grovel-epoll.lisp
index e9935df..21e0bb9 100644
--- a/grovel-epoll.lisp
+++ b/grovel-epoll.lisp
@@ -35,3 +35,13 @@
 (constant (+hup+       "EPOLLHUP"))
 (constant (+et+        "EPOLLET"))
 (constant (+exclusive+ "EPOLLEXCLUSIVE"))
+
+(cunion epoll-data "union epoll_data"
+  (ptr "ptr" :type :pointer)
+  (fd "fd" :type :int)
+  (u32 "u32" :type uint32-t)
+  (u64 "u64" :type uint64-t))
+
+(cstruct epoll-event "struct epoll_event"
+  (events "events" :type uint32-t)
+  (data "data" :type (:union epoll-data)))