1 /*
2     DSDL
3     Copyright (C) 2025 Inochi2D Project <luna@foxgirls.gay>
4 
5     This software is provided 'as-is', without any express or implied
6     warranty.  In no event will the authors be held liable for any damages
7     arising from the use of this software.
8 
9     Permission is granted to anyone to use this software for any purpose,
10     including commercial applications, and to alter it and redistribute it
11     freely, subject to the following restrictions:
12 
13     1. The origin of this software must not be misrepresented; you must not
14         claim that you wrote the original software. If you use this software
15         in a product, an acknowledgment in the product documentation would be
16         appreciated but is not required.
17     2. Altered source versions must be plainly marked as such, and must not be
18         misrepresented as being the original software.
19     3. This notice may not be removed or altered from any source distribution.
20 
21     ==========================================================================
22 
23     Simple DirectMedia Layer
24     Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
25 
26     This software is provided 'as-is', without any express or implied
27     warranty.  In no event will the authors be held liable for any damages
28     arising from the use of this software.
29 
30     Permission is granted to anyone to use this software for any purpose,
31     including commercial applications, and to alter it and redistribute it
32     freely, subject to the following restrictions:
33 
34     1. The origin of this software must not be misrepresented; you must not
35         claim that you wrote the original software. If you use this software
36         in a product, an acknowledgment in the product documentation would be
37         appreciated but is not required.
38     2. Altered source versions must be plainly marked as such, and must not be
39         misrepresented as being the original software.
40     3. This notice may not be removed or altered from any source distribution.
41 */
42 
43 /**
44     SDL GUID
45 
46     See_Also:
47         $(LINK2 https://wiki.libsdl.org/SDL3/CategoryGUID, SDL3 GUID Documentation)
48     
49     Copyright: © 2025 Inochi2D Project, © 1997-2025 Sam Lantinga
50     License: Subject to the terms of the Zlib License, as written in the LICENSE file.
51     Authors: 
52         Luna Nielsen
53 */
54 module sdl.guid;
55 import sdl.stdc;
56 
57 extern(C) nothrow @nogc:
58 
59 /**
60     An SDL_GUID is a 128-bit identifier for an input device that identifies
61     that device across runs of SDL programs on the same platform.
62 
63     If the device is detached and then re-attached to a different port, or if
64     the base system is rebooted, the device should still report the same GUID.
65 
66     GUIDs are as precise as possible but are not guaranteed to distinguish
67     physically distinct but equivalent devices. For example, two game
68     controllers from the same vendor with the same product ID and revision may
69     have the same GUID.
70 
71     GUIDs may be platform-dependent (i.e., the same device may report different
72     GUIDs on different operating systems).
73 */
74 alias SDL_GUID = ubyte[16];
75 
76 
77 
78 /**
79     Get an ASCII string representation for a given SDL_GUID.
80 
81     Params:
82         guid =      the SDL_GUID you wish to convert to string.
83         pszGUID =   buffer in which to write the ASCII string.
84         cbGUID =    the size of pszGUID, should be at least 33 bytes.
85 
86     See_Also:
87         $(D SDL_StringToGUID)
88 */
89 extern void SDL_GUIDToString(SDL_GUID guid, char* pszGUID, int cbGUID);
90 
91 /**
92     Convert a GUID string into a SDL_GUID structure.
93 
94     Performs no error checking. If this function is given a string containing
95     an invalid GUID, the function will silently succeed, but the GUID generated
96     will not be useful.
97 
98     Params:
99         pchGUID = string containing an ASCII representation of a GUID.
100     
101     Returns:
102         A SDL_GUID.
103 
104     See_Also:
105         $(D SDL_GUIDToString)
106 */
107 extern SDL_GUID SDL_StringToGUID(const(char)* pchGUID);