sdlStrlen function

int sdlStrlen(
  1. String? str
)
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str)

Implementation

int sdlStrlen(String? str) {
  final sdlStrlenLookupFunction = libSdl2.lookupFunction<
      Uint32 Function(Pointer<Utf8> str),
      int Function(Pointer<Utf8> str)>('SDL_strlen');
  final strPointer = str != null ? str.toNativeUtf8() : nullptr;
  final result = sdlStrlenLookupFunction(strPointer);
  calloc.free(strPointer);
  return result;
}