#include extern "C" { // need C linkage // define the function using a macro defined in aikido.h AIKIDO_NATIVE(strdup) { aikido::string *s = paras[0].str; char *p = strdup (s->c_str()); aikido::string *result = new aikido::string(p); free (p); return result; } }