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

KindCoveredAll%
expression044 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+ssl)
8
 
9
 (defun make-buffer (size)
10
   (cffi:make-shareable-byte-vector size))
11
 
12
 (defun buffer-length (buf)
13
   (length buf))
14
 
15
 (defun buffer-elt (buf index)
16
   (elt buf index))
17
 (defun set-buffer-elt (buf index val)
18
   (setf (elt buf index) val))
19
 (defsetf buffer-elt set-buffer-elt)
20
 
21
 (defun s/b-replace (seq buf &key (start1 0) end1 (start2 0) end2)
22
   (replace seq buf :start1 start1 :end1 end1 :start2 start2 :end2 end2))
23
 (defun b/s-replace (buf seq &key (start1 0) end1 (start2 0) end2)
24
   (replace buf seq :start1 start1 :end1 end1 :start2 start2 :end2 end2))
25
 
26
 (defmacro with-pointer-to-vector-data ((ptr buf) &body body)
27
   `(cffi:with-pointer-to-vector-data (,ptr ,buf)
28
     ,@body))