diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-03-21 09:29:31 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-03-21 09:29:31 +0000 |
commit | 9249006e64470337422f4fd9e176ea2cb7d603e1 (patch) | |
tree | 1bf17b3ec94067a513e8e8827b95ce49d5d39cb3 /include/libssh/libssh.h | |
parent | c9818a994804f4b6ea30a22b7a42aef701db98d8 (diff) | |
download | libssh-9249006e64470337422f4fd9e176ea2cb7d603e1.tar.gz libssh-9249006e64470337422f4fd9e176ea2cb7d603e1.tar.xz libssh-9249006e64470337422f4fd9e176ea2cb7d603e1.zip |
Add a ssh_version function.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@283 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r-- | include/libssh/libssh.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 4fb6a306..89d8a917 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -39,7 +39,25 @@ typedef unsigned long long uint64_t; #include <netdb.h> #endif /* _WIN32 */ -#define LIBSSH_VERSION "libssh-0.3-svn" +#define SSH_STRINGIFY(s) SSH_TOSTRING(s) +#define SSH_TOSTRING(s) #s + +/* libssh version macros */ +#define SSH_VERSION_INT(a, b, c) (a << 16 | b << 8 | c) +#define SSH_VERSION_DOT(a, b, c) a ##.## b ##.## c +#define SSH_VERSION(a, b, c) SSH_VERSION_DOT(a, b, c) + +/* libssh version */ +#define LIBSSH_VERSION_MAJOR 0 +#define LIBSSH_VERSION_MINOR 3 +#define LIBSSH_VERSION_MICRO 0 + +#define LIBSSH_VERSION_INT SSH_VERSION_INT(LIBSSH_VERSION_MAJOR, \ + LIBSSH_VERSION_MINOR, \ + LIBSSH_VERSION_MICRO) +#define LIBSSH_VERSION SSH_VERSION(LIBSSH_VERSION_MAJOR, \ + LIBSSH_VERSION_MINOR, \ + LIBSSH_VERSION_MICRO) /* GCC have printf type attribute check. */ #ifdef __GNUC__ @@ -133,6 +151,9 @@ typedef int socket_t; char *ssh_get_error(void *error); int ssh_get_error_code(void *error); +/* version checks */ +const char *ssh_version(int req_version); + /** \addtogroup ssh_log * @{ */ |