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
c164dc5b
...
c164dc5b5248d2a04c99b3baa983b55981efd7c7
authored
2003-08-27 14:09:46 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Print the number of lines along with the message sizes.
1 parent
fd0252fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
examples/mimetest.c
examples/mimetest.c
View file @
c164dc5
...
...
@@ -119,7 +119,7 @@ main (int argc, char **argv)
message_t
msg
;
header_t
hdr
;
size_t
nparts
;
size_t
msize
;
size_t
msize
,
nlines
;
if
((
ret
=
mailbox_get_message
(
mbox
,
i
,
&
msg
))
!=
0
)
{
...
...
@@ -131,6 +131,11 @@ main (int argc, char **argv)
fprintf
(
stderr
,
"message_size - %s
\n
"
,
mu_strerror
(
ret
));
exit
(
2
);
}
if
((
ret
=
message_lines
(
msg
,
&
nlines
))
!=
0
)
{
fprintf
(
stderr
,
"message_lines - %s
\n
"
,
mu_strerror
(
ret
));
exit
(
2
);
}
if
((
ret
=
message_get_header
(
msg
,
&
hdr
))
!=
0
)
{
fprintf
(
stderr
,
"message_get_header - %s
\n
"
,
mu_strerror
(
ret
));
...
...
@@ -150,8 +155,8 @@ main (int argc, char **argv)
}
printf
(
"Number of parts in message - %lu
\n
"
,
(
unsigned
long
)
nparts
);
printf
(
"Total message size - %lu
\n
"
,
(
unsigned
long
)
msize
);
printf
(
"Total message size - %lu
/%lu
\n
"
,
(
unsigned
long
)
msize
,
(
unsigned
long
)
nlines
);
message_display_parts
(
msg
,
0
);
}
mailbox_close
(
mbox
);
...
...
@@ -165,7 +170,7 @@ void
message_display_parts
(
message_t
msg
,
int
indent
)
{
int
ret
,
j
;
size_t
msize
,
nparts
,
nsubparts
;
size_t
msize
,
n
lines
,
n
parts
,
nsubparts
;
message_t
part
;
header_t
hdr
;
char
type
[
256
];
...
...
@@ -197,6 +202,11 @@ message_display_parts (message_t msg, int indent)
fprintf
(
stderr
,
"message_size - %s
\n
"
,
mu_strerror
(
ret
));
exit
(
2
);
}
if
((
ret
=
message_lines
(
part
,
&
nlines
))
!=
0
)
{
fprintf
(
stderr
,
"message_lines - %s
\n
"
,
mu_strerror
(
ret
));
exit
(
2
);
}
if
((
ret
=
message_get_header
(
part
,
&
hdr
))
!=
0
)
{
fprintf
(
stderr
,
"message_get_header - %s
\n
"
,
mu_strerror
(
ret
));
...
...
@@ -205,8 +215,8 @@ message_display_parts (message_t msg, int indent)
header_get_value
(
hdr
,
MU_HEADER_CONTENT_TYPE
,
type
,
sizeof
(
type
),
NULL
);
printf
(
"%*.*sType of part %d = %s
\n
"
,
indent
,
indent
,
""
,
j
,
type
);
printf
(
"%*.*sMessage part size - %lu
\n
"
,
indent
,
indent
,
""
,
(
unsigned
long
)
msize
);
printf
(
"%*.*sMessage part size - %lu
/%lu
\n
"
,
indent
,
indent
,
""
,
(
unsigned
long
)
msize
,
(
unsigned
long
)
nlines
);
encoding
[
0
]
=
'\0'
;
header_get_value
(
hdr
,
MU_HEADER_CONTENT_TRANSFER_ENCODING
,
encoding
,
sizeof
(
encoding
),
NULL
);
...
...
Please
register
or
sign in
to post a comment