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
ff639efd
...
ff639efd3ee44de0e4904c2d8bb7d0de31b932a1
authored
2007-06-28 08:03:29 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_header_append,mu_header_prepend): New function
1 parent
f532b7b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
include/mailutils/header.h
mailbox/header.c
include/mailutils/header.h
View file @
ff639ef
...
...
@@ -85,6 +85,10 @@ extern int mu_header_clear_modified (mu_header_t);
/* Set and get field values by field name. */
extern
int
mu_header_set_value
(
mu_header_t
,
const
char
*
,
const
char
*
,
int
);
extern
int
mu_header_remove
(
mu_header_t
,
const
char
*
,
int
);
extern
int
mu_header_append
(
mu_header_t
header
,
const
char
*
fn
,
const
char
*
fv
);
extern
int
mu_header_prepend
(
mu_header_t
header
,
const
char
*
fn
,
const
char
*
fv
);
extern
int
mu_header_insert
(
mu_header_t
,
const
char
*
,
const
char
*
,
const
char
*
,
int
,
int
);
...
...
mailbox/header.c
View file @
ff639ef
...
...
@@ -584,6 +584,48 @@ mu_header_remove (mu_header_t header, const char *fn, int n)
}
int
mu_header_append
(
mu_header_t
header
,
const
char
*
fn
,
const
char
*
fv
)
{
int
status
;
struct
mu_hdrent
*
ent
;
if
(
header
==
NULL
||
fn
==
NULL
||
fv
==
NULL
)
return
EINVAL
;
status
=
mu_header_fill
(
header
);
if
(
status
)
return
status
;
ent
=
mu_hdrent_create
(
header
,
NULL
,
fn
,
strlen
(
fn
),
fv
,
strlen
(
fv
));
if
(
!
ent
)
return
ENOMEM
;
mu_hdrent_append
(
header
,
ent
);
HEADER_SET_MODIFIED
(
header
);
return
0
;
}
int
mu_header_prepend
(
mu_header_t
header
,
const
char
*
fn
,
const
char
*
fv
)
{
int
status
;
struct
mu_hdrent
*
ent
;
if
(
header
==
NULL
||
fn
==
NULL
||
fv
==
NULL
)
return
EINVAL
;
status
=
mu_header_fill
(
header
);
if
(
status
)
return
status
;
ent
=
mu_hdrent_create
(
header
,
NULL
,
fn
,
strlen
(
fn
),
fv
,
strlen
(
fv
));
if
(
!
ent
)
return
ENOMEM
;
mu_hdrent_prepend
(
header
,
ent
);
HEADER_SET_MODIFIED
(
header
);
return
0
;
}
int
mu_header_insert
(
mu_header_t
header
,
const
char
*
fn
,
const
char
*
fv
,
const
char
*
ref
,
int
n
,
int
flags
)
...
...
@@ -1189,3 +1231,4 @@ mu_header_clear_modified (mu_header_t header)
return
0
;
}
...
...
Please
register
or
sign in
to post a comment