Commit 94adc8f4 94adc8f49244e0abfd3ac47e0cfb2af2a063adc5 by Sergey Poznyakoff

Further improvements in the Guile-related code.

* gint: Upgrade.
* libmu_scm/Makefile.am: Initialize BUILT_SOURCES.
* libmu_scm/mu_address.c (address_get_fp): Change
signature to match those of mu_address_aget family.
(all functions): Use functions from mu_address_aget family.
Downcase argument names. Refer to them in the docstring
using @var notation.
* libmu_scm/mu_body.c: Downcase argument names. Refer to them
in the docstring using @var notation.
* libmu_scm/mu_logger.c: Likewise.
* libmu_scm/mu_mailbox.c: Likewise.
* libmu_scm/mu_message.c: Likewise.
* libmu_scm/mu_mime.c: Likewise.
* libmu_scm/mu_scm.c: Likewise.
* libmu_scm/mu_util.c: Likewise.
1 parent 49e121ac
gint @ 4254b059
Subproject commit c6a7620deb7e3e139329e2daad31d4071f01b43b
Subproject commit 4254b0590e609b82dac3d688ecb401c9eefb7e25
......
......@@ -98,4 +98,5 @@ install-data-hook:
sitedir = @GUILE_SITE@/$(PACKAGE)
site_DATA = mailutils.scm
SUFFIXES=
BUILT_SOURCES=
include ../gint/gint.mk
......
......@@ -19,30 +19,29 @@
#include "mu_scm.h"
typedef int (*address_get_fp) (mu_address_t, size_t, char *, size_t, size_t *);
typedef int (*address_get_fp) (mu_address_t, size_t, char **);
static SCM
_get_address_part (const char *func_name, address_get_fp fun,
SCM ADDRESS, SCM NUM)
SCM address, SCM num)
{
mu_address_t addr;
int length;
char *str;
SCM ret;
int num;
int n;
int status;
SCM_ASSERT (scm_is_string (ADDRESS), ADDRESS, SCM_ARG1, func_name);
SCM_ASSERT (scm_is_string (address), address, SCM_ARG1, func_name);
if (!SCM_UNBNDP (NUM))
if (!SCM_UNBNDP (num))
{
SCM_ASSERT (scm_is_integer (NUM), NUM, SCM_ARG1, func_name);
num = scm_to_int (NUM);
SCM_ASSERT (scm_is_integer (num), num, SCM_ARG1, func_name);
n = scm_to_int (num);
}
else
num = 1;
n = 1;
str = scm_to_locale_string (ADDRESS);
str = scm_to_locale_string (address);
if (!str[0])
{
free (str);
......@@ -54,15 +53,7 @@ _get_address_part (const char *func_name, address_get_fp fun,
if (status)
mu_scm_error (func_name, status, "Cannot create address", SCM_BOOL_F);
str = malloc (length + 1);
if (!str)
{
mu_address_destroy (&addr);
mu_scm_error (func_name, ENOMEM,
"Cannot allocate memory", SCM_BOOL_F);
}
status = (*fun) (addr, num, str, length + 1, NULL);
status = (*fun) (addr, n, &str);
mu_address_destroy (&addr);
if (status == 0)
......@@ -79,58 +70,58 @@ _get_address_part (const char *func_name, address_get_fp fun,
}
SCM_DEFINE_PUBLIC (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return personal part of the NUMth email address from ADDRESS.\n")
(SCM address, SCM num),
"Return personal part of the @var{num}th email address from @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_personal
{
return _get_address_part (FUNC_NAME,
mu_address_get_personal, ADDRESS, NUM);
mu_address_aget_personal, address, num);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return comment part of the NUMth email address from ADDRESS.\n")
(SCM address, SCM num),
"Return comment part of the @var{num}th email address from @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_comments
{
return _get_address_part (FUNC_NAME,
mu_address_get_comments, ADDRESS, NUM);
mu_address_aget_comments, address, num);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return email part of the NUMth email address from ADDRESS.\n")
(SCM address, SCM num),
"Return email part of the @var{num}th email address from @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_email
{
return _get_address_part (FUNC_NAME,
mu_address_get_email, ADDRESS, NUM);
mu_address_aget_email, address, num);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return domain part of the NUMth email address from ADDRESS.\n")
(SCM address, SCM num),
"Return domain part of the @var{num}th email address from @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_domain
{
return _get_address_part (FUNC_NAME,
mu_address_get_domain, ADDRESS, NUM);
mu_address_aget_domain, address, num);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return local part of the NUMth email address from ADDRESS.\n")
(SCM address, SCM num),
"Return local part of the @var{num}th email address from @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_local
{
return _get_address_part (FUNC_NAME,
mu_address_get_local_part, ADDRESS, NUM);
mu_address_aget_local_part, address, num);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
(SCM ADDRESS),
"Return number of parts in email address ADDRESS.\n")
(SCM address),
"Return number of parts in email address @var{address}.\n")
#define FUNC_NAME s_scm_mu_address_get_count
{
mu_address_t addr;
......@@ -138,15 +129,15 @@ SCM_DEFINE_PUBLIC (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
int status;
char *str;
SCM_ASSERT (scm_is_string (ADDRESS), ADDRESS, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_string (address), address, SCM_ARG1, FUNC_NAME);
str = scm_to_locale_string (ADDRESS);
str = scm_to_locale_string (address);
status = mu_address_create (&addr, str);
free (str);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot create address for ~A",
scm_list_1 (ADDRESS));
scm_list_1 (address));
mu_address_get_count (addr, &count);
mu_address_destroy (&addr);
......@@ -155,29 +146,29 @@ SCM_DEFINE_PUBLIC (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_username_to_email, "mu-username->email", 0, 1, 0,
(SCM NAME),
"Deduce user's email address from his username. If NAME is omitted, \n"
(SCM name),
"Deduce user's email address from his username. If @var{name} is omitted, \n"
"current username is assumed\n")
#define FUNC_NAME s_scm_mu_username_to_email
{
char *name;
char *username;
char *email;
SCM ret;
if (SCM_UNBNDP (NAME))
name = NULL;
if (SCM_UNBNDP (name))
username = NULL;
else
{
SCM_ASSERT (scm_is_string (NAME), NAME, SCM_ARG1, FUNC_NAME);
name = scm_to_locale_string (NAME);
SCM_ASSERT (scm_is_string (name), name, SCM_ARG1, FUNC_NAME);
username = scm_to_locale_string (name);
}
email = mu_get_user_email (name);
free (name);
email = mu_get_user_email (username);
free (username);
if (!email)
mu_scm_error (FUNC_NAME, 0,
"Cannot get user email for ~A",
scm_list_1 (NAME));
scm_list_1 (name));
ret = scm_from_locale_string (email);
free (email);
......
......@@ -103,16 +103,16 @@ mu_scm_body_create (SCM msg, mu_body_t body)
/* Guile primitives */
SCM_DEFINE_PUBLIC (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
(SCM BODY),
"Read next line from the BODY.")
(SCM body),
"Read next line from the @var{body}.")
#define FUNC_NAME s_scm_mu_body_read_line
{
struct mu_body *mbp;
size_t n, nread;
int status;
SCM_ASSERT (mu_scm_is_body (BODY), BODY, SCM_ARG1, FUNC_NAME);
mbp = (struct mu_body *) SCM_CDR (BODY);
SCM_ASSERT (mu_scm_is_body (body), body, SCM_ARG1, FUNC_NAME);
mbp = (struct mu_body *) SCM_CDR (body);
if (!mbp->stream)
{
......@@ -164,8 +164,8 @@ SCM_DEFINE_PUBLIC (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_body_write, "mu-body-write", 2, 0, 0,
(SCM BODY, SCM TEXT),
"Append TEXT to message BODY.")
(SCM body, SCM text),
"Append @var{text} to message @var{body}.")
#define FUNC_NAME s_scm_mu_body_write
{
char *ptr;
......@@ -173,9 +173,9 @@ SCM_DEFINE_PUBLIC (scm_mu_body_write, "mu-body-write", 2, 0, 0,
struct mu_body *mbp;
int status;
SCM_ASSERT (mu_scm_is_body (BODY), BODY, SCM_ARG1, FUNC_NAME);
mbp = (struct mu_body *) SCM_CDR (BODY);
SCM_ASSERT (scm_is_string (TEXT), TEXT, SCM_ARG2, FUNC_NAME);
SCM_ASSERT (mu_scm_is_body (body), body, SCM_ARG1, FUNC_NAME);
mbp = (struct mu_body *) SCM_CDR (body);
SCM_ASSERT (scm_is_string (text), text, SCM_ARG2, FUNC_NAME);
if (!mbp->stream)
{
......@@ -185,9 +185,10 @@ SCM_DEFINE_PUBLIC (scm_mu_body_write, "mu-body-write", 2, 0, 0,
"Cannot get body stream", SCM_BOOL_F);
}
ptr = SCM_STRING_CHARS (TEXT);
ptr = scm_to_locale_string (text);
len = strlen (ptr);
status = mu_stream_write (mbp->stream, ptr, len, mbp->offset, &n);
free (ptr);
mu_scm_error (FUNC_NAME, status,
"Error writing to stream", SCM_BOOL_F);
mbp->offset += n;
......
......@@ -24,37 +24,37 @@
static char *log_tag;
SCM_DEFINE_PUBLIC (scm_mu_openlog, "mu-openlog", 3, 0, 0,
(SCM IDENT, SCM OPTION, SCM FACILITY),
(SCM ident, SCM option, SCM facility),
"Opens a connection to the system logger for Guile program.\n"
"IDENT, OPTION and FACILITY have the same meaning as in openlog(3)")
"@var{ident}, @var{option} and @var{facility} have the same meaning as in openlog(3)")
#define FUNC_NAME s_scm_mu_openlog
{
SCM_ASSERT (scm_is_string (IDENT), IDENT, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_string (ident), ident, SCM_ARG1, FUNC_NAME);
if (log_tag)
free (log_tag);
log_tag = scm_to_locale_string(IDENT);
log_tag = scm_to_locale_string (ident);
SCM_ASSERT (scm_is_integer (OPTION), OPTION, SCM_ARG2, FUNC_NAME);
SCM_ASSERT (scm_is_integer (FACILITY), FACILITY, SCM_ARG3, FUNC_NAME);
openlog (log_tag, scm_to_int (OPTION), scm_to_int (FACILITY));
SCM_ASSERT (scm_is_integer (option), option, SCM_ARG2, FUNC_NAME);
SCM_ASSERT (scm_is_integer (facility), facility, SCM_ARG3, FUNC_NAME);
openlog (log_tag, scm_to_int (option), scm_to_int (facility));
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_logger, "mu-logger", 2, 0, 0,
(SCM PRIO, SCM TEXT),
"Distributes TEXT via syslogd priority PRIO.")
(SCM prio, SCM text),
"Distributes @var{text} via the syslog priority @var{prio}.")
#define FUNC_NAME s_scm_mu_logger
{
int prio;
int nprio;
char *str;
SCM_ASSERT (scm_is_integer (PRIO), PRIO, SCM_ARG1, FUNC_NAME);
prio = scm_to_int (PRIO);
SCM_ASSERT (scm_is_integer (prio), prio, SCM_ARG1, FUNC_NAME);
nprio = scm_to_int (prio);
SCM_ASSERT (scm_is_string (TEXT), TEXT, SCM_ARG2, FUNC_NAME);
str = scm_to_locale_string (TEXT);
syslog (prio, "%s", str);
SCM_ASSERT (scm_is_string (text), text, SCM_ARG2, FUNC_NAME);
str = scm_to_locale_string (text);
syslog (nprio, "%s", str);
free (str);
return SCM_UNSPECIFIED;
}
......
......@@ -90,65 +90,66 @@ mu_scm_is_mime (SCM scm)
/* Guile primitives */
SCM_DEFINE_PUBLIC (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
(SCM FLAGS, SCM MESG),
(SCM flags, SCM mesg),
"Creates a new @acronym{MIME} object. Both arguments are optional.\n"
"FLAGS specifies the type of the object to create (@samp{0} is a reasonable\n"
"value). MESG gives the message to create the @acronym{MIME} object from.")
"@var{Flags} specifies the type of the object to create (@samp{0} is a\n"
"reasonable value). @var{mesg} gives the message to create the\n"
"@acronym{MIME} object from.")
#define FUNC_NAME s_scm_mu_mime_create
{
mu_message_t msg = NULL;
mu_mime_t mime;
int flags;
int fl;
int status;
if (scm_is_bool (FLAGS))
if (scm_is_bool (flags))
{
/*if (FLAGS == SCM_BOOL_F)*/
flags = 0;
/*if (flags == SCM_BOOL_F)*/
fl = 0;
}
else
{
SCM_ASSERT (scm_is_integer (FLAGS), FLAGS, SCM_ARG1, FUNC_NAME);
flags = scm_to_int32 (FLAGS);
SCM_ASSERT (scm_is_integer (flags), flags, SCM_ARG1, FUNC_NAME);
fl = scm_to_int (flags);
}
if (!SCM_UNBNDP (MESG))
if (!SCM_UNBNDP (mesg))
{
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME);
msg = mu_scm_message_get (MESG);
SCM_ASSERT (mu_scm_is_message (mesg), mesg, SCM_ARG2, FUNC_NAME);
msg = mu_scm_message_get (mesg);
}
status = mu_mime_create (&mime, msg, flags);
status = mu_mime_create (&mime, msg, fl);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot create MIME object", SCM_BOOL_F);
return mu_scm_mime_create (MESG, mime);
return mu_scm_mime_create (mesg, mime);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
(SCM MIME),
"Returns @code{#t} if MIME is a multipart object.\n")
(SCM mime),
"Returns @code{#t} if @var{mime} is a multipart object.\n")
#define FUNC_NAME s_scm_mu_mime_multipart_p
{
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
return mu_mime_is_multipart (mu_scm_mime_get (MIME)) ? SCM_BOOL_T : SCM_BOOL_F;
SCM_ASSERT (mu_scm_is_mime (mime), mime, SCM_ARG1, FUNC_NAME);
return mu_mime_is_multipart (mu_scm_mime_get (mime)) ? SCM_BOOL_T : SCM_BOOL_F;
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
(SCM MIME),
"Returns number of parts in the @sc{mime} object MIME.")
(SCM mime),
"Returns number of parts in the @acronym{MIME} object @var{mime}.")
#define FUNC_NAME s_scm_mu_mime_get_num_parts
{
mu_mime_t mime;
mu_mime_t mimeobj;
size_t nparts;
int status;
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
mime = mu_scm_mime_get (MIME);
status = mu_mime_get_num_parts (mime, &nparts);
SCM_ASSERT (mu_scm_is_mime (mime), mime, SCM_ARG1, FUNC_NAME);
mimeobj = mu_scm_mime_get (mime);
status = mu_mime_get_num_parts (mimeobj, &nparts);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot count MIME parts", SCM_BOOL_F);
......@@ -157,71 +158,71 @@ SCM_DEFINE_PUBLIC (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
(SCM MIME, SCM NUM),
"Returns NUMth part from the @sc{mime} object MIME.")
(SCM mime, SCM num),
"Returns @var{num}th part from the @acronym{MIME} object @var{mime}.")
#define FUNC_NAME s_scm_mu_mime_get_part
{
mu_message_t msg = NULL;
int status;
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_integer (NUM), NUM, SCM_ARG2, FUNC_NAME);
SCM_ASSERT (mu_scm_is_mime (mime), mime, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_integer (num), num, SCM_ARG2, FUNC_NAME);
status = mu_mime_get_part (mu_scm_mime_get (MIME),
scm_to_int32 (NUM), &msg);
status = mu_mime_get_part (mu_scm_mime_get (mime),
scm_to_int (num), &msg);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot get part ~A from MIME object ~A",
scm_list_2 (NUM, MIME));
scm_list_2 (num, mime));
return mu_scm_message_create (MIME, msg);
return mu_scm_message_create (mime, msg);
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
(SCM MIME, SCM MESG),
"Adds MESG to the @sc{mime} object MIME.")
(SCM mime, SCM mesg),
"Adds message @var{mesg} to the @acronym{MIME} object @var{mime}.")
#define FUNC_NAME s_scm_mu_mime_add_part
{
mu_mime_t mime;
mu_mime_t mimeobj;
mu_message_t msg;
int status;
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME);
mime = mu_scm_mime_get (MIME);
msg = mu_scm_message_get (MESG);
SCM_ASSERT (mu_scm_is_mime (mime), mime, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (mu_scm_is_message (mesg), mesg, SCM_ARG2, FUNC_NAME);
mimeobj = mu_scm_mime_get (mime);
msg = mu_scm_message_get (mesg);
status = mu_mime_add_part (mime, msg);
status = mu_mime_add_part (mimeobj, msg);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot add new part to MIME object ~A",
scm_list_1 (MIME));
scm_list_1 (mime));
mu_scm_message_add_owner (MESG, MIME);
mu_scm_message_add_owner (mesg, mime);
return SCM_BOOL_T;
}
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_mime_get_message, "mu-mime-get-message", 1, 0, 0,
(SCM MIME),
"Converts @sc{mime} object MIME to a message.\n")
(SCM mime),
"Converts @acronym{MIME} object @var{mime} to a message.\n")
#define FUNC_NAME s_scm_mu_mime_get_message
{
mu_mime_t mime;
mu_mime_t mimeobj;
mu_message_t msg;
int status;
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
mime = mu_scm_mime_get (MIME);
status = mu_mime_get_message (mime, &msg);
SCM_ASSERT (mu_scm_is_mime (mime), mime, SCM_ARG1, FUNC_NAME);
mimeobj = mu_scm_mime_get (mime);
status = mu_mime_get_message (mimeobj, &msg);
if (status)
mu_scm_error (FUNC_NAME, status,
"Cannot get message from MIME object ~A",
scm_list_1 (MIME));
scm_list_1 (mime));
return mu_scm_message_create (MIME, msg);
return mu_scm_message_create (mime, msg);
}
#undef FUNC_NAME
......
......@@ -89,7 +89,7 @@ register_format (const char *name)
SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
(SCM REST),
(SCM rest),
"Registers desired mailutils formats. Any number of arguments can be given.\n"
"Each argument must be one of the following strings:\n\n"
"@multitable @columnfractions 0.3 0.6\n"
......@@ -108,7 +108,7 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
{
int status;
if (scm_is_null (REST))
if (scm_is_null (rest))
{
status = register_format (NULL);
if (status)
......@@ -118,10 +118,10 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
}
else
{
for (; !scm_is_null (REST); REST = SCM_CDR (REST))
for (; !scm_is_null (rest); rest = SCM_CDR (rest))
{
char *s;
SCM scm = SCM_CAR (REST);
SCM scm = SCM_CAR (rest);
SCM_ASSERT (scm_is_string (scm), scm, SCM_ARGn, FUNC_NAME);
s = scm_to_locale_string (scm);
status = register_format (s);
......@@ -137,13 +137,13 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
#undef FUNC_NAME
SCM_DEFINE_PUBLIC (scm_mu_strerror, "mu-strerror", 1, 0, 0,
(SCM ERR),
"Return the error message corresponding to ERR, which must be\n"
(SCM err),
"Return the error message corresponding to @var{err}, which must be\n"
"an integer value.\n")
#define FUNC_NAME s_scm_mu_strerror
{
SCM_ASSERT (scm_is_integer (ERR), ERR, SCM_ARG1, FUNC_NAME);
return scm_from_locale_string (mu_strerror (scm_to_int (ERR)));
SCM_ASSERT (scm_is_integer (err), err, SCM_ARG1, FUNC_NAME);
return scm_from_locale_string (mu_strerror (scm_to_int (err)));
}
#undef FUNC_NAME
......
......@@ -20,8 +20,8 @@
#include "mu_scm.h"
SCM_DEFINE_PUBLIC (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
(SCM USER),
"Look up an entry in the user database. USER can be an integer,\n"
(SCM user),
"Look up an entry in the user database. @var{User} can be an integer,\n"
"or a string, giving the behaviour of @code{mu_get_auth_by_uid} or\n"
"@code{mu_get_auth_by_name} respectively.\n"
"\n"
......@@ -39,16 +39,16 @@ SCM_DEFINE_PUBLIC (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
&handle,
NULL, NULL);
if (scm_is_integer (USER))
if (scm_is_integer (user))
{
entry = mu_get_auth_by_uid (scm_to_int32 (USER));
entry = mu_get_auth_by_uid (scm_to_int (user));
}
else
{
char *s;
SCM_VALIDATE_STRING (1, USER);
s = scm_to_locale_string (USER);
SCM_VALIDATE_STRING (1, user);
s = scm_to_locale_string (user);
entry = mu_get_auth_by_name (s);
free (s);
}
......