version_hal: simplify methodes

adopt method names similar to cs name convention
This commit is contained in:
2019-01-02 17:24:10 +01:00
parent 9bd798def2
commit da0d4290a3
2 changed files with 39 additions and 37 deletions

View File

@@ -19,37 +19,33 @@
#include <version_hal.h> #include <version_hal.h>
std::string getPackageVersion() void hal_get_lib_version(hal_libversion_t *ver)
{ {
return PACKAGE_VERSION; if (!ver)
} return;
int getPackageVersionMajor() //init struct
{ *ver = {"",0,0,0,"","",""};
return PACKAGE_VERSION_MAJOR;
}
int getPackageVersionMinor() #ifdef VERSION
{ ver->vVersion = VERSION;
return PACKAGE_VERSION_MINOR; #endif
} #ifdef PACKAGE_VERSION_MAJOR
ver->vMajor = PACKAGE_VERSION_MAJOR;
int getPackageVersionMicro() #endif
{ #ifdef PACKAGE_VERSION_MAJOR
return PACKAGE_VERSION_MICRO; ver->vMinor = PACKAGE_VERSION_MINOR;
} #endif
#ifdef PACKAGE_VERSION_MINOR
std::string getPackagenName() ver->vPatch = PACKAGE_VERSION_MICRO;
{ #endif
return PACKAGE_NAME; #ifdef PACKAGE_NAME
} ver->vName = PACKAGE_NAME;
#endif
std::string getPackageString() #ifdef PACKAGE_STRING
{ ver->vStr = PACKAGE_STRING;
return PACKAGE_STRING; #endif
} #ifdef PACKAGE_VERSION_GIT
ver->vGitDescribe = PACKAGE_VERSION_GIT;
std::string getPackageVersionGit() #endif
{
return PACKAGE_VERSION_GIT;
} }

View File

@@ -3,13 +3,19 @@
#include <string> #include <string>
std::string getPackageVersion(); // library version functions
int getPackageVersionMajor(); typedef struct hal_libversion_t
int getPackageVersionMinor(); {
int getPackageVersionMicro(); std::string vVersion;
std::string getPackagenName(); int vMajor;
std::string getPackageString(); int vMinor;
std::string getPackageVersionGit(); int vPatch;;
std::string vName;
std::string vStr;
std::string vGitDescribe;
} hal_libversion_struct_t;
void hal_get_lib_version(hal_libversion_t *ver);
#endif //__VERSION_HAL_H__ #endif //__VERSION_HAL_H__