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
cbe0784b
...
cbe0784baa226553e71eed96e77ead9b839b0539
authored
2002-11-15 14:35:59 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(address_aget_local_part,address_aget_domain): New functions.
1 parent
3d5be386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
include/mailutils/address.h
mailbox/address.c
include/mailutils/address.h
View file @
cbe0784
...
...
@@ -48,6 +48,10 @@ extern int address_get_route
extern
int
address_aget_email
__P
((
address_t
,
size_t
,
char
**
));
extern
int
address_aget_local_part
__P
((
address_t
addr
,
size_t
no
,
char
**
buf
));
extern
int
address_aget_domain
__P
((
address_t
addr
,
size_t
no
,
char
**
buf
));
extern
int
address_is_group
__P
((
address_t
,
size_t
,
int
*
));
...
...
mailbox/address.c
View file @
cbe0784
...
...
@@ -393,6 +393,56 @@ address_aget_email (address_t addr, size_t no, char **buf)
}
int
address_aget_local_part
(
address_t
addr
,
size_t
no
,
char
**
buf
)
{
int
status
=
0
;
address_t
subaddr
;
if
(
addr
==
NULL
||
buf
==
NULL
)
return
EINVAL
;
subaddr
=
_address_get_nth
(
addr
,
no
);
if
(
!
subaddr
)
return
ENOENT
;
if
(
subaddr
->
local_part
)
{
*
buf
=
strdup
(
subaddr
->
local_part
);
if
(
!*
buf
)
status
=
ENOMEM
;
}
else
*
buf
=
NULL
;
return
status
;
}
int
address_aget_domain
(
address_t
addr
,
size_t
no
,
char
**
buf
)
{
int
status
=
0
;
address_t
subaddr
;
if
(
addr
==
NULL
||
buf
==
NULL
)
return
EINVAL
;
subaddr
=
_address_get_nth
(
addr
,
no
);
if
(
!
subaddr
)
return
ENOENT
;
if
(
subaddr
->
domain
)
{
*
buf
=
strdup
(
subaddr
->
domain
);
if
(
!*
buf
)
status
=
ENOMEM
;
}
else
*
buf
=
NULL
;
return
status
;
}
int
address_get_local_part
(
address_t
addr
,
size_t
no
,
char
*
buf
,
size_t
len
,
size_t
*
n
)
{
...
...
Please
register
or
sign in
to post a comment