Mercurial > emacs
annotate src/gnutls.h @ 111207:a8b7e7d8b686
* test/indent/octave.m: Add a test to ensure indentation is local.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 27 Oct 2010 10:48:05 -0400 |
parents | af2db97ca17a |
children | 6378d1b57038 |
rev | line source |
---|---|
110584 | 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 | |
110611
6c735824d0c1
Add gnutls logging and clean up various gnutls bits.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110584
diff
changeset
|
49 #define GNUTLS_LOG(level, max, string) if (level <= max) { gnutls_log_function (level, "(Emacs) " string); } |
6c735824d0c1
Add gnutls logging and clean up various gnutls bits.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110584
diff
changeset
|
50 |
110745
af2db97ca17a
Rework the gnutls boot interface.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110648
diff
changeset
|
51 #define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { gnutls_log_function2 (level, "(Emacs) " string, extra); } |
af2db97ca17a
Rework the gnutls boot interface.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110648
diff
changeset
|
52 |
110584 | 53 int |
110648
256dd50b2a63
Make sure all reads/writes to gnutls streams go via the gnutls functions.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110611
diff
changeset
|
54 emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, |
110584 | 55 unsigned int nbyte); |
56 int | |
110648
256dd50b2a63
Make sure all reads/writes to gnutls streams go via the gnutls functions.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110611
diff
changeset
|
57 emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, |
110584 | 58 unsigned int nbyte); |
59 | |
60 extern void syms_of_gnutls (void); | |
61 | |
62 #endif | |
63 | |
64 #endif |