Coverage report: /development/source/library/com/dydra/gitlab/dydra-cgi/ffi/lisp/spocq-ffi/package.lisp
| Kind | Covered | All | % |
| expression | 4 | 11 | 36.4 |
| branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
2
(:use :cl :cffi :cffi-sys)
3
(:export ;; package.lisp:
8
(in-package :spocq-ffi)
10
(eval-when (:compile-toplevel :load-toplevel :execute)
11
(pushnew #P"/opt/dydra/lib/" *foreign-library-directories* :test #'equal)
12
(define-foreign-library libspocq
13
(:unix (:or "libspocq.so.0" "libspocq.so"))
14
(:darwin (:or "libspocq.0.dylib" "libspocq.dylib"))
15
(t (:default "libspocq"))))
17
(defun load-library (&key path version debug features)
18
"Loads the libspocq native library.
19
Must be called before invoking any foreign functions in the library."
20
(declare (type boolean debug)
22
(load-foreign-library 'libspocq)
23
#| 20171001: initialization returns from the load-foreign-library,
25
(let ((spocq-core-build-id (symbol-value (find-symbol "*BUILD-REVISION*" "SPOCQ.I"))))
26
(when spocq-core-build-id
27
(handler-case (cffi:foreign-funcall "spocq_load" :string spocq-core-build-id :void)
28
(sb-kernel::undefined-alien-function-error () nil)))) |#
29
(values)) ;;; no meaningful return value
31
(defun unload-library ()
32
"Unloads the libspocq native library."
33
(close-foreign-library 'libspocq)
34
(values)) ;;; no meaningful return value