36 lines · 1.2 KB · Text
RawDownload
.TH libssh2_version 3 "23 Feb 2009" "libssh2 1.1" "libssh2 manual".SH NAMElibssh2_version - return the libssh2 version number.SH SYNOPSIS#include <libssh2.h> const char *libssh2_version(int required_version);.SH DESCRIPTIONIf \fIrequired_version\fP is lower than or equal to the version number of thelibssh2 in use, the version number of libssh2 is returned as a pointer to azero terminated string. The \fIrequired_version\fP should be the version number as constructed by theLIBSSH2_VERSION_NUM define in the libssh2.h public header file, which is a 24bit number in the 0xMMmmpp format. MM for major, mm for minor and pp for patchnumber..SH RETURN VALUEThe version number of libssh2 is returned as a pointer to a zero terminatedstring or NULL if the \fIrequired_version\fP isn't fulfilled..SH EXAMPLETo make sure you run with the correct libssh2 version: .nfif (!libssh2_version(LIBSSH2_VERSION_NUM)) {  fprintf (stderr, \&"Runtime libssh2 version too old!\&");  exit(1);}.fi Unconditionally get the version number: printf(\&"libssh2 version: %s\&", libssh2_version(0) );.SH AVAILABILITYThis function was added in libssh2 1.1, in previous versions there way no wayto extract this info in run-time.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t