21 |
* si[ze] [msglist] |
* si[ze] [msglist] |
22 |
*/ |
*/ |
23 |
|
|
24 |
|
static int |
25 |
|
size0 (msgset_t *mspec, message_t msg, void *data) |
26 |
|
{ |
27 |
|
size_t size = 0, lines = 0; |
28 |
|
|
29 |
|
message_size (msg, &size); |
30 |
|
message_lines (msg, &lines); |
31 |
|
|
32 |
|
fprintf (ofile, "%c%2d %3d/%-5d\n", |
33 |
|
mspec->msg_part[0] == cursor ? '>' : ' ', |
34 |
|
mspec->msg_part[0], lines, size); |
35 |
|
return 0; |
36 |
|
} |
37 |
|
|
38 |
int |
int |
39 |
mail_size (int argc, char **argv) |
mail_size (int argc, char **argv) |
40 |
{ |
{ |
41 |
if (argc > 1) |
return util_foreach_msg (argc, argv, MSG_ALL, size0, NULL); |
42 |
util_msglist_command (mail_size, argc, argv, 0); |
} |
|
else |
|
|
{ |
|
|
size_t size = 0, lines = 0; |
|
|
message_t msg; |
|
|
|
|
|
if (util_get_message (mbox, cursor, &msg, MSG_ALL)) |
|
|
return 1; |
|
43 |
|
|
|
message_size (msg, &size); |
|
|
message_lines (msg, &lines); |
|
44 |
|
|
|
fprintf (ofile, "%c%2d %3d/%-5d\n", cursor == realcursor ? '>' : ' ', |
|
|
cursor, lines, size); |
|
|
return 0; |
|
|
} |
|
|
return 1; |
|
|
} |
|