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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
8 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
...
...
@@ -71,6 +71,13 @@ extern int mu_address_contains_email (mu_address_t addr, const char *email);
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
}
...
...
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
...
...
@@ -214,7 +214,7 @@ mu_address_get_nth (mu_address_t addr, size_t no, mu_address_t *pret)
int
mu_address_get_personal
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
@@ -233,8 +233,31 @@ 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
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
@@ -253,8 +276,31 @@ 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
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
@@ -463,7 +509,7 @@ mu_address_aget_domain (mu_address_t addr, size_t no, char **buf)
int
mu_address_get_local_part
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
@@ -483,7 +529,7 @@ mu_address_get_local_part (mu_address_t addr, size_t no, char *buf, size_t len,
int
mu_address_get_domain
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
@@ -503,7 +549,7 @@ mu_address_get_domain (mu_address_t addr, size_t no, char *buf, size_t len,
int
mu_address_get_route
(
mu_address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
size_t
*
n
)
{
size_t
i
;
mu_address_t
subaddr
;
...
...
Please
register
or
sign in
to post a comment