Commit 49e121ac 49e121acc32a38b2d618cfd0544de349618c2bb1 by Sergey Poznyakoff

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.
1 parent 78712199
[submodule "gint"]
path = gint
url = git://git.gnu.org.ua/gint.git
......@@ -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)\
......
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
])
......@@ -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"
......
......@@ -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
......
gint @ c6a7620d
Subproject commit c6a7620deb7e3e139329e2daad31d4071f01b43b
......@@ -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=\
......
......@@ -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
......
......@@ -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
......
......@@ -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")
......
......@@ -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
......
......@@ -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;
......
......@@ -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>
}
......
......@@ -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
......
......@@ -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 to.\n")
......@@ -583,7 +583,7 @@ SCM_DEFINE (scm_mu_message_get_header_fields, "mu-message-get-header-fields", 1,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_set_header_fields, "mu-message-set-header-fields", 2, 1, 0,
SCM_DEFINE_PUBLIC (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 conses (cons HEADER VALUE). The function sets\n"
......@@ -640,7 +640,7 @@ SCM_DEFINE (scm_mu_message_set_header_fields, "mu-message-set-header-fields", 2,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_delete, "mu-message-delete", 1, 1, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_delete, "mu-message-delete", 1, 1, 0,
(SCM MESG, SCM FLAG),
"Mark the message MESG as deleted. Optional argument FLAG allows to toggle\n"
"deletion mark. The message is deleted if it is @code{#t} and undeleted if\n"
......@@ -677,7 +677,7 @@ SCM_DEFINE (scm_mu_message_delete, "mu-message-delete", 1, 1, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
(SCM MESG, SCM FLAG),
"Return value of the attribute FLAG of the message MESG.")
#define FUNC_NAME s_scm_mu_message_get_flag
......@@ -738,7 +738,7 @@ SCM_DEFINE (scm_mu_message_get_flag, "mu-message-get-flag", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
(SCM MESG, SCM FLAG, SCM VALUE),
"Set the attribute FLAG of the message MESG. If optional VALUE is #f, the\n"
"attribute is unset.")
......@@ -836,7 +836,7 @@ SCM_DEFINE (scm_mu_message_set_flag, "mu-message-set-flag", 2, 1, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
(SCM MESG, SCM FLAG),
"Return the value of the user attribute FLAG from the message MESG.")
#define FUNC_NAME s_scm_mu_message_get_user_flag
......@@ -858,7 +858,7 @@ SCM_DEFINE (scm_mu_message_get_user_flag, "mu-message-get-user-flag", 2, 0, 0,
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_set_user_flag, "mu-message-set-user-flag", 2, 1, 0,
SCM_DEFINE_PUBLIC (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 FLAG in the message MESG. If optional argumen\n"
"VALUE is @samp{#f}, the attribute is unset.")
......@@ -892,7 +892,7 @@ SCM_DEFINE (scm_mu_message_set_user_flag, "mu-message-set-user-flag", 2, 1, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_port, "mu-message-get-port", 2, 1, 0,
SCM_DEFINE_PUBLIC (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"
......@@ -948,7 +948,7 @@ SCM_DEFINE (scm_mu_message_get_port, "mu-message-get-port", 2, 1, 0,
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_body, "mu-message-get-body", 1, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_body, "mu-message-get-body", 1, 0, 0,
(SCM MESG),
"Returns the message body for the message MESG.")
#define FUNC_NAME s_scm_mu_message_get_body
......@@ -966,7 +966,7 @@ SCM_DEFINE (scm_mu_message_get_body, "mu-message-get-body", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_multipart_p, "mu-message-multipart?", 1, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_multipart_p, "mu-message-multipart?", 1, 0, 0,
(SCM MESG),
"Returns @code{#t} if MESG is a multipart @acronym{MIME} message.")
#define FUNC_NAME s_scm_mu_message_multipart_p
......@@ -981,7 +981,7 @@ SCM_DEFINE (scm_mu_message_multipart_p, "mu-message-multipart?", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_num_parts, "mu-message-get-num-parts", 1, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_num_parts, "mu-message-get-num-parts", 1, 0, 0,
(SCM MESG),
"Returns number of parts in a multipart @acronym{MIME} message. Returns\n"
"@code{#f} if the argument is not a multipart message.")
......@@ -1007,7 +1007,7 @@ SCM_DEFINE (scm_mu_message_get_num_parts, "mu-message-get-num-parts", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_part, "mu-message-get-part", 2, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_part, "mu-message-get-part", 2, 0, 0,
(SCM MESG, SCM PART),
"Returns part #PART from a multipart @acronym{MIME} message MESG.")
#define FUNC_NAME s_scm_mu_message_get_part
......@@ -1034,7 +1034,7 @@ SCM_DEFINE (scm_mu_message_get_part, "mu-message-get-part", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_send, "mu-message-send", 1, 3, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_send, "mu-message-send", 1, 3, 0,
(SCM MESG, SCM MAILER, SCM FROM, SCM TO),
"Sends the message MESG. Optional MAILER overrides default mailer settings\n"
"in mu-mailer. Optional FROM and TO give sender and recever addresses.\n")
......@@ -1118,7 +1118,7 @@ SCM_DEFINE (scm_mu_message_send, "mu-message-send", 1, 3, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_message_get_uid, "mu-message-get-uid", 1, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_message_get_uid, "mu-message-get-uid", 1, 0, 0,
(SCM MESG),
"Returns uid of the message MESG\n")
#define FUNC_NAME s_scm_mu_message_get_uid
......
......@@ -89,7 +89,7 @@ mu_scm_is_mime (SCM scm)
/* ************************************************************************* */
/* Guile primitives */
SCM_DEFINE (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
SCM_DEFINE_PUBLIC (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
(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"
......@@ -127,7 +127,7 @@ SCM_DEFINE (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
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")
#define FUNC_NAME s_scm_mu_mime_multipart_p
......@@ -137,7 +137,7 @@ SCM_DEFINE (scm_mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
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.")
#define FUNC_NAME s_scm_mu_mime_get_num_parts
......@@ -156,7 +156,7 @@ SCM_DEFINE (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
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.")
#define FUNC_NAME s_scm_mu_mime_get_part
......@@ -178,7 +178,7 @@ SCM_DEFINE (scm_mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
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.")
#define FUNC_NAME s_scm_mu_mime_add_part
......@@ -204,7 +204,7 @@ SCM_DEFINE (scm_mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_mime_get_message, "mu-mime-get-message", 1, 0, 0,
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")
#define FUNC_NAME s_scm_mu_mime_get_message
......
......@@ -88,7 +88,7 @@ register_format (const char *name)
}
SCM_DEFINE (scm_mu_register_format, "mu-register-format", 0, 0, 1,
SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
(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"
......@@ -136,7 +136,7 @@ SCM_DEFINE (scm_mu_register_format, "mu-register-format", 0, 0, 1,
}
#undef FUNC_NAME
SCM_DEFINE (scm_mu_strerror, "mu-strerror", 1, 0, 0,
SCM_DEFINE_PUBLIC (scm_mu_strerror, "mu-strerror", 1, 0, 0,
(SCM ERR),
"Return the error message corresponding to ERR, which must be\n"
"an integer value.\n")
......@@ -177,16 +177,22 @@ mu_scm_init ()
_mu_scm_package = scm_from_locale_string (PACKAGE);
scm_c_define ("mu-package", _mu_scm_package);
scm_c_export ("mu-package", NULL);
_mu_scm_version = scm_from_locale_string (VERSION);
scm_c_define ("mu-version", _mu_scm_version);
scm_c_export ("mu-version", NULL);
_mu_scm_package_string = scm_from_locale_string (PACKAGE_STRING);
scm_c_define ("mu-package-string", _mu_scm_package_string);
scm_c_export ("mu-package-string", NULL);
/* Create MU- attribute names */
for (i = 0; attr_kw[i].name; i++)
scm_c_define(attr_kw[i].name, scm_from_int(attr_kw[i].value));
{
scm_c_define (attr_kw[i].name, scm_from_int(attr_kw[i].value));
scm_c_export (attr_kw[i].name, NULL);
}
mu_scm_mutil_init ();
mu_scm_mailbox_init ();
......
......@@ -19,7 +19,7 @@
#include "mu_scm.h"
SCM_DEFINE (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
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"
"or a string, giving the behaviour of @code{mu_get_auth_by_uid} or\n"
......
......@@ -20,8 +20,6 @@
EXTRA_DIST = \
debugdef.m4\
guile-doc-snarf\
guile-doc-snarf.awk\
gylwrap\
mailutils.spec\
mailutils.spec.in\
......
#! /bin/sh
# Copyright (C) 2002, 2006, 2007 Sergey Poznyakoff
#
# This is a snarfer for guile version 1.6
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
OUTFILE=/dev/tty
DOCFILE=0
BASEDIR=`dirname $0`
test -n "${CPP+set}" || CPP="gcc -E"
test -n "${AWK+set}" || AWK=awk
temp=/tmp/snarf.$$
trap "rm -f $temp" 0 1 2 15
# process aruments
while [ $# -gt 0 ];
do
case $1 in
-o) OUTFILE=$2; shift 2;;
-d) DOCFILE=1; shift;;
*) break;;
esac
done
INFILE=$1; shift
cpp_exit=1
snarf_x() {
echo "/* source: $INFILE */" ;
echo "/* cpp arguments: $@ */" ;
$CPP -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp}
cpp_exit=$?
grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/"
}
snarf_doc() {
$CPP -DSCM_MAGIC_SNARF_DOCS "$@" > ${temp}
cpp_exit=$?
sed -n '
/^ *^^ {.*/{
# First, remove the delimiting braces
s/^ *^^ {//
s/\^^ }/^^/
# Initialize the hold space
h
:beg
# Delete everything after the first ^^
s/\^^.*//
# Exchange spaces
x
# Delete up to the first ^^
s/[^^]*\^^//
# Append to the hold space and exchange
H
x
# Branch if the last substitution was successful
tbeg
# Otherwise, print the pattern space
p
}' $temp | \
$AWK -f $BASEDIR/guile-doc-snarf.awk
}
case "$DOCFILE" in
0) snarf_x $INFILE "$@" > $OUTFILE;;
1) snarf_doc $INFILE "$@" > $OUTFILE;;
esac
if [ $cpp_exit -ne 0 ]; then
[ "$OUTFILE" != "/dev/tty" ] && rm $OUTFILE
fi
exit $cpp_exit
# Copyright (C) 2002, 2006, 2007 Sergey Poznyakoff
#
# This is a snarfer for guile version 1.6
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
BEGIN {
cname = ""
}
function flush() {
if (cname == "")
return;
if (arg_req + arg_opt + arg_var != numargs)
error(cname " incorrectly defined as taking " numargs " arguments")
print "\f" fname
print "@c snarfed from " loc_source ":" loc_line
printf "@deffn {Scheme procedure} %s", fname
# All scheme primitives follow the same naming style:
# SCM argument names are in upper case.
# So, we convert them to lower case for @deffn line and
# replace their occurrences in the docstring by appropriate
# @var{} commands.
for (i = 1; i <= numargs; i++) {
printf(" %s", tolower(arglist[i]))
gsub(arglist[i], "@var{" tolower(arglist[i]) "}", docstring)
}
print ""
print docstring
print "@end deffn\n"
delete argpos
delete arglist
cname = ""
}
function error(s) {
print loc_source ":" loc_line ": " s > "/dev/stderr"
exit 1
}
#{print NR ": " state}
state == 0 && NF != 0 { state = 1 }
state == 1 && $1 == "cname" { cname = $2; next }
state == 1 && $1 == "fname" { fname = substr($2,2,length($2)-2); next }
state == 1 && $1 == "type" { type = $2; next }
state == 1 && $1 == "location" { loc_source = $2; loc_line = $3; next }
state == 1 && $1 == "arglist" {
match($0, "\\(.*\\)")
s = substr($0,RSTART+1,RLENGTH-2)
numargs = split(s, a, ",")
for (i = 1; i <= numargs; i++) {
m = split(a[i], b, "[ \t]*")
if (b[1] == "") {
t = b[2]
n = b[3]
m--
} else {
t = b[1]
n = b[2]
}
if (m > 2 || t != "SCM")
error(cname ": wrong argument type for arg " i " " t)
arglist[i] = n
}
next
}
state == 1 && $1 == "argsig" { arg_req = $2; arg_opt = $3; arg_var = $4; next }
state == 1 && $1 == "argpos" { argpos[$2] = $3; next }
state == 1 && / *\"/ {
# Concatenate strings. A very simplified version, but
# works for us
gsub("\\\\n\" *\"", "\n")
gsub("\"\"", "")
gsub("\\\\n", "\n")
match($0,"\".*\"")
docstring = substr($0,RSTART+1,RLENGTH-2)
}
state == 1 && NF==0 { flush(); state = 0; }
END {
flush()
}