Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c948b18a
...
c948b18a102b660bab5a74f4615ea6c7a496419d
authored
2000-08-16 05:10:15 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
message add the header count part of the bytes being written.
1 parent
543739df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
mailbox/attribute.c
mailbox/include/private/attribute0.h
mailbox/message.c
mailbox/attribute.c
View file @
c948b18
...
...
@@ -108,7 +108,8 @@ attribute_set_recent (attribute_t attr)
return
EINVAL
;
if
(
attr
==
NULL
)
{
attr
->
flag
=
0
;
attr
->
flag
&=
~
MU_ATTRIBUTE_READ
;
attr
->
flag
&=
~
MU_ATTRIBUTE_SEEN
;
return
0
;
}
return
EACCES
;
...
...
@@ -167,7 +168,10 @@ attribute_is_recent (attribute_t attr)
{
if
(
attr
==
NULL
)
return
0
;
return
attr
->
flag
==
0
;
/* something is recent when it is not read and not seen. */
return
(
attr
->
flag
==
0
||
!
((
attr
->
flag
&
MU_ATTRIBUTE_SEEN
)
&&
(
attr
->
flag
&
MU_ATTRIBUTE_READ
));
}
int
...
...
@@ -229,7 +233,7 @@ attribute_unset_recent (attribute_t attr)
{
if
(
attr
==
NULL
)
return
0
;
attr
->
flag
|=
MU_ATTRIBUTE_SEEN
;
attr
->
|=
MU_ATTRIBUTE_SEEN
;
return
0
;
}
...
...
mailbox/include/private/attribute0.h
View file @
c948b18
...
...
@@ -37,13 +37,13 @@ struct _attribute
size_t
flag
;
};
#define MU_ATTRIBUTE_
SEEN ((int)1)
#define MU_ATTRIBUTE_
ANSWERED (MU_ATTRIBUTE_SEEN << 1)
#define MU_ATTRIBUTE_
FLAGGED (MU_ATTRIBUTE_ANSWERED << 1)
#define MU_ATTRIBUTE_D
ELETED (MU_ATTRIBUTE_FLAGGED << 1)
#define MU_ATTRIBUTE_
DRAFT (MU_ATTRIBUTE_DELETED << 1)
#define MU_ATTRIBUTE_RE
CENT (MU_ATTRIBUTE_DRAFT << 1)
#define MU_ATTRIBUTE_RE
AD (MU_ATTRIBUTE_RECENT << 1)
#define MU_ATTRIBUTE_
ANSWERED 0x01
#define MU_ATTRIBUTE_
FLAGGED 0x02
#define MU_ATTRIBUTE_
DELETED 0x04
#define MU_ATTRIBUTE_D
RAFT 0x08
#define MU_ATTRIBUTE_
SEEN 0x10
#define MU_ATTRIBUTE_RE
AD 0x20
#define MU_ATTRIBUTE_RE
CENT 0x00
#ifdef __cplusplus
}
...
...
mailbox/message.c
View file @
c948b18
...
...
@@ -559,7 +559,8 @@ message_write (stream_t os, const char *buf, size_t buflen,
off_t
off
,
size_t
*
pnwrite
)
{
message_t
msg
;
int
status
;
int
status
=
0
;
size_t
bufsize
=
0
;
if
(
os
==
NULL
||
(
msg
=
os
->
owner
)
==
NULL
)
return
EINVAL
;
...
...
@@ -629,11 +630,13 @@ message_write (stream_t os, const char *buf, size_t buflen,
msg
->
hdr_buf
=
thdr
;
memcpy
(
msg
->
hdr_buf
+
msg
->
hdr_buflen
,
buf
,
buflen
);
msg
->
hdr_buflen
+=
buflen
;
buflen
=
0
;
}
else
if
(
buflen
>
0
)
/* in the body */
{
stream_t
bs
;
body_t
body
;
size_t
written
=
0
;
if
((
status
=
message_get_body
(
msg
,
&
body
))
!=
0
||
(
status
=
body_get_stream
(
msg
->
body
,
&
bs
))
!=
0
)
{
...
...
@@ -646,9 +649,12 @@ message_write (stream_t os, const char *buf, size_t buflen,
off
=
0
;
else
off
-=
msg
->
hdr_buflen
;
return
stream_write
(
bs
,
buf
,
buflen
,
off
,
pnwrite
);
status
=
stream_write
(
bs
,
buf
,
buflen
,
off
,
&
written
);
buflen
-=
written
;
}
return
0
;
if
(
pnwrite
)
*
pnwrite
=
busize
-
buflen
;
return
status
;
}
static
int
...
...
Please
register
or
sign in
to post a comment