sdlStrnstr function
extern SDL_DECLSPEC char * SDLCALL SDL_strnstr(const char *haystack, const char *needle, size_t maxlen)
Implementation
Pointer<Int8> sdlStrnstr(String? haystack, String? needle, int maxlen) {
final sdlStrnstrLookupFunction = libSdl3.lookupFunction<
Pointer<Int8> Function(
Pointer<Utf8> haystack, Pointer<Utf8> needle, Uint32 maxlen),
Pointer<Int8> Function(Pointer<Utf8> haystack, Pointer<Utf8> needle,
int maxlen)>('SDL_strnstr');
final haystackPointer = haystack != null ? haystack.toNativeUtf8() : nullptr;
final needlePointer = needle != null ? needle.toNativeUtf8() : nullptr;
final result =
sdlStrnstrLookupFunction(haystackPointer, needlePointer, maxlen);
calloc.free(haystackPointer);
calloc.free(needlePointer);
return result;
}