Re: wrapping C functions
- Posted by rkdavis Feb 22, 2013
- 1456 views
petelomax said...
SDPringle said...
That's a little risky
I was thinking that too. Then it dawned on me, there is a far simpler way:
serialPrintf = link_c_proc(dll_ptr, "serialPrintf", {C_INT, C_POINTER}) procedure euSerialPrintf(integer fd, sequence fmt, object args) c_proc(serialPrintf, {fd, allocate_string(sprintf(fmt,args),1)}) end procedure
Pete
thanks, that looks good and will work for this case. i'll "steal" it and make the changes to the includes.