attribute.c mbx_unix.c message.c
do not use an owner to set the attributes. mime.c include/private/cpystr.h include/private/io0.h include/private/mailbox0.h include/private/mbx_imap.h include/private/mbx_mbox.h include/private/mbx_mdir.h include/private/mbx_mmdf.h include/private/mbx_pop.h include/private/mbx_unix.h include/private/message0.h include/private/mime0.h include/private/registrar0.h include/private/url0.h include/public/attribute.h include/public/auth.h include/public/event.h include/public/header.h include/public/io.h include/public/locker.h include/public/mailbox.h include/public/message.h include/public/mime.h include/public/registrar.h include/public/transcode.h include/public/url.h put the headers in a separate file space.
Showing
29 changed files
with
251 additions
and
101 deletions
... | @@ -56,7 +56,6 @@ attribute_destroy (attribute_t *pattr, void *owner) | ... | @@ -56,7 +56,6 @@ attribute_destroy (attribute_t *pattr, void *owner) |
56 | if (pattr && *pattr) | 56 | if (pattr && *pattr) |
57 | { | 57 | { |
58 | attribute_t attr = *pattr; | 58 | attribute_t attr = *pattr; |
59 | |||
60 | if (attr->owner == owner) | 59 | if (attr->owner == owner) |
61 | free (attr); | 60 | free (attr); |
62 | /* loose the link */ | 61 | /* loose the link */ |
... | @@ -66,85 +65,61 @@ attribute_destroy (attribute_t *pattr, void *owner) | ... | @@ -66,85 +65,61 @@ attribute_destroy (attribute_t *pattr, void *owner) |
66 | } | 65 | } |
67 | 66 | ||
68 | int | 67 | int |
69 | attribute_set_seen (attribute_t attr, void *owner) | 68 | attribute_set_seen (attribute_t attr) |
70 | { | 69 | { |
71 | if (attr == NULL) | 70 | if (attr == NULL) |
72 | return EINVAL; | 71 | return EINVAL; |
73 | if (owner == attr->owner) | ||
74 | { | ||
75 | attr->flag |= MU_ATTRIBUTE_SEEN; | 72 | attr->flag |= MU_ATTRIBUTE_SEEN; |
76 | return 0; | 73 | return 0; |
77 | } | ||
78 | return EACCES; | ||
79 | } | 74 | } |
80 | 75 | ||
81 | int | 76 | int |
82 | attribute_set_answered (attribute_t attr, void *owner) | 77 | attribute_set_answered (attribute_t attr) |
83 | { | 78 | { |
84 | if (attr == NULL) | 79 | if (attr == NULL) |
85 | return EINVAL; | 80 | return EINVAL; |
86 | if (owner == attr->owner) | ||
87 | { | ||
88 | attr->flag |= MU_ATTRIBUTE_ANSWERED; | 81 | attr->flag |= MU_ATTRIBUTE_ANSWERED; |
89 | return 0; | 82 | return 0; |
90 | } | ||
91 | return EACCES; | ||
92 | } | 83 | } |
93 | 84 | ||
94 | int | 85 | int |
95 | attribute_set_flagged (attribute_t attr, void *owner) | 86 | attribute_set_flagged (attribute_t attr) |
96 | { | 87 | { |
97 | if (attr == NULL) | 88 | if (attr == NULL) |
98 | return EINVAL; | 89 | return EINVAL; |
99 | if (owner == attr->owner) | ||
100 | { | ||
101 | attr->flag |= MU_ATTRIBUTE_FLAGGED; | 90 | attr->flag |= MU_ATTRIBUTE_FLAGGED; |
102 | return 0; | 91 | return 0; |
103 | } | ||
104 | return EACCES; | ||
105 | } | 92 | } |
106 | 93 | ||
107 | int | 94 | int |
108 | attribute_set_read (attribute_t attr, void *owner) | 95 | attribute_set_read (attribute_t attr) |
109 | { | 96 | { |
110 | if (attr == NULL) | 97 | if (attr == NULL) |
111 | return EINVAL; | 98 | return EINVAL; |
112 | if (owner == attr->owner) | ||
113 | { | ||
114 | attr->flag |= MU_ATTRIBUTE_READ; | 99 | attr->flag |= MU_ATTRIBUTE_READ; |
115 | return 0; | 100 | return 0; |
116 | } | ||
117 | return EACCES; | ||
118 | } | 101 | } |
119 | 102 | ||
120 | int | 103 | int |
121 | attribute_set_deleted (attribute_t attr, void *owner) | 104 | attribute_set_deleted (attribute_t attr) |
122 | { | 105 | { |
123 | if (attr == NULL) | 106 | if (attr == NULL) |
124 | return EINVAL; | 107 | return EINVAL; |
125 | if (owner == attr->owner) | ||
126 | { | ||
127 | attr->flag |= MU_ATTRIBUTE_DELETED; | 108 | attr->flag |= MU_ATTRIBUTE_DELETED; |
128 | return 0; | 109 | return 0; |
129 | } | ||
130 | return EACCES; | ||
131 | } | 110 | } |
132 | 111 | ||
133 | int | 112 | int |
134 | attribute_set_draft (attribute_t attr, void *owner) | 113 | attribute_set_draft (attribute_t attr) |
135 | { | 114 | { |
136 | if (attr == NULL) | 115 | if (attr == NULL) |
137 | return EINVAL; | 116 | return EINVAL; |
138 | if (owner == attr->owner) | ||
139 | { | ||
140 | attr->flag |= MU_ATTRIBUTE_DRAFT; | 117 | attr->flag |= MU_ATTRIBUTE_DRAFT; |
141 | return 0; | 118 | return 0; |
142 | } | ||
143 | return EACCES; | ||
144 | } | 119 | } |
145 | 120 | ||
146 | int | 121 | int |
147 | attribute_set_recent (attribute_t attr, void *owner) | 122 | attribute_set_recent (attribute_t attr) |
148 | { | 123 | { |
149 | if (attr == NULL) | 124 | if (attr == NULL) |
150 | return EINVAL; | 125 | return EINVAL; |
... | @@ -213,94 +188,66 @@ attribute_is_recent (attribute_t attr) | ... | @@ -213,94 +188,66 @@ attribute_is_recent (attribute_t attr) |
213 | } | 188 | } |
214 | 189 | ||
215 | int | 190 | int |
216 | attribute_unset_seen (attribute_t attr, void *owner) | 191 | attribute_unset_seen (attribute_t attr) |
217 | { | 192 | { |
218 | if (attr == NULL) | 193 | if (attr == NULL) |
219 | return 0; | 194 | return 0; |
220 | if (owner == attr->owner) | ||
221 | { | ||
222 | attr->flag &= ~MU_ATTRIBUTE_SEEN; | 195 | attr->flag &= ~MU_ATTRIBUTE_SEEN; |
223 | return 0; | 196 | return 0; |
224 | } | ||
225 | return EACCES; | ||
226 | } | 197 | } |
227 | 198 | ||
228 | int | 199 | int |
229 | attribute_unset_answered (attribute_t attr, void *owner) | 200 | attribute_unset_answered (attribute_t attr) |
230 | { | 201 | { |
231 | if (attr == NULL) | 202 | if (attr == NULL) |
232 | return 0; | 203 | return 0; |
233 | if (owner == attr->owner) | ||
234 | { | ||
235 | attr->flag &= ~MU_ATTRIBUTE_ANSWERED; | 204 | attr->flag &= ~MU_ATTRIBUTE_ANSWERED; |
236 | return 0; | 205 | return 0; |
237 | } | ||
238 | return EACCES; | ||
239 | } | 206 | } |
240 | 207 | ||
241 | int | 208 | int |
242 | attribute_unset_flagged (attribute_t attr, void *owner) | 209 | attribute_unset_flagged (attribute_t attr) |
243 | { | 210 | { |
244 | if (attr == NULL) | 211 | if (attr == NULL) |
245 | return 0; | 212 | return 0; |
246 | if (owner == attr->owner) | ||
247 | { | ||
248 | attr->flag &= ~MU_ATTRIBUTE_FLAGGED; | 213 | attr->flag &= ~MU_ATTRIBUTE_FLAGGED; |
249 | return 0; | 214 | return 0; |
250 | } | ||
251 | return EACCES; | ||
252 | } | 215 | } |
253 | 216 | ||
254 | int | 217 | int |
255 | attribute_unset_read (attribute_t attr, void *owner) | 218 | attribute_unset_read (attribute_t attr) |
256 | { | 219 | { |
257 | if (attr == NULL) | 220 | if (attr == NULL) |
258 | return 0; | 221 | return 0; |
259 | if (owner == attr->owner) | ||
260 | { | ||
261 | attr->flag &= ~MU_ATTRIBUTE_READ; | 222 | attr->flag &= ~MU_ATTRIBUTE_READ; |
262 | return 0; | 223 | return 0; |
263 | } | ||
264 | return EACCES; | ||
265 | } | 224 | } |
266 | 225 | ||
267 | int | 226 | int |
268 | attribute_unset_deleted (attribute_t attr, void *owner) | 227 | attribute_unset_deleted (attribute_t attr) |
269 | { | 228 | { |
270 | if (attr == NULL) | 229 | if (attr == NULL) |
271 | return 0; | 230 | return 0; |
272 | if (owner == attr->owner) | ||
273 | { | ||
274 | attr->flag &= ~MU_ATTRIBUTE_DELETED; | 231 | attr->flag &= ~MU_ATTRIBUTE_DELETED; |
275 | return 0; | 232 | return 0; |
276 | } | ||
277 | return EACCES; | ||
278 | } | 233 | } |
279 | 234 | ||
280 | int | 235 | int |
281 | attribute_unset_draft (attribute_t attr, void *owner) | 236 | attribute_unset_draft (attribute_t attr) |
282 | { | 237 | { |
283 | if (attr == NULL) | 238 | if (attr == NULL) |
284 | return 0; | 239 | return 0; |
285 | if (owner == attr->owner) | ||
286 | { | ||
287 | attr->flag &= ~MU_ATTRIBUTE_DRAFT; | 240 | attr->flag &= ~MU_ATTRIBUTE_DRAFT; |
288 | return 0; | 241 | return 0; |
289 | } | ||
290 | return EACCES; | ||
291 | } | 242 | } |
292 | 243 | ||
293 | int | 244 | int |
294 | attribute_unset_recent (attribute_t attr, void *owner) | 245 | attribute_unset_recent (attribute_t attr) |
295 | { | 246 | { |
296 | if (attr == NULL) | 247 | if (attr == NULL) |
297 | return 0; | 248 | return 0; |
298 | if (owner == attr->owner) | ||
299 | { | ||
300 | attr->flag &= ~MU_ATTRIBUTE_RECENT; | 249 | attr->flag &= ~MU_ATTRIBUTE_RECENT; |
301 | return 0; | 250 | return 0; |
302 | } | ||
303 | return EACCES; | ||
304 | } | 251 | } |
305 | 252 | ||
306 | int | 253 | int |
... | @@ -312,16 +259,12 @@ attribute_is_equal (attribute_t attr, attribute_t attr2) | ... | @@ -312,16 +259,12 @@ attribute_is_equal (attribute_t attr, attribute_t attr2) |
312 | } | 259 | } |
313 | 260 | ||
314 | int | 261 | int |
315 | attribute_copy (attribute_t dest, attribute_t src, void *dest_owner) | 262 | attribute_copy (attribute_t dest, attribute_t src) |
316 | { | 263 | { |
317 | if (dest == NULL || src == NULL) | 264 | if (dest == NULL || src == NULL) |
318 | return EINVAL; | 265 | return EINVAL; |
319 | if (dest->owner == dest_owner) | ||
320 | { | ||
321 | memcpy (dest, src, sizeof (*dest)); | 266 | memcpy (dest, src, sizeof (*dest)); |
322 | return 0; | 267 | return 0; |
323 | } | ||
324 | return EACCES; | ||
325 | } | 268 | } |
326 | 269 | ||
327 | int | 270 | int |
... | @@ -340,13 +283,13 @@ string_to_attribute (const char *buffer, size_t len, | ... | @@ -340,13 +283,13 @@ string_to_attribute (const char *buffer, size_t len, |
340 | { | 283 | { |
341 | sep = strchr(buffer, ':'); /* pass the ':' */ | 284 | sep = strchr(buffer, ':'); /* pass the ':' */ |
342 | if (strchr (sep, 'R') != NULL || strchr (sep, 'r') != NULL) | 285 | if (strchr (sep, 'R') != NULL || strchr (sep, 'r') != NULL) |
343 | attribute_set_read (*pattr, owner); | 286 | attribute_set_read (*pattr); |
344 | if (strchr (sep, 'O') != NULL || strchr (sep, 'o') != NULL) | 287 | if (strchr (sep, 'O') != NULL || strchr (sep, 'o') != NULL) |
345 | attribute_set_seen (*pattr, owner); | 288 | attribute_set_seen (*pattr); |
346 | if (strchr (sep, 'A') != NULL || strchr (sep, 'a') != NULL) | 289 | if (strchr (sep, 'A') != NULL || strchr (sep, 'a') != NULL) |
347 | attribute_set_answered (*pattr, owner); | 290 | attribute_set_answered (*pattr); |
348 | if (strchr (sep, 'F') != NULL || strchr (sep, 'f') != NULL) | 291 | if (strchr (sep, 'F') != NULL || strchr (sep, 'f') != NULL) |
349 | attribute_set_flagged (*pattr, owner); | 292 | attribute_set_flagged (*pattr); |
350 | } | 293 | } |
351 | return 0; | 294 | return 0; |
352 | } | 295 | } | ... | ... |
mailbox/include/private/mime0.h
0 → 100644
1 | /* GNU mailutils - a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000 Free Software Foundation, Inc. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU Library General Public License as published by | ||
6 | the Free Software Foundation; either version 2, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
17 | |||
18 | #ifndef _MIME0_H | ||
19 | #define _MIME0_H | ||
20 | |||
21 | #include <sys/types.h> | ||
22 | #include <mime.h> | ||
23 | |||
24 | #ifndef __P | ||
25 | #ifdef __STDC__ | ||
26 | #define __P(args) args | ||
27 | #else | ||
28 | #define __P(args) () | ||
29 | #endif | ||
30 | #endif /*__P */ | ||
31 | |||
32 | #ifdef _cplusplus | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
36 | #define MIME_MAX_HDR_LEN 256 | ||
37 | #define MIME_DFLT_BUF_SIZE 2048 | ||
38 | |||
39 | /* Parser states */ | ||
40 | #define MIME_STATE_BEGIN_LINE 1 | ||
41 | #define MIME_STATE_SCAN_BOUNDARY 2 | ||
42 | #define MIME_STATE_HEADERS 3 | ||
43 | |||
44 | #define MIME_FLAG_MASK 0x0000ffff | ||
45 | |||
46 | /* private */ | ||
47 | #define MIME_PARSER_ACTIVE 0x80000000 | ||
48 | #define MIME_PARSER_HAVE_CR 0x40000000 | ||
49 | #define MIME_NEW_MESSAGE 0x20000000 | ||
50 | |||
51 | struct _mime | ||
52 | { | ||
53 | message_t msg; | ||
54 | header_t hdrs; | ||
55 | stream_t stream; | ||
56 | int flags; | ||
57 | char *content_type; | ||
58 | |||
59 | int tparts; | ||
60 | int nmtp_parts; | ||
61 | struct _mime_part **mtp_parts; /* list of parts in the msg */ | ||
62 | |||
63 | int tmsgs; | ||
64 | int ncap_msgs; | ||
65 | struct _mime_part **cap_msgs; /* list of encapsulated msgs */ | ||
66 | |||
67 | /* parser state */ | ||
68 | char *boundary; | ||
69 | char *cur_line; | ||
70 | int line_ndx; | ||
71 | int cur_offset; | ||
72 | char *cur_buf; | ||
73 | int buf_size; | ||
74 | char *header_buf; | ||
75 | int header_buf_size; | ||
76 | int header_length; | ||
77 | int body_offset; | ||
78 | int body_length; | ||
79 | int parser_state; | ||
80 | }; | ||
81 | |||
82 | struct _mime_part | ||
83 | { | ||
84 | mime_t mime; | ||
85 | header_t hdr; | ||
86 | message_t msg; | ||
87 | int body_offset; | ||
88 | int body_len; | ||
89 | }; | ||
90 | |||
91 | #ifdef _cplusplus | ||
92 | } | ||
93 | #endif | ||
94 | |||
95 | #endif /* MIME0_H */ |
... | @@ -46,26 +46,26 @@ extern int attribute_is_draft __P ((attribute_t)); | ... | @@ -46,26 +46,26 @@ extern int attribute_is_draft __P ((attribute_t)); |
46 | extern int attribute_is_recent __P ((attribute_t)); | 46 | extern int attribute_is_recent __P ((attribute_t)); |
47 | extern int attribute_is_read __P ((attribute_t)); | 47 | extern int attribute_is_read __P ((attribute_t)); |
48 | 48 | ||
49 | extern int attribute_set_seen __P ((attribute_t, void *owner)); | 49 | extern int attribute_set_seen __P ((attribute_t)); |
50 | extern int attribute_set_answered __P ((attribute_t, void *owner)); | 50 | extern int attribute_set_answered __P ((attribute_t)); |
51 | extern int attribute_set_flagged __P ((attribute_t, void *owner)); | 51 | extern int attribute_set_flagged __P ((attribute_t)); |
52 | extern int attribute_set_deleted __P ((attribute_t, void *owner)); | 52 | extern int attribute_set_deleted __P ((attribute_t)); |
53 | extern int attribute_set_draft __P ((attribute_t, void *owner)); | 53 | extern int attribute_set_draft __P ((attribute_t)); |
54 | extern int attribute_set_recent __P ((attribute_t, void *owner)); | 54 | extern int attribute_set_recent __P ((attribute_t)); |
55 | extern int attribute_set_read __P ((attribute_t, void *owner)); | 55 | extern int attribute_set_read __P ((attribute_t)); |
56 | 56 | ||
57 | extern int attribute_unset_seen __P ((attribute_t, void *owner)); | 57 | extern int attribute_unset_seen __P ((attribute_t)); |
58 | extern int attribute_unset_answered __P ((attribute_t, void *owner)); | 58 | extern int attribute_unset_answered __P ((attribute_t)); |
59 | extern int attribute_unset_flagged __P ((attribute_t, void *owner)); | 59 | extern int attribute_unset_flagged __P ((attribute_t)); |
60 | extern int attribute_unset_deleted __P ((attribute_t, void *owner)); | 60 | extern int attribute_unset_deleted __P ((attribute_t)); |
61 | extern int attribute_unset_draft __P ((attribute_t, void *owner)); | 61 | extern int attribute_unset_draft __P ((attribute_t)); |
62 | extern int attribute_unset_recent __P ((attribute_t, void *owner)); | 62 | extern int attribute_unset_recent __P ((attribute_t)); |
63 | extern int attribute_unset_read __P ((attribute_t, void *owner)); | 63 | extern int attribute_unset_read __P ((attribute_t)); |
64 | 64 | ||
65 | extern int attribute_is_equal __P ((attribute_t att1, attribute_t att2)); | 65 | extern int attribute_is_equal __P ((attribute_t att1, attribute_t att2)); |
66 | 66 | ||
67 | extern int attribute_copy __P ((attribute_t dst, | 67 | extern int attribute_copy __P ((attribute_t dst, |
68 | attribute_t src, void *dest_owner)); | 68 | attribute_t src)); |
69 | 69 | ||
70 | extern int string_to_attribute __P ((const char *buf, size_t len, | 70 | extern int string_to_attribute __P ((const char *buf, size_t len, |
71 | attribute_t *pattr, void *owner)); | 71 | attribute_t *pattr, void *owner)); | ... | ... |
File moved
mailbox/include/public/mime.h
0 → 100644
1 | /* GNU mailutils - a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000 Free Software Foundation, Inc. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Library Public License as published by | ||
6 | the Free Software Foundation; either version 2, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU Library General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
17 | |||
18 | #ifndef _MIME_H | ||
19 | #define _MIME_H | ||
20 | |||
21 | #include <header.h> | ||
22 | #include <io.h> | ||
23 | #include <sys/types.h> | ||
24 | |||
25 | #ifndef __P | ||
26 | # ifdef __STDC__ | ||
27 | # define __P(args) args | ||
28 | # else | ||
29 | # define __P(args) () | ||
30 | # endif | ||
31 | #endif /* __P */ | ||
32 | |||
33 | /* mime flags */ | ||
34 | #define MIME_INCREAMENTAL_PARSER 0x00000001 | ||
35 | |||
36 | #ifdef _cplusplus | ||
37 | extern "C" { | ||
38 | #endif | ||
39 | |||
40 | /* forward declaration */ | ||
41 | struct _mime; | ||
42 | typedef struct _mime *mime_t; | ||
43 | |||
44 | int mime_init __P ((mime_t *pmime, message_t msg, int flags)); | ||
45 | void mime_destroy __P ((mime_t *pmime)); | ||
46 | int mime_is_multi_part __P ((mime_t mime)); | ||
47 | int mime_get_part __P ((mime_t mime, int part, message_t *msg)); | ||
48 | int mime_add_part __P ((mime_t mime, message_t msg)); | ||
49 | int mime_get_num_parts __P ((mime_t mime, int *nparts)); | ||
50 | int mime_get_message __P ((mime_t mime, message_t *msg)); | ||
51 | int mime_unencapsulate __P ((mime_t mime, message_t msg, message_t *newmsg)); | ||
52 | |||
53 | #ifdef _cplusplus | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | #endif /* _MIME_H */ |
mailbox/include/public/transcode.h
0 → 100644
1 | /* GNU mailutils - a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000 Free Software Foundation, Inc. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Library Public License as published by | ||
6 | the Free Software Foundation; either version 2, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU Library General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | ||
17 | |||
18 | #ifndef _TRANSCODE_H | ||
19 | #define _TRANSCODE_H | ||
20 | |||
21 | #include <sys/types.h> | ||
22 | |||
23 | #ifndef __P | ||
24 | # ifdef __STDC__ | ||
25 | # define __P(args) args | ||
26 | # else | ||
27 | # define __P(args) () | ||
28 | # endif | ||
29 | #endif /* __P */ | ||
30 | |||
31 | #ifdef _cplusplus | ||
32 | extern "C" { | ||
33 | #endif | ||
34 | |||
35 | /* forward declaration */ | ||
36 | struct _transcoder; | ||
37 | typedef struct _transcoder *transcoder_t; | ||
38 | |||
39 | struct _transcoder | ||
40 | { | ||
41 | stream_t ustream; /* user reads/writes decoded/encoded data from here */ | ||
42 | stream_t stream; /* encoder/decoder read/writes data to here */ | ||
43 | void (*destroy)(transcoder_t tc); | ||
44 | void *tcdata; | ||
45 | }; | ||
46 | |||
47 | extern int transcode_init __P ((transcoder_t *, char *encoding)); | ||
48 | extern void transcode_destroy __P ((transcoder_t *)); | ||
49 | extern int transcode_get_stream __P ((transcoder_t tc, stream_t *pis)); | ||
50 | extern int transcode_set_stream __P ((transcoder_t tc, stream_t is)); | ||
51 | |||
52 | #ifdef _cplusplus | ||
53 | } | ||
54 | #endif | ||
55 | |||
56 | #endif /* _TRANSCODE_H */ |
File moved
... | @@ -608,14 +608,14 @@ mailbox_unix_readhdr (mailbox_t mbox, char *buf, size_t len, | ... | @@ -608,14 +608,14 @@ mailbox_unix_readhdr (mailbox_t mbox, char *buf, size_t len, |
608 | mum->hdr_status = mum->hdr_status_end - strlen (buf); | 608 | mum->hdr_status = mum->hdr_status_end - strlen (buf); |
609 | sep = strchr(buf, ':'); /* pass the ':' */ | 609 | sep = strchr(buf, ':'); /* pass the ':' */ |
610 | if (strchr (sep, 'R') != NULL || strchr (sep, 'r') != NULL) | 610 | if (strchr (sep, 'R') != NULL || strchr (sep, 'r') != NULL) |
611 | attribute_set_read (mum->old_attr, mbox); | 611 | attribute_set_read (mum->old_attr); |
612 | if (strchr (sep, 'O') != NULL || strchr (sep, 'o') != NULL) | 612 | if (strchr (sep, 'O') != NULL || strchr (sep, 'o') != NULL) |
613 | attribute_set_seen (mum->old_attr, mbox); | 613 | attribute_set_seen (mum->old_attr); |
614 | if (strchr (sep, 'A') != NULL || strchr (sep, 'a') != NULL) | 614 | if (strchr (sep, 'A') != NULL || strchr (sep, 'a') != NULL) |
615 | attribute_set_answered (mum->old_attr, mbox); | 615 | attribute_set_answered (mum->old_attr); |
616 | if (strchr (sep, 'F') != NULL || strchr (sep, 'f') != NULL) | 616 | if (strchr (sep, 'F') != NULL || strchr (sep, 'f') != NULL) |
617 | attribute_set_flagged (mum->old_attr, mbox); | 617 | attribute_set_flagged (mum->old_attr); |
618 | attribute_copy (mum->new_attr, mum->old_attr, mbox); | 618 | attribute_copy (mum->new_attr, mum->old_attr); |
619 | } | 619 | } |
620 | } | 620 | } |
621 | /* check for any dubious conditions */ | 621 | /* check for any dubious conditions */ |
... | @@ -774,7 +774,7 @@ mailbox_unix_scan (mailbox_t mbox, size_t msgno, size_t *pcount) | ... | @@ -774,7 +774,7 @@ mailbox_unix_scan (mailbox_t mbox, size_t msgno, size_t *pcount) |
774 | status = attribute_init (&(mum->new_attr), mbox); | 774 | status = attribute_init (&(mum->new_attr), mbox); |
775 | if (status != 0) | 775 | if (status != 0) |
776 | { | 776 | { |
777 | attribute_init (&(mum->old_attr), mbox); | 777 | attribute_destroy (&(mum->old_attr), mbox); |
778 | funlockfile (mud->file); | 778 | funlockfile (mud->file); |
779 | mailbox_unix_iunlock (mbox); | 779 | mailbox_unix_iunlock (mbox); |
780 | mailbox_unix_unlock (mbox); | 780 | mailbox_unix_unlock (mbox); |
... | @@ -1443,8 +1443,7 @@ mailbox_unix_get_message (mailbox_t mbox, size_t msgno, message_t *pmsg) | ... | @@ -1443,8 +1443,7 @@ mailbox_unix_get_message (mailbox_t mbox, size_t msgno, message_t *pmsg) |
1443 | header_t header = NULL; | 1443 | header_t header = NULL; |
1444 | 1444 | ||
1445 | if (mbox == NULL || pmsg == NULL || | 1445 | if (mbox == NULL || pmsg == NULL || |
1446 | (mud = (mailbox_unix_data_t)mbox->data) == NULL || | 1446 | (mud = (mailbox_unix_data_t)mbox->data) == NULL) |
1447 | mailbox_unix_is_deleted (mbox, msgno)) | ||
1448 | return EINVAL; | 1447 | return EINVAL; |
1449 | 1448 | ||
1450 | mum = mud->umessages[msgno - 1]; | 1449 | mum = mud->umessages[msgno - 1]; | ... | ... |
... | @@ -150,7 +150,7 @@ message_clone (message_t msg) | ... | @@ -150,7 +150,7 @@ message_clone (message_t msg) |
150 | body_destroy (&body, msg); | 150 | body_destroy (&body, msg); |
151 | stream_destroy (&stream, msg); | 151 | stream_destroy (&stream, msg); |
152 | } | 152 | } |
153 | attribute_copy (attribute, msg->attribute, msg); | 153 | attribute_copy (attribute, msg->attribute); |
154 | 154 | ||
155 | /* every thing went ok */ | 155 | /* every thing went ok */ |
156 | msg->header = header; | 156 | msg->header = header; | ... | ... |
mailbox/mime.c
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment