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
91174a9d
...
91174a9d7bae3f0a022345189cd42bc8d1a3d91b
authored
2003-02-10 12:00:01 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use mh_annotate
1 parent
fe151e7f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
22 deletions
mh/anno.c
mh/anno.c
View file @
91174a9
...
...
@@ -50,9 +50,8 @@ struct mh_option mh_option[] = {
{
NULL
}
};
static
char
datebuf
[
80
];
static
int
inplace
;
/* Annotate the message in place */
static
char
*
anno_date
;
/* Annotation date
*/
static
int
anno_date
=
1
;
/* Add date to the annotation
*/
static
char
*
component
;
/* header field */
static
char
*
anno_text
;
/* header field value */
...
...
@@ -75,11 +74,11 @@ opt_handler (int key, char *arg, void *unused)
break
;
case
ARG_DATE
:
anno_date
=
datebuf
;
anno_date
=
is_true
(
arg
)
;
break
;
case
ARG_NODATE
:
anno_date
=
NULL
;
anno_date
=
0
;
break
;
case
ARG_COMPONENT
:
...
...
@@ -99,18 +98,7 @@ opt_handler (int key, char *arg, void *unused)
void
anno
(
mailbox_t
mbox
,
message_t
msg
,
size_t
num
,
void
*
data
)
{
header_t
hdr
;
attribute_t
attr
;
if
(
message_get_header
(
msg
,
&
hdr
))
return
;
if
(
anno_date
)
header_set_value
(
hdr
,
component
,
anno_date
,
0
);
header_set_value
(
hdr
,
component
,
anno_text
,
0
);
message_get_attribute
(
msg
,
&
attr
);
attribute_set_modified
(
attr
);
mh_annotate
(
msg
,
component
,
anno_text
,
anno_date
);
}
int
...
...
@@ -120,15 +108,9 @@ main (int argc, char **argv)
int
index
;
mailbox_t
mbox
;
mh_msgset_t
msgset
;
time_t
t
;
struct
tm
*
tm
;
mu_init_nls
();
t
=
time
(
NULL
);
tm
=
localtime
(
&
t
);
strftime
(
datebuf
,
sizeof
datebuf
,
"%a, %d %b %Y %H:%M:%S %Z"
,
tm
);
mh_argp_parse
(
argc
,
argv
,
options
,
mh_option
,
args_doc
,
doc
,
opt_handler
,
NULL
,
&
index
);
...
...
Please
register
or
sign in
to post a comment