00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
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
00101
00102
00103