From 747c71e7f428df78bf1fd0c9f1bea7c1a1bd2494 Mon Sep 17 00:00:00 2001
From: unknown <jkovacic@.(none)>
Date: Sat, 19 Nov 2011 14:15:21 +0100
Subject: [PATCH 3/3] Ticket 228: added an example to the
 libssh2_session_supported_algs(3) manpage

---
 docs/libssh2_session_supported_algs.3 |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/docs/libssh2_session_supported_algs.3 b/docs/libssh2_session_supported_algs.3
index a5719a2..c36aef2 100644
--- a/docs/libssh2_session_supported_algs.3
+++ b/docs/libssh2_session_supported_algs.3
@@ -21,6 +21,31 @@ must be called before calling this function, otherwise only "none" will be retur
 
 If successful, the function will allocate and fill the array with supported algorithms (the same names as defined in RFC 4253).
 The array is not NULL terminated.
+.SH EXAMPLE
+#include "libssh2.h"
+
+const char **algorithms;
+int rc, i;
+LIBSSH2_SESSION *session;
+
+/* initilize session */
+session = libssh2_session_init();
+rc = libssh2_session_supported_algs(session, 
+                                    LIBSSH2_METHOD_CRYPT_CS, 
+                                    &algorithms);
+if (rc>0) {
+    /* the call succeeded, do sth. with the list of algorithms
+       (e.g. list them)... */
+    printf("Supported symmetric algorithms:\n");
+    for ( i=0; i<rc; i++ )
+        printf("\t%s\n", algorithms[i]);
+
+    /* ... and free the allocated memory when not needed anymore */
+    libssh2_free(session, algorithms);
+}
+else {
+    /* call failed, error handling */
+}
 .SH RETURN VALUE
 On success, a number of returned algorithms (i.e a positive number will be returned).
 In case of a failure, an error code (a negative number, see below) is returned.
-- 
1.7.6.msysgit.0

