diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-04-12 16:28:41 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-04-12 16:29:22 +0300 |
commit | 49e121acc32a38b2d618cfd0544de349618c2bb1 (patch) | |
tree | 2cb54d76e3448a1f053ca84b74a7fbe43c368b11 /libmu_scm | |
parent | 787121995cef1f77d279df9b70a9eb1f4fb35325 (diff) | |
download | mailutils-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.
Diffstat (limited to 'libmu_scm')
-rw-r--r-- | libmu_scm/Makefile.am | 54 | ||||
-rw-r--r-- | libmu_scm/mailutils.scm.in | 64 | ||||
-rw-r--r-- | libmu_scm/mu_address.c | 14 | ||||
-rw-r--r-- | libmu_scm/mu_body.c | 4 | ||||
-rw-r--r-- | libmu_scm/mu_guile.c | 14 | ||||
-rw-r--r-- | libmu_scm/mu_logger.c | 11 | ||||
-rw-r--r-- | libmu_scm/mu_mailbox.c | 28 | ||||
-rw-r--r-- | libmu_scm/mu_message.c | 50 | ||||
-rw-r--r-- | libmu_scm/mu_mime.c | 12 | ||||
-rw-r--r-- | libmu_scm/mu_scm.c | 18 | ||||
-rw-r--r-- | libmu_scm/mu_util.c | 2 |
11 files changed, 93 insertions, 178 deletions
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 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 diff --git a/libmu_scm/mu_mime.c b/libmu_scm/mu_mime.c index ca9f79997..c8f512b33 100644 --- a/libmu_scm/mu_mime.c +++ b/libmu_scm/mu_mime.c @@ -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 diff --git a/libmu_scm/mu_scm.c b/libmu_scm/mu_scm.c index 9df955158..ddfa8d95a 100644 --- a/libmu_scm/mu_scm.c +++ b/libmu_scm/mu_scm.c @@ -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 (); diff --git a/libmu_scm/mu_util.c b/libmu_scm/mu_util.c index 22fedc586..bdf3aca78 100644 --- a/libmu_scm/mu_util.c +++ b/libmu_scm/mu_util.c @@ -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" |