Cryptic C function pointer for conversion

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Dec 17 06:06:07 PST 2016


On Saturday, 17 December 2016 at 13:39:27 UTC, data pulverizer 
wrote:

that is what it means, in D:

//void (*(*xDlSym)(sqlite3_vfs*,void*, const char 
*zSymbol))(void);

struct sqlite3_vfs {}

extern(C) {
alias RetRes = void function ();
alias DeclType = RetRes function (sqlite3_vfs *a,void *b, const 
char *zSymbol);

DeclType xDlSym;

void zoo (void) {}
auto goo (sqlite3_vfs *a,void *b, const char *zSymbol) { return 
&zoo; }
}

void main () {
   xDlSym = &goo;
}


at least that is what i managed to decode, fed to C(++) compiler 
and translate to D.


More information about the Digitalmars-d-learn mailing list