1 /* GnuTLS --- Guile bindings for GnuTLS.
2 Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
4 GnuTLS is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 GnuTLS is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with GnuTLS; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
18 /* Written by Ludovic Courtès <ludo@chbouib.org>. */
25 #include <gnutls/gnutls.h>
30 SCM_SYMBOL (gnutls_error_key, "gnutls-error");
33 scm_gnutls_error (int c_err, const char *c_func)
37 /* Note: If error code C_ERR is unknown, then ERR will be `#f'. */
38 err = scm_from_gnutls_error (c_err);
39 func = scm_from_locale_symbol (c_func);
41 (void) scm_throw (gnutls_error_key, scm_list_2 (err, func));
43 /* XXX: This is actually never reached, but since the Guile headers don't
44 declare `scm_throw ()' as `noreturn', we must add this to avoid GCC's
51 scm_init_gnutls_error (void)
56 /* arch-tag: 48f07ecf-65c4-480c-b043-a51eab592d6b