sdlUnsetenvUnsafe function

int sdlUnsetenvUnsafe(
  1. String? name
)

Clear a variable from the environment.

\param name the name of the variable to unset. \returns 0 on success, -1 on error.

\threadsafety This function is not thread safe, consider using SDL_UnsetEnvironmentVariable() instead.

\since This function is available since SDL 3.1.3.

\sa SDL_UnsetEnvironmentVariable

extern SDL_DECLSPEC int SDLCALL SDL_unsetenv_unsafe(const char *name)

Implementation

int sdlUnsetenvUnsafe(String? name) {
  final sdlUnsetenvUnsafeLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<Utf8> name),
      int Function(Pointer<Utf8> name)>('SDL_unsetenv_unsafe');
  final namePointer = name != null ? name.toNativeUtf8() : nullptr;
  final result = sdlUnsetenvUnsafeLookupFunction(namePointer);
  calloc.free(namePointer);
  return result;
}