Forum OpenACS Q&A: Re: Using the API for shell scripts

Collapse
Posted by Andrew Piskorski on
Jose, you are writing a stand-alone program in C, which you call from the command line? In that case, why would you ever need nsv? Nsv is for sharing data between threads in AOLserver. What does your command line C program do? Is this still for the "load many courses and users into OpenACS from an external database" problem that you opened this thread with? If so I don't see why you'd be doing any C coding at all for that.

I think the following is not useful for Jose's application, but just in case:

If on the other hand you're writing an AOLserver module in C, you may have noticed that AOLserver provides no C API to nsv, only a Tcl API. However, it is fortunately not too difficult to add an efficient C NSV API. I have done so and use it myself, although I never packaged it up for release. (Which means if someone actually needs it, let me know.)

If you are writing a non-AOLserver multi-threaded program and miss the AOLserver Nsv API, you are in luck, just use the Tcl Threads Extension with tclsh. It's tsv api is just like nsv only better. Last time I looked tsv also has only a Tcl API no C; I never tried to add a C API to it but presumably it should also be feasible.