sdlGuidFromString function
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.
\since This function is available since SDL 2.24.0.
\sa SDL_GUIDToString
extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID)
Implementation
SdlGuid sdlGuidFromString(String? pchGuid) {
final sdlGuidFromStringLookupFunction = libSdl2.lookupFunction<
SdlGuid Function(Pointer<Utf8> pchGuid),
SdlGuid Function(Pointer<Utf8> pchGuid)>('SDL_GUIDFromString');
final pchGuidPointer = pchGuid != null ? pchGuid.toNativeUtf8() : nullptr;
final result = sdlGuidFromStringLookupFunction(pchGuidPointer);
calloc.free(pchGuidPointer);
return result;
}