And if the c pointer points to a vector of numeric values and not a single int? Is there any way to manage that in pyrex?<br><br><div><span class="gmail_quote">2008/4/9, Lenard Lindstrom <<a href="mailto:len-l@telus.net">len-l@telus.net</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Daniele Pianu wrote:<br> > I've a C function like this<br> ><br> > void Socket_getRemoteAddr(Socket *self, char *serverHostAddr, int bufferSize, int *serverPortNo)<br> ><br> > and I want to wrap it on this python method<br>
><br> > def setRemoteAddr( self, serverHostAddr, serverPortNo )<br> ><br> > serverPortNo is a python integer, and it must reflect modifications<br> > done on the relative C argument (serverPortNo). How can I do it in pyrex?<br>
><br> <br>The usual way is to return the changed value as a value of the function:<br> <br> def setRemoteAddr(...., int serverPortNo):<br> ....<br> Socket_getRemoteAddr(...., &serverPortNo)<br> ....<br> return serverPortNo<br>
<br> --<br> Lenard Lindstrom<br> <<a href="mailto:len-l@telus.net">len-l@telus.net</a>><br> <br> <br> _______________________________________________<br> Pyrex mailing list<br> <a href="mailto:Pyrex@lists.copyleft.no">Pyrex@lists.copyleft.no</a><br>
<a href="http://lists.copyleft.no/mailman/listinfo/pyrex">http://lists.copyleft.no/mailman/listinfo/pyrex</a><br> </blockquote></div><br>