mirror of
https://gitee.com/openharmony/third_party_libnl
synced 2024-11-24 02:29:50 +00:00
582a32433c
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
706 B
C
37 lines
706 B
C
/*
|
|
* lib/version.c Run-time version 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) 2003-2012 Thomas Graf <tgraf@suug.ch>
|
|
*/
|
|
|
|
/**
|
|
* @ingroup core
|
|
* @defgroup utils Utilities
|
|
*
|
|
* Run-time version information
|
|
*
|
|
* @{
|
|
*/
|
|
|
|
|
|
/**
|
|
* @name Run-time version information
|
|
* @{
|
|
*/
|
|
|
|
#include <netlink/version.h>
|
|
|
|
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;
|
|
|
|
/** @} */
|
|
|
|
/** @} */
|