fpdemo.c:

/* start snip */
typedef void(*pt2Func)(void);
void pexec(pt2Func f)
{
        printf("start executing pointer\n");
        f();
        printf("done executing pointer\n");
}
/* end snip */

fp.pas:

{start snip}
program p;

{$link fpdemo.o}
{$linklib c}


type
    PFUNC = function():integer;

var
        a : integer;

procedure pexec(t : PFUNC); cdecl; external;

function f(): integer;
begin
        writeln('hello world');
end;

begin
        pexec(@f);
end.
{end snip}
compile with:
gcc -c fpdemo.c -arch i386
fpc fp.pas
Output:
start executing pointer
hello world
done executing pointer