folder.c
5.45 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This program 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, or (at your option)
any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdlib.h>
#include <mailutils/error.h>
#include <mailutils/sys/folder.h>
int
folder_add_ref (folder_t folder)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->add_ref == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->add_ref (folder);
}
int
folder_release (folder_t folder)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->release == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->release (folder);
}
int
folder_destroy (folder_t folder)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->destroy == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->destroy (folder);
}
int
folder_open (folder_t folder, int flag)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->open == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->open (folder, flag);
}
int
folder_close (folder_t folder)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->close == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->close (folder);
}
int
folder_delete (folder_t folder, const char *name)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->delete == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->delete (folder, name);
}
int
folder_rename (folder_t folder, const char *oldname, const char *newname)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->rename == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->rename (folder, oldname, newname);
}
int
folder_subscribe (folder_t folder, const char *name)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->subscribe == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->subscribe (folder, name);
}
int
folder_unsubscribe (folder_t folder, const char *name)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->unsubscribe == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->unsubscribe (folder, name);
}
int
folder_list (folder_t folder, const char *dir, const char *name,
iterator_t *iterator)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->list == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->list (folder, dir, name, iterator);
}
int
folder_lsub (folder_t folder, const char *dir, const char *name,
iterator_t *iterator)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->lsub == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->lsub (folder, dir, name, iterator);
}
/* Stream settings. */
int
folder_get_stream (folder_t folder, stream_t *stream)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->get_stream == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->get_stream (folder, stream);
}
int
folder_set_stream (folder_t folder, stream_t stream)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->set_stream == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->set_stream (folder, stream);
}
/* Notifications. */
int
folder_get_observable (folder_t folder, observable_t *observable)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->get_observable == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->get_observable (folder, observable);
}
int
folder_get_debug (folder_t folder, mu_debug_t *debug)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->get_debug == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->get_debug (folder, debug);
}
int
folder_set_debug (folder_t folder, mu_debug_t debug)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->set_debug == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->set_debug (folder, debug);
}
/* Authentication. */
int
folder_get_authority (folder_t folder, authority_t *authority)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->get_authority == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->get_authority (folder, authority);
}
int
folder_set_authority (folder_t folder, authority_t authority)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->set_authority == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->set_authority (folder, authority);
}
/* URL. */
int
folder_get_url (folder_t folder, url_t *url)
{
if (folder == NULL || folder->vtable == NULL
|| folder->vtable->get_url == NULL)
return MU_ERROR_NOT_SUPPORTED;
return folder->vtable->get_url (folder, url);
}