Commit 2861b15e 2861b15e499a181a87fec588cc490913a33dc719 by Sergey Poznyakoff

(address_get_nth): New function. Get Nth subaddress from an address.

1 parent 53c4cc94
......@@ -33,6 +33,8 @@ extern address_t address_dup __P ((address_t src));
/* Set FROM to null, after adding its addresses to TO. */
extern int address_concatenate __P ((address_t to, address_t* from));
extern int address_get_nth
__P ((address_t addr, size_t no, address_t *pret));
extern int address_get_email
__P ((address_t, size_t, char *, size_t, size_t *));
extern int address_get_local_part
......
......@@ -202,6 +202,16 @@ _address_get_nth (address_t addr, size_t no)
}
int
address_get_nth (address_t addr, size_t no, address_t *pret)
{
address_t subaddr = _address_get_nth (addr, no);
if (!subaddr)
return ENOENT;
*pret = address_dup (subaddr);
return 0;
}
int
address_get_personal (address_t addr, size_t no, char *buf, size_t len,
size_t * n)
{
......