annotate src/gnutls.h @ 111002:62243368de05

shr.el (shr-insert): Remove space inserted before or after a breakable character or at the beginning or the end of a line. shr.el (shr-find-fill-point): Do kinsoku; find the second best point or give it up if there's no breakable point.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 15 Oct 2010 08:10:56 +0000
parents af2db97ca17a
children 6378d1b57038
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
110584
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
1 /* GnuTLS glue for GNU Emacs.
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
2 Copyright (C) 2010 Free Software Foundation, Inc.
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
3
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
5
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
6 GNU Emacs is free software: you can redistribute it and/or modify
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
8 the Free Software Foundation, either version 3 of the License, or
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
9 (at your option) any later version.
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
10
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
14 GNU General Public License for more details.
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
15
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
18
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
19 #ifndef EMACS_GNUTLS_DEFINED
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
20 #define EMACS_GNUTLS_DEFINED
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
21
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
22 #ifdef HAVE_GNUTLS
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
23 #include <gnutls/gnutls.h>
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
24
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
25 typedef enum
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
26 {
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
27 /* Initialization stages. */
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
28 GNUTLS_STAGE_EMPTY = 0,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
29 GNUTLS_STAGE_CRED_ALLOC,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
30 GNUTLS_STAGE_FILES,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
31 GNUTLS_STAGE_INIT,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
32 GNUTLS_STAGE_PRIORITY,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
33 GNUTLS_STAGE_CRED_SET,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
34
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
35 /* Handshake stages. */
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
36 GNUTLS_STAGE_HANDSHAKE_CANDO = GNUTLS_STAGE_CRED_SET,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
37 GNUTLS_STAGE_TRANSPORT_POINTERS_SET,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
38 GNUTLS_STAGE_HANDSHAKE_TRIED,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
39
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
40 GNUTLS_STAGE_READY,
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
41 } gnutls_initstage_t;
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
42
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
43 #define GNUTLS_EMACS_ERROR_INVALID_TYPE GNUTLS_E_APPLICATION_ERROR_MIN
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
44
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
45 #define GNUTLS_INITSTAGE(proc) (XPROCESS (proc)->gnutls_initstage)
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
46
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
47 #define GNUTLS_PROCESS_USABLE(proc) (GNUTLS_INITSTAGE(proc) >= GNUTLS_STAGE_READY)
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
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
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
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
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
55 unsigned int nbyte);
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
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
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
58 unsigned int nbyte);
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
59
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
60 extern void syms_of_gnutls (void);
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
61
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
62 #endif
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
63
9d94d76ce611 Set up GnuTLS support.
Ted Zlatanov <tzz@lifelogs.com>
parents:
diff changeset
64 #endif