Coverage report: /home/ellis/.stash/lisp/cl-plus-ssl/src/config.lisp

KindCoveredAll%
expression09 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
2
 ;;;
3
 ;;; Copyright (C) contributors as per cl+ssl git history
4
 ;;;
5
 ;;; See LICENSE for details.
6
 
7
 (in-package :cl-user)
8
 
9
 (defpackage :cl+ssl/config
10
   (:documentation "By default cl+ssl searches for OpenSSL shared libraries
11
 in platform-dependent default locations.
12
 
13
 To explicitly specify what to load, use the cl+ssl/config
14
 module before loading cl+ssl:
15
 
16
     (ql:quickload \"cl+ssl/config\")
17
     (cl+ssl/config:define-libssl-path \"/opt/local/lib/libssl.dylib\")
18
     (cl+ssl/config:define-libcrypto-path \"/opt/local/lib/libcrypto.dylib\")
19
     (ql:quickload \"cl+ssl\")
20
 
21
 The PATH parameter of those two macros is not evaluated.
22
 This is dictated by CFFI. So either use a literal
23
 or compute it at the macro-expansion time.
24
 
25
 You may need to rebuild cl+ssl for the changed paths to have effect.
26
 This depends on CFFI and the FFI implementation of your Lisp.
27
 ")
28
   (:export #:define-libssl-path
29
            #:define-libcrypto-path)
30
   (:use :common-lisp))
31
 
32
 (in-package :cl+ssl/config)
33
 
34
 (defvar *libssl-override* nil)
35
 (defvar *libcrypto-override* nil)
36
 
37
 (defmacro define-libssl-path (path)
38
   "Define the path where libssl resides to be PATH (not evaluated). This
39
 macro should be used before loading CL+SSL.
40
 "
41
   `(progn
42
      (cffi:define-foreign-library libssl (t ,path))
43
      (setq *libssl-override* t)))
44
 
45
 (defmacro define-libcrypto-path (path)
46
   "Define the path where libcrypto resides to be PATH (not evaluated). This
47
 macro should be used before loading CL+SSL.
48
 "
49
   `(progn
50
      (cffi:define-foreign-library libcrypto (t ,path))
51
      (setq *libcrypto-override* t)))
52
 
53
 
54
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55
 ;; The above package replaces now _deprecated_ *FEATURES* flag
56
 ;; :CL+SSL-FOREIGN-LIBS-ALREADY-LOADED
57
 ;;
58
 ;; The flag allows user to load himself the
59
 ;; libssl / libcrypto (and libeay32 on Windows),
60
 ;; thus choosing the foreigh library(-ies) path and version to load.
61
 ;;
62
 ;; You will probably need to recompile CL+SSL for the feature to take
63
 ;; effect.
64
 ;;
65
 ;; If specified, neither loading of the cl+ssl ASDF system nor
66
 ;; (cl+ssl:reload) try to load the foreign libraries, assuming
67
 ;; user has loaded them already.
68
 ;;
69
 ;; The _deprecated_ usage example:
70
 ;;
71
 ;;     (cffi:load-foreign-library "libssl.so.1.0.0")
72
 ;;
73
 ;;     (let ((*features* (cons :cl+ssl-foreign-libs-already-loaded
74
 ;;                             *features*)))
75
 ;;
76
 ;;     (ql:quickload :a-system-which-depends-on-cl+ssl)
77
 ;;
78
 ;;     ;; or just load cl+ssl
79
 ;;     (ql:quickload :cl+ssl))
80
 ;;
81
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;