strings.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_STRINGS_HEADER
  2. #define _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_STRINGS_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #define IS_STRING_EMPTY(_string) (NULL == (_string) || L'\0' == *(_string))
  7. wchar_t *
  8. String_Malloc(size_t size);
  9. wchar_t *
  10. String_ReAlloc(wchar_t *string,
  11. size_t size);
  12. void
  13. String_Free(wchar_t *string);
  14. wchar_t *
  15. String_Duplicate(const wchar_t *string);
  16. char *
  17. String_ToAnsi(unsigned int codePage,
  18. unsigned long flags,
  19. const wchar_t *string,
  20. int stringLength,
  21. const char *defaultChar,
  22. BOOL *usedDefaultChar);
  23. size_t
  24. String_CopyTo(wchar_t *destination,
  25. const wchar_t *source,
  26. size_t size);
  27. wchar_t *
  28. String_FromWindowEx(HWND hwnd,
  29. size_t *lengthOut,
  30. BOOL *errorOut);
  31. #define String_FromWindow(/*HWND*/ _hwnd)\
  32. String_FromWindowEx((_hwnd), NULL, NULL)
  33. /*
  34. Ansi String
  35. */
  36. char *
  37. AnsiString_Malloc(size_t size);
  38. char *
  39. AnsiString_ReAlloc(char *string,
  40. size_t size);
  41. void
  42. AnsiString_Free(char *string);
  43. char *
  44. AnsiString_Duplicate(const char *string);
  45. wchar_t *
  46. AnsiString_ToUnicode(unsigned int codePage,
  47. unsigned long flags,
  48. const char *string,
  49. int stringLength);
  50. /*
  51. Resource String
  52. */
  53. wchar_t*
  54. ResourceString_Duplicate(const wchar_t *source);
  55. void
  56. ResourceString_Free(wchar_t *string);
  57. size_t
  58. ResourceString_CopyTo(wchar_t *destination,
  59. const wchar_t *source,
  60. size_t size);
  61. #endif //_NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_STRINGS_HEADER