#include <stdio.h>
typedef void FUNC(const char *str);
typedef FUNC *FUNCPTR;
void func(const char *str)
{
}
void foo(FUNC *fn) { fn("foo"); }
void bar(FUNCPTR fn) { fn("bar"); }
void foobar(FUNC fn) { fn("foobar"); } // OK
int main()
{
FUNC *fn1 = func;
FUNCPTR fn2 = func;
// FUNC fn3 = func; // エラー
foo(func);
bar(func);
foobar(func);
fn1("fn1");
fn2("fn2");
// fn3("fn3");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHZvaWQgRlVOQyhjb25zdCBjaGFyICpzdHIpOwp0eXBlZGVmIEZVTkMgKkZVTkNQVFI7Cgp2b2lkIGZ1bmMoY29uc3QgY2hhciAqc3RyKQp7CiAgICBwcmludGYoImZ1bmMoJXMpXG4iLCBzdHIpOwp9Cgp2b2lkIGZvbyhGVU5DICpmbikgeyBmbigiZm9vIik7IH0Kdm9pZCBiYXIoRlVOQ1BUUiBmbikgeyBmbigiYmFyIik7IH0Kdm9pZCBmb29iYXIoRlVOQyBmbikgeyBmbigiZm9vYmFyIik7IH0gIC8vIE9LCgppbnQgbWFpbigpCnsKICAgIEZVTkMgKmZuMSA9IGZ1bmM7CiAgICBGVU5DUFRSIGZuMiA9IGZ1bmM7Ci8vICBGVU5DIGZuMyA9IGZ1bmM7ICAgIC8vIOOCqOODqeODvAoKICAgIGZvbyhmdW5jKTsKICAgIGJhcihmdW5jKTsKICAgIGZvb2JhcihmdW5jKTsKICAgIGZuMSgiZm4xIik7CiAgICBmbjIoImZuMiIpOwovLyAgZm4zKCJmbjMiKTsKCiAgICByZXR1cm4gMDsKfQo=