#include <stdio.h>
typedef void* (*function_pointer_t)(int index);
struct function_holder {
function_pointer_t callback;
};
void* testFn(int i)
{
}
int main(void) {
struct function_holder fh = { testFn };
struct function_holder* fhp = &fh;
fh.callback = testFn;
fh.callback(1);
fhp->callback(2);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHZvaWQqICgqZnVuY3Rpb25fcG9pbnRlcl90KShpbnQgaW5kZXgpOwoKc3RydWN0IGZ1bmN0aW9uX2hvbGRlciB7CglmdW5jdGlvbl9wb2ludGVyX3QgY2FsbGJhY2s7Cn07Cgp2b2lkKiB0ZXN0Rm4oaW50IGkpCnsKCXByaW50ZigidGVzdEZuICVkXG4iLCBpKTsKfQoKaW50IG1haW4odm9pZCkgewogICAgc3RydWN0IGZ1bmN0aW9uX2hvbGRlciBmaCA9IHsgdGVzdEZuIH07CiAgICBzdHJ1Y3QgZnVuY3Rpb25faG9sZGVyKiBmaHAgPSAmZmg7CiAgICAKICAgIGZoLmNhbGxiYWNrID0gdGVzdEZuOwogICAgZmguY2FsbGJhY2soMSk7CiAgICBmaHAtPmNhbGxiYWNrKDIpOwoKCXJldHVybiAwOwp9Cg==