Re: Using libwww with gnome/gtk+

Hello James,

In our previous episode, James Henstridge said:
> 
> I have been looking at using at using libwww in one of the gnome
> (www.gnome.org) programs I have written.  In doing this I have written up
> some event register/unregister functions that use the glib event loop,
> which makes libwww fit nicely into just about any gnome or gtk+ program.
> 
> If anyone else is interested in it, it is at /gnorpm/tests/glibwww.c in
> the gnome CVS tree, which can be viewed at:
>   http://cvs.gnome.org/lxr/source/gnorpm/tests/glibwww.c
>
> This code may be useful for other people wanting to use libwww with gtk.

Good work. Would you mind if I put a link to it from the libwww NEWS page?

One question, didn't you need to register the timers too with libwww?
When I set up my X11 libwww interface in Amaya, I had to register them too,
using:

	   HTTimer_registerSetTimerCallback ();
	   HTTimer_registerDeleteTimerCallback ();

(Same principle as with HTEvent_setRegisterCallback).

> Now for my question:  what is the best way to only link with enough of
> libwww to get http and ftp transfers (no HTML, XML, news, gopher, telnet,
> etc)?  With libwww compiled as multiple shared libraries under unix, it
> seems that if you use any of the higher level libraries you end up needing
> to link with all the other libraries.
> 
> It seems that if you use the HTProfile_new* functions, you end up needing
> symbols from every other library, even if the functionality is never used.
> Is there a better way to initialise libwww?

You'll have to write your own HTInit.c module and link to it too. That's
what I did in Amaya to minimize the number of mini-libwww's that need to
be linked. Look at the tiny browser (Examples/tiny.c) for an example
of how to do it.

One last interesting question, why are you using libwww instead of ghttp?

-Jose

Received on Wednesday, 1 September 1999 08:47:51 UTC