PlatformHelpers.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef HEADER_PlatformHelpers
  2. #define HEADER_PlatformHelpers
  3. /*
  4. htop - darwin/PlatformHelpers.h
  5. (C) 2018 Pierre Malhaire, 2020-2022 htop dev team, 2021 Alexander Momchilov
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <stdbool.h>
  10. #include <sys/types.h>
  11. typedef struct KernelVersion {
  12. short int major;
  13. short int minor;
  14. short int patch;
  15. } KernelVersion;
  16. void Platform_GetKernelVersion(KernelVersion* k);
  17. /* compare the given os version with the one installed returns:
  18. 0 if equals the installed version
  19. positive value if less than the installed version
  20. negative value if more than the installed version
  21. */
  22. int Platform_CompareKernelVersion(KernelVersion v);
  23. // lowerBound <= currentVersion < upperBound
  24. bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upperBound);
  25. double Platform_calculateNanosecondsPerMachTick(void);
  26. void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize);
  27. bool Platform_isRunningTranslated(void);
  28. double Platform_calculateNanosecondsPerMachTick(void);
  29. #endif