Commit 29021e95 29021e954aaec4a5db1c50a505ec914fe8bbae69 by Sergey Poznyakoff

Add a function for creating an empty email address object.

* include/mailutils/address.h (mu_address_create_null): New proto.
* libmailutils/address/address.c (mu_address_create_null): New function.
1 parent 7ca75462
......@@ -62,6 +62,8 @@ struct mu_address
struct mu_address *next;
};
extern int mu_address_create_null (mu_address_t *);
extern int mu_address_create_hint (mu_address_t *, const char *,
mu_address_t, int);
......
......@@ -36,6 +36,16 @@
#include <mailutils/address.h>
#include <mailutils/cstr.h>
int
mu_address_create_null (mu_address_t *pa)
{
mu_address_t a = calloc (1, sizeof (*a));
if (!a)
return ENOMEM;
*pa = a;
return 0;
}
/* Get email addresses from rfc822 address. */
int
mu_address_create_hint (mu_address_t *a, const char *s, mu_address_t hint,
......