diff options
author | Коренберг Марк (дома) <socketpair@gmail.com> | 2012-08-29 16:55:14 (GMT) |
---|---|---|
committer | Коренберг Марк (дома) <socketpair@gmail.com> | 2012-08-29 21:19:04 (GMT) |
commit | 582a32433ca03dd2ca78dc485329cb81d391a192 (patch) | |
tree | adeca4c6beb49792c013625d637405768092b5f2 /include | |
parent | d10d9633a5b673641eebe3f33c89a334d1972aa2 (diff) | |
download | libnl-582a32433ca03dd2ca78dc485329cb81d391a192.zip libnl-582a32433ca03dd2ca78dc485329cb81d391a192.tar.gz libnl-582a32433ca03dd2ca78dc485329cb81d391a192.tar.bz2 |
Run-time version information is now available
Run-time version information is available as exported four integers:
- const int nl_ver_num = LIBNL_VER_NUM;
- const int nl_ver_maj = LIBNL_VER_MAJ;
- const int nl_ver_min = LIBNL_VER_MIN;
- const int nl_ver_mic = LIBNL_VER_MIC;
The purpose of this is to get version of compiled library as run time.
Use cases:
- To know exact version of the library in Python's ctypes module,
Say, to find out if nl_cache_mngr_alloc() allow sk=NULL
- To make sure that the version of the loaded library corresponds to the
version of headers (for the paranoid). Say, to check:
if (LIBNL_VER_NUM != nl_ver_num)
exit(1);
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/version.h.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/netlink/version.h.in b/include/netlink/version.h.in index ac56799..35bf2aa 100644 --- a/include/netlink/version.h.in +++ b/include/netlink/version.h.in @@ -1,5 +1,5 @@ /* - * netlink/version.h Compile Time Versioning Information + * netlink/version.h Versioning Information * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,6 +12,8 @@ #ifndef NETLINK_VERSION_H_ #define NETLINK_VERSION_H_ +/* Compile Time Versioning Information */ + #define LIBNL_STRING "@PACKAGE_STRING@" #define LIBNL_VERSION "@PACKAGE_VERSION@" @@ -25,4 +27,11 @@ #define LIBNL_REVISION @LT_REVISION@ #define LIBNL_AGE @LT_AGE@ +/* Run-time version information */ + +extern const int nl_ver_num; +extern const int nl_ver_maj; +extern const int nl_ver_min; +extern const int nl_ver_mic; + #endif |