libssh2_version.3 (1232B)
1.TH libssh2_version 3 "23 Feb 2009" "libssh2" "libssh2" 2.SH NAME 3libssh2_version - return the libssh2 version number 4.SH SYNOPSIS 5.nf 6#include <libssh2.h> 7 8const char * 9libssh2_version(int required_version); 10.fi 11.SH DESCRIPTION 12If \fIrequired_version\fP is lower than or equal to the version number of the 13libssh2 in use, the version number of libssh2 is returned as a pointer to a 14zero terminated string. 15 16The \fIrequired_version\fP should be the version number as constructed by the 17LIBSSH2_VERSION_NUM define in the libssh2.h public header file, which is a 24 18bit number in the 0xMMmmpp format. MM for major, mm for minor and pp for patch 19number. 20.SH RETURN VALUE 21The version number of libssh2 is returned as a pointer to a zero terminated 22string or NULL if the \fIrequired_version\fP is not fulfilled. 23.SH EXAMPLE 24To make sure you run with the correct libssh2 version: 25 26.nf 27if(!libssh2_version(LIBSSH2_VERSION_NUM)) { 28 fprintf(stderr, \&"Runtime libssh2 version too old!\&"); 29 exit(1); 30} 31.fi 32 33Unconditionally get the version number: 34 35.nf 36printf(\&"libssh2 version: %s\&", libssh2_version(0)); 37.fi 38.SH AVAILABILITY 39This function was added in libssh2 1.1, in previous versions there way no way 40to extract this info in run-time.