2022-06-04 14:16:28 -06:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2023-01-09 10:41:41 -07:00
|
|
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
2022-06-04 14:16:28 -06: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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file SDL_guid.h
|
|
|
|
*
|
2023-02-18 10:32:06 -07:00
|
|
|
* \brief Include file for handling ::SDL_GUID values.
|
2022-06-04 14:16:28 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SDL_guid_h_
|
|
|
|
#define SDL_guid_h_
|
|
|
|
|
2022-11-26 21:43:38 -07:00
|
|
|
#include <SDL3/SDL_stdinc.h>
|
|
|
|
#include <SDL3/SDL_error.h>
|
2022-06-04 14:16:28 -06:00
|
|
|
|
2022-12-22 09:38:59 -07:00
|
|
|
#include <SDL3/SDL_begin_code.h>
|
2022-06-04 14:16:28 -06:00
|
|
|
/* Set up for C function definitions, even when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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. 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.
|
|
|
|
*
|
|
|
|
* 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).
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
Uint8 data[16];
|
|
|
|
} SDL_GUID;
|
|
|
|
|
|
|
|
/* Function prototypes */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an ASCII string representation for a given ::SDL_GUID.
|
|
|
|
*
|
|
|
|
* You should supply at least 33 bytes for pszGUID.
|
|
|
|
*
|
|
|
|
* \param guid the ::SDL_GUID you wish to convert to string
|
|
|
|
* \param pszGUID buffer in which to write the ASCII string
|
|
|
|
* \param cbGUID the size of pszGUID
|
2023-02-08 12:43:52 -07:00
|
|
|
* \returns 0 on success or a negative error code on failure; call
|
|
|
|
* SDL_GetError() for more information.
|
2022-06-04 14:16:28 -06:00
|
|
|
*
|
2022-11-22 15:40:14 -07:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-06-04 14:16:28 -06:00
|
|
|
*
|
|
|
|
* \sa SDL_GUIDFromString
|
|
|
|
*/
|
2023-02-08 12:43:52 -07:00
|
|
|
extern DECLSPEC int SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
2022-06-04 14:16:28 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert a GUID string into a ::SDL_GUID structure.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* \returns a ::SDL_GUID structure.
|
|
|
|
*
|
2022-11-22 15:40:14 -07:00
|
|
|
* \since This function is available since SDL 3.0.0.
|
2022-06-04 14:16:28 -06:00
|
|
|
*
|
|
|
|
* \sa SDL_GUIDToString
|
|
|
|
*/
|
|
|
|
extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
|
|
|
|
|
|
|
|
/* Ends C function definitions when using C++ */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-12-22 09:38:59 -07:00
|
|
|
#include <SDL3/SDL_close_code.h>
|
2022-06-04 14:16:28 -06:00
|
|
|
|
|
|
|
#endif /* SDL_guid_h_ */
|