Statistics
| Revision:

root / src / nntp.h @ 1

History | View | Annotate | Download (2.74 KB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2003 Hiroyuki Yamamoto
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 2 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program 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
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
 */
19

    
20
#ifndef __NNTP_H__
21
#define __NNTP_H__
22

    
23
#include "session.h"
24
#if USE_SSL
25
#  include "ssl.h"
26
#endif
27

    
28
typedef struct _NNTPSession        NNTPSession;
29

    
30
#define NNTP_SESSION(obj)       ((NNTPSession *)obj)
31

    
32
struct _NNTPSession
33
{
34
        Session session;
35

    
36
        gchar *group;
37

    
38
        gchar *userid;
39
        gchar *passwd;
40
        gboolean auth_failed;
41
};
42

    
43
#define NN_SUCCESS        0
44
#define NN_SOCKET        2
45
#define NN_AUTHFAIL        3
46
#define NN_PROTOCOL        4
47
#define NN_SYNTAX        5
48
#define NN_IOERR        6
49
#define NN_ERROR        7
50
#define NN_AUTHREQ        8
51
#define NN_AUTHCONT        9
52

    
53
#define NNTPBUFSIZE        8192
54

    
55
#if USE_SSL
56
Session *nntp_session_new        (const gchar        *server,
57
                                 gushort         port,
58
                                 gchar                *buf,
59
                                 const gchar        *userid,
60
                                 const gchar        *passwd,
61
                                 SSLType         ssl_type);
62
#else
63
Session *nntp_session_new        (const gchar        *server,
64
                                 gushort         port,
65
                                 gchar                *buf,
66
                                 const gchar        *userid,
67
                                 const gchar        *passwd);
68
#endif
69

    
70
gint nntp_group                        (NNTPSession        *session,
71
                                 const gchar        *group,
72
                                 gint                *num,
73
                                 gint                *first,
74
                                 gint                *last);
75
gint nntp_get_article                (NNTPSession        *session,
76
                                 const gchar        *cmd,
77
                                 gint                 num,
78
                                 gchar               **msgid);
79
gint nntp_article                (NNTPSession        *session,
80
                                 gint                 num,
81
                                 gchar               **msgid);
82
gint nntp_body                        (NNTPSession        *session,
83
                                 gint                 num,
84
                                 gchar               **msgid);
85
gint nntp_head                        (NNTPSession        *session,
86
                                 gint                 num,
87
                                 gchar               **msgid);
88
gint nntp_stat                        (NNTPSession        *session,
89
                                 gint                 num,
90
                                 gchar               **msgid);
91
gint nntp_next                        (NNTPSession        *session,
92
                                 gint                *num,
93
                                 gchar               **msgid);
94
gint nntp_xover                        (NNTPSession        *session,
95
                                 gint                 first,
96
                                 gint                 last);
97
gint nntp_xhdr                        (NNTPSession        *session,
98
                                 const gchar        *header,
99
                                 gint                 first,
100
                                 gint                 last);
101
gint nntp_list                        (NNTPSession        *session);
102
gint nntp_post                        (NNTPSession        *session,
103
                                 FILE                *fp);
104
gint nntp_newgroups                (NNTPSession        *session);
105
gint nntp_newnews                (NNTPSession        *session);
106
gint nntp_mode                        (NNTPSession        *sessio,
107
                                 gboolean         stream);
108

    
109
#endif /* __NNTP_H__ */