Re: WWW interface functions in Gnome libraries?




On Tue, 19 May 1998, Graham Hughes wrote:
> In the event that it *is* considered useful, does this seem like a sane
> API?
> 
> 	void gnome_www_dispatch_browser(gchar * url);
>

Looks good to me. The browser command line should be a setting in
gnome-preferences, rather than hardcoded, with gnome-help-browser as the
hardcoded fallback.  You can probably see what I mean in
gnome-preferences.c. 

Some kind of error handling would be nice too, because a dialog should
come up if the browser launch fails. The dialog could be in the library or
your function could have a return code, I don't know which would be best.
 
> Run the default browser on url.
> 
> 	gint gnome_www_get_url(gchar * url, gchar * mimetype,
> 			       gint size);
> 

How about gchar ** mimetype, returning an allocated string, and drop the
size argument? A little simpler that way, and no fear of not getting the
whole mimetype.

What happens if it's a bad URL or there's an http error?

Havoc Pennington ==== http://pobox.com/~hp



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]