void gsys::vtid_lib::register_base_types() { DECL_BASE1(gsys_char,"char") DECL_BASE1(gsys_short,"short") DECL_BASE1(gsys_long,"long") DECL_BASE1(gsys_double,"double") DECL_BASE1(gsys_unsigned_int,"uint") /* DECL_BASE2(gsys_float,"float","real") DECL_BASE2(gsys_unsigned_char,"byte","uchar") DECL_BASE2(gsys_unsigned_short,"ushort","word") DECL_BASE2(gsys_unsigned_long,"ulong","dword") #ifdef GSYS_DETAIL_USE_64BIT_TYPES DECL_BASE2(gsys_long_long,"int64","longlong") DECL_BASE2(gsys_unsigned_long_long,"qword","uint64") #endif */ register_strings(); register_helpers(); }
static int lang_duktape_file(RLang *lang, const char *file) { int ret = -1; char *code = r_file_slurp (file, NULL); if (code) { register_helpers (lang); duk_push_lstring (ctx, code, strlen (code)); duk_push_string (ctx,file); free (code); ret = duk_safe_call (ctx, wrapped_compile_execute, 2, 1); if (ret != DUK_EXEC_SUCCESS) { print_error(ctx, stderr); eprintf ("duktape error"); } else { duk_pop (ctx); } } return ret; }
static int lang_duktape_run(RLang *lang, const char *code, int len) { register_helpers (lang); return lang_duktape_safe_eval (ctx, code); }