4. Verification in Scheme
The functionality of monolith_verify
is wrapped in a
scheme function called monolith:verify
, and loaded
with a function called s9_monolith_verify
.
<<funcdefs>>=
void s9_monolith_verify(void);
<<funcs>>=
static cell pp_verify(cell p)
{
monolith_d *m;
char md5[32];
int size;
m = monolith_data_get();
/* TODO: make this a parameter */
size = 44100 * 4; /* 5 seconds at 44.1 kHz */
monolith_verify(m, size, md5);
return UNSPECIFIC;
}
static S9_PRIM verify_primitives[] = {
{"monolith:verify",
pp_verify, 1, 1,
{S9_T_INTEGER,S9_T_ANY,S9_T_ANY}},
{NULL}
};
void s9_monolith_verify(void)
{
monolith_scheme_add_primitives("monolith", verify_primitives);
}
prev | home | next