Commit 002b3bcb 002b3bcb592e96ff9332fa0d825454c8911e06f8 by Alain Magloire

Move util_cpystr() in the mu_ namespace.

	* include/mailutils/mutil.h: util_cpystr() to mu_cpystr().
	* mailbox/address.c: util_cpystr() to mu_cpystr().
	* mailbox/url.c: util_cpystr() to mu_cpystr().
	* mailbox/mutil.c: util_cpystr() to mu_cpystr().
	* mailbox/wicket.c: util_cpystr() to mu_cpystr().
1 parent 9388abdf
......@@ -62,20 +62,20 @@ extern time_t mu_tm2time __P ((struct tm * timeptr, mu_timezone * tz));
extern char * mu_get_homedir __P ((void));
extern char * mu_tilde_expansion __P ((const char *ref, const char *delim, const char *homedir));
extern size_t util_cpystr __P ((char *dst, const char *src, size_t size));
extern size_t mu_cpystr __P ((char *dst, const char *src, size_t size));
struct passwd;
extern void mu_register_getpwnam __P((struct passwd *(*fun) __P((const char *))));
extern struct passwd * mu_getpwnam __P((const char *name));
extern int mu_virtual_domain;
extern struct passwd * getpwnam_virtual __P((const char *u));
extern char * mu_get_user_email __P((char *name));
extern char * mu_normalize_path __P((char *path, const char *delim));
#ifdef __cplusplus
}
#endif
......
......@@ -103,7 +103,7 @@ address_get_personal (address_t addr, size_t no, char *buf, size_t len,
{
if (j == no)
{
i = util_cpystr (buf, addr->personal, len);
i = mu_cpystr (buf, addr->personal, len);
status = 0;
break;
}
......@@ -125,7 +125,7 @@ address_get_comments (address_t addr, size_t no, char *buf, size_t len,
{
if (j == no)
{
i = util_cpystr (buf, addr->comments, len);
i = mu_cpystr (buf, addr->comments, len);
if (n)
*n = i;
status = 0;
......@@ -146,7 +146,7 @@ address_get_email (address_t addr, size_t no, char *buf, size_t len, size_t *n)
{
if (j == no)
{
i = util_cpystr (buf, addr->email, len);
i = mu_cpystr (buf, addr->email, len);
if (n)
*n = i;
status = 0;
......@@ -167,7 +167,7 @@ address_get_local_part (address_t addr, size_t no, char *buf, size_t len, size_t
{
if (j == no)
{
i = util_cpystr (buf, addr->local_part, len);
i = mu_cpystr (buf, addr->local_part, len);
if (n)
*n = i;
status = 0;
......@@ -188,7 +188,7 @@ address_get_domain (address_t addr, size_t no, char *buf, size_t len, size_t *n)
{
if (j == no)
{
i = util_cpystr (buf, addr->domain, len);
i = mu_cpystr (buf, addr->domain, len);
if (n)
*n = i;
status = 0;
......@@ -209,7 +209,7 @@ address_get_route (address_t addr, size_t no, char *buf, size_t len, size_t *n)
{
if (j == no)
{
i = util_cpystr (buf, addr->route, len);
i = mu_cpystr (buf, addr->route, len);
if (n)
*n = i;
status = 0;
......@@ -251,7 +251,7 @@ address_to_string (address_t addr, char *buf, size_t len, size_t *n)
return EINVAL;
if (buf)
*buf = '\0';
i = util_cpystr (buf, addr->addr, len);
i = mu_cpystr (buf, addr->addr, len);
if (n)
*n = i;
return 0;
......
......@@ -318,7 +318,7 @@ mu_tilde_expansion (const char *ref, const char *delim, const char *homedir)
/* Smart strncpy that always add the null and returns the number of bytes
written. */
size_t
util_cpystr (char *dst, const char *src, size_t size)
mu_cpystr (char *dst, const char *src, size_t size)
{
size_t len = src ? strlen (src) : 0 ;
if (dst == NULL || size == 0)
......
......@@ -352,7 +352,7 @@ url_get_scheme (const url_t url, char *scheme, size_t len, size_t *n)
return EINVAL;
if (url->_get_scheme)
return url->_get_scheme (url, scheme, len, n);
i = util_cpystr (scheme, url->scheme, len);
i = mu_cpystr (scheme, url->scheme, len);
if (n)
*n = i;
return 0;
......@@ -366,7 +366,7 @@ url_get_user (const url_t url, char *user, size_t len, size_t *n)
return EINVAL;
if (url->_get_user)
return url->_get_user (url, user, len, n);
i = util_cpystr (user, url->user, len);
i = mu_cpystr (user, url->user, len);
if (n)
*n = i;
return 0;
......@@ -382,7 +382,7 @@ url_get_passwd (const url_t url, char *passwd, size_t len, size_t *n)
return EINVAL;
if (url->_get_passwd)
return url->_get_passwd (url, passwd, len, n);
i = util_cpystr (passwd, url->passwd, len);
i = mu_cpystr (passwd, url->passwd, len);
if (n)
*n = i;
return 0;
......@@ -396,7 +396,7 @@ url_get_auth (const url_t url, char *auth, size_t len, size_t *n)
return EINVAL;
if (url->_get_auth)
return url->_get_auth (url, auth, len, n);
i = util_cpystr (auth, url->auth, len);
i = mu_cpystr (auth, url->auth, len);
if (n)
*n = i;
return 0;
......@@ -410,7 +410,7 @@ url_get_host (const url_t url, char *host, size_t len, size_t *n)
return EINVAL;
if (url->_get_host)
return url->_get_host (url, host, len, n);
i = util_cpystr (host, url->host, len);
i = mu_cpystr (host, url->host, len);
if (n)
*n = i;
return 0;
......@@ -435,7 +435,7 @@ url_get_path (const url_t url, char *path, size_t len, size_t *n)
return EINVAL;
if (url->_get_path)
return url->_get_path (url, path, len, n);
i = util_cpystr(path, url->path, len);
i = mu_cpystr(path, url->path, len);
if (n)
*n = i;
return 0;
......@@ -449,7 +449,7 @@ url_get_query (const url_t url, char *query, size_t len, size_t *n)
return EINVAL;
if (url->_get_query)
return url->_get_query (url, query, len, n);
i = util_cpystr(query, url->query, len);
i = mu_cpystr(query, url->query, len);
if (n)
*n = i;
return 0;
......
......@@ -77,7 +77,7 @@ wicket_get_filename (wicket_t wicket, char *filename, size_t len,
size_t n;
if (wicket == NULL)
return EINVAL;
n = util_cpystr (filename, wicket->filename, len);
n = mu_cpystr (filename, wicket->filename, len);
if (pwriten)
*pwriten = n;
return 0;
......