demuxer.lisp 605 B

12345678910111213141516171819202122232425
  1. (in-package :hurd)
  2. ;; Defines a new internal demuxer port the portset-demuxer.
  3. (defcfun ("set_demuxer" %set-demuxer)
  4. :void
  5. (fun :pointer))
  6. (defcfun ("portset_demuxer" %portset-demuxer)
  7. :int
  8. (in :pointer)
  9. (out :pointer))
  10. (defmacro set-demuxer (fun)
  11. "Defines fun as the internal demuxer for portset-demuxer."
  12. (with-gensyms (callback-name)
  13. `(progn
  14. (defcallback ,callback-name :boolean
  15. ((port port)
  16. (in :pointer)
  17. (out :pointer))
  18. (funcall ,fun port in out))
  19. (%set-demuxer (callback ,callback-name)))))