__attribute__((callback(1, 2))) void *broker0(void *(*callee)(void *), void *payload) {
return callee(payload);
}
__attribute__((callback(callee, payload))) void *broker1(void *payload, void *(*callee)(void *)) {
return broker0(callee, payload);
}
void *broker2(void (*callee)(void));
__attribute__((callback(callee))) void *broker2(void (*callee)(void));
void *broker2(void (*callee)(void));
__attribute__((callback(4, 1, 2, c))) void *broker3(int, int, int c, int (*callee)(int, int, int), int);
__attribute__((callback(4, -1, a, __))) void *broker4(int a, int, int, int (*callee)(int, int, int), int);
__attribute__((callback(4, d, 5, 2))) void *broker5(int, int, int, int (*callee)(int, int, int), int d);
static void *VoidPtr2VoidPtr(void *payload) {
return payload;
}
static int ThreeInt2Int(int a, int b, int c) {
return a * b + c;
}
void foo(void) {
broker0(VoidPtr2VoidPtr, 0l);
broker1(0l, VoidPtr2VoidPtr);
broker2(foo);
broker3(1, 4, 5, ThreeInt2Int, 1);
broker4(4, 2, 7, ThreeInt2Int, 0);
broker5(8, 0, 3, ThreeInt2Int, 4);
}