;; gdbm.ffi				-*- Scheme -*-

;; Copyright (C) 2018 Matthew R. Wette
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
;; License as published by the Free Software Foundation; either
;; version 3 of the License, or (at your option) any later version.
;;
;; This library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with this library; if not, see <http://www.gnu.org/licenses/>

(define-ffi-module (ffi gdbm)
  #:include '("gdbm.h")
  #:library '("libgdbm"))

;; I think GDBM_FILE are not defined and used consistently.
(define-fh-pointer-type GDBM_FILE* GDBM_FILE*-desc
  GDBM_FILE*? make-GDBM_FILE*)
(export GDBM_FILE* GDBM_FILE*? make-GDBM_FILE*)

;; This is needed but not generated by default by compile-ffi.
;; needed on my mac (version?) but not on ubuntu 16.04
;; so we may need to deal with versions : ugh
#|
(define-fh-pointer-type gdbm_count_t* (bs:pointer gdbm_count_t-desc)
  gdbm_count_t*? make-gdbm_count_t*)
(export gdbm_count_t* gdbm_count_t*? make-gdbm_count_t*)
|#

;; --- last line ---
