#include <iostream>
#include <ecl/ecl.h>
cl_object c_func(cl_object cl_x)
{
int x = fixint(cl_x);
return make_integer(2 * x);
}
inline
cl_object eval(char *str)
{
return cl_safe_eval(c_string_to_object(str), Cnil, OBJNULL);
}
inline
cl_object symbol(char *str)
{
return cl_intern(1, make_simple_base_string(str));
}
int main(int argc, char *argv[])
{
cl_boot(argc, argv);
cl_def_c_function(symbol("C-FUNC"), (void *)c_func, 1);
eval("(load \"embedded\")");
int res = fixint(eval("(emb2 10)"));
std::cout << res << std::endl;
cl_shutdown();
return 0;
}