;; epoll.ffi				-*- Scheme -*-

;; Copyright (C) 2018 Matthew R. Wette
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
;; License as published by the Free Software Foundation; either
;; version 3 of the License, or (at your option) any later version.
;;
;; This library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with this library; if not, see <http://www.gnu.org/licenses/>

;; Epoll has a packed structure that should be translated properly to 
;; bytestructure definition.

(define-ffi-module (ffi epoll)
  #:include '("sys/epoll.h"))

(define-public EPOLL (make-symtab-function ffi-epoll-symbol-tab "EPOLL"))

(define-public (make-epoll-event . args)
  (apply logand (map unwrap-enum-EPOLL_EVENTS args)))

;; --- last line ---
