Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

downloads.h

Go to the documentation of this file.
00001 /*
00002  * $Id: downloads.h,v 1.14 2005/12/18 06:09:10 cbiere Exp $
00003  *
00004  * Copyright (c) 2001-2003, Raphael Manfredi
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *----------------------------------------------------------------------
00024  */
00025 
00036 #ifndef _core_downloads_h_
00037 #define _core_downloads_h_
00038 
00039 #include "lib/header.h"
00040 #include "fileinfo.h"
00041 
00042 #include "if/core/downloads.h"
00043 #include "if/core/search.h"         /* For gnet_host_vec_t */
00044 
00049 extern GSList *sl_unqueued;
00050 
00051 /*
00052  * Global Functions.
00053  */
00054 
00055 void download_init(void);
00056 void download_restore_state(void);
00057 void download_store_if_dirty(void);
00058 void download_timer(time_t now);
00059 void download_info_change_all(fileinfo_t *old_fi, fileinfo_t *new_fi);
00060 void download_orphan_new(
00061     gchar *file, filesize_t size, gchar *sha1, fileinfo_t *fi);
00062 void download_queue(struct download *d,
00063     const gchar *fmt, ...) G_GNUC_PRINTF(2, 3);
00064 void download_stop(struct download *, guint32,
00065     const gchar *, ...) G_GNUC_PRINTF(3, 4);
00066 void download_stop_v(struct download *d, guint32 new_status,
00067     const gchar * reason, va_list ap);
00068 void download_push_ack(struct gnutella_socket *);
00069 void download_fallback_to_push(struct download *, gboolean, gboolean);
00070 void download_pickup_queued(void);
00071 void download_forget(struct download *, gboolean unavailable);
00072 gboolean download_start_prepare(struct download *d);
00073 gboolean download_start_prepare_running(struct download *d);
00074 void download_send_request(struct download *);
00075 void download_retry(struct download *);
00076 void download_close(void);
00077 gboolean download_server_nopush(gchar *guid,
00078             const host_addr_t addr, guint16 port);
00079 void download_free_removed(void);
00080 void download_redirect_to_server(struct download *d,
00081         const host_addr_t addr, guint16 port);
00082 void download_actively_queued(struct download *d, gboolean queued);
00083 
00084 void download_verify_start(struct download *d);
00085 void download_verify_progress(struct download *d, guint32 hashed);
00086 void download_verify_done(struct download *d, gchar *digest, guint elapsed);
00087 void download_verify_error(struct download *d);
00088 
00089 void download_move_start(struct download *d);
00090 void download_move_progress(struct download *d, filesize_t copied);
00091 void download_move_done(struct download *d, guint elapsed);
00092 void download_move_error(struct download *d);
00093 
00094 guint extract_retry_after(struct download *d, const header_t *header);
00095 gboolean is_faked_download(const struct download *d);
00096 
00097 struct download *download_find_waiting_unparq(const host_addr_t addr,
00098                     guint16 port);
00099 void download_set_socket_rx_size(gint rx_size);
00100 
00101 void download_proxy_newstate(struct download *d);
00102 void download_proxy_sent(struct download *d);
00103 void download_proxy_failed(struct download *d);
00104 
00105 struct download * download_browse_start(const gchar *name,
00106     const gchar *hostname, host_addr_t addr, guint16 port,
00107     const gchar *guid, gboolean push, const gnet_host_vec_t *proxies,
00108     gnet_search_t search);
00109 
00110 void download_abort_browse_host(gpointer download, gnet_search_t sh);
00111 void download_got_eof(struct download *d);
00112 void download_rx_done(struct download *d);
00113 void download_browse_received(struct download *d, ssize_t received);
00114 void download_browse_maybe_finished(struct download *d);
00115 
00116 #endif /* _core_downloads_h_ */
00117 
00118 /* vi: set ts=4 sw=4 cindent: */

Generated on Sun Feb 12 10:49:56 2006 for Gtk-Gnutella by doxygen 1.3.6