On Thu, Jun 30, 2005 at 04:50:58PM +0200, Wojciech Kocjan wrote: > Andrew Piskorski napisa??(a):
> >You can call Tcl from C (with Ns_TclEval, probably other ways too). > >E.g., I started using Ns_TclEval to do nsv operations (nsv_set, > >nsv_get, etc.) from C, inside my own little C wrapper functions. Then > Of course you meant Tcl_EvalObjv()? That would be another (and more modern) way to do it. I wrote the code I was talking about in 2001, using AOLserver 3.3+ad13, and back then I happily used Ns_TclEval, and in fact all string commands, no Tcl_Obj stuff at all. Worked fine. When I switched to AOLserver 4.x I had to change my C nsv_* wrappers to use Tcl_Obj, since that's how the nsv functions are implemented in 4.x. And then I learned to be very careful to properly use Tcl_IncrRefCount() and Tcl_DecrRefCount() (the Tcl docs are not entirely clear on that), or you will get memory leaks. -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
