Cryptic C function pointer for conversion

data pulverizer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Dec 17 07:15:26 PST 2016


On Saturday, 17 December 2016 at 14:06:07 UTC, ketmar 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);
> ...
> }

Thanks ketmar,

I guess that this means I got it the other way round the function 
pointer that is returned is the function that takes in and 
returns void.

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

Does this mean that you can translate C code to D natively? I am 
currently only aware of the dstep package.




More information about the Digitalmars-d-learn mailing list