version.h 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _VERSION_H
  2. #define _VERSION_H
  3. // These variables are autogenerated and compiled
  4. // into the library by the version.cmake script
  5. extern "C"
  6. {
  7. extern const char* GIT_TAG;
  8. extern const char* GIT_REV;
  9. extern const char* GIT_BRANCH;
  10. extern const char* BUILD_TIME;
  11. }
  12. #include <string>
  13. #include <string.h>
  14. #include "Helper.h"
  15. #include <fstream>
  16. const char* build_time(void)
  17. {
  18. return BUILD_TIME;
  19. }
  20. const char* libfive_git_version(void)
  21. {
  22. return GIT_TAG;
  23. }
  24. const char* libfive_git_revision(void)
  25. {
  26. return GIT_REV;
  27. }
  28. const char* libfive_git_branch(void)
  29. {
  30. return GIT_BRANCH;
  31. }
  32. char _char_getHTMLversion[50]="NaN\0";
  33. const char* getHTMLversion(void){
  34. FILE* pFile;
  35. string fn = FormatFileName("/sdcard/html/version.txt");
  36. pFile = fopen(fn.c_str(), "r");
  37. if (pFile == NULL)
  38. return _char_getHTMLversion;
  39. fgets(_char_getHTMLversion, sizeof(_char_getHTMLversion), pFile);
  40. fclose(pFile);
  41. return _char_getHTMLversion;
  42. }
  43. #endif // _VERSION_H