comparison src/gnutls.h @ 110584:9d94d76ce611

Set up GnuTLS support. * configure.in: Set up GnuTLS. * lisp/net/gnutls.el: GnuTLS glue code to set up a connection. * src/Makefile.in (LIBGNUTLS_LIBS, LIBGNUTLS_CFLAGS, ALL_CFLAGS) (obj, LIBES): Set up GnuTLS support. * src/config.in: Set up GnuTLS support. * src/emacs.c: Set up GnuTLS support and call syms_of_gnutls. * src/gnutls.c: The source code for GnuTLS support in Emacs. * src/gnutls.h: The GnuTLS glue for Emacs, macros and enums. * src/process.c (make_process, Fstart_process) (read_process_output, send_process): Set up GnuTLS support for process input/output file descriptors. * src/process.h: Set up GnuTLS support.
author Ted Zlatanov <tzz@lifelogs.com>
date Sun, 26 Sep 2010 01:06:28 -0500
parents
children 6c735824d0c1
comparison
equal deleted inserted replaced
110583:b6d2a63ad993 110584:9d94d76ce611
1 /* GnuTLS glue for GNU Emacs.
2 Copyright (C) 2010 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18
19 #ifndef EMACS_GNUTLS_DEFINED
20 #define EMACS_GNUTLS_DEFINED
21
22 #ifdef HAVE_GNUTLS
23 #include <gnutls/gnutls.h>
24
25 typedef enum
26 {
27 /* Initialization stages. */
28 GNUTLS_STAGE_EMPTY = 0,
29 GNUTLS_STAGE_CRED_ALLOC,
30 GNUTLS_STAGE_FILES,
31 GNUTLS_STAGE_INIT,
32 GNUTLS_STAGE_PRIORITY,
33 GNUTLS_STAGE_CRED_SET,
34
35 /* Handshake stages. */
36 GNUTLS_STAGE_HANDSHAKE_CANDO = GNUTLS_STAGE_CRED_SET,
37 GNUTLS_STAGE_TRANSPORT_POINTERS_SET,
38 GNUTLS_STAGE_HANDSHAKE_TRIED,
39
40 GNUTLS_STAGE_READY,
41 } gnutls_initstage_t;
42
43 #define GNUTLS_EMACS_ERROR_INVALID_TYPE GNUTLS_E_APPLICATION_ERROR_MIN
44
45 #define GNUTLS_INITSTAGE(proc) (XPROCESS (proc)->gnutls_initstage)
46
47 #define GNUTLS_PROCESS_USABLE(proc) (GNUTLS_INITSTAGE(proc) >= GNUTLS_STAGE_READY)
48
49 int
50 emacs_gnutls_write (int fildes, gnutls_session_t state, char *buf,
51 unsigned int nbyte);
52 int
53 emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf,
54 unsigned int nbyte);
55
56 extern void syms_of_gnutls (void);
57
58 #endif
59
60 #endif