* 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-query.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
static SCM
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;
}
@ -261,8 +259,8 @@ contacts_to_list (MuMsgContact *contact, EachContactData *ecdata)
SCM item;
const char *addr, *name;
addr = mu_msg_contact_address(contact);
name = mu_msg_contact_name(contact);
addr = mu_msg_contact_address (contact);
name = mu_msg_contact_name (contact);
item = scm_list_1
(scm_list_2 (
@ -283,6 +281,7 @@ contact_list_field (SCM msg_smob, MuMsgFieldId mfid)
switch (mfid) {
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_BCC: ecdata.ctype = MU_MSG_CONTACT_TYPE_BCC; break;
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);
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;
}
#undef FUNC_NAME