Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/man/man3/libssh2_version.3 @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@68 | 1 .TH libssh2_version 3 "23 Feb 2009" "libssh2 1.1" "libssh2 manual" |
jpayne@68 | 2 .SH NAME |
jpayne@68 | 3 libssh2_version - return the libssh2 version number |
jpayne@68 | 4 .SH SYNOPSIS |
jpayne@68 | 5 #include <libssh2.h> |
jpayne@68 | 6 |
jpayne@68 | 7 const char * |
jpayne@68 | 8 libssh2_version(int required_version); |
jpayne@68 | 9 .SH DESCRIPTION |
jpayne@68 | 10 If \fIrequired_version\fP is lower than or equal to the version number of the |
jpayne@68 | 11 libssh2 in use, the version number of libssh2 is returned as a pointer to a |
jpayne@68 | 12 zero terminated string. |
jpayne@68 | 13 |
jpayne@68 | 14 The \fIrequired_version\fP should be the version number as constructed by the |
jpayne@68 | 15 LIBSSH2_VERSION_NUM define in the libssh2.h public header file, which is a 24 |
jpayne@68 | 16 bit number in the 0xMMmmpp format. MM for major, mm for minor and pp for patch |
jpayne@68 | 17 number. |
jpayne@68 | 18 .SH RETURN VALUE |
jpayne@68 | 19 The version number of libssh2 is returned as a pointer to a zero terminated |
jpayne@68 | 20 string or NULL if the \fIrequired_version\fP isn't fulfilled. |
jpayne@68 | 21 .SH EXAMPLE |
jpayne@68 | 22 To make sure you run with the correct libssh2 version: |
jpayne@68 | 23 |
jpayne@68 | 24 .nf |
jpayne@68 | 25 if (!libssh2_version(LIBSSH2_VERSION_NUM)) { |
jpayne@68 | 26 fprintf (stderr, \&"Runtime libssh2 version too old!\&"); |
jpayne@68 | 27 exit(1); |
jpayne@68 | 28 } |
jpayne@68 | 29 .fi |
jpayne@68 | 30 |
jpayne@68 | 31 Unconditionally get the version number: |
jpayne@68 | 32 |
jpayne@68 | 33 printf(\&"libssh2 version: %s\&", libssh2_version(0) ); |
jpayne@68 | 34 .SH AVAILABILITY |
jpayne@68 | 35 This function was added in libssh2 1.1, in previous versions there way no way |
jpayne@68 | 36 to extract this info in run-time. |