EXTRA_PROGRAMS = errcodes printlist alert-printlist
-errcodes_SOURCES = errcodes.c
+errcodes_SOURCES = errcodes.c common.c common.h
errcodes_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
-printlist_SOURCES = printlist.c
+printlist_SOURCES = printlist.c common.c common.h
printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
-alert_printlist_SOURCES = alert-printlist.c
+alert_printlist_SOURCES = alert-printlist.c common.c common.h
alert_printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
error_codes.texi: $(top_srcdir)/lib/gnutls_errors.c $(srcdir)/errcodes.c
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include <gnutls/openpgp.h>
+#include "common.h"
static void main_texinfo (void);
static void main_latex(void);
+char buffer[1024];
+
int
main (int argc, char *argv[])
{
{
if (gnutls_alert_get_strname(i)==NULL) continue;
printf ("@item %s\n@tab %d\n@tab %s\n",
- gnutls_alert_get_strname(i),
+ escape_texi_string(gnutls_alert_get_strname(i), buffer, sizeof(buffer)),
(unsigned int) i, gnutls_alert_get_name (i));
}
printf ("@end multitable\n");
"\\tablelasttail{\\hline}\n"
"\\bottomcaption{The TLS alert table}\n\n";
-static char* escape_string( const char* str)
-{
-static char buffer[500];
-int i = 0, j = 0;
-
-
-while( str[i] != 0 && j < sizeof(buffer) - 1) {
- if (str[i]=='_') {
- buffer[j++] = '\\';
- buffer[j++] = '_';
- } else {
- buffer[j++] = str[i];
- }
- i++;
-};
-
-buffer[j] = 0;
-
-return buffer;
-
-}
-
static void main_latex(void)
{
int i, j;
{
if (gnutls_alert_get_strname(i)==NULL) continue;
printf ("{\\small{%s}} & \\code{%d} & %s",
- escape_string(gnutls_alert_get_strname(i)),
+ escape_string(gnutls_alert_get_strname(i), buffer, sizeof(buffer)),
(unsigned int) i, gnutls_alert_get_name (i));
printf( "\\\\\n");
}
--- /dev/null
+char* escape_string( const char* str, char* buffer, int buffer_size)
+{
+int i = 0, j = 0;
+
+
+while( str[i] != 0 && j <buffer_size - 1) {
+ if (str[i]=='_') {
+ buffer[j++] = '\\';
+ buffer[j++] = '_';
+ buffer[j++] = '\\';
+ buffer[j++] = '-';
+ } else if (str[i]=='#') {
+ buffer[j++] = '\\';
+ buffer[j++] = '#';
+ } else {
+ buffer[j++] = str[i];
+ }
+ i++;
+};
+
+buffer[j] = 0;
+
+return buffer;
+
+}
+
+char* escape_texi_string( const char* str, char* buffer, int buffer_size)
+{
+int i = 0, j = 0;
+
+
+while( str[i] != 0 && j <buffer_size - 1) {
+ if (str[i]=='_') {
+ buffer[j++] = '_';
+ buffer[j++] = '@';
+ buffer[j++] = '-';
+ } else {
+ buffer[j++] = str[i];
+ }
+ i++;
+};
+
+buffer[j] = 0;
+
+return buffer;
+
+}
--- /dev/null
+char* escape_string( const char* str, char* buffer, int buffer_size);
+char* escape_texi_string( const char* str, char* buffer, int buffer_size);
#include <stdlib.h>
#include <string.h>
#include <gnutls/gnutls.h>
+#include "common.h"
static void main_latex(void);
static int main_texinfo (void);
return 0;
}
-static char* escape_texi_string( const char* str, char* buffer, int buffer_size)
-{
-int i = 0, j = 0;
-
-
-while( str[i] != 0 && j <buffer_size - 1) {
- if (str[i]=='_') {
- buffer[j++] = '_';
- buffer[j++] = '@';
- buffer[j++] = '-';
- } else {
- buffer[j++] = str[i];
- }
- i++;
-};
-
-buffer[j] = 0;
-
-return buffer;
-
-}
-
static int main_texinfo (void)
{
int i, j;
return 0;
}
-static char* escape_string( const char* str, char* buffer, int buffer_size)
-{
-int i = 0, j = 0;
-
-
-while( str[i] != 0 && j <buffer_size - 1) {
- if (str[i]=='_') {
- buffer[j++] = '\\';
- buffer[j++] = '_';
- buffer[j++] = '\\';
- buffer[j++] = '-';
- } else if (str[i]=='#') {
- buffer[j++] = '\\';
- buffer[j++] = '#';
- } else {
- buffer[j++] = str[i];
- }
- i++;
-};
-
-buffer[j] = 0;
-
-return buffer;
-
-}
-
static void main_latex(void)
{
int i, j;
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include <gnutls/openpgp.h>
+#include "common.h"
static void main_texinfo (void);
static void main_latex(void);
+char buffer[1024];
+
int
main (int argc, char *argv[])
{
(i, id, &kx, &cipher, &mac, &version)); i++)
{
printf ("@item %s\n@tab 0x%02X 0x%02X\n@tab %s\n",
- name,
+ escape_texi_string(name, buffer, sizeof(buffer)),
(unsigned char) id[0], (unsigned char) id[1],
gnutls_protocol_get_name (version));
}
"\\tablelasttail{\\hline}\n"
"\\bottomcaption{The ciphersuites table}\n\n";
-static char* escape_string( const char* str)
-{
-static char buffer[500];
-int i = 0, j = 0;
-
-
-while( str[i] != 0 && j < sizeof(buffer) - 1) {
- if (str[i]=='_') {
- buffer[j++] = '\\';
- buffer[j++] = '_';
- } else {
- buffer[j++] = str[i];
- }
- i++;
-};
-
-buffer[j] = 0;
-
-return buffer;
-
-}
-
static void main_latex(void)
{
int i, j;
(i, id, &kx, &cipher, &mac, &version)); i++)
{
printf ("{\\small{%s}} & \\code{0x%02X 0x%02X} & %s",
- escape_string(name),
+ escape_string(name, buffer, sizeof(buffer)),
(unsigned char) id[0], (unsigned char) id[1],
gnutls_protocol_get_name (version));
printf( "\\\\\n");