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

bh_upload.h

Go to the documentation of this file.
00001 /*
00002  * $Id: bh_upload.h,v 1.6 2006/01/01 19:09:03 rmanfredi Exp $
00003  *
00004  * Copyright (c) 2005, Christian Biere & 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 
00037 #ifndef _core_bh_upload_h_
00038 #define _core_bh_upload_h_
00039 
00040 #include "common.h"
00041 
00042 #include "tx.h"
00043 #include "tx_link.h"
00044 #include "tx_deflate.h"
00045 
00046 #include "if/core/hosts.h"
00047 #include "if/core/wrap.h"
00048 
00052 #define BH_VERSION_MAJOR    1
00053 #define BH_VERSION_MINOR    0
00054 
00058 #define BH_DEFLATE  (1 << 0)        
00059 #define BH_GZIP     (1 << 1)        
00060 #define BH_CHUNKED  (1 << 2)        
00061 #define BH_HTML     (1 << 3)        
00062 #define BH_QHITS    (1 << 4)        
00064 struct gnutella_socket;
00065 struct bio_source;
00066 
00067 typedef void (*bh_closed_t)(gpointer arg);
00068 typedef void (*bh_writable_t)(gpointer arg);
00069 
00070 struct special_ctx {
00071     txdrv_t *tx;
00072     ssize_t (*read)(gpointer ctx, gpointer dest, size_t size);
00073     ssize_t (*write)(gpointer ctx, gpointer data, size_t size);
00074     void (*flush)(gpointer ctx, bh_closed_t cb, gpointer arg);
00075     void (*close)(gpointer ctx, gboolean fully_served);
00076 };
00077 
00078 struct special_ctx *browse_host_open(
00079     gpointer owner, gnet_host_t *host,
00080     bh_writable_t writable,
00081     struct tx_deflate_cb *deflate_cb,
00082     struct tx_link_cb *link_cb,
00083     wrap_io_t *wio,
00084     gint flags);
00085 
00086 #endif /* _core_bh_upload_h_ */
00087 
00088 /* vi: set ts=4 sw=4 cindent: */

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