helpers.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef HELPERS_H
  2. #define HELPERS_H
  3. #ifndef CONFIG
  4. #define CONFIG "config.h"
  5. #endif // CONFIG
  6. #include CONFIG
  7. #include <stdint.h>
  8. #include "types.h"
  9. #define GUID_LE 0
  10. #define GUID_BE 1
  11. #define GUID_SWAP 2
  12. BOOL stringToInt(const char *const szValue, const unsigned int min, const unsigned int max, unsigned int *const value);
  13. unsigned int getOptionArgumentInt(const char o, const unsigned int min, const unsigned int max);
  14. void optReset(void);
  15. char* win_strerror(const int message);
  16. int ucs2_to_utf8_char (const WCHAR ucs2_le, char *utf8);
  17. size_t utf8_to_ucs2(WCHAR* const ucs2_le, const char* const utf8, const size_t maxucs2, const size_t maxutf8);
  18. WCHAR utf8_to_ucs2_char (const unsigned char * input, const unsigned char ** end_ptr);
  19. BOOL ucs2_to_utf8(const WCHAR* const ucs2_le, char* utf8, size_t maxucs2, size_t maxutf8);
  20. int_fast8_t string2Uuid(const char *const restrict input, GUID *const restrict guid);
  21. void randomNumberInit();
  22. void LEGUID(GUID *const restrict result, const GUID* const restrict guid);
  23. void parseAddress(char *const addr, char** szHost, char** szPort);
  24. __noreturn void OutOfMemory(void);
  25. void* vlmcsd_malloc(size_t len);
  26. void hex2bin(BYTE *const bin, const char *hex, const size_t maxbin);
  27. __pure BOOL getArgumentBool(int_fast8_t *result, const char *const argument);
  28. #endif // HELPERS_H