set-options.lisp 816 B

123456789101112131415161718192021222324
  1. (in-package :hurd)
  2. (defcfun ("fsys_set_options" %fsys-set-options)
  3. err
  4. (fsys port)
  5. (data :pointer)
  6. (data-len msg-type-number)
  7. (do-children :boolean))
  8. (defun fsys-set-options (fsys &key options (do-children t))
  9. "Set the translator options. 'options' must be a translator options object. Pass T to 'do-children' to set options to children translator."
  10. (declare (type fixnum fsys)
  11. (type boolean do-children))
  12. (let* ((ls (get-translator-options options))
  13. (len-ls (string-list-len ls))
  14. (total (sum-list len-ls)))
  15. (with-foreign-pointer (ptr total)
  16. (list-to-foreign-string-zero-separated ls
  17. ptr
  18. len-ls)
  19. (select-error (%fsys-set-options fsys ptr total do-children)))))