function pointers and callbacks
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user