File: nntp-method.h

package info (click to toggle)
gnome-vfs 1:2.24.4-6.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 17,144 kB
  • ctags: 10,422
  • sloc: ansic: 78,500; sh: 10,341; makefile: 902; perl: 99
file content (89 lines) | stat: -rw-r--r-- 2,186 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* nntp-method.h - VFS modules for NNTP

    Copyright (C) 2001 Andy Hertzfeld

   The Gnome Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The Gnome Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.

   based on Ian McKellar's (yakk@yakk.net) ftp method for gnome-vfs
   
   presents a high level, file-oriented view of a newsgroup, integrating file fragments
   and organizing them in folders

   Author: Andy Hertzfeld <andy@differnet.com>
 
 */

#ifndef NNTP_METHOD_H
#define NNTP_METHOD_H

#include <libgnomevfs/gnome-vfs-module.h>

typedef struct
{
	int fragment_number;
	char* fragment_id;
	int fragment_size;
	int bytes_read;
} nntp_fragment;

typedef struct
{
  	char* file_name;
	char* folder_name;
	char* file_type;
	int file_size;
	gboolean is_directory;
	time_t mod_date;
	
	int total_parts;
	GList *part_list;
 } nntp_file;

typedef struct {
	GnomeVFSMethodHandle method_handle;
	GnomeVFSInetConnection *inet_connection;
	GnomeVFSSocketBuffer *socketbuf;
	GnomeVFSURI *uri;
	GString *response_buffer;
	gchar *response_message;
	gint response_code;
	enum {
		NNTP_NOTHING,
		NNTP_READ,
		NNTP_WRITE,
		NNTP_READDIR
	} operation;
		
	gchar *server_type; /* the response from TYPE */
	gboolean anonymous;
	
	GList *next_file;
	nntp_file *current_file;
	GList *current_fragment;
	
	gpointer buffer;
	int buffer_size;
	int amount_in_buffer;
	int buffer_offset;
	
	gboolean request_in_progress;
	gboolean eof_flag;
	gboolean uu_decode_mode;
	gboolean base_64_decode_mode;
} NNTPConnection;


#endif /* NNTP_METHOD_H */