Path: blob/master/thirdparty/sdl/include/SDL3/SDL_guid.h
9912 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/* WIKI CATEGORY: GUID */2223/**24* # CategoryGUID25*26* A GUID is a 128-bit value that represents something that is uniquely27* identifiable by this value: "globally unique."28*29* SDL provides functions to convert a GUID to/from a string.30*/3132#ifndef SDL_guid_h_33#define SDL_guid_h_3435#include <SDL3/SDL_stdinc.h>3637#include <SDL3/SDL_begin_code.h>38/* Set up for C function definitions, even when using C++ */39#ifdef __cplusplus40extern "C" {41#endif4243/**44* An SDL_GUID is a 128-bit identifier for an input device that identifies45* that device across runs of SDL programs on the same platform.46*47* If the device is detached and then re-attached to a different port, or if48* the base system is rebooted, the device should still report the same GUID.49*50* GUIDs are as precise as possible but are not guaranteed to distinguish51* physically distinct but equivalent devices. For example, two game52* controllers from the same vendor with the same product ID and revision may53* have the same GUID.54*55* GUIDs may be platform-dependent (i.e., the same device may report different56* GUIDs on different operating systems).57*58* \since This struct is available since SDL 3.2.0.59*/60typedef struct SDL_GUID {61Uint8 data[16];62} SDL_GUID;6364/* Function prototypes */6566/**67* Get an ASCII string representation for a given SDL_GUID.68*69* \param guid the SDL_GUID you wish to convert to string.70* \param pszGUID buffer in which to write the ASCII string.71* \param cbGUID the size of pszGUID, should be at least 33 bytes.72*73* \threadsafety It is safe to call this function from any thread.74*75* \since This function is available since SDL 3.2.0.76*77* \sa SDL_StringToGUID78*/79extern SDL_DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);8081/**82* Convert a GUID string into a SDL_GUID structure.83*84* Performs no error checking. If this function is given a string containing85* an invalid GUID, the function will silently succeed, but the GUID generated86* will not be useful.87*88* \param pchGUID string containing an ASCII representation of a GUID.89* \returns a SDL_GUID structure.90*91* \threadsafety It is safe to call this function from any thread.92*93* \since This function is available since SDL 3.2.0.94*95* \sa SDL_GUIDToString96*/97extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_StringToGUID(const char *pchGUID);9899/* Ends C function definitions when using C++ */100#ifdef __cplusplus101}102#endif103#include <SDL3/SDL_close_code.h>104105#endif /* SDL_guid_h_ */106107108