RE: ClearSilver for C CGI bindings
"Liran Tal" <[email protected]> Thu, 13 Nov 2008 14:32:05 +0200
| Newsgroups | gmane.text.clearsilver.general |
|---|---|
| Message-ID | <[email protected]> |
I would love to hear about other "live" examples implemented in C for ClearSilver usage as it's what we are going for. In regards to the model, we're talking about a configuration for a router's settings web application and I was thinking of implementing it in such way that each configuration/status page is a CGI program of it's own with it's own cs template and there will probably be a single hdf file which aggregates all the data. In this manner too, I would be happy to hear of ideas for improvements or a "better way to do it" comments. Thanks, Liran. -----Original Message----- From: Brandon Long [mailto:[email protected]] Sent: Thursday, November 13, 2008 1:19 AM To: David Jeske Cc: Liran Tal; [email protected] Subject: Re: ClearSilver for C CGI bindings The clearsilver model currently lacks a "top level" idea of how to accept and dispatch different types of requests. The closest we've come to releasing something like that is for python in the examples directory: python/examples/base/CSPage.py, but even that is actually just an example base class for a single page, which doesn't include the "how do I route a request to a page". One of the reasons for this is that there are a lot of ways to do things, and a lot of the early adopters for Clearsilver did things in wildly different ways. Some used C and had a separate CGI for each page, some used python with a separate python script in mod_python, some routed all requests through a single python wrapper, some weren't using the LAMP stack at all but were compiling the code directly into their own webserver. The imd example is probably a pretty poor example of how one would actually want to organize a large web app in C. I should probably work on a better example. I had a slightly better one in C which implemented a simple blog service, but it was for a customer and quickly became more specific and less general than would be useful, and it depended on code that couldn't be open sourced. Maybe someone else on the list has a good and simple example that is available? Brandon On 11/12/08 David Jeske uttered the following other thing: > You can see an example image-server CGI written in C in the "imd" directory. > > The API is mostly the same in each language, so the brief tutorial written for > the Python API should be fairly easy to mentally translate into C. Make sure > you've checked out these pages first... > > http://www.clearsilver.net/docs/template_basics.hdf > http://www.clearsilver.net/docs/intro_clearsilver.hdf > http://www.clearsilver.net/docs/c_api.hdf > > Then take a look at the code in imd/imd.c. It provides a basic layout for a > c-CGI. > > > -- Liran Tal wrote: > > The website documentation doesn't cover in great detail the C > > programming logic to create a CGI. > > > > I have looked at the examples in the the cgi/ directory provided with > > the tar.gz package although these > > > > are the final product and there are no examples with documented usage on > > how to utilize the provided > > > > C API. > > > > Are there any C-specific tutorials out there one can follow? > > ------------------------------------ > > Yahoo! Groups Links > > > -- "When life hands you lemons, ask for a bottle of Tequila and salt!" http://www.tequilalove.com/ ******************************************** This outgoing mail message was scanned by McAfee GroupShield Engine