mu-scm: add full-message support (body/header)
Implement support for "header" and "body" procedures, with require loading the message file from disk, and create a foreign object for the message. We keep those alive in a vector, and hook up a finalizer. Update docs & tests as well.
This commit is contained in:
@ -17,8 +17,7 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#include "mu-scm-store.hh"
|
||||
#include "mu-scm-contact.hh"
|
||||
#include "mu-scm-types.hh"
|
||||
|
||||
using namespace Mu;
|
||||
using namespace Mu::Scm;
|
||||
@ -154,3 +153,17 @@ Mu::Scm::init_store(const Store& store)
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
||||
SCM
|
||||
Mu::Scm::to_scm(const Contact& contact)
|
||||
{
|
||||
static SCM email{scm_from_utf8_symbol("email")};
|
||||
static SCM name{scm_from_utf8_symbol("name")};
|
||||
|
||||
SCM alist = scm_acons(email, to_scm(contact.email), SCM_EOL);
|
||||
if (!contact.name.empty())
|
||||
alist = scm_acons(name, to_scm(contact.name), alist);
|
||||
|
||||
return alist;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user