
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);
37 lines
1,022 B
C
37 lines
1,022 B
C
/*
|
|
* 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
|
|
* License as published by the Free Software Foundation version 2.1
|
|
* of the License.
|
|
*
|
|
* Copyright (c) 2008-2011 Thomas Graf <tgraf@suug.ch>
|
|
*/
|
|
|
|
#ifndef NETLINK_VERSION_H_
|
|
#define NETLINK_VERSION_H_
|
|
|
|
/* Compile Time Versioning Information */
|
|
|
|
#define LIBNL_STRING "@PACKAGE_STRING@"
|
|
#define LIBNL_VERSION "@PACKAGE_VERSION@"
|
|
|
|
#define LIBNL_VER_MAJ @MAJ_VERSION@
|
|
#define LIBNL_VER_MIN @MIN_VERSION@
|
|
#define LIBNL_VER_MIC @MIC_VERSION@
|
|
#define LIBNL_VER(maj,min) ((maj) << 8 | (min))
|
|
#define LIBNL_VER_NUM LIBNL_VER(LIBNL_VER_MAJ, LIBNL_VER_MIN)
|
|
|
|
#define LIBNL_CURRENT @LT_CURRENT@
|
|
#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
|