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

bh_download.h

Go to the documentation of this file.
00001 /*
00002  * $Id: bh_download.h,v 1.2 2005/11/18 22:00:35 rmanfredi Exp $
00003  *
00004  * Copyright (c) 2005, 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_bh_download_h_
00037 #define _core_bh_download_h_
00038 
00039 #include "common.h"
00040 
00041 #include "search.h"
00042 #include "rx.h"
00043 #include "rx_link.h"
00044 #include "rx_inflate.h"
00045 #include "rx_chunk.h"
00046 
00047 #include "if/core/wrap.h"
00048 #include "if/core/gnutella.h"
00049 
00053 #define BH_DL_INFLATE   (1 << 0)    
00054 #define BH_DL_GUNZIP    (1 << 1)    
00055 #define BH_DL_CHUNKED   (1 << 2)    
00057 struct browse_ctx {
00058     gpointer owner;                 
00059     rxdrv_t *rx;                    
00060     gnet_host_t host;               
00061     gnet_search_t sh;               
00062     gchar *vendor;                  
00063     struct gnutella_header header;  
00064     gchar *data;                    
00065     guint data_size;                
00066     guint pos;                      
00067     guint32 size;                   
00068     gboolean has_header;            
00069     gboolean closed;                
00070 };
00071 
00072 /*
00073  * Public interface.
00074  */
00075 
00076 struct bio_source;
00077 
00078 struct browse_ctx *browse_host_dl_create(
00079     gpointer owner, gnet_host_t *host, gnet_search_t sh);
00080 void browse_host_dl_free(struct browse_ctx *bc);
00081 gboolean browse_host_dl_for_search(struct browse_ctx *bc, gnet_search_t sh);
00082 void browse_host_dl_write(struct browse_ctx *bc, gchar *data, size_t len);
00083 gboolean browse_host_dl_receive(
00084     struct browse_ctx *bc, gnet_host_t *host, wrap_io_t *wio,
00085     const gchar *vendor, guint32 flags);
00086 struct bio_source *browse_host_io_source(struct browse_ctx *bc);
00087 void browse_host_dl_close(struct browse_ctx *bc);
00088 void browse_host_dl_search_closed(struct browse_ctx *bc, gnet_search_t sh);
00089 
00090 #endif /* _core_bh_download_h_ */
00091 
00092 /* vi: set ts=4 sw=4 cindent: */

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