Code Search for Developers
 
 
  

downloads.h from Gtk-Gnutella at Krugle


Show downloads.h syntax highlighted

/*
 * $Id: downloads.h 14746 2007-09-02 19:28:51Z cbiere $
 *
 * Copyright (c) 2001-2003, Raphael Manfredi
 *
 *----------------------------------------------------------------------
 * This file is part of gtk-gnutella.
 *
 *  gtk-gnutella is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  gtk-gnutella is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with gtk-gnutella; if not, write to the Free Software
 *  Foundation, Inc.:
 *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *----------------------------------------------------------------------
 */

/**
 * @ingroup core
 * @file
 *
 * Needs brief description here.
 *
 * @author Raphael Manfredi
 * @date 2001-2003
 */

#ifndef _core_downloads_h_
#define _core_downloads_h_

#include "common.h"

#include "lib/header.h"

#include "fileinfo.h"

#include "if/core/downloads.h"
#include "if/core/search.h"			/* For gnet_host_vec_t */

/*
 * Global Functions.
 */

void download_init(void);
void download_restore_state(void);
void download_store_if_dirty(void);
void download_timer(time_t now);
void download_info_change_all(fileinfo_t *old_fi, fileinfo_t *new_fi);
void download_orphan_new(const gchar *file, filesize_t size,
		const struct sha1 *sha1, fileinfo_t *fi);
void download_queue(struct download *d,
	const gchar *fmt, ...) G_GNUC_PRINTF(2, 3);
void download_stop(struct download *, download_status_t,
	const gchar *, ...) G_GNUC_PRINTF(3, 4);
void download_stop_v(struct download *d, download_status_t new_status,
    const gchar * reason, va_list ap);
void download_push_ack(struct gnutella_socket *);
void download_fallback_to_push(struct download *, gboolean, gboolean);
void download_forget(struct download *, gboolean unavailable);
gboolean download_start_prepare(struct download *d);
gboolean download_start_prepare_running(struct download *d);
void download_send_request(struct download *);
void download_connected(struct download *);
void download_close(void);
gboolean download_server_nopush(const gchar *guid,
			const host_addr_t addr, guint16 port);
void download_free_removed(void);
void download_redirect_to_server(struct download *d,
		const host_addr_t addr, guint16 port);
void download_actively_queued(struct download *d, gboolean queued);

void download_move_start(struct download *d);
void download_move_progress(struct download *d, filesize_t copied);
void download_move_done(struct download *d, const gchar *pathname,
		guint elapsed);
void download_move_error(struct download *d);

guint extract_retry_after(struct download *d, const header_t *header);
gboolean is_faked_download(const struct download *d);

struct download *download_find_waiting_unparq(const host_addr_t addr,
					guint16 port);
void download_set_socket_rx_size(unsigned rx_size);

void download_proxy_newstate(struct download *d);
void download_proxy_sent(struct download *d);
void download_proxy_failed(struct download *d);

struct download * download_browse_start(
	const gchar *hostname, host_addr_t addr, guint16 port,
	const gchar *guid, const gnet_host_vec_t *proxies,
	gnet_search_t search, guint32 flags);

struct download * download_thex_start(const gchar *uri,
	const struct sha1 *sha1, const struct tth *tth, filesize_t filesize,
	const gchar *hostname, host_addr_t addr, guint16 port,
	const gchar *guid, const gnet_host_vec_t *proxies,
	guint32 flags);

void download_abort_browse_host(struct download *d, gnet_search_t sh);
void download_got_eof(struct download *d);
void download_rx_done(struct download *d);

void download_data_received(struct download *d, ssize_t received);
void download_maybe_finished(struct download *d);

gboolean download_handle_http(const gchar *url);
gboolean download_is_stalled(struct download *);
gboolean download_is_alive(const struct download *);

gboolean download_remove(struct download *d);
void download_abort(struct download *d);

#endif /* _core_downloads_h_ */

/* vi: set ts=4 sw=4 cindent: */




See more files for this project here

Gtk-Gnutella

A GTK+ Gnutella client for Unix, efficient, reliable and fast, written in C. It has been optimized for speed and scalability, with low-memory consumption. It is meant to be left running 24x7, using little CPU and only the configured bandwidth.

Project homepage: http://sourceforge.net/projects/gtk-gnutella
Programming language(s): C
License: other

  Jmakefile
  Makefile.SH
  alive.c
  alive.h
  ban.c
  ban.h
  bh_download.c
  bh_download.h
  bh_upload.c
  bh_upload.h
  bitzi.c
  bitzi.h
  bogons.c
  bogons.h
  bsched.c
  bsched.h
  clock.c
  clock.h
  dh.c
  dh.h
  dime.c
  dime.h
  dmesh.c
  dmesh.h
  downloads.c
  downloads.h
  dq.c
  dq.h
  extensions.c
  extensions.h
  features.c
  features.h
  file_object.c
  file_object.h
  fileinfo.c
  fileinfo.h
  geo_ip.c
  geo_ip.h
  ggep.c
  ggep.h
  ggep_type.c
  ggep_type.h
  gmsg.c
  gmsg.h
  gnet_stats.c
  gnet_stats.h
  gnutella.h
  guid.c
  guid.h
  hcache.c
  hcache.h
  hostiles.c
  hostiles.h
  hosts.c
  hosts.h
  hsep.c
  hsep.h
  http.c
  http.h
  huge.c
  huge.h
  ignore.c
  ignore.h
  inet.c
  inet.h
  ioheader.c
  ioheader.h
  local_shell.c
  local_shell.h
  matching.c
  matching.h
  mime_types.h
  move.c
  move.h
  mq.c
  mq.h
  mq_tcp.c
  mq_tcp.h
  mq_udp.c
  mq_udp.h
  namesize.c
  namesize.h
  nodes.c
  nodes.h
  ntp.c
  ntp.h
  oob.c
  oob.h
  oob_proxy.c
  oob_proxy.h
  parq.c
  parq.h
  pcache.c
  pcache.h
  pmsg.c
  pmsg.h
  pproxy.c
  pproxy.h
  qhit.c
  qhit.h
  qrp.c
  qrp.h