;; libssh.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 libssh)
  #:pkg-config "libssh"
  #:include '("libssh/libssh.h")
  #:inc-filter (lambda (file-spec path-spec)
                 (string-contains path-spec "libssh/" 0)))

(define-public libssh-symval ffi-libssh-symbol-val)

(define-public ssh_channel*-desc (bs:pointer  ssh_channel-desc))
(define-fh-pointer-type ssh_channel* 
  ssh_channel*-desc ssh_channel*? make-ssh_channel*)
(export ssh_channel* ssh_channel*? make-ssh_channel*)
(fh-ref<=>deref! ssh_channel* make-ssh_channel* ssh_channel make-ssh_channel)

(define-public ssh_key*-desc (bs:pointer  ssh_key-desc))
(define-fh-pointer-type ssh_key* ssh_key*-desc ssh_key*? make-ssh_key*)
(export ssh_key* ssh_key*? make-ssh_key*)
(fh-ref<=>deref! ssh_key* make-ssh_key* ssh_key make-ssh_key)

(define-public ssh_session*-desc (bs:pointer  ssh_session-desc))
(define-fh-pointer-type ssh_session* 
  ssh_session*-desc ssh_session*? make-ssh_session*)
(export ssh_session* ssh_session*? make-ssh_session*)
(fh-ref<=>deref! ssh_session* make-ssh_session* ssh_session make-ssh_session)

(define-public ssh_string*-desc (bs:pointer  ssh_string-desc))
(define-fh-pointer-type ssh_string* 
  ssh_string*-desc ssh_string*? make-ssh_string*)
(export ssh_string* ssh_string*? make-ssh_string*)
(fh-ref<=>deref! ssh_string* make-ssh_string* ssh_string make-ssh_string)


;; --- last line ---
