1 /* $Id: glibwww.hh,v 1.1.1.1 2003/07/04 22:30:05 atterer Exp $ -*- C++ -*-
3 This code was taken from glibwww2
4 <http://cvs.gnome.org/lxr/source/glibwww2/>, main author: James
5 Henstdridge <james@daa.com.au>, distributable under GPL, v2 or
9 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
18 void glibwww_parse_proxy_env();
20 /* Defined here so we don't have to include any libwww headers */
21 typedef struct _HTRequest GWWWRequest;
23 /* If status < 0, an error occured */
24 typedef void (*GWWWLoadToFileFunc) (const gchar *url, const gchar *file,
25 int status, gpointer user_data);
26 typedef void (*GWWWLoadToMemFunc) (const gchar *url, const gchar *buffer,
27 int size, int status, gpointer user_data);
29 /* Initialise enough of libwww for doing http/ftp downloads with
30 * authentication, redirection and proxy support.
32 void glibwww_init (const gchar *appName, const gchar *appVersion);
33 void glibwww_cleanup (void); /* not necessary -- registered with g_atexit() */
35 /* register the GUI dialogs for glibwww. This will take care of all the
36 * authentication and progress bar stuff for the application. */
37 void glibwww_register_gnome_dialogs (void);
39 /* Setup proxies as needed -- use the http://proxyhost:port/ notation */
40 void glibwww_add_proxy (const gchar *protocol, const gchar *proxy);
41 void glibwww_add_noproxy (const gchar *host);
43 /* Load a url to a file or to memory. The callback will be invoked
45 GWWWRequest *glibwww_load_to_file (const gchar *url, const gchar *file,
46 GWWWLoadToFileFunc callback,
49 GWWWRequest *glibwww_load_to_mem (const gchar *url,
50 GWWWLoadToMemFunc callback,
53 /* Abort a currently running download */
54 gboolean glibwww_abort_request(GWWWRequest *request);
56 /* Get the progress of the currently running request. nread or total may
57 * return a negative result if it can't determine how far along things are. */
58 void glibwww_request_progress (GWWWRequest *request,
59 glong *nread, glong *total);
62 /* This is called by glibwww_init, but may be useful if you only want to
63 * use the callbacks provided by glibwww for embedding libwww into the
65 void glibwww_register_callbacks (void);