Common Lisp Package: EV

README:

cl-ev cl-ev is an attempt at cffi bindings for libev.

API Support We support the following watchers:

  • Periodic
  • IO
  • Timer
  • Idle

TODO Support the following watchers:

  • Signal
  • Child
  • Stat
  • Fork

Example Usage This is a port of the example libev program.

`common-lisp (ql:quickload :ev) (in-package :ev)

(defparameter io-handler (make-instance 'ev-io-watcher)) (defparameter timer-handler (make-instance 'ev-timer)) (defparameter periodic-handler (make-instance 'ev-periodic))

(defun io-cb (loop watcher events) (format t "IO Callback hit! loop ~S watcher ~S events ~S~%" loop watcher events))

(defun timer-cb (loop watcher events) (format t "Timer Callback hit! loop ~S watcher ~S events ~S~%" loop watcher events))

(defun periodic-cb (loop watcher events) (format t "Periodic Callback hit! loop ~S watcher ~S events ~S~%" loop watcher events))

(defun run-loop () (let ((l (make-instance 'ev-loop))) (set-timer l timer-handler #'timer-cb 5.5d0) (set-io-watcher l io-handler 0 EV_READ #'io-cb) (set-perodic l periodic-handler #'periodic-cb 0.0d0 10.0d0 nil) (event-dispatch l))) `

FUNCTION

Public

Undocumented

EV_NOW (LOOP)

Private

Undocumented

CALLBACK-KEY (WATCHER)

EV_ASYNC_SEND (LOOP W)

EV_ASYNC_START (LOOP W)

EV_ASYNC_STOP (LOOP W)

EV_BACKEND (LOOP)

EV_BREAK (LOOP HOW)

EV_CHECK_START (LOOP W)

EV_CHECK_STOP (LOOP W)

EV_CHILD_START (LOOP W)

EV_CHILD_STOP (LOOP W)

EV_CLEANUP_START (LOOP W)

EV_CLEANUP_STOP (LOOP W)

EV_CLEAR_PENDING (LOOP W)

EV_DEFAULT_DESTROY

EV_DEFAULT_FORK

EV_DEFAULT_LOOP (FLAGS)

EV_DEFAULT_LOOP_UC_

EV_DEPTH (LOOP)

EV_EMBED_START (LOOP W)

EV_EMBED_STOP (LOOP W)

EV_EMBED_SWEEP (LOOP W)

EV_EMBEDDABLE_BACKENDS

EV_FEED_EVENT (LOOP W REVENTS)

EV_FEED_FD_EVENT (LOOP FD REVENTS)

EV_FEED_SIGNAL (SIGNUM)

EV_FEED_SIGNAL_EVENT (LOOP SIGNUM)

EV_FORK_START (LOOP W)

EV_FORK_STOP (LOOP W)

EV_IDLE_INIT (EV CB)

EV_IDLE_START (LOOP W)

EV_IDLE_STOP (LOOP W)

EV_INIT (EV CB_)

EV_INVOKE (LOOP W REVENTS)

EV_INVOKE_PENDING (LOOP)

EV_IO_INIT (EV CB FD EVENTS)

EV_IO_SET (EV FD_ EVENTS_)

EV_IO_START (LOOP W)

EV_IO_STOP (LOOP W)

EV_IS_ACTIVE (EV)

EV_IS_DEFAULT_LOOP (LOOP)

EV_IS_PENDING (EV)

EV_ITERATION (LOOP)

EV_LOOP (LOOP FLAGS)

EV_LOOP_COUNT (LOOP)

EV_LOOP_DEPTH (LOOP)

EV_LOOP_DESTROY (LOOP)

EV_LOOP_FORK (LOOP)

EV_LOOP_NEW (FLAGS)

EV_LOOP_VERIFY (LOOP)

EV_NOW_UPDATE (LOOP)

EV_ONCE (LOOP FD EVENTS TIMEOUT CB ARG)

EV_PENDING_COUNT (LOOP)

EV_PERIODIC_AGAIN (LOOP W)

EV_PERIODIC_INIT (EV CB OFFSET INTERVAL RESCHED-CB)

EV_PERIODIC_SET (EV _OFFSET _INTERVAL RESCHED-CB)

EV_PERIODIC_START (LOOP W)

EV_PERIODIC_STOP (LOOP W)

EV_PREPARE_START (LOOP W)

EV_PREPARE_STOP (LOOP W)

EV_REF (LOOP)

EV_RESUME (LOOP)

EV_RUN (LOOP FLAGS)

EV_SET_ALLOCATOR (CB)

EV_SET_INVOKE_PENDING_CB (LOOP INVOKE_PENDING_CB)

EV_SET_IO_COLLECT_INTERVAL (LOOP INTERVAL)

EV_SET_LOOP_RELEASE_CB (LOOP RELEASE ACQUIRE)

EV_SET_SYSERR_CB (CB)

EV_SET_TIMEOUT_COLLECT_INTERVAL (LOOP INTERVAL)

EV_SET_USERDATA (LOOP DATA)

EV_SIGNAL_START (LOOP W)

EV_SIGNAL_STOP (LOOP W)

EV_SLEEP (DELAY)

EV_STAT_START (LOOP W)

EV_STAT_STAT (LOOP W)

EV_STAT_STOP (LOOP W)

EV_SUPPORTED_BACKENDS

EV_SUSPEND (LOOP)

EV_TIME

EV_TIMER_AGAIN (LOOP W)

EV_TIMER_INIT (EV CB AFTER REPEAT)

EV_TIMER_REMAINING (LOOP W)

EV_TIMER_SET (EV AFTER_ REPEAT_)

EV_TIMER_START (LOOP W)

EV_TIMER_STOP (LOOP W)

EV_UNLOOP (LOOP HOW)

EV_UNREF (LOOP)

EV_USERDATA (LOOP)

EV_VERIFY (LOOP)

EV_VERSION_MAJOR

EV_VERSION_MINOR

SET-WATCHER-TYPE-SLOT (WATCHER TYPE SLOT VALUE)

SWIG-LISPIFY (NAME FLAG &OPTIONAL (PACKAGE *PACKAGE*))

WATCHER-TYPE-SLOT (WATCHER TYPE SLOT)

MACRO

Private

DEFANONENUM (&BODY ENUMS)

Converts anonymous enums to defconstants.

GENERIC-FUNCTION

Public

Undocumented

EVENT-DISPATCH (EV-LOOP &OPTIONAL START-WATCHERS)

SET-IDLE (EV-LOOP WATCHER FUNCTION)

SET-IO-WATCHER (EV-LOOP WATCHER FD EVENT-TYPE FUNCTION)

SET-TIMER (EV-LOOP WATCHER FUNCTION TIMEOUT &KEY REPEAT (REPEAT 0.0d0))

START-WATCHER (LOOP WATCHER)

STOP-WATCHER (LOOP WATCHER &KEY KEEP-CALLBACK &ALLOW-OTHER-KEYS)

WATCHER-ACTIVE-P (WATCHER)

WATCHER-SLOT (WATCHER SLOT)

Private

Undocumented

EV-CALLBACK (EV-LOOP WATCHER EVENTS)

SET-PERODIC (LOOP WATCHER CB OFFSET INTERVAL RESCHEDULE-CB)

SET-WATCHER-SLOT (WATCHER SLOT VALUE)

SLOT-ACCESSOR

Private

EVENT-LOOP (OBJECT)

the libev event_loop

SETFEVENT-LOOP (NEW-VALUE OBJECT)

the libev event_loop

Undocumented

EV-POINTER (OBJECT)

SETFEV-POINTER (NEW-VALUE OBJECT)

VARIABLE

Private

Undocumented

*CALLBACKS*

*LOOPS*

*RESCHEDULE-CALLBACKS*

*WATCHERS*

CLASS

Public

Undocumented

EV-IDLE

EV-IO-WATCHER

EV-LOOP

EV-TIMER

EV-WATCHER

Private

Undocumented

EV-PERIODIC

EV_ASYNC-TCLASS

EV_CHECK-TCLASS

EV_CHILD-TCLASS

EV_CLEANUP-TCLASS

EV_EMBED-TCLASS

EV_FORK-TCLASS

EV_IDLE-TCLASS

EV_IO-TCLASS

EV_PERIODIC-TCLASS

EV_PREPARE-TCLASS

EV_SIGNAL-TCLASS

EV_STAT-TCLASS

EV_TIMER-TCLASS

EV_WATCHER-TCLASS

EV_WATCHER_LIST-TCLASS

EV_WATCHER_TIME-TCLASS

CONSTANT

Public

Undocumented

EV_READ

EV_WRITE

Private

Undocumented

EV__IOFDSET

EV_ASYNC

EV_ASYNC_ENABLE

EV_CHECK

EV_CHECK_ENABLE

EV_CHILD

EV_CHILD_ENABLE

EV_CLEANUP

EV_CLEANUP_ENABLE

EV_COMPAT3

EV_CUSTOM

EV_EMBED

EV_EMBED_ENABLE

EV_ERROR

EV_FEATURE_API

EV_FEATURE_BACKENDS

EV_FEATURE_CODE

EV_FEATURE_CONFIG

EV_FEATURE_DATA

EV_FEATURE_OS

EV_FEATURE_WATCHERS

EV_FEATURES

EV_FORK

EV_FORK_ENABLE

EV_IDLE

EV_IDLE_ENABLE

EV_IO

EV_MAXPRI

EV_MINPRI

EV_MULTIPLICITY

EV_NONE

EV_PERIODIC

EV_PERIODIC_ENABLE

EV_PREPARE

EV_PREPARE_ENABLE

EV_PROTOTYPES

EV_SIGNAL

EV_SIGNAL_ENABLE

EV_STAT

EV_STAT_ENABLE

EV_TIMEOUT

EV_TIMER

EV_UNDEF

EV_VERSION_MAJOR

EV_VERSION_MINOR

EV_WALK_ENABLE

EVBACKEND_ALL

EVBACKEND_DEVPOLL

EVBACKEND_EPOLL

EVBACKEND_KQUEUE

EVBACKEND_MASK

EVBACKEND_POLL

EVBACKEND_PORT

EVBACKEND_SELECT

EVBREAK_ALL

EVBREAK_CANCEL

EVBREAK_ONE

EVFLAG_AUTO

EVFLAG_FORKCHECK

EVFLAG_NOENV

EVFLAG_NOINOTIFY

EVFLAG_NOSIGFD

EVFLAG_NOSIGMASK

EVFLAG_SIGNALFD

EVRUN_NOWAIT

EVRUN_ONCE