os.h 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2010-2018 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
  4. */
  5. #ifndef BX_OS_H_HEADER_GUARD
  6. #define BX_OS_H_HEADER_GUARD
  7. #include "debug.h"
  8. #if BX_PLATFORM_OSX
  9. # define BX_DL_EXT "dylib"
  10. #elif BX_PLATFORM_WINDOWS
  11. # define BX_DL_EXT "dll"
  12. #else
  13. # define BX_DL_EXT "so"
  14. #endif //
  15. namespace bx
  16. {
  17. ///
  18. void sleep(uint32_t _ms);
  19. ///
  20. void yield();
  21. ///
  22. uint32_t getTid();
  23. ///
  24. size_t getProcessMemoryUsed();
  25. ///
  26. void* dlopen(const char* _filePath);
  27. ///
  28. void dlclose(void* _handle);
  29. ///
  30. void* dlsym(void* _handle, const char* _symbol);
  31. ///
  32. bool getenv(const char* _name, char* _out, uint32_t* _inOutSize);
  33. ///
  34. void setenv(const char* _name, const char* _value);
  35. ///
  36. void unsetenv(const char* _name);
  37. ///
  38. int chdir(const char* _path);
  39. ///
  40. void* exec(const char* const* _argv);
  41. } // namespace bx
  42. #endif // BX_OS_H_HEADER_GUARD