From: Block, R. (N-SSTI) <ron...@lm...> - 2007-02-12 14:46:47
|
Murthy, Try returning the pointer in return variable. That's what worked for me. ________________________________ From: swi...@li... [mailto:swi...@li...] On Behalf Of chandragiri murthy Sent: Thursday, February 08, 2007 9:16 AM To: swi...@li... Subject: [Swig-user] pointer to pointer problem Hi all, I have to generate perl interface for a C function that takes a reference pointer (pointer to pointer) to a structure as an argument and returns the malloced structure into this argument back. I have trouble to generate perl interface using swig. Please tell me how to do this. I give the C code below. int init_struct (struct mystruct **st){ struct mystruct ms = malloc(sizeof(struct mystruct)); ms->number = 1; ms->name = "murthy"; *st = ms; return 1; } thanks murthy ________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. <http://us.rd.yahoo.com/evt=49936/*http:/videogames.yahoo.com> |