sdlVasprintf function

int sdlVasprintf(
  1. Pointer<Pointer<Int8>> strp,
  2. String? fmt,
  3. Pointer<NativeType> arg2
)
extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2)

Implementation

int sdlVasprintf(
    Pointer<Pointer<Int8>> strp, String? fmt, Pointer<NativeType> arg2) {
  final sdlVasprintfLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<Pointer<Int8>> strp, Pointer<Utf8> fmt,
          Pointer<NativeType> arg2),
      int Function(Pointer<Pointer<Int8>> strp, Pointer<Utf8> fmt,
          Pointer<NativeType> arg2)>('SDL_vasprintf');
  final fmtPointer = fmt != null ? fmt.toNativeUtf8() : nullptr;
  final result = sdlVasprintfLookupFunction(strp, fmtPointer, arg2);
  calloc.free(fmtPointer);
  return result;
}