attribute.c attribute.h header.c mailbox.c mailbox0.h
mbx_unix.c message.c remove reference to attribrute0.h attribute0.h collapse in attribute.c
Showing
8 changed files
with
21 additions
and
118 deletions
... | @@ -15,12 +15,27 @@ | ... | @@ -15,12 +15,27 @@ |
15 | along with this program; if not, write to the Free Software | 15 | along with this program; if not, write to the Free Software |
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
17 | 17 | ||
18 | #include <attribute0.h> | 18 | #include <attribute.h> |
19 | 19 | ||
20 | #include <sys/types.h> | 20 | #include <sys/types.h> |
21 | #include <stdlib.h> | 21 | #include <stdlib.h> |
22 | #include <errno.h> | 22 | #include <errno.h> |
23 | 23 | ||
24 | #define MU_ATTRIBUTE_SEEN ((int)1) | ||
25 | #define MU_ATTRIBUTE_ANSWERED (MU_ATTRIBUTE_SEEN << 1) | ||
26 | #define MU_ATTRIBUTE_FLAGGED (MU_ATTRIBUTE_ANSWERED << 1) | ||
27 | #define MU_ATTRIBUTE_DELETED (MU_ATTRIBUTE_FLAGGED << 1) | ||
28 | #define MU_ATTRIBUTE_DRAFT (MU_ATTRIBUTE_DELETED << 1) | ||
29 | #define MU_ATTRIBUTE_RECENT (MU_ATTRIBUTE_DRAFT << 1) | ||
30 | #define MU_ATTRIBUTE_READ (MU_ATTRIBUTE_RECENT << 1) | ||
31 | |||
32 | struct _attribute | ||
33 | { | ||
34 | size_t flag; | ||
35 | void *owner; | ||
36 | int ref_count; | ||
37 | }; | ||
38 | |||
24 | int | 39 | int |
25 | attribute_init (attribute_t *pattr, void *owner) | 40 | attribute_init (attribute_t *pattr, void *owner) |
26 | { | 41 | { | ... | ... |
... | @@ -62,6 +62,8 @@ extern int attribute_unset_read __P ((attribute_t)); | ... | @@ -62,6 +62,8 @@ extern int attribute_unset_read __P ((attribute_t)); |
62 | 62 | ||
63 | extern int attribute_is_equal __P ((attribute_t att1, attribute_t att2)); | 63 | extern int attribute_is_equal __P ((attribute_t att1, attribute_t att2)); |
64 | 64 | ||
65 | extern int attribute_copy __P ((attribute_t dst, attribute_t src)); | ||
66 | extern int attribute_get_owner __P ((attribute_t attr, void **owner)); | ||
65 | #ifdef __cplusplus | 67 | #ifdef __cplusplus |
66 | } | 68 | } |
67 | #endif | 69 | #endif | ... | ... |
mailbox/attribute0.h
deleted
100644 → 0
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 _ATTRIBUTE0_H | ||
19 | #define _ATTRIBUTE0_H | ||
20 | |||
21 | #include <message.h> | ||
22 | #include <attribute.h> | ||
23 | |||
24 | #include <sys/types.h> | ||
25 | |||
26 | #ifdef __cplusplus | ||
27 | extern "C" { | ||
28 | #endif | ||
29 | |||
30 | #ifndef __P | ||
31 | # ifdef __STDC__ | ||
32 | # define __P(args) args | ||
33 | # else | ||
34 | # define __P(args) () | ||
35 | # endif | ||
36 | #endif /*__P */ | ||
37 | |||
38 | #define MU_ATTRIBUTE_SEEN ((int)1) | ||
39 | #define MU_ATTRIBUTE_ANSWERED (MU_ATTRIBUTE_SEEN << 1) | ||
40 | #define MU_ATTRIBUTE_FLAGGED (MU_ATTRIBUTE_ANSWERED << 1) | ||
41 | #define MU_ATTRIBUTE_DELETED (MU_ATTRIBUTE_FLAGGED << 1) | ||
42 | #define MU_ATTRIBUTE_DRAFT (MU_ATTRIBUTE_DELETED << 1) | ||
43 | #define MU_ATTRIBUTE_RECENT (MU_ATTRIBUTE_DRAFT << 1) | ||
44 | #define MU_ATTRIBUTE_READ (MU_ATTRIBUTE_RECENT << 1) | ||
45 | |||
46 | struct _attribute | ||
47 | { | ||
48 | size_t flag; | ||
49 | void *owner; | ||
50 | int ref_count; | ||
51 | }; | ||
52 | |||
53 | /* not user visible ?? */ | ||
54 | extern int attribute_copy __P ((attribute_t dst, attribute_t src)); | ||
55 | extern int attribute_get_owner __P ((attribute_t attr, void **owner)); | ||
56 | |||
57 | #ifdef __cplusplus | ||
58 | } | ||
59 | #endif | ||
60 | |||
61 | #endif /* _ATTRIBUTE0_H */ |
... | @@ -27,19 +27,6 @@ | ... | @@ -27,19 +27,6 @@ |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | 28 | ||
29 | static int header_parse (header_t *h, const char *blurb, size_t len); | 29 | static int header_parse (header_t *h, const char *blurb, size_t len); |
30 | /* | ||
31 | static int rfc822_set_value (header_t h, const char *fn, const char *fb, | ||
32 | size_t n, int replace); | ||
33 | static int rfc822_get_value (header_t h, const char *fn, char *fb, | ||
34 | size_t len, size_t *n); | ||
35 | static int rfc822_entry_count (header_t, size_t *num); | ||
36 | static int rfc822_entry_name (header_t h, size_t num, char *buf, | ||
37 | size_t buflen, size_t *total); | ||
38 | static int rfc822_entry_value (header_t h, size_t num, char *buf, | ||
39 | size_t buflen, size_t *total); | ||
40 | static int rfc822_get_istream (header_t h, istream_t *pis); | ||
41 | static int rfc822_get_ostream (header_t h, ostream_t *pos); | ||
42 | */ | ||
43 | static int header_read (istream_t is, char *buf, size_t buflen, | 30 | static int header_read (istream_t is, char *buf, size_t buflen, |
44 | off_t off, ssize_t *pnread); | 31 | off_t off, ssize_t *pnread); |
45 | 32 | ||
... | @@ -70,8 +57,6 @@ struct _header | ... | @@ -70,8 +57,6 @@ struct _header |
70 | int ref_count; | 57 | int ref_count; |
71 | }; | 58 | }; |
72 | 59 | ||
73 | |||
74 | |||
75 | int | 60 | int |
76 | header_init (header_t *ph, const char *blurb, size_t len, void *owner) | 61 | header_init (header_t *ph, const char *blurb, size_t len, void *owner) |
77 | { | 62 | { | ... | ... |
... | @@ -178,14 +178,6 @@ mailbox_is_updated (mailbox_t mbox) | ... | @@ -178,14 +178,6 @@ mailbox_is_updated (mailbox_t mbox) |
178 | return mbox->_is_updated (mbox); | 178 | return mbox->_is_updated (mbox); |
179 | } | 179 | } |
180 | 180 | ||
181 | ssize_t | ||
182 | mailbox_get_size (mailbox_t mbox, size_t msgno, size_t *h, size_t *b) | ||
183 | { | ||
184 | if (mbox == NULL || mbox->_get_size == NULL) | ||
185 | return EINVAL; | ||
186 | return mbox->_get_size (mbox, msgno, h, b); | ||
187 | } | ||
188 | |||
189 | /* locking */ | 181 | /* locking */ |
190 | int | 182 | int |
191 | mailbox_set_locker (mailbox_t mbox, locker_t locker) | 183 | mailbox_set_locker (mailbox_t mbox, locker_t locker) | ... | ... |
... | @@ -71,8 +71,6 @@ struct _mailbox | ... | @@ -71,8 +71,6 @@ struct _mailbox |
71 | int (*_undelete) __P ((mailbox_t, size_t msgno)); | 71 | int (*_undelete) __P ((mailbox_t, size_t msgno)); |
72 | int (*_is_deleted) __P ((mailbox_t, size_t msgno)); | 72 | int (*_is_deleted) __P ((mailbox_t, size_t msgno)); |
73 | int (*_num_deleted) __P ((mailbox_t, size_t *)); | 73 | int (*_num_deleted) __P ((mailbox_t, size_t *)); |
74 | int (*_get_size) __P ((mailbox_t, size_t msgno, | ||
75 | size_t *h, size_t *b)); | ||
76 | }; | 74 | }; |
77 | 75 | ||
78 | /* private */ | 76 | /* private */ |
... | @@ -80,12 +78,6 @@ extern int mailbox_delete __P ((mailbox_t, size_t msgno)); | ... | @@ -80,12 +78,6 @@ extern int mailbox_delete __P ((mailbox_t, size_t msgno)); |
80 | extern int mailbox_undelete __P ((mailbox_t, size_t msgno)); | 78 | extern int mailbox_undelete __P ((mailbox_t, size_t msgno)); |
81 | extern int mailbox_is_deleted __P ((mailbox_t, size_t msgno)); | 79 | extern int mailbox_is_deleted __P ((mailbox_t, size_t msgno)); |
82 | extern int mailbox_num_deleted __P ((mailbox_t, size_t *)); | 80 | extern int mailbox_num_deleted __P ((mailbox_t, size_t *)); |
83 | extern int mailbox_get_size __P ((mailbox_t, size_t msgno, | ||
84 | size_t *h, size_t *b)); | ||
85 | extern ssize_t mailbox_get_header __P ((mailbox_t, size_t msgno, char *h, | ||
86 | size_t len, off_t off, int *err)); | ||
87 | extern ssize_t mailbox_get_body __P ((mailbox_t, size_t msgno, char *b, | ||
88 | size_t len, off_t off, int *err)); | ||
89 | 81 | ||
90 | extern int mailbox_get_auth __P ((mailbox_t mbox, auth_t *auth)); | 82 | extern int mailbox_get_auth __P ((mailbox_t mbox, auth_t *auth)); |
91 | extern int mailbox_set_auth __P ((mailbox_t mbox, auth_t auth)); | 83 | extern int mailbox_set_auth __P ((mailbox_t mbox, auth_t auth)); | ... | ... |
... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
21 | #include <registrar0.h> | 21 | #include <registrar0.h> |
22 | #include <message0.h> | 22 | #include <message0.h> |
23 | #include <url0.h> | 23 | #include <url0.h> |
24 | #include <attribute0.h> | 24 | #include <attribute.h> |
25 | #include <io0.h> | 25 | #include <io0.h> |
26 | #include <header.h> | 26 | #include <header.h> |
27 | #include <auth.h> | 27 | #include <auth.h> |
... | @@ -118,8 +118,6 @@ static int mailbox_unix_undelete (mailbox_t, size_t msgno); | ... | @@ -118,8 +118,6 @@ static int mailbox_unix_undelete (mailbox_t, size_t msgno); |
118 | static int mailbox_unix_is_deleted (mailbox_t, size_t msgno); | 118 | static int mailbox_unix_is_deleted (mailbox_t, size_t msgno); |
119 | static int mailbox_unix_expunge (mailbox_t); | 119 | static int mailbox_unix_expunge (mailbox_t); |
120 | static int mailbox_unix_num_deleted (mailbox_t, size_t *); | 120 | static int mailbox_unix_num_deleted (mailbox_t, size_t *); |
121 | static int mailbox_unix_get_size (mailbox_t, size_t msgno, size_t *header, | ||
122 | size_t *body); | ||
123 | 121 | ||
124 | static int mailbox_unix_parse (mailbox_t, size_t *msgs); | 122 | static int mailbox_unix_parse (mailbox_t, size_t *msgs); |
125 | static int mailbox_unix_is_updated (mailbox_t); | 123 | static int mailbox_unix_is_updated (mailbox_t); |
... | @@ -279,7 +277,6 @@ mailbox_unix_init (mailbox_t *pmbox, const char *name) | ... | @@ -279,7 +277,6 @@ mailbox_unix_init (mailbox_t *pmbox, const char *name) |
279 | mbox->_is_deleted = mailbox_unix_is_deleted; | 277 | mbox->_is_deleted = mailbox_unix_is_deleted; |
280 | mbox->_expunge = mailbox_unix_expunge; | 278 | mbox->_expunge = mailbox_unix_expunge; |
281 | mbox->_num_deleted = mailbox_unix_num_deleted; | 279 | mbox->_num_deleted = mailbox_unix_num_deleted; |
282 | mbox->_get_size = mailbox_unix_get_size; | ||
283 | 280 | ||
284 | mbox->_is_updated = mailbox_unix_is_updated; | 281 | mbox->_is_updated = mailbox_unix_is_updated; |
285 | 282 | ||
... | @@ -1454,25 +1451,6 @@ mailbox_unix_size (mailbox_t mbox, off_t *size) | ... | @@ -1454,25 +1451,6 @@ mailbox_unix_size (mailbox_t mbox, off_t *size) |
1454 | } | 1451 | } |
1455 | 1452 | ||
1456 | static int | 1453 | static int |
1457 | mailbox_unix_get_size (mailbox_t mbox, size_t msgno, size_t *h, size_t *b) | ||
1458 | { | ||
1459 | mailbox_unix_data_t mud; | ||
1460 | mailbox_unix_message_t mum; | ||
1461 | |||
1462 | if (mbox == NULL || | ||
1463 | (mud = (mailbox_unix_data_t)mbox->data) == NULL || | ||
1464 | !mailbox_unix_is_valid (mbox, msgno)) | ||
1465 | return EINVAL; | ||
1466 | |||
1467 | mum = &(mud->umessages[msgno]); | ||
1468 | if (h) | ||
1469 | *h = mum->header_end - mum->header; | ||
1470 | if (b) | ||
1471 | *b = mum->body_end - mum->body; | ||
1472 | return 0; | ||
1473 | } | ||
1474 | |||
1475 | static int | ||
1476 | mailbox_unix_messages_count (mailbox_t mbox, size_t *count) | 1454 | mailbox_unix_messages_count (mailbox_t mbox, size_t *count) |
1477 | { | 1455 | { |
1478 | mailbox_unix_data_t mud; | 1456 | mailbox_unix_data_t mud; | ... | ... |
... | @@ -16,8 +16,8 @@ | ... | @@ -16,8 +16,8 @@ |
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
17 | 17 | ||
18 | 18 | ||
19 | #include <header0.h> | 19 | #include <header.h> |
20 | #include <attribute0.h> | 20 | #include <attribute.h> |
21 | #include <message0.h> | 21 | #include <message0.h> |
22 | #include <mailbox0.h> | 22 | #include <mailbox0.h> |
23 | #include <io0.h> | 23 | #include <io0.h> | ... | ... |
-
Please register or sign in to post a comment