bi: Add getter for user-visible library names

This commit is contained in:
Ignacio R. Morelle 2015-07-13 02:24:18 -03:00
parent 8ac2239ca1
commit 29d4da6ec4
2 changed files with 14 additions and 0 deletions

View file

@ -195,6 +195,15 @@ const std::string& library_runtime_version(LIBRARY_ID lib)
return versions.linked[lib];
}
const std::string& library_name(LIBRARY_ID lib)
{
if(lib >= LIB_COUNT) {
return empty_version;
}
return versions.names[lib];
}
namespace {
bool strlen_comparator(const std::string& a, const std::string& b)

View file

@ -48,6 +48,11 @@ const std::string& library_build_version(LIBRARY_ID lib);
*/
const std::string& library_runtime_version(LIBRARY_ID lib);
/**
* Retrieve the user-visible name for the given library.
*/
const std::string& library_name(LIBRARY_ID lib);
/**
* Produce a plain-text report of library versions suitable for stdout/stderr.
*/