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
fa22b724
...
fa22b72449bd706a85efbc4a9b00f12b40ec8b3b
authored
2005-11-28 11:16:36 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_context_destroy,mh_context_merge): New functions.
1 parent
f71cfc8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
mh/mh_ctx.c
mh/mh_ctx.c
View file @
fa22b72
...
...
@@ -42,6 +42,45 @@ mh_context_create (char *name, int copy)
return
ctx
;
}
void
mh_context_destroy
(
mh_context_t
**
pctx
)
{
mh_context_t
*
ctx
=
*
pctx
;
free
(
ctx
->
name
);
if
(
ctx
->
header
)
mu_header_destroy
(
&
ctx
->
header
,
mu_header_get_owner
(
ctx
->
header
));
free
(
ctx
);
*
pctx
=
NULL
;
}
void
mh_context_merge
(
mh_context_t
*
dst
,
mh_context_t
*
src
)
{
if
(
!
dst
->
header
)
{
dst
->
header
=
src
->
header
;
src
->
header
=
NULL
;
}
else
{
size_t
i
,
count
;
mu_header_get_field_count
(
src
->
header
,
&
count
);
for
(
i
=
1
;
i
<=
count
;
i
++
)
{
char
*
name
=
NULL
;
char
*
value
=
NULL
;
mu_header_aget_field_name
(
src
->
header
,
i
,
&
name
);
mu_header_aget_field_value
(
src
->
header
,
i
,
&
value
);
mu_header_set_value
(
dst
->
header
,
name
,
value
,
1
);
free
(
name
);
free
(
value
);
}
}
}
int
mh_context_read
(
mh_context_t
*
ctx
)
{
...
...
Please
register
or
sign in
to post a comment