On Fri, Nov 08, 2002 at 07:36:33AM -0800, Jim Wilcoxson wrote:
>Creating a TCL-accessible array in a C module is trival. Just pass
Ah, thanks! Sometimes having one simple example in front of you is so
much more useful than any number of man pages. :)
>You use Tcl_GetVar to read simple TCL vars in C, or Tcl_GetVar2 to
>read TCL array vars in C. Again, these can be local, global, or
>ns_shares. Yet another reason why nsv's aren't the greatest thing
>since sliced bread. ;)
Well, AOLserver really SHOULD ship with a C API to nsv, but since it
doesn't, I created my own partial one. It was pretty easy. But then,
I took the shortcut of often using Ns_TclEval in my C nsv wrapper
functions. If I was doing it as part of AOLserver I'd instead create
a real C API and change the nsv Tcl commands to use it.
Perhaps nsv should be replaced with the svar work Zoran had worked on? You could provide backwards compatibility wrappers of course. What do you think Zoran?
- n
