sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Guid

Description

A GUID is a 128-bit value that represents something that is uniquely identifiable by this value: "globally unique."

SDL provides functions to convert a GUID to/from a string. 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).

FFI conventions

Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Guid.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.

Full conventions: SDL3.Sys.

Since: 3.2.0

Synopsis

Documentation

Function aliases

guidToString Source #

Arguments

:: SDL_GUID
guid
the SDL_GUID you wish to convert to string.
-> Ptr CChar
pszGUID
buffer in which to write the ASCII string.
-> Int32
cbGUID
the size of pszGUID, should be at least 33 bytes.
-> IO () 

Get an ASCII string representation for a given SDL_GUID.

Thread safety
It is safe to call this function from any thread.
See also
stringToGUID

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GUIDToString. The safe flavor is guidToStringSafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GUIDToString, defined at SDL3/SDL_guid.h 80:34

Since: 3.2.0

guidToStringSafe Source #

Arguments

:: SDL_GUID
guid
the SDL_GUID you wish to convert to string.
-> Ptr CChar
pszGUID
buffer in which to write the ASCII string.
-> Int32
cbGUID
the size of pszGUID, should be at least 33 bytes.
-> IO () 

Get an ASCII string representation for a given SDL_GUID.

Thread safety
It is safe to call this function from any thread.
See also
stringToGUID

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GUIDToString. The unsafe flavor is guidToString .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GUIDToString, defined at SDL3/SDL_guid.h 80:34

Since: 3.2.0

stringToGUID Source #

Arguments

:: PtrConst CChar
pchGUID
string containing an ASCII representation of a GUID.
-> IO SDL_GUID 

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.

Returns
a SDL_GUID structure.
Thread safety
It is safe to call this function from any thread.
See also
guidToString

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_StringToGUID. The safe flavor is stringToGUIDSafe .
C declaration
SDL_StringToGUID, defined at SDL3/SDL_guid.h 98:38

Since: 3.2.0

stringToGUIDSafe Source #

Arguments

:: PtrConst CChar
pchGUID
string containing an ASCII representation of a GUID.
-> IO SDL_GUID 

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.

Returns
a SDL_GUID structure.
Thread safety
It is safe to call this function from any thread.
See also
guidToString

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_StringToGUID. The unsafe flavor is stringToGUID .
C declaration
SDL_StringToGUID, defined at SDL3/SDL_guid.h 98:38

Since: 3.2.0