2022-06-05 04:16:28 +08:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2024-01-02 05:15:26 +08:00
|
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
2022-06-05 04:16:28 +08:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
2024-05-14 22:19:34 +08:00
|
|
|
/* WIKI CATEGORY: GUID */
|
|
|
|
|
2022-06-05 04:16:28 +08:00
|
|
|
/**
|
2024-05-16 22:44:37 +08:00
|
|
|
* # CategoryGUID
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
2024-05-16 22:44:37 +08:00
|
|
|
* A GUID is a 128-bit value that represents something that is uniquely
|
|
|
|
* identifiable by this value: "globally unique."
|
2022-06-05 04:16:28 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SDL_guid_h_
|
|
|
|
#define SDL_guid_h_
|
|
|
|
|
2022-11-27 12:43:38 +08:00
|
|
|
#include <SDL3/SDL_stdinc.h>
|
|
|
|
#include <SDL3/SDL_error.h>
|
2022-06-05 04:16:28 +08:00
|
|
|
|
2022-12-23 00:38:59 +08:00
|
|
|
#include <SDL3/SDL_begin_code.h>
|
2022-06-05 04:16:28 +08:00
|
|
|
/* Set up for C function definitions, even when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2024-04-09 12:49:23 +08:00
|
|
|
* An SDL_GUID is a 128-bit identifier for an input device that identifies
|
|
|
|
* that device across runs of SDL programs on the same platform.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
2024-04-09 12:49:23 +08:00
|
|
|
* If the device is detached and then re-attached to a different port, or if
|
|
|
|
* the base system is rebooted, the device should still report the same GUID.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
2024-04-09 12:49:23 +08:00
|
|
|
* GUIDs are as precise as possible but are not guaranteed to distinguish
|
|
|
|
* physically distinct but equivalent devices. For example, two game
|
|
|
|
* controllers from the same vendor with the same product ID and revision may
|
|
|
|
* have the same GUID.
|
|
|
|
*
|
|
|
|
* GUIDs may be platform-dependent (i.e., the same device may report different
|
|
|
|
* GUIDs on different operating systems).
|
2024-04-12 01:34:29 +08:00
|
|
|
*
|
|
|
|
* \since This struct is available since SDL 3.0.0.
|
2022-06-05 04:16:28 +08:00
|
|
|
*/
|
2023-12-18 01:28:58 +08:00
|
|
|
typedef struct SDL_GUID {
|
2022-06-05 04:16:28 +08:00
|
|
|
Uint8 data[16];
|
|
|
|
} SDL_GUID;
|
|
|
|
|
|
|
|
/* Function prototypes */
|
|
|
|
|
|
|
|
/**
|
2024-05-17 00:16:57 +08:00
|
|
|
* Get an ASCII string representation for a given SDL_GUID.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
|
|
|
* You should supply at least 33 bytes for pszGUID.
|
|
|
|
*
|
2024-05-17 00:16:57 +08:00
|
|
|
* \param guid the SDL_GUID you wish to convert to string
|
2022-06-05 04:16:28 +08:00
|
|
|
* \param pszGUID buffer in which to write the ASCII string
|
|
|
|
* \param cbGUID the size of pszGUID
|
2023-02-09 03:43:52 +08:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
2022-11-23 06:40:14 +08:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
|
|
|
* \sa SDL_GUIDFromString
|
|
|
|
*/
|
2024-05-18 07:52:36 +08:00
|
|
|
extern SDL_DECLSPEC int SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
2022-06-05 04:16:28 +08:00
|
|
|
|
|
|
|
/**
|
2024-05-17 00:16:57 +08:00
|
|
|
* Convert a GUID string into a SDL_GUID structure.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
|
|
|
* Performs no error checking. If this function is given a string containing
|
|
|
|
* an invalid GUID, the function will silently succeed, but the GUID generated
|
|
|
|
* will not be useful.
|
|
|
|
*
|
|
|
|
* \param pchGUID string containing an ASCII representation of a GUID
|
2024-05-17 00:16:57 +08:00
|
|
|
* \returns a SDL_GUID structure.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
2022-11-23 06:40:14 +08:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-06-05 04:16:28 +08:00
|
|
|
*
|
|
|
|
* \sa SDL_GUIDToString
|
|
|
|
*/
|
2024-05-18 07:52:36 +08:00
|
|
|
extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
|
2022-06-05 04:16:28 +08:00
|
|
|
|
|
|
|
/* Ends C function definitions when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-12-23 00:38:59 +08:00
|
|
|
#include <SDL3/SDL_close_code.h>
|
2022-06-05 04:16:28 +08:00
|
|
|
|
|
|
|
#endif /* SDL_guid_h_ */
|