* mu-guile: small updates

This commit is contained in:
djcb
2011-12-19 23:54:54 +02:00
parent 043945bc4b
commit ce107b9bfc
2 changed files with 44 additions and 41 deletions

View File

@ -17,6 +17,7 @@
** **
*/ */
#include <mu-msg.h> #include <mu-msg.h>
#include <mu-query.h> #include <mu-query.h>
#include <mu-runtime.h> #include <mu-runtime.h>
@ -110,13 +111,10 @@ SCM_DEFINE_PUBLIC (msg_move, "mu:msg:move-to-maildir", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
static SCM static SCM
scm_from_string_or_null (const char *str) scm_from_string_or_null (const char *str)
{ {
return str ? scm_from_utf8_string (str) : SCM_UNSPECIFIED; return str ? scm_from_utf8_string (str) : SCM_BOOL_F;
} }
@ -283,6 +281,7 @@ contact_list_field (SCM msg_smob, MuMsgFieldId mfid)
switch (mfid) { switch (mfid) {
case MU_MSG_FIELD_ID_TO: ecdata.ctype = MU_MSG_CONTACT_TYPE_TO; break; case MU_MSG_FIELD_ID_TO: ecdata.ctype = MU_MSG_CONTACT_TYPE_TO; break;
case MU_MSG_FIELD_ID_FROM: ecdata.ctype = MU_MSG_CONTACT_TYPE_FROM; break;
case MU_MSG_FIELD_ID_CC: ecdata.ctype = MU_MSG_CONTACT_TYPE_CC; break; case MU_MSG_FIELD_ID_CC: ecdata.ctype = MU_MSG_CONTACT_TYPE_CC; break;
case MU_MSG_FIELD_ID_BCC: ecdata.ctype = MU_MSG_CONTACT_TYPE_BCC; break; case MU_MSG_FIELD_ID_BCC: ecdata.ctype = MU_MSG_CONTACT_TYPE_BCC; break;
default: g_return_val_if_reached (SCM_UNDEFINED); default: g_return_val_if_reached (SCM_UNDEFINED);

View File

@ -52,6 +52,10 @@ SCM_DEFINE_PUBLIC (init_mu, "mu:init", 0, 1, 0,
SCM_UNSPECIFIED); SCM_UNSPECIFIED);
initialized = TRUE; initialized = TRUE;
/* cleanup when we're exiting */
if (atexit (mu_runtime_uninit) != 0)
g_warning ("failed to register mu_runtime_uninit with atexit");
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME