ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / modules / nntp-method.h
1 /* nntp-method.h - VFS modules for NNTP
2
3     Copyright (C) 2001 Andy Hertzfeld
4
5    The Gnome Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9
10    The Gnome Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public
16    License along with the Gnome Library; see the file COPYING.LIB.  If not,
17    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18    Boston, MA 02111-1307, USA.
19
20    based on Ian McKellar's (yakk@yakk.net) ftp method for gnome-vfs
21    
22    presents a high level, file-oriented view of a newsgroup, integrating file fragments
23    and organizing them in folders
24
25    Author: Andy Hertzfeld <andy@differnet.com>
26  
27  */
28
29 #ifndef NNTP_METHOD_H
30 #define NNTP_METHOD_H
31
32 #include <libgnomevfs/gnome-vfs-module.h>
33
34 typedef struct
35 {
36         int fragment_number;
37         char* fragment_id;
38         int fragment_size;
39         int bytes_read;
40 } nntp_fragment;
41
42 typedef struct
43 {
44         char* file_name;
45         char* folder_name;
46         char* file_type;
47         int file_size;
48         gboolean is_directory;
49         time_t mod_date;
50         
51         int total_parts;
52         GList *part_list;
53  } nntp_file;
54
55 typedef struct {
56         GnomeVFSMethodHandle method_handle;
57         GnomeVFSInetConnection *inet_connection;
58         GnomeVFSSocketBuffer *socketbuf;
59         GnomeVFSURI *uri;
60         GString *response_buffer;
61         gchar *response_message;
62         gint response_code;
63         enum {
64                 NNTP_NOTHING,
65                 NNTP_READ,
66                 NNTP_WRITE,
67                 NNTP_READDIR
68         } operation;
69                 
70         gchar *server_type; /* the response from TYPE */
71         gboolean anonymous;
72         
73         GList *next_file;
74         nntp_file *current_file;
75         GList *current_fragment;
76         
77         gpointer buffer;
78         int buffer_size;
79         int amount_in_buffer;
80         int buffer_offset;
81         
82         gboolean request_in_progress;
83         gboolean eof_flag;
84         gboolean uu_decode_mode;
85         gboolean base_64_decode_mode;
86 } NNTPConnection;
87
88
89 #endif /* NNTP_METHOD_H */