changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/ffi/rocksdb/slicetransform.lisp

changeset 698: 96958d3eb5b0
parent: 57813b8ee029
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; rocksdb/slicetransform.lisp --- RocksDB SliceTransform
2 
3 ;; These are used primarily in transactions
4 
5 ;;; Refs:
6 
7 ;; https://rocksdb.org/blog/2017/08/24/pinnableslice.html
8 
9 ;; https://github.com/facebook/rocksdb/blob/main/include/rocksdb/slice_transform.h
10 
11 ;;; Code:
12 (in-package :rocksdb)
13 
14 (define-alien-type rocksdb-transform-function
15  (function (array unsigned-char)
16  (array unsigned-char)
17  size-t
18  (* size-t)))
19 
20 (define-alien-type rocksdb-in-domain-function
21  (function unsigned-char
22  (* t)
23  (array unsigned-char)
24  size-t))
25 
26 (define-alien-type rocksdb-in-range-function
27  (function unsigned-char
28  (* t)
29  (array unsigned-char)
30  size-t))
31 
32 (define-alien-routine rocksdb-slicetransform-create (* rocksdb-slicetransform)
33  (state (* t))
34  (destructor (* rocksdb-destructor-function))
35  (transform (* rocksdb-transform-function))
36  (in-domain (* rocksdb-in-domain-function))
37  (in-range (* rocksdb-in-range-function))
38  (name (* rocksdb-name-function)))
39 
40 (define-alien-routine rocksdb-slicetransform-create-noop (* rocksdb-slicetransform))
41 
42 (define-alien-routine rocksdb-slicetransform-create-fixed-prefix (* rocksdb-slicetransform)
43  (n size-t))
44 
45 (define-alien-routine rocksdb-slicetransform-destroy void (st (* rocksdb-slicetransform)))