On Sun, Jun 22, 2008 at 3:16 PM, Leonardo Foderaro <[EMAIL PROTECTED]>
wrote:

> Hi,
> I'm trying to write a simple prototype of the library we talked about
> some days ago.
> It is a really early version at the moment.. just some experiments (of
> course the lucky codename is test.c )
>
> What I'm using:
> - libcurl  for the remote content fetching
> - libxml2  for the gadget xml parsing
> - some data structures from the glibc2.0 (e.g. GHashTable) for storing
> dynamic variables
> - a lexical scanner (generated using flex) for the hangman substitution
>
> Actually I'm able to fetch a gadget from a remote URL (or a local
> file), load it into the XmlParser and perform the hangman vars
> substitution of the Content node through the flex scanner  (only
> __MODULE_ID__ for now).
>
> Of course there's a lot of work to do.
>
> Let me know what could be the next logical step.. I think I should
> construct a C representation of the gadget with all its properties,
> right? (it just writes to stdout at the moment)


Yeah, you'll probably want a struct similar to the JSON output from
/metadata in Shindig. As a library user / module writer, that's what I'd
want to consume.

Definitely try libcurl in multi mode -- it's quite possible to implement a
high concurrency http client in this model using async events -- you can use
libevent for this.

The ideal library would probably look something like this:

os_request *req = os_request_create();
req->locale = ...
os_request_add_gadget(req, "http://example.org/gadget.xml";);
os_get_data(req, &callback);

void callback(os_request *req, os_response *resp) {...}

Rendering could then be implemented as a consumer of this library.



>
> thanks to all,
> leonardo
>

Reply via email to