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

ioheader.h

Go to the documentation of this file.
00001 /*
00002  * $Id: ioheader.h,v 1.3 2005/06/25 01:37:40 daichik Exp $
00003  *
00004  * Copyright (c) 2002-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_ioheader_h_
00037 #define _core_ioheader_h_
00038 
00039 #include <glib.h>
00040 
00041 struct io_header;
00042 struct header;
00043 struct getline;
00044 struct bsched;
00045 struct gnutella_socket;
00046 
00051 struct io_error {
00052     void (*line_too_long)(gpointer resource);
00053     void (*header_error_tell)(gpointer resource, gint error);   
00054     void (*header_error)(gpointer resource, gint error);
00055     void (*input_exception)(gpointer resource);
00056     void (*input_buffer_full)(gpointer resource);
00057     void (*header_read_error)(gpointer resource, gint error);
00058     void (*header_read_eof)(gpointer resource);
00059     void (*header_extra_data)(gpointer resource);
00060 };
00061 
00062 typedef void (*io_done_cb_t)(gpointer resource, struct header *header);
00063 typedef void (*io_start_cb_t)(gpointer resource);
00064 
00065 /*
00066  * Parsing flags.
00067  */
00068 
00069 #define IO_HEAD_ONLY        0x00000001  
00070 #define IO_SAVE_FIRST       0x00000002  
00071 #define IO_SINGLE_LINE      0x00000004  
00072 #define IO_3_WAY            0x00000008  
00073 #define IO_SAVE_HEADER      0x00000010  
00075 /*
00076  * Public interface
00077  */
00078 
00079 void io_free(gpointer opaque);
00080 struct header *io_header(gpointer opaque);
00081 struct getline *io_getline(gpointer opaque);
00082 gchar *io_gettext(gpointer opaque);
00083 
00084 void io_get_header(
00085     gpointer resource,              
00086     gpointer *io_opaque,            
00087     struct bsched *bs,              
00088     struct gnutella_socket *s,      
00089     gint flags,                     
00090     io_done_cb_t done,              
00091     io_start_cb_t start,            
00092     const struct io_error *error);  
00094 void io_continue_header(
00095     gpointer opaque,                
00096     gint flags,                     
00097     io_done_cb_t done,              
00098     io_start_cb_t start);           
00100 #endif  /* _core_ioheader_h_ */
00101 
00102 /* vi: set ts=4 sw=4 cindent: */
00103 

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