1libssh2_version(3)                  libssh2                 libssh2_version(3)
2
3
4

NAME

6       libssh2_version - return the libssh2 version number
7

SYNOPSIS

9       #include <libssh2.h>
10
11       const char *
12       libssh2_version(int required_version);
13

DESCRIPTION

15       If required_version is lower than or equal to the version number of the
16       libssh2 in use, the version number of libssh2 is returned as a  pointer
17       to a zero terminated string.
18
19       The required_version should be the version number as constructed by the
20       LIBSSH2_VERSION_NUM define in the libssh2.h public header  file,  which
21       is  a  24 bit number in the 0xMMmmpp format. MM for major, mm for minor
22       and pp for patch number.
23

RETURN VALUE

25       The version number of libssh2 is returned as a pointer to a zero termiā€
26       nated string or NULL if the required_version is not fulfilled.
27

EXAMPLE

29       To make sure you run with the correct libssh2 version:
30
31       if(!libssh2_version(LIBSSH2_VERSION_NUM)) {
32         fprintf(stderr, "Runtime libssh2 version too old!");
33         exit(1);
34       }
35
36       Unconditionally get the version number:
37
38       printf("libssh2 version: %s", libssh2_version(0));
39

AVAILABILITY

41       This  function was added in libssh2 1.1, in previous versions there way
42       no way to extract this info in run-time.
43
44
45
46libssh2                           23 Feb 2009               libssh2_version(3)
Impressum