2 * Copyright (C) 2008-2012 Free Software Foundation, Inc.
3 * Author: Nikos Mavrogiannopoulos
5 * This file is part of GnuTLS.
7 * GnuTLS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuTLS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include <gnutls/gnutls.h>
26 #include <gnutls/x509.h>
27 #include <gnutls/openpgp.h>
30 static void main_texinfo (void);
31 static void main_latex(void);
36 main (int argc
, char *argv
[])
46 static void main_texinfo (void)
51 gnutls_kx_algorithm_t kx
;
52 gnutls_cipher_algorithm_t cipher
;
53 gnutls_mac_algorithm_t mac
;
54 gnutls_protocol_t version
;
56 printf ("@multitable @columnfractions .55 .10 .30\n@anchor{tab:alerts}\n");
57 printf ("@headitem Alert @tab ID @tab Description\n");
58 for (i
= 0; i
<256;i
++)
60 if (gnutls_alert_get_strname(i
)==NULL
) continue;
61 printf ("@item %s\n@tab %d\n@tab %s\n",
62 escape_texi_string(gnutls_alert_get_strname(i
), buffer
, sizeof(buffer
)),
63 (unsigned int) i
, gnutls_alert_get_name (i
));
65 printf ("@end multitable\n");
70 static const char headers
[] = "\\tablefirsthead{%\n"
72 "Alert & ID & Description\\\\\n"
77 "\\multicolumn{3}{|l|}{\\small\\sl continued from previous page}\\\\\n"
81 "\\multicolumn{3}{|r|}{\\small\\sl continued on next page}\\\\\n"
84 "\\tablelasttail{\\hline}\n"
85 "\\bottomcaption{The TLS alert table}\n\n";
87 static void main_latex(void)
95 printf("\\begin{supertabular}{|p{.50\\linewidth}|p{.07\\linewidth}|p{.34\\linewidth}|}\n\\label{tab:alerts}\n");
100 gnutls_kx_algorithm_t kx
;
101 gnutls_cipher_algorithm_t cipher
;
102 gnutls_mac_algorithm_t mac
;
103 gnutls_protocol_t version
;
105 for (i
= 0; i
<256;i
++)
107 if (gnutls_alert_get_strname(i
)==NULL
) continue;
108 printf ("{\\small{%s}} & \\code{%d} & %s",
109 escape_string(gnutls_alert_get_strname(i
), buffer
, sizeof(buffer
)),
110 (unsigned int) i
, gnutls_alert_get_name (i
));
114 printf("\\end{supertabular}\n\n");