summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-11-21 21:03:47 +0200
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-11-21 21:03:47 +0200
commitb18e915a5dc340ebeb8da589b41c9c3e33812562 (patch)
tree1db941301210fc94fb835248be95e8bb3a44f1ec /doc
parent8b14ab18cf5e5214ac3d28412e0c503e83a753c1 (diff)
parent3e3206f243ef69a3b0fd0c6e2a61aeb394fd3aa5 (diff)
downloadgnutls-b18e915a5dc340ebeb8da589b41c9c3e33812562.tar.gz
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/gnutls
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/Makefile.am8
-rw-r--r--doc/examples/ex-alert.c4
-rw-r--r--doc/examples/ex-client-psk.c2
-rw-r--r--doc/examples/ex-pkcs12.c6
-rw-r--r--doc/examples/ex-rfc2818.c4
-rw-r--r--doc/examples/ex-session-info.c2
-rw-r--r--doc/examples/ex-verify.c4
-rw-r--r--doc/examples/ex-x509-info.c2
-rw-r--r--doc/examples/examples.h26
-rw-r--r--doc/examples/tcp.c6
-rw-r--r--doc/reference/Makefile.am2
11 files changed, 53 insertions, 13 deletions
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index ecba23d680..004af4020f 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -19,8 +19,8 @@
# along with this file; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+AM_CFLAGS = $(WARN_CFLAGS)
AM_CPPFLAGS = \
- $(WARN_CFLAGS) \
-I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes \
-I$(top_srcdir)/libextra/includes \
-I$(top_srcdir)/gl -I$(top_builddir)/gl
@@ -43,7 +43,6 @@ endif
if ENABLE_CXX
ex_cxx_SOURCES = ex-cxx.cpp
-ex_cxx_CPPFLAGS = -I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes
ex_cxx_LDADD = $(CXX_LDADD)
noinst_PROGRAMS += ex-cxx
endif
@@ -70,5 +69,6 @@ endif
noinst_LTLIBRARIES = libexamples.la
-libexamples_la_SOURCES = ex-alert.c ex-pkcs12.c ex-rfc2818.c \
- ex-session-info.c ex-x509-info.c ex-verify.c tcp.c
+libexamples_la_SOURCES = examples.h ex-alert.c ex-pkcs12.c \
+ ex-rfc2818.c ex-session-info.c ex-x509-info.c ex-verify.c \
+ tcp.c
diff --git a/doc/examples/ex-alert.c b/doc/examples/ex-alert.c
index 7f5829925c..ba708a366c 100644
--- a/doc/examples/ex-alert.c
+++ b/doc/examples/ex-alert.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -13,6 +13,8 @@
#include <stdlib.h>
#include <gnutls/gnutls.h>
+#include "examples.h"
+
/* This function will check whether the given return code from
* a gnutls function (recv/send), is an alert, and will print
* that alert.
diff --git a/doc/examples/ex-client-psk.c b/doc/examples/ex-client-psk.c
index dc1b0f6a12..9d62ccfae0 100644
--- a/doc/examples/ex-client-psk.c
+++ b/doc/examples/ex-client-psk.c
@@ -36,7 +36,7 @@ main (void)
char buffer[MAX_BUF + 1];
const char *err;
gnutls_psk_client_credentials_t pskcred;
- const gnutls_datum_t key = { "DEADBEEF", 8 };
+ const gnutls_datum_t key = { (char*) "DEADBEEF", 8 };
gnutls_global_init ();
diff --git a/doc/examples/ex-pkcs12.c b/doc/examples/ex-pkcs12.c
index b017c85a45..23363c78d4 100644
--- a/doc/examples/ex-pkcs12.c
+++ b/doc/examples/ex-pkcs12.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -14,6 +14,8 @@
#include <gnutls/gnutls.h>
#include <gnutls/pkcs12.h>
+#include "examples.h"
+
#define OUTFILE "out.p12"
/* This function will write a pkcs12 structure into a file.
@@ -36,7 +38,7 @@ write_pkcs12 (const gnutls_datum_t * cert,
/* A good idea might be to use gnutls_x509_privkey_get_key_id()
* to obtain a unique ID.
*/
- gnutls_datum_t key_id = { "\x00\x00\x07", 3 };
+ gnutls_datum_t key_id = { (char*) "\x00\x00\x07", 3 };
gnutls_global_init ();
diff --git a/doc/examples/ex-rfc2818.c b/doc/examples/ex-rfc2818.c
index 49fd7b608d..010fb30d67 100644
--- a/doc/examples/ex-rfc2818.c
+++ b/doc/examples/ex-rfc2818.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -13,6 +13,8 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
+#include "examples.h"
+
/* This function will try to verify the peer's certificate, and
* also check if the hostname matches, and the activation, expiration dates.
*/
diff --git a/doc/examples/ex-session-info.c b/doc/examples/ex-session-info.c
index 6f1d07abaa..3ddbd3b38d 100644
--- a/doc/examples/ex-session-info.c
+++ b/doc/examples/ex-session-info.c
@@ -14,7 +14,7 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-extern void print_x509_certificate_info (gnutls_session_t);
+#include "examples.h"
/* This function will print some details of the
* given session.
diff --git a/doc/examples/ex-verify.c b/doc/examples/ex-verify.c
index e9337213bc..ab3f2c6dad 100644
--- a/doc/examples/ex-verify.c
+++ b/doc/examples/ex-verify.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -14,6 +14,8 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
+#include "examples.h"
+
/* All the available CRLs
*/
gnutls_x509_crl_t *crl_list;
diff --git a/doc/examples/ex-x509-info.c b/doc/examples/ex-x509-info.c
index d1433ab559..1fe3684100 100644
--- a/doc/examples/ex-x509-info.c
+++ b/doc/examples/ex-x509-info.c
@@ -14,6 +14,8 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
+#include "examples.h"
+
static const char *
bin2hex (const void *bin, size_t bin_size)
{
diff --git a/doc/examples/examples.h b/doc/examples/examples.h
new file mode 100644
index 0000000000..0667dc44be
--- /dev/null
+++ b/doc/examples/examples.h
@@ -0,0 +1,26 @@
+#ifndef EXAMPLES_H
+# define EXAMPLES_H
+
+void
+check_alert (gnutls_session_t session, int ret);
+
+int
+write_pkcs12 (const gnutls_datum_t * cert,
+ const gnutls_datum_t * pkcs8_key, const char *password);
+
+void
+verify_certificate (gnutls_session_t session, const char *hostname);
+
+int
+print_info (gnutls_session_t session);
+
+void
+print_x509_certificate_info (gnutls_session_t session);
+
+void
+verify_certificate_chain (gnutls_session_t session,
+ const char *hostname,
+ const gnutls_datum_t * cert_chain,
+ int cert_chain_length);
+
+#endif /* EXAMPLES_H */
diff --git a/doc/examples/tcp.c b/doc/examples/tcp.c
index ec390e623e..876e706057 100644
--- a/doc/examples/tcp.c
+++ b/doc/examples/tcp.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -20,6 +20,10 @@
#define SA struct sockaddr
+/* tcp.c */
+int tcp_connect (void);
+void tcp_close (int sd);
+
/* Connects to the peer and returns a socket
* descriptor.
*/
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 511b27aa0c..d71d67fefb 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -25,7 +25,7 @@ SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
-SCAN_OPTIONS=
+SCAN_OPTIONS=--deprecated-guards=ASN1_DISABLE_DEPRECATED
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml