sdlVsnprintf function

int sdlVsnprintf(
  1. Pointer<NativeType> arg0,
  2. int maxlen,
  3. String? fmt,
  4. Pointer<NativeType> arg3,
)
extern SDL_DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3)

Implementation

int sdlVsnprintf(Pointer<NativeType> arg0, int maxlen, String? fmt,
    Pointer<NativeType> arg3) {
  final sdlVsnprintfLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<NativeType> arg0, Uint32 maxlen, Pointer<Utf8> fmt,
          Pointer<NativeType> arg3),
      int Function(Pointer<NativeType> arg0, int maxlen, Pointer<Utf8> fmt,
          Pointer<NativeType> arg3)>('SDL_vsnprintf');
  final fmtPointer = fmt != null ? fmt.toNativeUtf8() : nullptr;
  final result = sdlVsnprintfLookupFunction(arg0, maxlen, fmtPointer, arg3);
  calloc.free(fmtPointer);
  return result;
}