jpayne@68: .TH libssh2_version 3 "23 Feb 2009" "libssh2 1.1" "libssh2 manual" jpayne@68: .SH NAME jpayne@68: libssh2_version - return the libssh2 version number jpayne@68: .SH SYNOPSIS jpayne@68: #include jpayne@68: jpayne@68: const char * jpayne@68: libssh2_version(int required_version); jpayne@68: .SH DESCRIPTION jpayne@68: If \fIrequired_version\fP is lower than or equal to the version number of the jpayne@68: libssh2 in use, the version number of libssh2 is returned as a pointer to a jpayne@68: zero terminated string. jpayne@68: jpayne@68: The \fIrequired_version\fP should be the version number as constructed by the jpayne@68: LIBSSH2_VERSION_NUM define in the libssh2.h public header file, which is a 24 jpayne@68: bit number in the 0xMMmmpp format. MM for major, mm for minor and pp for patch jpayne@68: number. jpayne@68: .SH RETURN VALUE jpayne@68: The version number of libssh2 is returned as a pointer to a zero terminated jpayne@68: string or NULL if the \fIrequired_version\fP isn't fulfilled. jpayne@68: .SH EXAMPLE jpayne@68: To make sure you run with the correct libssh2 version: jpayne@68: jpayne@68: .nf jpayne@68: if (!libssh2_version(LIBSSH2_VERSION_NUM)) { jpayne@68: fprintf (stderr, \&"Runtime libssh2 version too old!\&"); jpayne@68: exit(1); jpayne@68: } jpayne@68: .fi jpayne@68: jpayne@68: Unconditionally get the version number: jpayne@68: jpayne@68: printf(\&"libssh2 version: %s\&", libssh2_version(0) ); jpayne@68: .SH AVAILABILITY jpayne@68: This function was added in libssh2 1.1, in previous versions there way no way jpayne@68: to extract this info in run-time.