2012-04-15 18:33:45 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the sigrok project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2012-07-04 22:55:07 +00:00
|
|
|
#include "libsigrok.h"
|
2012-04-15 18:33:45 +00:00
|
|
|
|
2012-10-21 22:30:12 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
2013-04-06 17:25:03 +00:00
|
|
|
* Version number querying functions, definitions, and macros.
|
2012-10-21 22:30:12 +00:00
|
|
|
*/
|
|
|
|
|
2012-10-21 14:13:36 +00:00
|
|
|
/**
|
|
|
|
* @defgroup grp_versions Versions
|
|
|
|
*
|
2013-04-06 17:25:03 +00:00
|
|
|
* Version number querying functions, definitions, and macros.
|
2012-10-21 14:13:36 +00:00
|
|
|
*
|
2013-04-13 16:58:11 +00:00
|
|
|
* This set of API calls returns two different version numbers related
|
|
|
|
* to libsigrok. The "package version" is the release version number of the
|
|
|
|
* libsigrok tarball in the usual "major.minor.micro" format, e.g. "0.1.0".
|
|
|
|
*
|
|
|
|
* The "library version" is independent of that; it is the libtool version
|
|
|
|
* number in the "current:revision:age" format, e.g. "2:0:0".
|
|
|
|
* See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning for details.
|
|
|
|
*
|
|
|
|
* Both version numbers (and/or individual components of them) can be
|
|
|
|
* retrieved via the API calls at runtime, and/or they can be checked at
|
|
|
|
* compile/preprocessor time using the respective macros.
|
|
|
|
*
|
2012-10-21 14:13:36 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the major libsigrok package version number.
|
|
|
|
*
|
|
|
|
* @return The major package version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_package_version_major_get(void)
|
|
|
|
{
|
|
|
|
return SR_PACKAGE_VERSION_MAJOR;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the minor libsigrok package version number.
|
|
|
|
*
|
|
|
|
* @return The minor package version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_package_version_minor_get(void)
|
|
|
|
{
|
|
|
|
return SR_PACKAGE_VERSION_MINOR;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the micro libsigrok package version number.
|
|
|
|
*
|
|
|
|
* @return The micro package version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_package_version_micro_get(void)
|
|
|
|
{
|
|
|
|
return SR_PACKAGE_VERSION_MICRO;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the libsigrok package version number as a string.
|
|
|
|
*
|
|
|
|
* @return The package version number string. The returned string is
|
|
|
|
* static and thus should NOT be free'd by the caller.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API const char *sr_package_version_string_get(void)
|
|
|
|
{
|
|
|
|
return SR_PACKAGE_VERSION_STRING;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the "current" part of the libsigrok library version number.
|
|
|
|
*
|
|
|
|
* @return The "current" library version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_lib_version_current_get(void)
|
|
|
|
{
|
|
|
|
return SR_LIB_VERSION_CURRENT;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the "revision" part of the libsigrok library version number.
|
|
|
|
*
|
|
|
|
* @return The "revision" library version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_lib_version_revision_get(void)
|
|
|
|
{
|
|
|
|
return SR_LIB_VERSION_REVISION;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the "age" part of the libsigrok library version number.
|
|
|
|
*
|
|
|
|
* @return The "age" library version number.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API int sr_lib_version_age_get(void)
|
|
|
|
{
|
|
|
|
return SR_LIB_VERSION_AGE;
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:58:11 +00:00
|
|
|
/**
|
|
|
|
* Get the libsigrok library version number as a string.
|
|
|
|
*
|
|
|
|
* @return The library version number string. The returned string is
|
|
|
|
* static and thus should NOT be free'd by the caller.
|
|
|
|
*
|
|
|
|
* @since 0.1.0
|
|
|
|
*/
|
2012-04-15 18:33:45 +00:00
|
|
|
SR_API const char *sr_lib_version_string_get(void)
|
|
|
|
{
|
|
|
|
return SR_LIB_VERSION_STRING;
|
|
|
|
}
|
2012-10-21 14:13:36 +00:00
|
|
|
|
|
|
|
/** @} */
|