/* uniduk-v1.c, first trial, integrate a Javascript engine in Unicon tectonics: gcc -std=c99 -o uniduk.so -shared -fpic uniduk-v1.c duktape.c -lm */ #include #include "duktape.h" #include "icall.h" int uniduk(int argc, descriptor *argv) { duk_context *ctx = duk_create_heap_default(); duk_eval_string(ctx, argv[1].vword.sptr); duk_destroy_heap(ctx); argv[0].dword = D_Integer; argv[0].vword.integr = 42; return 0; }