summaryrefslogtreecommitdiff
path: root/libmu_scm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-08-26 14:23:32 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-08-26 14:23:32 +0000
commit6178304b1670d7288d8a37b9165bda5cbc44c180 (patch)
treee17d3bce1e0b2a537937bc331efa240ce382b81e /libmu_scm
parentef22616eba2aaa4e05079852ac1fa67c4ceeff08 (diff)
downloadmailutils-6178304b1670d7288d8a37b9165bda5cbc44c180.tar.gz
mailutils-6178304b1670d7288d8a37b9165bda5cbc44c180.tar.bz2
Normalize global namespace. Part 1
Diffstat (limited to 'libmu_scm')
-rw-r--r--libmu_scm/mu_address.c54
-rw-r--r--libmu_scm/mu_body.c20
-rw-r--r--libmu_scm/mu_guimb.c6
-rw-r--r--libmu_scm/mu_logger.c12
-rw-r--r--libmu_scm/mu_mailbox.c72
-rw-r--r--libmu_scm/mu_message.c182
-rw-r--r--libmu_scm/mu_mime.c26
-rw-r--r--libmu_scm/mu_scm.c8
-rw-r--r--libmu_scm/mu_util.c4
9 files changed, 192 insertions, 192 deletions
diff --git a/libmu_scm/mu_address.c b/libmu_scm/mu_address.c
index 14eaaf404..a1fca0053 100644
--- a/libmu_scm/mu_address.c
+++ b/libmu_scm/mu_address.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -47,13 +47,13 @@ _get_address_part (const char *func_name, address_get_fp fun,
if (length == 0)
return scm_makfrom0str("");
- if (address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
+ if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
return SCM_BOOL_F;
str = malloc (length + 1);
if (!str)
{
- address_destroy (&addr);
+ mu_address_destroy (&addr);
return SCM_BOOL_F;
}
@@ -61,65 +61,65 @@ _get_address_part (const char *func_name, address_get_fp fun,
ret = scm_makfrom0str (str);
else
ret = SCM_BOOL_F;
- address_destroy (&addr);
+ mu_address_destroy (&addr);
free (str);
return ret;
}
-SCM_DEFINE (mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
+SCM_DEFINE (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return personal part of an email address.\n")
-#define FUNC_NAME s_mu_address_get_personal
+#define FUNC_NAME s_scm_mu_address_get_personal
{
return _get_address_part (FUNC_NAME,
- address_get_personal, ADDRESS, NUM);
+ mu_address_get_personal, ADDRESS, NUM);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
+SCM_DEFINE (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return comment part of an email address.\n")
-#define FUNC_NAME s_mu_address_get_comments
+#define FUNC_NAME s_scm_mu_address_get_comments
{
return _get_address_part (FUNC_NAME,
- address_get_comments, ADDRESS, NUM);
+ mu_address_get_comments, ADDRESS, NUM);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_address_get_email, "mu-address-get-email", 1, 1, 0,
+SCM_DEFINE (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return email part of an email address.\n")
-#define FUNC_NAME s_mu_address_get_email
+#define FUNC_NAME s_scm_mu_address_get_email
{
return _get_address_part (FUNC_NAME,
- address_get_email, ADDRESS, NUM);
+ mu_address_get_email, ADDRESS, NUM);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
+SCM_DEFINE (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return domain part of an email address.\n")
-#define FUNC_NAME s_mu_address_get_domain
+#define FUNC_NAME s_scm_mu_address_get_domain
{
return _get_address_part (FUNC_NAME,
- address_get_domain, ADDRESS, NUM);
+ mu_address_get_domain, ADDRESS, NUM);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_address_get_local, "mu-address-get-local", 1, 1, 0,
+SCM_DEFINE (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return local part of an email address.\n")
-#define FUNC_NAME s_mu_address_get_local
+#define FUNC_NAME s_scm_mu_address_get_local
{
return _get_address_part (FUNC_NAME,
- address_get_local_part, ADDRESS, NUM);
+ mu_address_get_local_part, ADDRESS, NUM);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0,
+SCM_DEFINE (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
(SCM ADDRESS),
"Return number of parts in email address.\n")
-#define FUNC_NAME s_mu_address_get_count
+#define FUNC_NAME s_scm_mu_address_get_count
{
address_t addr;
size_t count = 0;
@@ -127,20 +127,20 @@ SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0,
SCM_ASSERT (SCM_NIMP (ADDRESS) && SCM_STRINGP (ADDRESS),
ADDRESS, SCM_ARG1, FUNC_NAME);
- if (address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
+ if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
return SCM_MAKINUM(0);
- address_get_count (addr, &count);
- address_destroy (&addr);
- return scm_makenum (count);
+ mu_address_get_count (addr, &count);
+ mu_address_destroy (&addr);
+ return mu_scm_makenum (count);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_username_to_email, "mu-username->email", 0, 1, 0,
+SCM_DEFINE (scm_mu_username_to_email, "mu-username->email", 0, 1, 0,
(SCM NAME),
"Deduce the email from the username. If NAME is omitted, current username\n"
"is assumed\n")
-#define FUNC_NAME s_mu_username_to_email
+#define FUNC_NAME s_scm_mu_username_to_email
{
char *name;
char *email;
diff --git a/libmu_scm/mu_body.c b/libmu_scm/mu_body.c
index a0e3df29d..b1f289128 100644
--- a/libmu_scm/mu_body.c
+++ b/libmu_scm/mu_body.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -58,10 +58,10 @@ mu_scm_body_print (SCM body_smob, SCM port, scm_print_state * pstate)
size_t b_size = 0, b_lines = 0, len = 0;
char buffer[512];
- body_size (mbp->body, &b_size);
- body_lines (mbp->body, &b_lines);
+ mu_body_size (mbp->body, &b_size);
+ mu_body_lines (mbp->body, &b_lines);
buffer[0] = 0;
- body_get_filename (mbp->body, buffer, sizeof (buffer), &len);
+ mu_body_get_filename (mbp->body, buffer, sizeof (buffer), &len);
scm_puts ("#<body \"", port);
scm_puts (buffer, port);
@@ -101,10 +101,10 @@ mu_scm_body_create (SCM msg, body_t body)
/* ************************************************************************* */
/* Guile primitives */
-SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
+SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
(SCM BODY),
"Read next line from the BODY.")
-#define FUNC_NAME s_mu_body_read_line
+#define FUNC_NAME s_scm_mu_body_read_line
{
struct mu_body *mbp;
int n, nread;
@@ -114,7 +114,7 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
if (!mbp->stream)
{
- if (body_get_stream (mbp->body, &mbp->stream))
+ if (mu_body_get_stream (mbp->body, &mbp->stream))
return SCM_BOOL_F;
}
@@ -156,10 +156,10 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0,
+SCM_DEFINE (scm_mu_body_write, "mu-body-write", 2, 0, 0,
(SCM BODY, SCM TEXT),
"Append TEXT to message BODY.")
-#define FUNC_NAME s_mu_body_write
+#define FUNC_NAME s_scm_mu_body_write
{
char *ptr;
size_t len, n;
@@ -172,7 +172,7 @@ SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0,
if (!mbp->stream)
{
- if (body_get_stream (mbp->body, &mbp->stream))
+ if (mu_body_get_stream (mbp->body, &mbp->stream))
return SCM_BOOL_F;
}
diff --git a/libmu_scm/mu_guimb.c b/libmu_scm/mu_guimb.c
index 351b90772..c32c2ebc2 100644
--- a/libmu_scm/mu_guimb.c
+++ b/libmu_scm/mu_guimb.c
@@ -21,7 +21,7 @@
static void _scheme_main (void *closure, int argc, char **argv);
void
-mu_process_mailbox (int argc, char *argv[], guimb_param_t *param)
+mu_process_mailbox (int argc, char *argv[], mu_guimb_param_t *param)
{
scm_boot_guile (argc, argv, _scheme_main, param);
}
@@ -32,14 +32,14 @@ SCM _user_name;
static SCM
catch_body (void *closure)
{
- guimb_param_t *param = closure;
+ mu_guimb_param_t *param = closure;
return param->catch_body (param->data, param->mbox);
}
void
_scheme_main (void *closure, int argc, char **argv)
{
- guimb_param_t *param = closure;
+ mu_guimb_param_t *param = closure;
if (param->debug_guile)
{
diff --git a/libmu_scm/mu_logger.c b/libmu_scm/mu_logger.c
index 13cb1ebad..dadedf383 100644
--- a/libmu_scm/mu_logger.c
+++ b/libmu_scm/mu_logger.c
@@ -20,10 +20,10 @@
#include <syslog.h>
-SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0,
+SCM_DEFINE (scm_mu_openlog, "mu-openlog", 3, 0, 0,
(SCM IDENT, SCM OPTION, SCM FACILITY),
"Opens a connection to the system logger for Guile program.")
-#define FUNC_NAME s_mu_openlog
+#define FUNC_NAME s_scm_mu_openlog
{
char *ident;
int option, facility;
@@ -56,10 +56,10 @@ SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0,
+SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
(SCM PRIO, SCM TEXT),
"Generates a log message to be distributed via syslogd.")
-#define FUNC_NAME s_mu_logger
+#define FUNC_NAME s_scm_mu_logger
{
int prio;
@@ -79,10 +79,10 @@ SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_closelog, "mu-closelog", 0, 0, 0,
+SCM_DEFINE (scm_mu_closelog, "mu-closelog", 0, 0, 0,
(),
"Closes the channel to the system logger open by mu-openlog.")
-#define FUNC_NAME s_mu_closelog
+#define FUNC_NAME s_scm_mu_closelog
{
closelog ();
return SCM_UNSPECIFIED;
diff --git a/libmu_scm/mu_mailbox.c b/libmu_scm/mu_mailbox.c
index 677772148..af46e129c 100644
--- a/libmu_scm/mu_mailbox.c
+++ b/libmu_scm/mu_mailbox.c
@@ -38,11 +38,11 @@ static scm_sizet
mu_scm_mailbox_free (SCM mailbox_smob)
{
struct mu_mailbox *mum = (struct mu_mailbox *) SCM_CDR (mailbox_smob);
- mailbox_close (mum->mbox);
- mailbox_destroy (&mum->mbox);
+ mu_mailbox_close (mum->mbox);
+ mu_mailbox_destroy (&mum->mbox);
free (mum);
/* NOTE: Currently there is no way for this function to return the
- amount of memory *actually freed* by mailbox_destroy */
+ amount of memory *actually freed* by mu_mailbox_destroy */
return sizeof (struct mu_mailbox);
}
@@ -53,8 +53,8 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate)
size_t count = 0;
url_t url = NULL;
- mailbox_messages_count (mum->mbox, &count);
- mailbox_get_url (mum->mbox, &url);
+ mu_mailbox_messages_count (mum->mbox, &count);
+ mu_mailbox_get_url (mum->mbox, &url);
scm_puts ("#<mailbox ", port);
@@ -134,10 +134,10 @@ SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
(SCM URL, SCM MODE),
"Opens a mailbox specified by URL.")
-#define FUNC_NAME s_mu_mailbox_open
+#define FUNC_NAME s_scm_mu_mailbox_open
{
mailbox_t mbox = NULL;
char *mode_str;
@@ -167,12 +167,12 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
if (mode & MU_STREAM_READ && mode & MU_STREAM_WRITE)
mode = (mode & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR;
- if (mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0)
+ if (mu_mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0)
return SCM_BOOL_F;
- if (mailbox_open (mbox, mode) != 0)
+ if (mu_mailbox_open (mbox, mode) != 0)
{
- mailbox_destroy (&mbox);
+ mu_mailbox_destroy (&mbox);
return SCM_BOOL_F;
}
@@ -180,42 +180,42 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
(SCM MBOX), "Closes mailbox MBOX")
-#define FUNC_NAME s_mu_mailbox_close
+#define FUNC_NAME s_scm_mu_mailbox_close
{
struct mu_mailbox *mum;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- mailbox_close (mum->mbox);
- mailbox_destroy (&mum->mbox);
+ mu_mailbox_close (mum->mbox);
+ mu_mailbox_destroy (&mum->mbox);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
(SCM MBOX),
"Returns the URL of the mailbox.")
-#define FUNC_NAME s_mu_mailbox_get_url
+#define FUNC_NAME s_scm_mu_mailbox_get_url
{
struct mu_mailbox *mum;
url_t url;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- mailbox_get_url (mum->mbox, &url);
+ mu_mailbox_get_url (mum->mbox, &url);
return scm_makfrom0str (url_to_string (url));
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
(SCM MBOX, SCM MODE),
"Returns a port associated with the contents of the MBOX.\n"
"MODE is a string defining operation mode of the stream. It may\n"
"contain any of the two characters: \"r\" for reading, \"w\" for\n"
"writing.\n")
-#define FUNC_NAME s_mu_mailbox_get_port
+#define FUNC_NAME s_scm_mu_mailbox_get_port
{
struct mu_mailbox *mum;
stream_t stream;
@@ -224,16 +224,16 @@ SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
SCM_ASSERT (SCM_NIMP (MODE) && SCM_STRINGP (MODE),
MODE, SCM_ARG2, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- if (mailbox_get_stream (mum->mbox, &stream))
+ if (mu_mailbox_get_stream (mum->mbox, &stream))
return SCM_BOOL_F;
return mu_port_make_from_stream (MBOX, stream,
scm_mode_bits (SCM_STRING_CHARS (MODE)));
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
(SCM MBOX, SCM MSGNO), "Retrieve from MBOX message # MSGNO.")
-#define FUNC_NAME s_mu_mailbox_get_message
+#define FUNC_NAME s_scm_mu_mailbox_get_message
{
size_t msgno;
struct mu_mailbox *mum;
@@ -246,16 +246,16 @@ SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
msgno = SCM_INUM (MSGNO);
- if (mailbox_get_message (mum->mbox, msgno, &msg))
+ if (mu_mailbox_get_message (mum->mbox, msgno, &msg))
return SCM_BOOL_F;
return mu_scm_message_create (MBOX, msg);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
(SCM MBOX), "Returns number of messages in the mailbox.")
-#define FUNC_NAME s_mu_mailbox_messages_count
+#define FUNC_NAME s_scm_mu_mailbox_messages_count
{
struct mu_mailbox *mum;
size_t nmesg;
@@ -263,43 +263,43 @@ SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- if (mailbox_messages_count (mum->mbox, &nmesg))
+ if (mu_mailbox_messages_count (mum->mbox, &nmesg))
return SCM_BOOL_F;
- return scm_makenum (nmesg);
+ return mu_scm_makenum (nmesg);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
(SCM MBOX), "Expunges deleted messages from the mailbox.")
-#define FUNC_NAME s_mu_mailbox_expunge
+#define FUNC_NAME s_scm_mu_mailbox_expunge
{
struct mu_mailbox *mum;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- if (mailbox_expunge (mum->mbox))
+ if (mu_mailbox_expunge (mum->mbox))
return SCM_BOOL_F;
return SCM_BOOL_T;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_url, "mu-mailbox-url", 1, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_url, "mu-mailbox-url", 1, 0, 0,
(SCM MBOX), "Returns the URL of the mailbox")
-#define FUNC_NAME s_mu_mailbox_url
+#define FUNC_NAME s_scm_mu_mailbox_url
{
struct mu_mailbox *mum;
url_t url;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
- mailbox_get_url (mum->mbox, &url);
+ mu_mailbox_get_url (mum->mbox, &url);
return scm_makfrom0str (url_to_string (url));
}
#undef FUNC_NAME
-SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
+SCM_DEFINE (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
(SCM MBOX, SCM MESG), "Appends the message to the mailbox")
-#define FUNC_NAME s_mu_mailbox_append_message
+#define FUNC_NAME s_scm_mu_mailbox_append_message
{
struct mu_mailbox *mum;
message_t msg;
@@ -308,7 +308,7 @@ SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
msg = mu_scm_message_get (MESG);
- if (mailbox_append_message (mum->mbox, msg))
+ if (mu_mailbox_append_message (mum->mbox, msg))
return SCM_BOOL_F;
return SCM_BOOL_T;
}
diff --git a/libmu_scm/mu_message.c b/libmu_scm/mu_message.c
index 36eca8e90..e996dac4d 100644
--- a/libmu_scm/mu_message.c
+++ b/libmu_scm/mu_message.c
@@ -51,17 +51,17 @@ _get_envelope_sender (envelope_t env)
address_t addr;
char buffer[128];
- if (envelope_sender (env, buffer, sizeof (buffer), NULL)
- || address_create (&addr, buffer))
+ if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL)
+ || mu_address_create (&addr, buffer))
return NULL;
- if (address_get_email (addr, 1, buffer, sizeof (buffer), NULL))
+ if (mu_address_get_email (addr, 1, buffer, sizeof (buffer), NULL))
{
- address_destroy (&addr);
+ mu_address_destroy (&addr);
return NULL;
}
- address_destroy (&addr);
+ mu_address_destroy (&addr);
return strdup (buffer);
}
@@ -97,7 +97,7 @@ mu_scm_message_print (SCM message_smob, SCM port, scm_print_state * pstate)
else
scm_puts ("UNKNOWN", port);
- envelope_date (env, buffer, sizeof (buffer), NULL);
+ mu_envelope_date (env, buffer, sizeof (buffer), NULL);
p = buffer;
if (mu_parse_ctime_date_time (&p, &tm, &tz) == 0)
strftime (buffer, sizeof (buffer), "%a %b %e %H:%M", &tm);
@@ -174,10 +174,10 @@ mu_scm_is_message (SCM scm)
/* ************************************************************************* */
/* Guile primitives */
-SCM_DEFINE (mu_message_create, "mu-message-create", 0, 0, 0,
+SCM_DEFINE (scm_mu_message_create, "mu-message-create", 0, 0, 0,
(),
"Creates an empty message.")
-#define FUNC_NAME s_mu_message_create
+#define FUNC_NAME s_scm_mu_message_create
{
message_t msg;
message_create (&msg, NULL);
@@ -186,10 +186,10 @@ SCM_DEFINE (mu_message_create, "mu-message-create", 0, 0, 0,
#undef FUNC_NAME
/* FIXME: This changes envelope date */
-SCM_DEFINE (mu_message_copy, "mu-message-copy", 1, 0, 0,
+SCM_DEFINE (scm_mu_message_copy, "mu-message-copy", 1, 0, 0,
(SCM MESG),
"Creates the copy of the given message.\n")
-#define FUNC_NAME s_mu_message_copy
+#define FUNC_NAME s_scm_mu_message_copy
{
message_t msg, newmsg;
stream_t in = NULL, out = NULL;
@@ -230,10 +230,10 @@ SCM_DEFINE (mu_message_copy, "mu-message-copy", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_destroy, "mu-message-destroy", 1, 0, 0,
+SCM_DEFINE (scm_mu_message_destroy, "mu-message-destroy", 1, 0, 0,
(SCM MESG),
"Destroys the message.")
-#define FUNC_NAME s_mu_message_destroy
+#define FUNC_NAME s_scm_mu_message_destroy
{
struct mu_message *mum;
@@ -244,13 +244,13 @@ SCM_DEFINE (mu_message_destroy, "mu-message-destroy", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_set_header, "mu-message-set-header", 3, 1, 0,
+SCM_DEFINE (scm_mu_message_set_header, "mu-message-set-header", 3, 1, 0,
(SCM MESG, SCM HEADER, SCM VALUE, SCM REPLACE),
"Sets new VALUE to the header HEADER of the message MESG.\n"
"If the HEADER is already present in the message its value\n"
"is replaced with the suplied one iff the optional REPLACE is\n"
"#t. Otherwise new header is created and appended.")
-#define FUNC_NAME s_mu_message_set_header
+#define FUNC_NAME s_scm_mu_message_set_header
{
message_t msg;
header_t hdr;
@@ -272,44 +272,44 @@ SCM_DEFINE (mu_message_set_header, "mu-message-set-header", 3, 1, 0,
}
message_get_header (msg, &hdr);
- header_set_value (hdr, SCM_STRING_CHARS (HEADER), SCM_STRING_CHARS (VALUE),
+ mu_header_set_value (hdr, SCM_STRING_CHARS (HEADER), SCM_STRING_CHARS (VALUE),
replace);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_size, "mu-message-get-size", 1, 0, 0,
+SCM_DEFINE (scm_mu_message_get_size, "mu-message-get-size", 1, 0, 0,
(SCM MESG),
"Returns the size of the given message.")
-#define FUNC_NAME s_mu_message_get_size
+#define FUNC_NAME s_scm_mu_message_get_size
{
message_t msg;
size_t size;
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);
msg = mu_scm_message_get (MESG);
message_size (msg, &size);
- return scm_makenum (size);
+ return mu_scm_makenum (size);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_lines, "mu-message-get-lines", 1, 0, 0,
+SCM_DEFINE (scm_mu_message_get_lines, "mu-message-get-lines", 1, 0, 0,
(SCM MESG),
"Returns number of lines in the given message.")
-#define FUNC_NAME s_mu_message_get_lines
+#define FUNC_NAME s_scm_mu_message_get_lines
{
message_t msg;
size_t lines;
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);
msg = mu_scm_message_get (MESG);
message_lines (msg, &lines);
- return scm_makenum (lines);
+ return mu_scm_makenum (lines);
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
+SCM_DEFINE (scm_mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
(SCM MESG),
"Returns the sender email address for the message MESG.")
-#define FUNC_NAME s_mu_message_get_sender
+#define FUNC_NAME s_scm_mu_message_get_sender
{
message_t msg;
envelope_t env = NULL;
@@ -327,10 +327,10 @@ SCM_DEFINE (mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_header, "mu-message-get-header", 2, 0, 0,
+SCM_DEFINE (scm_mu_message_get_header, "mu-message-get-header", 2, 0, 0,
(SCM MESG, SCM HEADER),
"Returns the header value of the HEADER in the MESG.")
-#define FUNC_NAME s_mu_message_get_header
+#define FUNC_NAME s_scm_mu_message_get_header
{
message_t msg;
header_t hdr;
@@ -344,7 +344,7 @@ SCM_DEFINE (mu_message_get_header, "mu-message-get-header", 2, 0, 0,
HEADER, SCM_ARG2, FUNC_NAME);
header_string = SCM_STRING_CHARS (HEADER);
message_get_header (msg, &hdr);
- if (header_aget_value (hdr, header_string, &value) == 0)
+ if (mu_header_aget_value (hdr, header_string, &value) == 0)
{
ret = scm_makfrom0str (value);
free (value);
@@ -366,12 +366,12 @@ string_sloppy_member (SCM lst, char *name)
return 0;
}
-SCM_DEFINE (mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1, 0,
+SCM_DEFINE (scm_mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1, 0,
(SCM MESG, SCM HEADERS),
"Returns the list of headers in the MESG. If optional HEADERS is\n"
"specified it should be a list of header names to restrict return\n"
"value to.\n")
-#define FUNC_NAME s_mu_message_get_header_fields
+#define FUNC_NAME s_scm_mu_message_get_header_fields
{
size_t i, nfields = 0;
message_t msg;
@@ -389,16 +389,16 @@ SCM_DEFINE (mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1,
}
message_get_header (msg, &hdr);
- header_get_field_count (hdr, &nfields);
+ mu_header_get_field_count (hdr, &nfields);
for (i = 1; i <= nfields; i++)
{
SCM new_cell, scm_name, scm_value;
char *name, *value;
- header_aget_field_name (hdr, i, &name);
+ mu_header_aget_field_name (hdr, i, &name);
if (headers != SCM_EOL && string_sloppy_member (headers, name) == 0)
continue;
- header_aget_field_value (hdr, i, &value);
+ mu_header_aget_field_value (hdr, i, &value);
scm_name = scm_makfrom0str (name);
scm_value = scm_makfrom0str (value);
@@ -423,14 +423,14 @@ SCM_DEFINE (mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1,
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_set_header_fields, "mu-message-set-header-fields", 2, 1, 0,
+SCM_DEFINE (scm_mu_message_set_header_fields, "mu-message-set-header-fields", 2, 1, 0,
(SCM MESG, SCM LIST, SCM REPLACE),
"Set the headers in the message MESG from LIST\n"
"LIST is a list of (cons HEADER VALUE)\n"
"Optional parameter REPLACE spceifies whether the new header\n"
"values should replace the headers already present in the\n"
"message.")
-#define FUNC_NAME s_mu_message_set_header_fields
+#define FUNC_NAME s_scm_mu_message_set_header_fields
{
message_t msg;
header_t hdr;
@@ -463,17 +463,17 @@ SCM_DEFINE (mu_message_set_header_fields, "mu-message-set-header-fields", 2, 1,
car, SCM_ARGn, FUNC_NAME);
SCM_ASSERT (SCM_NIMP (cdr) && SCM_STRINGP (cdr),
cdr, SCM_ARGn, FUNC_NAME);
- header_set_value (hdr, SCM_STRING_CHARS (car), SCM_STRING_CHARS (cdr), replace);
+ mu_header_set_value (hdr, SCM_STRING_CHARS (car), SCM_STRING_CHARS (cdr), replace);
}
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_delete, "mu-message-delete", 1, 1, 0,
+SCM_DEFINE (scm_mu_message_delete, "mu-message-delete", 1, 1, 0,
(SCM MESG, SCM FLAG),
"Mark given message as deleted. Optional FLAG allows to toggle deleted mark\n"
"The message is deleted if it is #t and undeleted if it is #f")
-#define FUNC_NAME s_mu_message_delete
+#define FUNC_NAME s_scm_mu_message_delete
{
message_t msg;
attribute_t attr;
@@ -489,17 +489,17 @@ SCM_DEFINE (mu_message_delete, "mu-message-delete", 1, 1, 0,
}
message_get_attribute (msg, &attr);
if (delete)
- attribute_set_deleted (attr);
+ mu_attribute_set_deleted (attr);
else
- attribute_unset_deleted (attr);
+ mu_attribute_unset_deleted (attr);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
+SCM_DEFINE (scm_mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
(SCM MESG, SCM FLAG),
"Return value of the attribute FLAG.")
-#define FUNC_NAME s_mu_message_get_flag
+#define FUNC_NAME s_scm_mu_message_get_flag
{
message_t msg;
attribute_t attr;
@@ -513,42 +513,42 @@ SCM_DEFINE (mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
switch (SCM_INUM (FLAG))
{
case MU_ATTRIBUTE_ANSWERED:
- ret = attribute_is_answered (attr);
+ ret = mu_attribute_is_answered (attr);
break;
case MU_ATTRIBUTE_FLAGGED:
- ret = attribute_is_flagged (attr);
+ ret = mu_attribute_is_flagged (attr);
break;
case MU_ATTRIBUTE_DELETED:
- ret = attribute_is_deleted (attr);
+ ret = mu_attribute_is_deleted (attr);
break;
case MU_ATTRIBUTE_DRAFT:
- ret = attribute_is_draft (attr);
+ ret = mu_attribute_is_draft (attr);
break;
case MU_ATTRIBUTE_SEEN:
- ret = attribute_is_seen (attr);
+ ret = mu_attribute_is_seen (attr);
break;
case MU_ATTRIBUTE_READ:
- ret = attribute_is_read (attr);
+ ret = mu_attribute_is_read (attr);
break;
case MU_ATTRIBUTE_MODIFIED:
- ret = attribute_is_modified (attr);
+ ret = mu_attribute_is_modified (attr);
break;
case MU_ATTRIBUTE_RECENT:
- ret = attribute_is_recent (attr);
+ ret = mu_attribute_is_recent (attr);
break;
default:
- attribute_get_flags (attr, &ret);
+ mu_attribute_get_flags (attr, &ret);
ret &= SCM_INUM (FLAG);
}
return ret ? SCM_BOOL_T : SCM_BOOL_F;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
+SCM_DEFINE (scm_mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
(SCM MESG, SCM FLAG, SCM VALUE),
"Set the given attribute of the message. If optional VALUE is #f, the\n"
"attribute is unset.")
-#define FUNC_NAME s_mu_message_set_flag
+#define FUNC_NAME s_scm_mu_message_set_flag
{
message_t msg;
attribute_t attr;
@@ -570,64 +570,64 @@ SCM_DEFINE (mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
{
case MU_ATTRIBUTE_ANSWERED:
if (value)
- attribute_set_answered (attr);
+ mu_attribute_set_answered (attr);
else
- attribute_unset_answered (attr);
+ mu_attribute_unset_answered (attr);
break;
case MU_ATTRIBUTE_FLAGGED:
if (value)
- attribute_set_flagged (attr);
+ mu_attribute_set_flagged (attr);
else
- attribute_unset_flagged (attr);
+ mu_attribute_unset_flagged (attr);
break;
case MU_ATTRIBUTE_DELETED:
if (value)
- attribute_set_deleted (attr);
+ mu_attribute_set_deleted (attr);
else
- attribute_unset_deleted (attr);
+ mu_attribute_unset_deleted (attr);
break;
case MU_ATTRIBUTE_DRAFT:
if (value)
- attribute_set_draft (attr);
+ mu_attribute_set_draft (attr);
else
- attribute_unset_draft (attr);
+ mu_attribute_unset_draft (attr);
break;
case MU_ATTRIBUTE_SEEN:
if (value)
- attribute_set_seen (attr);
+ mu_attribute_set_seen (attr);
else
- attribute_unset_seen (attr);
+ mu_attribute_unset_seen (attr);
break;
case MU_ATTRIBUTE_READ:
if (value)
- attribute_set_read (attr);
+ mu_attribute_set_read (attr);
else
- attribute_unset_read (attr);
+ mu_attribute_unset_read (attr);
break;
case MU_ATTRIBUTE_MODIFIED:
if (value)
- attribute_set_modified (attr);
+ mu_attribute_set_modified (attr);
else
- attribute_clear_modified (attr);
+ mu_attribute_clear_modified (attr);
break;
case MU_ATTRIBUTE_RECENT:
if (value)
- attribute_set_recent (attr);
+ mu_attribute_set_recent (attr);
else
- attribute_unset_recent (attr);
+ mu_attribute_unset_recent (attr);
break;
default:
if (value)
- attribute_set_flags (attr, SCM_INUM (FLAG));
+ mu_attribute_set_flags (attr, SCM_INUM (FLAG));
}
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
+SCM_DEFINE (scm_mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
(SCM MESG, SCM FLAG),
"Returns value of the user attribute FLAG.")
-#define FUNC_NAME s_mu_message_get_user_flag
+#define FUNC_NAME s_scm_mu_message_get_user_flag
{
message_t msg;
attribute_t attr;
@@ -636,17 +636,17 @@ SCM_DEFINE (mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
msg = mu_scm_message_get (MESG);
SCM_ASSERT (SCM_IMP (FLAG) && SCM_INUMP (FLAG), FLAG, SCM_ARG2, FUNC_NAME);
message_get_attribute (msg, &attr);
- return attribute_is_userflag (attr, SCM_INUM (FLAG)) ?
+ return mu_attribute_is_userflag (attr, SCM_INUM (FLAG)) ?
SCM_BOOL_T : SCM_BOOL_F;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_set_user_flag, "mu-message-set-user-flag", 2, 1, 0,
+SCM_DEFINE (scm_mu_message_set_user_flag, "mu-message-set-user-flag", 2, 1, 0,
(SCM MESG, SCM FLAG, SCM VALUE),
"Set the given user attribute of the message. If optional VALUE is\n"
"#f, the attribute is unset.")
-#define FUNC_NAME s_mu_message_set_user_flag
+#define FUNC_NAME s_scm_mu_message_set_user_flag
{
message_t msg;
attribute_t attr;
@@ -665,14 +665,14 @@ SCM_DEFINE (mu_message_set_user_flag, "mu-message-set-user-flag", 2, 1, 0,
message_get_attribute (msg, &attr);
if (set)
- attribute_set_userflag (attr, SCM_INUM (FLAG));
+ mu_attribute_set_userflag (attr, SCM_INUM (FLAG));
else
- attribute_unset_userflag (attr, SCM_INUM (FLAG));
+ mu_attribute_unset_userflag (attr, SCM_INUM (FLAG));
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-SCM_DEFINE (mu_message_get_port, "mu-message-get-port", 2, 1, 0,
+SCM_DEFINE (scm_mu_message_get_port, "mu-message-get-port", 2, 1, 0,
(SCM MESG, SCM MODE, SCM FULL),
"Returns a port associated with the given MESG. MODE is a string\n"
"defining operation mode of the stream. It may contain any of the\n"
@@ -681,7 +681,7 @@ SCM_DEFINE (mu_message_get_port, "mu-message-get-port", 2, 1, 0,
"If it is #t then the returned port will allow access to any\n"
"part of the message (including headers). If it is #f then the port\n"
"accesses only the message body (the default).\n")
-#define FUNC_NAME s_mu_message_get_port
+#define FUNC_NAME s_scm_mu_message_get_port
{
message_t msg;
stream_t stream = NULL;
@@ -705,7 +705,7 @@ SCM_DEFINE (mu_message_get_port, "mu-message-get-port", 2, 1, 0,
body_t body = NULL;