sdlAtoi function

int sdlAtoi(
  1. String? str
)
extern DECLSPEC int SDLCALL SDL_atoi(const char *str)

Implementation

int sdlAtoi(String? str) {
  final sdlAtoiLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<Utf8> str),
      int Function(Pointer<Utf8> str)>('SDL_atoi');
  final strPointer = str != null ? str.toNativeUtf8() : nullptr;
  final result = sdlAtoiLookupFunction(strPointer);
  calloc.free(strPointer);
  return result;
}