github.com/jwijenbergh/purego@v0.0.0-20240126093400-70ff3a61df13/libcbtest/callback.c (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: 2023 The Ebitengine Authors 3 4 #include <string.h> 5 6 typedef int (*callback)(const char *, int); 7 8 int callCallback(const void *fp, const char *s) { 9 // If the callback corrupts FP, this local variable on the stack will have incorrect value. 10 int sentinel = 10101; 11 ((callback)(fp))(s, strlen(s)); 12 return sentinel; 13 }