function pointers and callbacks

This commit is contained in:
2026-06-15 21:09:46 +02:00
parent 3b7c3fcbd0
commit f5605fd3ec
21 changed files with 1927 additions and 122 deletions
+11
View File
@@ -36,6 +36,17 @@ int imported_string(const char *value) {
return 0;
}
int imported_apply(Imported_Mapper mapper, int value) {
if (mapper == NULL) {
abort();
}
int result = mapper(value);
if (result != value * 2) {
abort();
}
return result;
}
int imported_variadic(int marker, ...) {
va_list args;
va_start(args, marker);