Question about function aliases

Gary Willoughby dev at nomad.so
Wed Dec 11 15:42:42 PST 2013


For example i have some C code like this:

typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData 
clientData, Tcl_Interp *interp));

void Tcl_CallWhenDeleted(Tcl_Interp* interp, 
Tcl_InterpDeleteProc* proc, ClientData clientData);


I intend on converted this to D thus:

alias void function(ClientData clientData, Tcl_Interp* interp) 
Tcl_InterpDeleteProc;

void Tcl_CallWhenDeleted(Tcl_Interp* interp, 
Tcl_InterpDeleteProc* proc, ClientData clientData);

Is it correct keeping the * with the Tcl_InterpDeleteProc 
parameter or do i remove it? Is the alias above a function 
pointer?

To call this function can i use a function literal for the 
Tcl_InterpDeleteProc parameter? or do i need to pass an address 
of the function?


More information about the Digitalmars-d-learn mailing list