commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. rel-2_1-53-g43a43a7


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. rel-2_1-53-g43a43a7
Date: Thu, 01 Apr 2010 10:35:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=43a43a758881ae1294b73696175bc066e9257aa2

The branch, master has been updated
       via  43a43a758881ae1294b73696175bc066e9257aa2 (commit)
       via  ee08a14e8d73482297fa603938e0ba04475c092c (commit)
       via  36226fa2c08235807a34ca448788f6cdaa9cff02 (commit)
      from  c3378d59ccc7cf6d57d6b07ed8923a169c7923cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 43a43a758881ae1294b73696175bc066e9257aa2
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Apr 1 13:25:41 2010 +0300

    Fix SCM syslog interface.
    
    * libmu_scm/mu_logger.c (log_tag): New static.
    (mu-openlog): Preserve log tag in log_tag, because
    openlog stores its first argument as-is.
    Simplify argument handling.
    (mu-logger): Simplify argument handling.
    (mu-closelog): Free log_tag.

commit ee08a14e8d73482297fa603938e0ba04475c092c
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Apr 1 13:15:01 2010 +0300

    Remove the uses of deprecated Guile functions.
    
    * am/guile.m4 (MU_CHECK_GUILE): Check for scm_t_off.
    * include/mailutils/guile.h (mu_scm_makenum)
    (mu_set_variable): Remove prototypes.
    * libmu_scm/mu_address.c: Remove calls to deprecated Guile functions.
    * libmu_scm/mu_body.c: Likewise.
    * libmu_scm/mu_guile.c: Likewise.
    * libmu_scm/mu_mailbox.c: Likewise.
    * libmu_scm/mu_message.c: Likewise.
    * libmu_scm/mu_mime.c: Likewise.
    * libmu_scm/mu_util.c: Likewise.
    * libmu_scm/mu_scm.c (mu_scm_makenum): Remove.
    (mu_set_variable): Remove. Use scm_c_define instead.

commit 36226fa2c08235807a34ca448788f6cdaa9cff02
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Apr 1 13:13:28 2010 +0300

    Add missing include.
    
    * mailutils/mutil.h: Include mailutils/mutil.h

-----------------------------------------------------------------------

Summary of changes:
 am/guile.m4               |    3 +-
 include/mailutils/guile.h |    3 +-
 libmu_scm/mu_address.c    |    6 ++--
 libmu_scm/mu_body.c       |    4 +-
 libmu_scm/mu_guile.c      |    2 +-
 libmu_scm/mu_logger.c     |   51 ++++++++++++++---------------------------
 libmu_scm/mu_mailbox.c    |   12 +++++-----
 libmu_scm/mu_message.c    |   55 +++++++++++++++++++-------------------------
 libmu_scm/mu_mime.c       |    6 ++--
 libmu_scm/mu_scm.c        |   53 +++++++++++-------------------------------
 libmu_scm/mu_util.c       |   22 ++++++-----------
 mailbox/cfg_lexer.l       |    3 +-
 12 files changed, 83 insertions(+), 137 deletions(-)

diff --git a/am/guile.m4 b/am/guile.m4
index ff0a544..f049037 100644
--- a/am/guile.m4
+++ b/am/guile.m4
@@ -62,7 +62,8 @@ AC_DEFUN([MU_CHECK_GUILE],
     GUILE_VERSION=
     GUILE_VERSION_NUMBER=
     m4_if($3,,[AC_MSG_ERROR(required library libguile not found)], [$3])
-  else    
+  else
+    AC_CHECK_TYPES([scm_t_off],[],[],[#include <libguile.h>])
     AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION",
                        [Guile version number])
     AC_DEFINE_UNQUOTED(GUILE_VERSION_NUMBER, $GUILE_VERSION_NUMBER,
diff --git a/include/mailutils/guile.h b/include/mailutils/guile.h
index 1c0e6e2..1db5b8a 100644
--- a/include/mailutils/guile.h
+++ b/include/mailutils/guile.h
@@ -43,8 +43,7 @@ extern "C" {
 
 void mu_scm_error (const char *func_name, int status,
                   const char *fmt, SCM args);
-extern SCM mu_scm_makenum (unsigned long val);
-extern void mu_set_variable (const char *name, SCM value);
+
 extern void mu_scm_init (void);
 
 extern void mu_scm_mailbox_init (void);
diff --git a/libmu_scm/mu_address.c b/libmu_scm/mu_address.c
index ace89c2..a357170 100644
--- a/libmu_scm/mu_address.c
+++ b/libmu_scm/mu_address.c
@@ -66,7 +66,7 @@ _get_address_part (const char *func_name, address_get_fp fun,
   mu_address_destroy (&addr);
 
   if (status == 0)
-    ret = scm_makfrom0str (str);
+    ret = scm_from_locale_string (str);
   else
     {
       free (str);
@@ -150,7 +150,7 @@ SCM_DEFINE (scm_mu_address_get_count, 
"mu-address-get-count", 1, 0, 0,
 
   mu_address_get_count (addr, &count);
   mu_address_destroy (&addr);
-  return mu_scm_makenum (count);
+  return scm_from_size_t (count);
 }
 #undef FUNC_NAME
 
@@ -179,7 +179,7 @@ SCM_DEFINE (scm_mu_username_to_email, "mu-username->email", 
0, 1, 0,
                  "Cannot get user email for ~A",
                  scm_list_1 (NAME));
 
-  ret = scm_makfrom0str (email);
+  ret = scm_from_locale_string (email);
   free (email);
   return ret;
 }
diff --git a/libmu_scm/mu_body.c b/libmu_scm/mu_body.c
index 435e2c2..43ee30b 100644
--- a/libmu_scm/mu_body.c
+++ b/libmu_scm/mu_body.c
@@ -19,7 +19,7 @@
 
 #include "mu_scm.h"
 
-long body_tag;
+static scm_t_bits body_tag;
 
 struct mu_body
 {
@@ -159,7 +159,7 @@ SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 
0, 0,
   if (nread == 0)
     return SCM_EOF_VAL;
 
-  return scm_makfrom0str (mbp->buffer);
+  return scm_from_locale_string (mbp->buffer);
 }
 #undef FUNC_NAME
 
diff --git a/libmu_scm/mu_guile.c b/libmu_scm/mu_guile.c
index c2fb89c..b5cd261 100644
--- a/libmu_scm/mu_guile.c
+++ b/libmu_scm/mu_guile.c
@@ -131,7 +131,7 @@ load_path_handler (void *data)
   struct load_closure *lp = data;
 
   scm_set_program_arguments (lp->argc, lp->argv, (char*)lp->filename);
-  scm_primitive_load (scm_makfrom0str (lp->filename));
+  scm_primitive_load (scm_from_locale_string (lp->filename));
   return SCM_UNDEFINED;
 }
 
diff --git a/libmu_scm/mu_logger.c b/libmu_scm/mu_logger.c
index 5b6d0f4..4dc7841 100644
--- a/libmu_scm/mu_logger.c
+++ b/libmu_scm/mu_logger.c
@@ -21,39 +21,22 @@
 
 #include <syslog.h>
 
+static char *log_tag;
+
 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.\n"
 "IDENT, OPTION and FACILITY have the same meaning as in openlog(3)")
 #define FUNC_NAME s_scm_mu_openlog
 {
-  char *ident, *ident_mem = NULL;
-  int option, facility;
-
-  if (IDENT == SCM_BOOL_F)
-    ident = "libmu_scm";
-  else
-    {
-      SCM_ASSERT (scm_is_string (IDENT), IDENT, SCM_ARG1, FUNC_NAME);
-      ident = ident_mem = scm_to_locale_string (IDENT);
-    }
+  SCM_ASSERT (scm_is_string (IDENT), IDENT, SCM_ARG1, FUNC_NAME);
+  if (log_tag)
+    free (log_tag);
+  log_tag = scm_to_locale_string(IDENT);
        
-  if (scm_is_integer (OPTION))
-    option = scm_to_int32 (OPTION);
-  else if (SCM_BIGP (OPTION)) 
-    option = (int) scm_i_big2dbl (OPTION);
-  else 
-    SCM_ASSERT (0, OPTION, SCM_ARG2, FUNC_NAME);
-
-  if (scm_is_integer (FACILITY)) 
-    facility = scm_to_int32 (FACILITY);
-  else if (SCM_BIGP (FACILITY)) 
-    facility = (int) scm_i_big2dbl (FACILITY);
-  else
-    SCM_ASSERT (0, FACILITY, SCM_ARG3, FUNC_NAME);
-
-  openlog (ident, option, facility);
-  free (ident_mem);
+  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
@@ -66,18 +49,13 @@ SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
   int prio;
   char *str;
 
-  if (PRIO == SCM_BOOL_F) 
-    prio = LOG_INFO;
-  else if (scm_is_integer (PRIO)) 
-    prio = scm_to_int32 (PRIO);
-  else if (SCM_BIGP (PRIO)) 
-    prio = (int) scm_i_big2dbl (PRIO);
-  else
-    SCM_ASSERT (0, PRIO, SCM_ARG1, FUNC_NAME);
+  SCM_ASSERT (scm_is_integer (PRIO), PRIO, SCM_ARG1, FUNC_NAME);
+  prio = 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);
+  free (str);
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
@@ -88,6 +66,11 @@ SCM_DEFINE (scm_mu_closelog, "mu-closelog", 0, 0, 0,
 #define FUNC_NAME s_scm_mu_closelog
 {
   closelog ();
+  if (log_tag)
+    {
+      free (log_tag);
+      log_tag = NULL;
+    }
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
diff --git a/libmu_scm/mu_mailbox.c b/libmu_scm/mu_mailbox.c
index 4d4eb55..8a54fda 100644
--- a/libmu_scm/mu_mailbox.c
+++ b/libmu_scm/mu_mailbox.c
@@ -19,7 +19,7 @@
 
 #include "mu_scm.h"
 
-long mailbox_tag;
+static scm_t_bits mailbox_tag;
 
 /* NOTE: Maybe will have to add some more members. That's why it is a
    struct, not just a typedef mu_mailbox_t */
@@ -160,7 +160,7 @@ SCM_DEFINE (scm_mu_user_mailbox_url, "mu-user-mailbox-url", 
1, 0, 0,
     mu_scm_error (FUNC_NAME, rc,
                  "Cannot construct mailbox URL for ~A",
                  scm_list_1 (USER));
-  ret = scm_makfrom0str (p);
+  ret = scm_from_locale_string (p);
   free (p);
   return ret;
 }
@@ -175,13 +175,13 @@ SCM_DEFINE (scm_mu_folder_directory, 
"mu-folder-directory", 0, 1, 0,
   if (!SCM_UNBNDP (URL))
     {
       char *s;
-      
+
       SCM_ASSERT (scm_is_string (URL), URL, SCM_ARG1, FUNC_NAME);
       s = scm_to_locale_string (URL);
       mu_set_folder_directory (s);
       free (s);
     }
-  return scm_makfrom0str (mu_folder_directory ());
+  return scm_from_locale_string (mu_folder_directory ());
 }
 #undef FUNC_NAME 
 
@@ -288,7 +288,7 @@ SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 
1, 0, 0,
                   "Cannot get mailbox url",
                   SCM_BOOL_F);
 
-  return scm_makfrom0str (mu_url_to_string (url));
+  return scm_from_locale_string (mu_url_to_string (url));
 }
 #undef FUNC_NAME
 
@@ -364,7 +364,7 @@ SCM_DEFINE (scm_mu_mailbox_messages_count, 
"mu-mailbox-messages-count", 1, 0, 0,
     mu_scm_error (FUNC_NAME, status,
                  "Cannot count messages in mailbox ~A",
                  scm_list_1 (MBOX));
-  return mu_scm_makenum (nmesg);
+  return scm_from_size_t (nmesg);
 }
 #undef FUNC_NAME
 
diff --git a/libmu_scm/mu_message.c b/libmu_scm/mu_message.c
index 61d4c78..4167f96 100644
--- a/libmu_scm/mu_message.c
+++ b/libmu_scm/mu_message.c
@@ -19,7 +19,7 @@
 
 #include "mu_scm.h"
 
-long message_tag;
+static scm_t_bits message_tag;
 
 struct mu_message
 {
@@ -147,13 +147,13 @@ mu_scm_message_add_owner (SCM MESG, SCM owner)
   struct mu_message *mum = (struct mu_message *) SCM_CDR (MESG);
   SCM cell;
 
-  if (SCM_IMP (mum->mbox) && SCM_BOOLP (mum->mbox))
+  if (scm_is_bool (mum->mbox))
     {
       mum->mbox = owner;
       return;
     }
   
-  if (SCM_NIMP (mum->mbox) && SCM_CONSP (mum->mbox))
+  if (scm_is_pair (mum->mbox))
     cell = scm_cons (owner, mum->mbox);
   else
     cell = scm_cons (owner, scm_cons (mum->mbox, SCM_EOL));
@@ -281,7 +281,7 @@ SCM_DEFINE (scm_mu_message_set_header, 
"mu-message-set-header", 3, 1, 0,
   msg = mu_scm_message_get (MESG);
   SCM_ASSERT (scm_is_string (HEADER), HEADER, SCM_ARG2, FUNC_NAME);
 
-  if (SCM_IMP (VALUE) && SCM_BOOLP (VALUE))
+  if (scm_is_bool (VALUE))
     return SCM_UNSPECIFIED;
   
   SCM_ASSERT (scm_is_string (VALUE), VALUE, SCM_ARG2, FUNC_NAME);
@@ -317,10 +317,11 @@ SCM_DEFINE (scm_mu_message_get_size, 
"mu-message-get-size", 1, 0, 0,
 {
   mu_message_t msg;
   size_t size;
+  
   SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);
   msg = mu_scm_message_get (MESG);
   mu_message_size (msg, &size);
-  return mu_scm_makenum (size);
+  return scm_from_size_t (size);
 }
 #undef FUNC_NAME
 
@@ -341,7 +342,7 @@ SCM_DEFINE (scm_mu_message_get_lines, 
"mu-message-get-lines", 1, 0, 0,
                  "Cannot get number of lines in message ~A",
                  scm_list_1 (MESG));
 
-  return mu_scm_makenum (lines);
+  return scm_from_size_t (lines);
 }
 #undef FUNC_NAME
 
@@ -426,7 +427,7 @@ SCM_DEFINE (scm_mu_message_get_envelope_date, 
"mu-message-get-envelope-date", 1,
   status = mu_parse_ctime_date_time (&sdate, &tm, &tz);
   if (status)
     mu_scm_error (FUNC_NAME, status, "invalid envelope date",
-                 scm_list_1 (scm_makfrom0str (sdate)));
+                 scm_list_1 (scm_from_locale_string (sdate)));
   return filltime (&tm, tz.utc_offset, tz.tz_name);  
 }
 #undef FUNC_NAME
@@ -447,7 +448,7 @@ SCM_DEFINE (scm_mu_message_get_sender, 
"mu-message-get-sender", 1, 0, 0,
   if (status == 0)
     {
       char *p = _get_envelope_sender (env);
-      ret = scm_makfrom0str (p);
+      ret = scm_from_locale_string (p);
       free (p);
     }
   else
@@ -484,7 +485,7 @@ SCM_DEFINE (scm_mu_message_get_header, 
"mu-message-get-header", 2, 0, 0,
   switch (status)
     {
     case 0:
-      ret = scm_makfrom0str (value);
+      ret = scm_from_locale_string (value);
       free (value);
       break;
       
@@ -533,8 +534,7 @@ SCM_DEFINE (scm_mu_message_get_header_fields, 
"mu-message-get-header-fields", 1,
   msg = mu_scm_message_get (MESG);
   if (!SCM_UNBNDP (HEADERS))
     {
-      SCM_ASSERT (SCM_NIMP (HEADERS) && SCM_CONSP (HEADERS),
-                 HEADERS, SCM_ARG2, FUNC_NAME);
+      SCM_ASSERT (scm_is_pair (HEADERS), HEADERS, SCM_ARG2, FUNC_NAME);
       headers = HEADERS;
     }
 
@@ -558,7 +558,7 @@ SCM_DEFINE (scm_mu_message_get_header_fields, 
"mu-message-get-header-fields", 1,
                      "Cannot get header field ~A, message ~A",
                      scm_list_2 (scm_from_size_t (i), MESG));
       
-      if (headers != SCM_EOL && string_sloppy_member (headers, name) == 0)
+      if (!scm_is_null (headers) && string_sloppy_member (headers, name) == 0)
        continue;
       status = mu_header_aget_field_value (hdr, i, &value);
       if (status)
@@ -566,12 +566,12 @@ SCM_DEFINE (scm_mu_message_get_header_fields, 
"mu-message-get-header-fields", 1,
                      "Cannot get header value ~A, message ~A",
                      scm_list_2 (scm_from_size_t (i), MESG));
 
-      scm_name = scm_makfrom0str (name);
-      scm_value = scm_makfrom0str (value);
+      scm_name = scm_from_locale_string (name);
+      scm_value = scm_from_locale_string (value);
 
       scm_new = scm_cons (scm_cons (scm_name, scm_value), SCM_EOL);
       
-      if (scm_first == SCM_EOL)
+      if (scm_is_null (scm_first))
        scm_first = scm_last = scm_new;
       else
        {
@@ -601,13 +601,11 @@ SCM_DEFINE (scm_mu_message_set_header_fields, 
"mu-message-set-header-fields", 2,
   
   SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);
   msg = mu_scm_message_get (MESG);
-  SCM_ASSERT (((SCM_IMP (LIST) && SCM_EOL == LIST) ||
-              (SCM_NIMP (LIST) && SCM_CONSP (LIST))),
+  SCM_ASSERT (scm_is_null (LIST) || scm_is_pair (LIST),
              LIST, SCM_ARG2, FUNC_NAME);
   if (!SCM_UNBNDP (REPLACE))
     {
-      SCM_ASSERT (SCM_IMP (REPLACE) && SCM_BOOLP (REPLACE),
-                 REPLACE, SCM_ARG3, FUNC_NAME);
+      SCM_ASSERT (scm_is_bool (REPLACE), REPLACE, SCM_ARG3, FUNC_NAME);
       replace = REPLACE == SCM_BOOL_T;
     }
 
@@ -616,14 +614,13 @@ SCM_DEFINE (scm_mu_message_set_header_fields, 
"mu-message-set-header-fields", 2,
     mu_scm_error (FUNC_NAME, status,
                  "Cannot get message headers", SCM_BOOL_F);
 
-  for (list = LIST; list != SCM_EOL; list = SCM_CDR (list))
+  for (list = LIST; !scm_is_null (list); list = SCM_CDR (list))
     {
       SCM cell = SCM_CAR (list);
       SCM car, cdr;
       char *hdr_c, *val_c;
       
-      SCM_ASSERT (SCM_NIMP (cell) && SCM_CONSP (cell),
-                 cell, SCM_ARGn, FUNC_NAME);
+      SCM_ASSERT (scm_is_pair (cell), cell, SCM_ARGn, FUNC_NAME);
       car = SCM_CAR (cell);
       cdr = SCM_CDR (cell);
       SCM_ASSERT (scm_is_string (car), car, SCM_ARGn, FUNC_NAME);
@@ -659,8 +656,7 @@ SCM_DEFINE (scm_mu_message_delete, "mu-message-delete", 1, 
1, 0,
   msg = mu_scm_message_get (MESG);
   if (!SCM_UNBNDP (FLAG))
     {
-      SCM_ASSERT (SCM_IMP (FLAG) && SCM_BOOLP (FLAG),
-                 FLAG, SCM_ARG2, FUNC_NAME);
+      SCM_ASSERT (scm_is_bool (FLAG), FLAG, SCM_ARG2, FUNC_NAME);
       delete = FLAG == SCM_BOOL_T;
     }
   status = mu_message_get_attribute (msg, &attr);
@@ -759,8 +755,7 @@ SCM_DEFINE (scm_mu_message_set_flag, "mu-message-set-flag", 
2, 1, 0,
 
   if (!SCM_UNBNDP (VALUE))
     {
-      SCM_ASSERT (SCM_IMP (VALUE) && SCM_BOOLP (VALUE),
-                 VALUE, SCM_ARG3, FUNC_NAME);
+      SCM_ASSERT (scm_is_bool (VALUE), VALUE, SCM_ARG3, FUNC_NAME);
       value = VALUE == SCM_BOOL_T;
     }
   
@@ -880,8 +875,7 @@ SCM_DEFINE (scm_mu_message_set_user_flag, 
"mu-message-set-user-flag", 2, 1, 0,
 
   if (!SCM_UNBNDP (VALUE))
     {
-      SCM_ASSERT (SCM_IMP (VALUE) && SCM_BOOLP (VALUE),
-                 VALUE, SCM_ARG3, FUNC_NAME);
+      SCM_ASSERT (scm_is_bool (VALUE), VALUE, SCM_ARG3, FUNC_NAME);
       set = VALUE == SCM_BOOL_T;
     }
   
@@ -922,8 +916,7 @@ SCM_DEFINE (scm_mu_message_get_port, "mu-message-get-port", 
2, 1, 0,
 
   if (!SCM_UNBNDP (FULL))
     {
-      SCM_ASSERT (SCM_IMP (FULL) && SCM_BOOLP (FULL),
-                 FULL, SCM_ARG3, FUNC_NAME);
+      SCM_ASSERT (scm_is_bool (FULL), FULL, SCM_ARG3, FUNC_NAME);
       if (FULL == SCM_BOOL_T)
        {
          status = mu_message_get_stream (msg, &stream);
@@ -1010,7 +1003,7 @@ SCM_DEFINE (scm_mu_message_get_num_parts, 
"mu-message-get-num-parts", 1, 0, 0,
     mu_scm_error (FUNC_NAME, status,
                  "Cannot get number of parts in the message ~A",
                  scm_list_1 (MESG));
-  return mu_scm_makenum (nparts);
+  return scm_from_size_t (nparts);
 }
 #undef FUNC_NAME
 
diff --git a/libmu_scm/mu_mime.c b/libmu_scm/mu_mime.c
index de889ed..ca9f799 100644
--- a/libmu_scm/mu_mime.c
+++ b/libmu_scm/mu_mime.c
@@ -19,7 +19,7 @@
 
 #include "mu_scm.h"
 
-long mime_tag;
+static scm_t_bits mime_tag;
 
 struct mu_mime
 {
@@ -101,7 +101,7 @@ SCM_DEFINE (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
   int flags;
   int status;
   
-  if (SCM_IMP (FLAGS) && SCM_BOOLP (FLAGS))
+  if (scm_is_bool (FLAGS))
     {
       /*if (FLAGS == SCM_BOOL_F)*/
       flags = 0;
@@ -152,7 +152,7 @@ SCM_DEFINE (scm_mu_mime_get_num_parts, 
"mu-mime-get-num-parts", 1, 0, 0,
   if (status)
     mu_scm_error (FUNC_NAME, status,
                  "Cannot count MIME parts", SCM_BOOL_F);
-  return mu_scm_makenum (nparts);
+  return scm_from_size_t (nparts);
 }
 #undef FUNC_NAME
 
diff --git a/libmu_scm/mu_scm.c b/libmu_scm/mu_scm.c
index 3b02a86..9df9551 100644
--- a/libmu_scm/mu_scm.c
+++ b/libmu_scm/mu_scm.c
@@ -29,36 +29,11 @@ mu_scm_error (const char *func_name, int status,
 {
   scm_error_scm (scm_from_locale_symbol ("mailutils-error"),
                 func_name ? scm_from_locale_string (func_name) : SCM_BOOL_F,
-                scm_makfrom0str (fmt),
+                scm_from_locale_string (fmt),
                 args,
                 scm_list_1 (scm_from_int (status)));
 }
 
-SCM
-mu_scm_makenum (unsigned long val)
-#ifndef HAVE_SCM_LONG2NUM
-{
-  if (SCM_FIXABLE ((long) val))
-    return scm_from_int (val);
-
-#ifdef SCM_BIGDIG
-  return scm_long2big (val);
-#else /* SCM_BIGDIG */
-  return scm_make_real ((double) val);
-#endif /* SCM_BIGDIG */
-}
-#else
-{
-  return scm_long2num (val);
-}
-#endif
-
-void
-mu_set_variable (const char *name, SCM value)
-{
-  scm_c_define (name, value);
-}
-
 SCM _mu_scm_package_string; /* STRING: PACKAGE_STRING */
 SCM _mu_scm_package;        /* STRING: PACKAGE */
 SCM _mu_scm_version;        /* STRING: VERSION */
@@ -133,7 +108,7 @@ SCM_DEFINE (scm_mu_register_format, "mu-register-format", 
0, 0, 1,
 {
   int status;
 
-  if (REST == SCM_EOL)
+  if (scm_is_null (REST))
     {
       status = register_format (NULL);
       if (status)
@@ -143,7 +118,7 @@ SCM_DEFINE (scm_mu_register_format, "mu-register-format", 
0, 0, 1,
     }
   else
     {
-      for (; REST != SCM_EOL; REST = SCM_CDR (REST))
+      for (; !scm_is_null (REST); REST = SCM_CDR (REST))
        {
          char *s;
          SCM scm = SCM_CAR (REST);
@@ -168,7 +143,7 @@ SCM_DEFINE (scm_mu_strerror, "mu-strerror", 1, 0, 0,
 #define FUNC_NAME s_scm_mu_strerror
 {
   SCM_ASSERT (scm_is_integer (ERR), ERR, SCM_ARG1, FUNC_NAME);
-  return scm_makfrom0str (mu_strerror (scm_to_int (ERR)));
+  return scm_from_locale_string (mu_strerror (scm_to_int (ERR)));
 }
 #undef FUNC_NAME
 
@@ -194,20 +169,20 @@ mu_scm_init ()
 {
   int i;
 
-  _mu_scm_mailer = scm_makfrom0str ("sendmail:" PATH_SENDMAIL);
-  mu_set_variable ("mu-mailer", _mu_scm_mailer);
+  _mu_scm_mailer = scm_from_locale_string ("sendmail:" PATH_SENDMAIL);
+  scm_c_define ("mu-mailer", _mu_scm_mailer);
 
-  _mu_scm_debug = mu_scm_makenum(0);
-  mu_set_variable ("mu-debug", _mu_scm_debug);
+  _mu_scm_debug = scm_from_int (0);
+  scm_c_define ("mu-debug", _mu_scm_debug);
 
-  _mu_scm_package = scm_makfrom0str (PACKAGE);
-  mu_set_variable ("mu-package", _mu_scm_package);
+  _mu_scm_package = scm_from_locale_string (PACKAGE);
+  scm_c_define ("mu-package", _mu_scm_package);
 
-  _mu_scm_version = scm_makfrom0str (VERSION);
-  mu_set_variable ("mu-version", _mu_scm_version);
+  _mu_scm_version = scm_from_locale_string (VERSION);
+  scm_c_define ("mu-version", _mu_scm_version);
 
-  _mu_scm_package_string = scm_makfrom0str (PACKAGE_STRING);
-  mu_set_variable ("mu-package-string", _mu_scm_package_string);
+  _mu_scm_package_string = scm_from_locale_string (PACKAGE_STRING);
+  scm_c_define ("mu-package-string", _mu_scm_package_string);
 
   /* Create MU- attribute names */
   for (i = 0; attr_kw[i].name; i++)
diff --git a/libmu_scm/mu_util.c b/libmu_scm/mu_util.c
index 2668a76..22fedc5 100644
--- a/libmu_scm/mu_util.c
+++ b/libmu_scm/mu_util.c
@@ -56,20 +56,14 @@ SCM_DEFINE (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
     mu_scm_error (FUNC_NAME, errno,
                  "Cannot get user credentials", SCM_BOOL_F);
 
-  ve[0] = scm_makfrom0str (entry->name);
-  ve[1] = scm_makfrom0str (entry->passwd);
-  ve[2] = scm_ulong2num ((unsigned long) entry->uid);
-  ve[3] = scm_ulong2num ((unsigned long) entry->gid);
-  ve[4] = scm_makfrom0str (entry->gecos);
-  if (!entry->dir)
-    ve[5] = scm_makfrom0str ("");
-  else
-    ve[5] = scm_makfrom0str (entry->dir);
-  if (!entry->shell)
-    ve[6] = scm_makfrom0str ("");
-  else
-    ve[6] = scm_makfrom0str (entry->shell);
-  ve[7] = scm_makfrom0str (entry->mailbox);
+  ve[0] = scm_from_locale_string (entry->name);
+  ve[1] = scm_from_locale_string (entry->passwd);
+  ve[2] = scm_from_ulong ((unsigned long) entry->uid);
+  ve[3] = scm_from_ulong ((unsigned long) entry->gid);
+  ve[4] = scm_from_locale_string (entry->gecos);
+  ve[5] = scm_from_locale_string (entry->dir ? entry->dir : "");
+  ve[6] = scm_from_locale_string (entry->shell ? entry->shell : "");
+  ve[7] = scm_from_locale_string (entry->mailbox);
 
   scm_array_handle_release (&handle);
   
diff --git a/mailbox/cfg_lexer.l b/mailbox/cfg_lexer.l
index 47faca2..f530ca2 100644
--- a/mailbox/cfg_lexer.l
+++ b/mailbox/cfg_lexer.l
@@ -37,7 +37,8 @@
 #include <mailutils/nls.h>
 #include <mailutils/cfg.h>
 #include <mailutils/list.h>
-
+#include <mailutils/mutil.h>
+  
 #include "cfg_parser.h"
 
 void _mu_line_begin (void);


hooks/post-receive
-- 
GNU Mailutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]