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:
Dirk-Jan C. Binnema
2025-06-21 11:53:18 +03:00
parent 812d78be49
commit ca46c09ccb
11 changed files with 303 additions and 124 deletions

View File

@ -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;
}