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
d0e8c315
...
d0e8c315c1b5e66abfad618848da4e3fe2dc5536
authored
2006-04-26 11:56:18 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_address_set_personal)
(mu_address_set_comments): New functions
1 parent
4bacbfc2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
include/mailutils/address.h
mailbox/address.c
include/mailutils/address.h
View file @
d0e8c31
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2005
, 2006
Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
...
...
@@ -72,6 +72,13 @@ extern int mu_address_union (mu_address_t *a, mu_address_t b);
extern
size_t
mu_address_format_string
(
mu_address_t
addr
,
char
*
buf
,
size_t
buflen
);
/* The following setters are not entirely orthogonal to their _get_
counterparts. Only personal and comments parts can be set */
extern
int
mu_address_set_personal
(
mu_address_t
addr
,
size_t
no
,
const
char
*
buf
);
extern
int
mu_address_set_comments
(
mu_address_t
addr
,
size_t
no
,
const
char
*
buf
);
#ifdef __cplusplus
}
#endif
...
...
mailbox/address.c
View file @
d0e8c31
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2005
, 2006
Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
...
...
@@ -233,6 +233,29 @@ mu_address_get_personal (mu_address_t addr, size_t no, char *buf, size_t len,
}
int
mu_address_set_personal
(
mu_address_t
addr
,
size_t
no
,
const
char
*
buf
)
{
char
*
s
;
mu_address_t
subaddr
;
if
(
addr
==
NULL
)
return
EINVAL
;
subaddr
=
_address_get_nth
(
addr
,
no
);
if
(
!
subaddr
)
return
MU_ERR_NOENT
;
s
=
strdup
(
buf
);
if
(
!
s
)
return
errno
;
free
(
subaddr
->
personal
);
subaddr
->
personal
=
s
;
return
0
;
}
int
mu_address_get_comments
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
{
...
...
@@ -253,6 +276,29 @@ mu_address_get_comments (mu_address_t addr, size_t no, char *buf, size_t len,
}
int
mu_address_set_comments
(
mu_address_t
addr
,
size_t
no
,
const
char
*
buf
)
{
char
*
s
;
mu_address_t
subaddr
;
if
(
addr
==
NULL
)
return
EINVAL
;
subaddr
=
_address_get_nth
(
addr
,
no
);
if
(
!
subaddr
)
return
MU_ERR_NOENT
;
s
=
strdup
(
buf
);
if
(
!
s
)
return
errno
;
free
(
subaddr
->
comments
);
subaddr
->
comments
=
s
;
return
0
;
}
int
mu_address_get_email
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
{
...
...
Please
register
or
sign in
to post a comment