Added GPG-ERROR library.
[iolib.git] / net.tls / wrappers.lisp
blobefcc69f7634b9b7e3c32b34abbcb9bdc6288cddd
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Indent-tabs-mode: NIL -*-
2 ;;;
3 ;;; wrappers.lisp --- Wrappers for initialization of GNUTLS and GCRYPT.
4 ;;;
5 ;;; Copyright (C) 2008, Stelian Ionescu <sionescu@common-lisp.net>
6 ;;;
7 ;;; This code is free software; you can redistribute it and/or
8 ;;; modify it under the terms of the version 2.1 of
9 ;;; the GNU Lesser General Public License as published by
10 ;;; the Free Software Foundation, as clarified by the
11 ;;; preamble found here:
12 ;;; http://opensource.franz.com/preamble.html
13 ;;;
14 ;;; This program is distributed in the hope that it will be useful,
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU Lesser General
20 ;;; Public License along with this library; if not, write to the
21 ;;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22 ;;; Boston, MA 02110-1301, USA
24 (in-package :net.tls)
26 (include "gcrypt.h" "errno.h" "pthread.h")
28 (c "GCRY_THREAD_OPTION_PTHREAD_IMPL;")
30 (defwrapper* "gcrypt_set_thread_cbs"
31 ("gcry_error_t" (errno-wrapper :unsigned-int
32 :error-predicate plusp
33 :error-generator signal-gpg-error))
35 "return gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);")