summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-04-12 16:28:41 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-04-12 16:29:22 +0300
commit49e121acc32a38b2d618cfd0544de349618c2bb1 (patch)
tree2cb54d76e3448a1f053ca84b74a7fbe43c368b11
parent787121995cef1f77d279df9b70a9eb1f4fb35325 (diff)
downloadmailutils-49e121acc32a38b2d618cfd0544de349618c2bb1.tar.gz
mailutils-49e121acc32a38b2d618cfd0544de349618c2bb1.tar.bz2
Migrate Guile support to GINT.
* gint: New module. * am/guile.m4: Remove. * mu-aux/guile-doc-snarf: Remove. * mu-aux/guile-doc-snarf.awk: Remove. * mu-aux/Makefile.am (EXTRA_DIST): Remove guile-doc-snarf, guile-doc-snarf.awk * Makefile.am: Add gint. * bootstrap.conf: Init gint submodule. * configure.ac: Rewrite Guile support using GINT_INIT. (AC_CONFIG_FILES): Add gint/Makefile. * guimb/scm/Makefile.am (sitedir): Change. * guimb/scm/Makefile.am: Likewise. * libmu_scm/Makefile.am: Include ../gint/gint.mk Adjust all variables. Remove unnecessary rules. * libmu_scm/mailutils.scm.in: Remove exports and includes. Remove obsolete code. * libmu_scm/mu_address.c: Use SCM_DEFINE_PUBLIC to declare public interfaces. * libmu_scm/mu_body.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_logger.c: Likewise. (mu_scm_logger_init): Make all constants public. * libmu_scm/mu_scm.c: Likewise. * libmu_scm/mu_guile.c: Use scm_c_catch instead of the obsolete scm_internal_lazy_catch.
-rw-r--r--.gitmodules3
-rw-r--r--Makefile.am4
-rw-r--r--am/guile.m485
-rw-r--r--bootstrap.conf3
-rw-r--r--configure.ac57
m---------gint0
-rw-r--r--guimb/scm/Makefile.am2
-rw-r--r--libmu_scm/Makefile.am54
-rw-r--r--libmu_scm/mailutils.scm.in64
-rw-r--r--libmu_scm/mu_address.c14
-rw-r--r--libmu_scm/mu_body.c4
-rw-r--r--libmu_scm/mu_guile.c14
-rw-r--r--libmu_scm/mu_logger.c11
-rw-r--r--libmu_scm/mu_mailbox.c28
-rw-r--r--libmu_scm/mu_message.c50
-rw-r--r--libmu_scm/mu_mime.c12
-rw-r--r--libmu_scm/mu_scm.c18
-rw-r--r--libmu_scm/mu_util.c2
-rw-r--r--mu-aux/Makefile.am2
-rwxr-xr-xmu-aux/guile-doc-snarf86
-rw-r--r--mu-aux/guile-doc-snarf.awk102
21 files changed, 120 insertions, 495 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..7c369d49c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "gint"]
+ path = gint
+ url = git://git.gnu.org.ua/gint.git
diff --git a/Makefile.am b/Makefile.am
index 0fc2e3c8c..f6f53a9c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
-ACLOCAL_AMFLAGS = -I m4 -I am
+ACLOCAL_AMFLAGS = -I m4 -I am -I gint
if MU_COND_PYTHON
PYTHON_DIR = python
@@ -81,6 +81,7 @@ if MU_COND_MIMEVIEW
endif
if MU_COND_LIBMU_SCM
+ GINT_DIR = gint
LIBMU_SCM_DIR = libmu_scm
endif
@@ -101,6 +102,7 @@ SUBDIRS = \
libmu_argp\
libmu_cfg\
$(LIBMU_CPP_DIR)\
+ $(GINT_DIR)\
$(LIBMU_SCM_DIR)\
libmu_sieve\
$(PYTHON_DIR)\
diff --git a/am/guile.m4 b/am/guile.m4
deleted file mode 100644
index 64b5cace9..000000000
--- a/am/guile.m4
+++ /dev/null
@@ -1,85 +0,0 @@
-dnl This file is part of GNU mailutils.
-dnl Copyright (C) 2001, 2006, 2007, 2010 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software Foundation,
-dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-dnl
-
-dnl MU_CHECK_GUILE(minversion, [act-if-found], [ac-if-not-found])
-dnl $1 $2 $3
-AC_DEFUN([MU_CHECK_GUILE],
-[
- AS_VAR_SET([mu_cv_guile], [no])
- AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $PATH)
- if test "$GUILE_CONFIG" = no; then
- m4_if($3,,[AC_MSG_ERROR(cannot find Guile)], [$3])
- else
- AC_SUBST(GUILE_INCLUDES)
- AC_SUBST(GUILE_LIBS)
- AC_SUBST(GUILE_VERSION)
- AC_SUBST(GUILE_VERSION_NUMBER)
-
- GUILE_INCLUDES=`$GUILE_CONFIG compile`
- GUILE_LIBS=`$GUILE_CONFIG link`
- GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed 's/guile-config [[^0-9]]* \([[0-9]][[0-9.]]*\)$/\1/'`
- VEX=`echo $GUILE_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'`
- GUILE_VERSION_NUMBER=`eval expr "$VEX"`
-
- ifelse($1,,,[
- VEX=`echo $1 | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'`
- min=`eval expr "$VEX"`
- if test $GUILE_VERSION_NUMBER -lt $min; then
- m4_if($3,,
- [AC_MSG_ERROR([Guile version too old; required is at least ]$1)],
- [$3])
- fi])
-
- save_LIBS=$LIBS
- save_CFLAGS=$CFLAGS
- LIBS="$LIBS $GUILE_LIBS"
- CFLAGS="$CFLAGS $GUILE_INCLUDES"
- AC_TRY_LINK([#include <libguile.h>],
- m4_if([$1], , scm_shell(0, NULL);, [$1]),
- [AS_VAR_SET([mu_cv_guile], $GUILE_VERSION)])
- LIBS=$save_LIBS
- CFLAGS=$save_CFLAGS
- fi
-
- if test $mu_cv_guile = no; then
- GUILE_INCLUDES=
- GUILE_LIBS=
- GUILE_VERSION=
- GUILE_VERSION_NUMBER=
- m4_if($3,,[AC_MSG_ERROR(required library libguile not found)], [$3])
- else
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libguile.h>]],
- [SCM_DEVAL_P = 1;
- SCM_BACKTRACE_P = 1;
- SCM_RECORD_POSITIONS_P = 1;
- SCM_RESET_DEBUG_MODE;])],
- [mu_cv_guile_debug=yes],
- [mu_cv_guile_debug=no])
- if test $mu_cv_guile_debug = yes; then
- AC_DEFINE_UNQUOTED(GUILE_DEBUG_MACROS, 1,
- [Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined])
- fi
- 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,
- [Guile version number: MAX*10 + MIN])
- m4_if($2,,,[$2])
- fi
-])
-
diff --git a/bootstrap.conf b/bootstrap.conf
index f61b6d633..253776769 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -81,6 +81,9 @@ excluded_files='
m4/visibility.m4
'
+git submodule init || exit $?
+git submodule update || exit $?
+
# Read local configuration file
if [ -r .bootstrap ]; then
echo "$0: Reading configuration file .bootstrap"
diff --git a/configure.ac b/configure.ac
index 29a760028..ad3107520 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1073,51 +1073,27 @@ if test "$status_dbm" != no; then
fi
dnl Check for Guile
-AC_SUBST(GUILE_BINDIR)
-AC_SUBST(LIBMU_SCM)
-AC_SUBST(LIBMU_SCM_DEPS)
-AC_SUBST(MU_GUILE_SITE_DIR)
-AC_SUBST(MU_GUILE_SIEVE_MOD_DIR)
-AC_SUBST(MU_GUILE_SIEVE_MOD_DATA)
-
+AC_SUBST([GUILE_BINDIR])
+AC_SUBST([LIBMU_SCM])
+AC_SUBST([LIBMU_SCM_DEPS])
+AC_SUBST([MU_GUILE_SIEVE_MOD_DIR])
+AC_SUBST([MU_GUILE_SIEVE_MOD_DATA])
if test "$useguile" != "no"; then
- MU_CHECK_GUILE(1.8,
- [useguile=yes
- AC_DEFINE(WITH_GUILE,1,[Enable Guile support])
- GUILE_BINDIR=`guile-config info bindir`
- LIBMU_SCM=../libmu_scm/libmu_scm.la
- LIBMU_SCM_DEPS='${MU_LIB_MBOX} ${MU_LIB_IMAP} ${MU_LIB_POP} ${MU_LIB_MH} ${MU_LIB_MAILDIR} ${MU_LIB_MAILER}'
- MU_GUILE_SITE_DIR='$(GUILE_SITE)/$(PACKAGE)'
- MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/sieve-modules'
- MU_GUILE_SIEVE_MOD_DATA='$(MU_GUILE_SIEVE_MOD_DATA_X)'
- ],[useguile=no])
-
- if test "$useguile" = "yes"; then
- AC_ARG_WITH([guiledir],
- AC_HELP_STRING([--with-guiledir=DIR],
- [Specify the directory to install guile modules to]),
- [case $withval in
- /*) GUILE_SITE=$withval;;
- yes) GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site;;
- *) AC_MSG_ERROR([Argument to --with-guiledir must be an absolute directory name]);;
- esac],
- [GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site
- pfx=$prefix
- test "$pfx" = NONE && pfx=$ac_default_prefix
- case $GUILE_SITE in
- $pfx/*) ;; # OK
- *) AC_MSG_WARN([guile site directory "$GUILE_SITE" lies outside your current prefix ($pfx).])
- GUILE_SITE='$(pkgdatadir)/$(VERSION)/guile'
- AC_MSG_WARN([Falling back to ${GUILE_SITE} instead. Use --with-guiledir to force using site directory.])
- ;;
- esac])
- fi
+ GINT_INIT([gint],[1.8],
+ [useguile=yes
+ AC_DEFINE([WITH_GUILE],1,[Enable Guile support])
+ GUILE_BINDIR=`guile-config info bindir`
+ LIBMU_SCM=../libmu_scm/libmu_scm.la
+ LIBMU_SCM_DEPS='${MU_LIB_MBOX} ${MU_LIB_IMAP} ${MU_LIB_POP} ${MU_LIB_MH} ${MU_LIB_MAILDIR} ${MU_LIB_MAILER}'
+ MU_GUILE_SIEVE_MOD_DIR='$(GUILE_SITE)/$(PACKAGE)/sieve-modules'
+ MU_GUILE_SIEVE_MOD_DATA='$(MU_GUILE_SIEVE_MOD_DATA_X)'
+ GINT_INCLUDES='${MU_APP_COMMON_INCLUDES}'
+ GINT_LDADD=../lib/libmuaux.la
+ ],[useguile=no])
fi
AM_CONDITIONAL([MU_COND_LIBMU_SCM],[test "$useguile" = "yes"])
-AC_SUBST(GUILE_SITE)
-
dnl Check for Emacs site-lisp directory
AM_PATH_LISPDIR
@@ -1353,6 +1329,7 @@ AC_CONFIG_FILES([
examples/cpp/Makefile
examples/python/Makefile
examples/scheme/Makefile
+ gint/Makefile
frm/Makefile
frm/testsuite/Makefile
guimb/Makefile
diff --git a/gint b/gint
new file mode 160000
+Subproject c6a7620deb7e3e139329e2daad31d4071f01b43
diff --git a/guimb/scm/Makefile.am b/guimb/scm/Makefile.am
index bb014ff68..68df43fb0 100644
--- a/guimb/scm/Makefile.am
+++ b/guimb/scm/Makefile.am
@@ -37,7 +37,7 @@ sieve.sed: Makefile
CLEANFILES = sieve.scm sieve.sed
-sitedir=@MU_GUILE_SITE_DIR@
+sitedir=@GUILE_SITE@/$(PACKAGE)
site_DATA=sieve-core.scm
MU_GUILE_SIEVE_MOD_DATA_X=\
diff --git a/libmu_scm/Makefile.am b/libmu_scm/Makefile.am
index 92588ede0..f317bba2d 100644
--- a/libmu_scm/Makefile.am
+++ b/libmu_scm/Makefile.am
@@ -18,7 +18,7 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
-INCLUDES = -I. @MU_LIB_COMMON_INCLUDES@ @GUILE_INCLUDES@
+INCLUDES = -I. @MU_LIB_COMMON_INCLUDES@
lib_LTLIBRARIES=libmu_scm.la
@@ -51,10 +51,7 @@ libmu_scm_la_LIBADD = \
${MU_LIB_MAILUTILS}\
@GUILE_LIBS@
-EXTRA_DIST=mailutils.scm mailutils.scm.in guile-procedures.texi guile-procedures.txt
-
-sitedir=@MU_GUILE_SITE_DIR@
-site_DATA=guile-procedures.txt mailutils.scm
+EXTRA_DIST=mailutils.scm mailutils.scm.in
DOT_X_FILES=\
mu_address.x\
@@ -78,55 +75,16 @@ DOT_DOC_FILES=\
mu_scm.doc\
mu_util.doc
-BUILT_SOURCES=$(DOT_X_FILES) $(DOT_DOC_FILES) guile-procedures.texi
-
+CLEANFILES=
DISTCLEANFILES=\
- $(DOT_X_FILES)\
- $(DOT_DOC_FILES)\
- guile-procedures.texi\
- guile-procedures.txt\
mailutils.scm
-CLEANFILES=*.inc
-
-AM_CPPFLAGS=-DDATADIR=\"$(pkgdatadir)\"
-ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
- --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
-
-GUILE_DOC_SNARF=$(mu_aux_dir)/guile-doc-snarf
-
-SUFFIXES=.x .doc .inc .in
-
-.c.x:
- $(AM_V_GEN)AWK=$(AWK) \
- $(GUILE_DOC_SNARF) -o $@ \
- $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
-.c.doc:
- $(AM_V_GEN)AWK=$(AWK) \
- $(GUILE_DOC_SNARF) -d -o $@ \
- $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
-.c.inc:
- $(AM_V_GEN)sed -n 's/SCM_DEFINE *(.[^,]*, *\"\([^"][^"]*\)\".*/[(export \1)]/p' $< > $@
-
-guile-procedures.texi: $(DOT_DOC_FILES)
- $(AM_V_GEN)cat $(DOT_DOC_FILES) > $@
-
-guile-procedures.txt: guile-procedures.texi
- $(AM_V_GEN) rm -f $@; \
- $(MAKEINFO) --force -o $@ guile-procedures.texi || test -f $@
-
-mailutils.scm: mailutils.scm.in $(C_SRCS:.c=.inc)
+mailutils.scm: mailutils.scm.in
$(AM_V_GEN)m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \
-DSITEDIR=$(sitedir) \
-DBUILDDIR=$(top_builddir)/libmu_scm \
$(srcdir)/mailutils.scm.in > $@
-
-## Add -MG to make the .x magic work with auto-dep code.
-MKDEP = $(CC) -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
install-data-hook:
@here=`pwd`; \
cd $(DESTDIR)$(libdir);\
@@ -137,3 +95,7 @@ install-data-hook:
fi; \
cd $$here
+sitedir = @GUILE_SITE@/$(PACKAGE)
+site_DATA = mailutils.scm
+SUFFIXES=
+include ../gint/gint.mk
diff --git a/libmu_scm/mailutils.scm.in b/libmu_scm/mailutils.scm.in
index 66d773e79..d78a75332 100644
--- a/libmu_scm/mailutils.scm.in
+++ b/libmu_scm/mailutils.scm.in
@@ -20,7 +20,7 @@
changequote([,])dnl
(define-module (mailutils mailutils)
- #:use-module (ice-9 documentation))
+ #:use-module (ice-9 documentation))
(set! documentation-files (append documentation-files
(list "SITEDIR/guile-procedures.txt")))
@@ -38,65 +38,7 @@ changequote([,])dnl
(lambda (lib)
(dynamic-link (string-append lib-path lib)))
mu-libs)
- (cond
- ((or (string=? (version) "1.4")
- (string=? (version) "1.4.1"))
- (dynamic-call "mu_scm_init"
- (dynamic-link (string-append
- lib-path
- "libguile-mailutils-v-VERSION"))))
- (else
- (load-extension (string-append
- lib-path "libguile-mailutils-v-VERSION") "mu_scm_init"))))
-
-(export mu-package)
-(export mu-package-string)
-(export mu-version)
-(export mu-mailer)
-(export mu-debug)
-(export mu-path-maildir)
-(export mu-path-folder-dir)
-
-(export MU-ATTRIBUTE-ANSWERED)
-(export MU-ATTRIBUTE-FLAGGED)
-(export MU-ATTRIBUTE-DELETED)
-(export MU-ATTRIBUTE-DRAFT)
-(export MU-ATTRIBUTE-SEEN)
-(export MU-ATTRIBUTE-READ)
-(export MU-ATTRIBUTE-MODIFIED)
-(export MU-ATTRIBUTE-RECENT)
-
-(export LOG_USER)
-(export LOG_DAEMON)
-(export LOG_AUTH)
-(export LOG_LOCAL0)
-(export LOG_LOCAL1)
-(export LOG_LOCAL2)
-(export LOG_LOCAL3)
-(export LOG_LOCAL4)
-(export LOG_LOCAL5)
-(export LOG_LOCAL6)
-(export LOG_LOCAL7)
-(export LOG_EMERG)
-(export LOG_ALERT)
-(export LOG_CRIT)
-(export LOG_ERR)
-(export LOG_WARNING)
-(export LOG_NOTICE)
-(export LOG_INFO)
-(export LOG_DEBUG)
-(export LOG_CONS)
-(export LOG_NDELAY)
-(export LOG_PID)
-
-include(BUILDDIR/mu_address.inc)
-include(BUILDDIR/mu_body.inc)
-include(BUILDDIR/mu_mailbox.inc)
-include(BUILDDIR/mu_message.inc)
-include(BUILDDIR/mu_mime.inc)
-include(BUILDDIR/mu_logger.inc)
-include(BUILDDIR/mu_port.inc)
-include(BUILDDIR/mu_scm.inc)
-include(BUILDDIR/mu_util.inc)
+ (load-extension (string-append
+ lib-path "libguile-mailutils-v-VERSION") "mu_scm_init"))
;;;; End of mailutils.scm
diff --git a/libmu_scm/mu_address.c b/libmu_scm/mu_address.c
index a3571700d..9ced92c8c 100644
--- a/libmu_scm/mu_address.c
+++ b/libmu_scm/mu_address.c
@@ -78,7 +78,7 @@ _get_address_part (const char *func_name, address_get_fp fun,
return ret;
}
-SCM_DEFINE (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_personal
@@ -88,7 +88,7 @@ SCM_DEFINE (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_comments
@@ -98,7 +98,7 @@ SCM_DEFINE (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_email
@@ -108,7 +108,7 @@ SCM_DEFINE (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_domain
@@ -118,7 +118,7 @@ SCM_DEFINE (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_local
@@ -128,7 +128,7 @@ SCM_DEFINE (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
+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")
#define FUNC_NAME s_scm_mu_address_get_count
@@ -154,7 +154,7 @@ SCM_DEFINE (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_username_to_email, "mu-username->email", 0, 1, 0,
+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"
"current username is assumed\n")
diff --git a/libmu_scm/mu_body.c b/libmu_scm/mu_body.c
index 43ee30b74..a2597171b 100644
--- a/libmu_scm/mu_body.c
+++ b/libmu_scm/mu_body.c
@@ -102,7 +102,7 @@ mu_scm_body_create (SCM msg, mu_body_t body)
/* ************************************************************************* */
/* Guile primitives */
-SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
(SCM BODY),
"Read next line from the BODY.")
#define FUNC_NAME s_scm_mu_body_read_line
@@ -163,7 +163,7 @@ SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_body_write, "mu-body-write", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_body_write, "mu-body-write", 2, 0, 0,
(SCM BODY, SCM TEXT),
"Append TEXT to message BODY.")
#define FUNC_NAME s_scm_mu_body_write
diff --git a/libmu_scm/mu_guile.c b/libmu_scm/mu_guile.c
index 26dc2a7d4..39e191630 100644
--- a/libmu_scm/mu_guile.c
+++ b/libmu_scm/mu_guile.c
@@ -57,9 +57,10 @@ mu_guile_safe_exec (SCM (*handler) (void *data), void *data, SCM *result)
return 1;
ed.handler = handler;
ed.data = data;
- scm_internal_lazy_catch (SCM_BOOL_T,
- scheme_safe_exec_body, (void*)&ed,
- eval_catch_handler, &jmp_env);
+ scm_c_catch (SCM_BOOL_T,
+ scheme_safe_exec_body, (void*)&ed,
+ eval_catch_handler, &jmp_env,
+ NULL, NULL);
if (result)
*result = ed.result;
return 0;
@@ -91,9 +92,10 @@ mu_guile_safe_proc_call (SCM proc, SCM arglist, SCM *presult)
return 1;
cell = scm_cons (proc, arglist);
- result = scm_internal_lazy_catch (SCM_BOOL_T,
- eval_catch_body, cell,
- eval_catch_handler, &jmp_env);
+ result = scm_c_catch (SCM_BOOL_T,
+ eval_catch_body, cell,
+ eval_catch_handler, &jmp_env,
+ NULL, NULL);
if (presult)
*presult = result;
return 0;
diff --git a/libmu_scm/mu_logger.c b/libmu_scm/mu_logger.c
index 4dc7841f0..ab6ee87be 100644
--- a/libmu_scm/mu_logger.c
+++ b/libmu_scm/mu_logger.c
@@ -23,7 +23,7 @@
static char *log_tag;
-SCM_DEFINE (scm_mu_openlog, "mu-openlog", 3, 0, 0,
+SCM_DEFINE_PUBLIC (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)")
@@ -41,7 +41,7 @@ SCM_DEFINE (scm_mu_openlog, "mu-openlog", 3, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_logger, "mu-logger", 2, 0, 0,
(SCM PRIO, SCM TEXT),
"Distributes TEXT via syslogd priority PRIO.")
#define FUNC_NAME s_scm_mu_logger
@@ -60,7 +60,7 @@ SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_closelog, "mu-closelog", 0, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_closelog, "mu-closelog", 0, 0, 0,
(),
"Closes the channel to the system logger opened by @code{mu-openlog}.")
#define FUNC_NAME s_scm_mu_closelog
@@ -113,6 +113,9 @@ mu_scm_logger_init ()
int i;
for (i = 0; i < sizeof (syslog_kw)/sizeof (syslog_kw[0]); i++)
- scm_c_define (syslog_kw[i].name, scm_from_int (syslog_kw[i].facility));
+ {
+ scm_c_define (syslog_kw[i].name, scm_from_int (syslog_kw[i].facility));
+ scm_c_export (syslog_kw[i].name, NULL);
+ }
#include <mu_logger.x>
}
diff --git a/libmu_scm/mu_mailbox.c b/libmu_scm/mu_mailbox.c
index 663755e16..f58fbad9e 100644
--- a/libmu_scm/mu_mailbox.c
+++ b/libmu_scm/mu_mailbox.c
@@ -137,7 +137,7 @@ mu_scm_is_mailbox (SCM scm)
/* ************************************************************************* */
/* Guile primitives */
-SCM_DEFINE (scm_mu_mail_directory, "mu-mail-directory", 0, 1, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mail_directory, "mu-mail-directory", 0, 1, 0,
(SCM URL),
"Do not use this function. Use mu-user-mailbox-url instead.")
#define FUNC_NAME s_scm_mu_mail_directory
@@ -149,7 +149,7 @@ SCM_DEFINE (scm_mu_mail_directory, "mu-mail-directory", 0, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_user_mailbox_url, "mu-user-mailbox-url", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_user_mailbox_url, "mu-user-mailbox-url", 1, 0, 0,
(SCM USER),
"")
#define FUNC_NAME s_scm_mu_user_mailbox_url
@@ -172,7 +172,7 @@ SCM_DEFINE (scm_mu_user_mailbox_url, "mu-user-mailbox-url", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
+SCM_DEFINE_PUBLIC (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
(SCM URL),
"If URL is given, sets it as a name of the user's folder directory.\n"
"Returns the current value of the folder directory.")
@@ -191,7 +191,7 @@ SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
(SCM URL, SCM MODE),
"Opens the mailbox specified by URL. MODE is a string, consisting of\n"
"the characters described below, giving the access mode for the mailbox\n"
@@ -263,7 +263,7 @@ SCM_DEFINE (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
(SCM MBOX), "Closes mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_close
{
@@ -277,7 +277,7 @@ SCM_DEFINE (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
(SCM MBOX),
"Returns url of the mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_get_url
@@ -298,7 +298,7 @@ SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
+SCM_DEFINE_PUBLIC (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"
@@ -327,7 +327,7 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
(SCM MBOX, SCM MSGNO),
"Retrieve from message #MSGNO from the mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_get_message
@@ -353,7 +353,7 @@ SCM_DEFINE (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
(SCM MBOX),
"Returns number of messages in the mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_messages_count
@@ -374,7 +374,7 @@ SCM_DEFINE (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
(SCM MBOX),
"Expunges deleted messages from the mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_expunge
@@ -393,7 +393,7 @@ SCM_DEFINE (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
(SCM MBOX, SCM MESG),
"Appends message MESG to the mailbox MBOX.")
#define FUNC_NAME s_scm_mu_mailbox_append_message
@@ -430,7 +430,7 @@ SCM_DEFINE (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
} \
while (0)
-SCM_DEFINE (scm_mu_mailbox_first_message, "mu-mailbox-first-message", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_first_message, "mu-mailbox-first-message", 1, 0, 0,
(SCM MBOX),
"Returns first message from the mailbox.")
#define FUNC_NAME s_scm_mu_mailbox_first_message
@@ -457,7 +457,7 @@ SCM_DEFINE (scm_mu_mailbox_first_message, "mu-mailbox-first-message", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_next_message, "mu-mailbox-next-message", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_next_message, "mu-mailbox-next-message", 1, 0, 0,
(SCM MBOX),
"Returns next message from the mailbox.")
#define FUNC_NAME s_scm_mu_mailbox_next_message
@@ -487,7 +487,7 @@ SCM_DEFINE (scm_mu_mailbox_next_message, "mu-mailbox-next-message", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_mailbox_more_messages_p, "mu-mailbox-more-messages?", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_mailbox_more_messages_p, "mu-mailbox-more-messages?", 1, 0, 0,
(SCM MBOX),
"Returns next message from the mailbox.")
#define FUNC_NAME s_scm_mu_mailbox_more_messages_p
diff --git a/libmu_scm/mu_message.c b/libmu_scm/mu_message.c
index 4167f963d..d9e338630 100644
--- a/libmu_scm/mu_message.c
+++ b/libmu_scm/mu_message.c
@@ -176,7 +176,7 @@ mu_scm_is_message (SCM scm)
/* ************************************************************************* */
/* Guile primitives */
-SCM_DEFINE (scm_mu_message_create, "mu-message-create", 0, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_create, "mu-message-create", 0, 0, 0,
(),
"Creates an empty message.\n")
#define FUNC_NAME s_scm_mu_message_create
@@ -188,7 +188,7 @@ SCM_DEFINE (scm_mu_message_create, "mu-message-create", 0, 0, 0,
#undef FUNC_NAME
/* FIXME: This changes envelope date */
-SCM_DEFINE (scm_mu_message_copy, "mu-message-copy", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_copy, "mu-message-copy", 1, 0, 0,
(SCM MESG),
"Creates the copy of the message MESG.\n")
#define FUNC_NAME s_scm_mu_message_copy
@@ -249,7 +249,7 @@ SCM_DEFINE (scm_mu_message_copy, "mu-message-copy", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_destroy, "mu-message-destroy", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_destroy, "mu-message-destroy", 1, 0, 0,
(SCM MESG),
"Destroys the message MESG.")
#define FUNC_NAME s_scm_mu_message_destroy
@@ -263,7 +263,7 @@ SCM_DEFINE (scm_mu_message_destroy, "mu-message-destroy", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_set_header, "mu-message-set-header", 3, 1, 0,
+SCM_DEFINE_PUBLIC (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 HEADER is already present in the message its value\n"
@@ -284,7 +284,7 @@ SCM_DEFINE (scm_mu_message_set_header, "mu-message-set-header", 3, 1, 0,
if (scm_is_bool (VALUE))
return SCM_UNSPECIFIED;
- SCM_ASSERT (scm_is_string (VALUE), VALUE, SCM_ARG2, FUNC_NAME);
+ SCM_ASSERT (scm_is_string (VALUE), VALUE, SCM_ARG3, FUNC_NAME);
if (!SCM_UNBNDP (REPLACE))
{
replace = REPLACE == SCM_BOOL_T;
@@ -310,7 +310,7 @@ SCM_DEFINE (scm_mu_message_set_header, "mu-message-set-header", 3, 1, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_get_size, "mu-message-get-size", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_size, "mu-message-get-size", 1, 0, 0,
(SCM MESG),
"Returns the size of the message MESG\n.")
#define FUNC_NAME s_scm_mu_message_get_size
@@ -325,7 +325,7 @@ SCM_DEFINE (scm_mu_message_get_size, "mu-message-get-size", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_get_lines, "mu-message-get-lines", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_lines, "mu-message-get-lines", 1, 0, 0,
(SCM MESG),
"Returns number of lines in the given message.\n")
#define FUNC_NAME s_scm_mu_message_get_lines
@@ -367,7 +367,7 @@ filltime (struct tm *bd_time, int zoff, const char *zname)
return result;
}
-SCM_DEFINE (scm_mu_message_get_envelope, "mu-message-get-envelope", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_envelope, "mu-message-get-envelope", 1, 0, 0,
(SCM MESG),
"Returns envelope date of the message MESG.\n")
#define FUNC_NAME s_scm_mu_message_get_envelope
@@ -402,7 +402,7 @@ SCM_DEFINE (scm_mu_message_get_envelope, "mu-message-get-envelope", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_get_envelope_date, "mu-message-get-envelope-date", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_envelope_date, "mu-message-get-envelope-date", 1, 0, 0,
(SCM MESG),
"Returns envelope date of the message MESG.\n")
#define FUNC_NAME s_scm_mu_message_get_envelope_date
@@ -432,7 +432,7 @@ SCM_DEFINE (scm_mu_message_get_envelope_date, "mu-message-get-envelope-date", 1,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
(SCM MESG),
"Returns email address of the sender of the message MESG.\n")
#define FUNC_NAME s_scm_mu_message_get_sender
@@ -459,7 +459,7 @@ SCM_DEFINE (scm_mu_message_get_sender, "mu-message-get-sender", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_mu_message_get_header, "mu-message-get-header", 2, 0, 0,
+SCM_DEFINE_PUBLIC (scm_mu_message_get_header, "mu-message-get-header", 2, 0, 0,
(SCM MESG, SCM HEADER),
"Returns value of the header HEADER from the message MESG.\n")
#define FUNC_NAME s_scm_mu_message_get_header
@@ -517,7 +517,7 @@ string_sloppy_member (SCM lst, char *name)
return 0;
}
-SCM_DEFINE (scm_mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1, 0,
+SCM_DEFINE_PUBLIC (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 message MESG. Optional argument\n"
"HEADERS gives a list of header names to restrict return value