🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.1 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_guid.h
  20. *
  21. * Include file for handling ::SDL_GUID values.
  22. */
  23. #ifndef SDL_guid_h_
  24. #define SDL_guid_h_
  25. #include "SDL_stdinc.h"
  26. #include "SDL_error.h"
  27. #include "begin_code.h"
  28. /* Set up for C function definitions, even when using C++ */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /**
  33. * An SDL_GUID is a 128-bit identifier for an input device that
  34. * identifies that device across runs of SDL programs on the same
  35. * platform. If the device is detached and then re-attached to a
  36. * different port, or if the base system is rebooted, the device
  37. * should still report the same GUID.
  38. *
  39. * GUIDs are as precise as possible but are not guaranteed to
  40. * distinguish physically distinct but equivalent devices. For
  41. * example, two game controllers from the same vendor with the same
  42. * product ID and revision may have the same GUID.
  43. *
  44. * GUIDs may be platform-dependent (i.e., the same device may report
  45. * different GUIDs on different operating systems).
  46. */
  47. typedef struct {
  48. Uint8 data[16];
  49. } SDL_GUID;
  50. /* Function prototypes */
  51. /**
  52. * Get an ASCII string representation for a given ::SDL_GUID.
  53. *
  54. * You should supply at least 33 bytes for pszGUID.
  55. *
  56. * \param guid the ::SDL_GUID you wish to convert to string
  57. * \param pszGUID buffer in which to write the ASCII string
  58. * \param cbGUID the size of pszGUID
  59. *
  60. * \since This function is available since SDL 2.24.0.
  61. *
  62. * \sa SDL_GUIDFromString
  63. */
  64. extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
  65. /**
  66. * Convert a GUID string into a ::SDL_GUID structure.
  67. *
  68. * Performs no error checking. If this function is given a string containing
  69. * an invalid GUID, the function will silently succeed, but the GUID generated
  70. * will not be useful.
  71. *
  72. * \param pchGUID string containing an ASCII representation of a GUID
  73. * \returns a ::SDL_GUID structure.
  74. *
  75. * \since This function is available since SDL 2.24.0.
  76. *
  77. * \sa SDL_GUIDToString
  78. */
  79. extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
  80. /* Ends C function definitions when using C++ */
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #include "close_code.h"
  85. #endif /* SDL_guid_h_ */
  86. /* vi: set ts=4 sw=4 expandtab: */