summaryrefslogtreecommitdiff
path: root/libsylph/nntp.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph/nntp.h')
-rw-r--r--libsylph/nntp.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/libsylph/nntp.h b/libsylph/nntp.h
new file mode 100644
index 0000000..045fae7
--- /dev/null
+++ b/libsylph/nntp.h
@@ -0,0 +1,123 @@
1/*
2 * LibSylph -- E-Mail client library
3 * Copyright (C) 1999-2012 Hiroyuki Yamamoto
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This 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 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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#include "socks.h"
28
29typedef struct _NNTPSession NNTPSession;
30
31#define NNTP_SESSION(obj) ((NNTPSession *)obj)
32
33struct _NNTPSession
34{
35 Session session;
36
37 gchar *group;
38
39 gchar *userid;
40 gchar *passwd;
41 gboolean auth_failed;
42};
43
44#define NN_SUCCESS 0
45#define NN_SOCKET 2
46#define NN_AUTHFAIL 3
47#define NN_PROTOCOL 4
48#define NN_SYNTAX 5
49#define NN_IOERR 6
50#define NN_ERROR 7
51#define NN_AUTHREQ 8
52#define NN_AUTHCONT 9
53
54#define NNTPBUFSIZE 8192
55
56#if USE_SSL
57Session *nntp_session_new (const gchar *server,
58 gushort port,
59 gchar *buf,
60 const gchar *userid,
61 const gchar *passwd,
62 SSLType ssl_type);
63Session *nntp_session_new_full (const gchar *server,
64 gushort port,
65 SocksInfo *socks_info,
66 gchar *buf,
67 const gchar *userid,
68 const gchar *passwd,
69 SSLType ssl_type);
70#else
71Session *nntp_session_new (const gchar *server,
72 gushort port,
73 gchar *buf,
74 const gchar *userid,
75 const gchar *passwd);
76Session *nntp_session_new_full (const gchar *server,
77 gushort port,
78 SocksInfo *socks_info,
79 gchar *buf,
80 const gchar *userid,
81 const gchar *passwd);
82#endif
83
84gint nntp_group (NNTPSession *session,
85 const gchar *group,
86 gint *num,
87 gint *first,
88 gint *last);
89gint nntp_get_article (NNTPSession *session,
90 const gchar *cmd,
91 gint num,
92 gchar **msgid);
93gint nntp_article (NNTPSession *session,
94 gint num,
95 gchar **msgid);
96gint nntp_body (NNTPSession *session,
97 gint num,
98 gchar **msgid);
99gint nntp_head (NNTPSession *session,
100 gint num,
101 gchar **msgid);
102gint nntp_stat (NNTPSession *session,
103 gint num,
104 gchar **msgid);
105gint nntp_next (NNTPSession *session,
106 gint *num,
107 gchar **msgid);
108gint nntp_xover (NNTPSession *session,
109 gint first,
110 gint last);
111gint nntp_xhdr (NNTPSession *session,
112 const gchar *header,
113 gint first,
114 gint last);
115gint nntp_list (NNTPSession *session);
116gint nntp_post (NNTPSession *session,
117 FILE *fp);
118gint nntp_newgroups (NNTPSession *session);
119gint nntp_newnews (NNTPSession *session);
120gint nntp_mode (NNTPSession *session,
121 gboolean stream);
122
123#endif /* __NNTP_H__ */