blob: 84885110fb6dbf8cecbc8f1e0ad9df20766eee31 [file]
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "cbbox.h"
int cb(int (*fn)(void));
static int fn(void) {
printf("hello from fn!\n");
return 32;
}
int main() {
void *box_fn = cbbox_register_cb(&fn);
int r = cb(box_fn);
assert(r == 42);
printf("cb(fn) = %d\n", r);
}