1libssh2_version(3) libssh2 manual libssh2_version(3)
2
3
4
6 libssh2_version - return the libssh2 version number
7
9 #include <libssh2.h>
10
11 const char * libssh2_version(int required_version);
12
14 If required_version is lower than or equal to the version number of the
15 libssh2 in use, the version number of libssh2 is returned as a pointer
16 to a zero terminated string.
17
18 The required_version should be the version number as constructed by the
19 LIBSSH2_VERSION_NUM define in the libssh2.h public header file, which
20 is a 24 bit number in the 0xMMmmpp format. MM for major, mm for minor
21 and pp for patch number.
22
24 The version number of libssh2 is returned as a pointer to a zero termiā
25 nated string or NULL if the required_version isn't fulfilled.
26
28 To make sure you run with the correct libssh2 version:
29
30 if (!libssh2_version(LIBSSH2_VERSION_NUM)) {
31 fprintf (stderr, "Runtime libssh2 version too old!");
32 exit(1);
33 }
34
35 Unconditionally get the version number:
36
37 printf("libssh2 version: %s", libssh2_version(0) );
38
40 This function was added in libssh2 1.1, in previous versions there way
41 no way to extract this info in run-time.
42
43
44
45libssh2 1.1 23 Feb 2009 libssh2_version(3)