From 511a972a951ec0a8a2bc908f00327054d770165c Mon Sep 17 00:00:00 2001 From: Jernej Kovacic Date: Tue, 31 Jan 2012 23:05:03 +0100 Subject: [PATCH] session_supported_algs docs: added an example --- docs/libssh2_session_supported_algs.3 | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/libssh2_session_supported_algs.3 b/docs/libssh2_session_supported_algs.3 index ec542460..74f07771 100644 --- a/docs/libssh2_session_supported_algs.3 +++ b/docs/libssh2_session_supported_algs.3 @@ -1,4 +1,4 @@ -.TH libssh2_session_supported_algs 3 "23 Oct 2011" "libssh2 1.3.1" "libssh2 manual" +.TH libssh2_session_supported_algs 3 "23 Oct 2011" "libssh2 1.4.0" "libssh2 manual" .SH NAME libssh2_session_supported_algs - get list of supported algorithms .SH SYNOPSIS @@ -28,6 +28,32 @@ calling this function, otherwise only "none" will be returned. 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 +.nf +#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