immunio 0.15.4 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +0 -27
- data/ext/immunio/Rakefile +9 -0
- data/lib/immunio/plugins/active_record.rb +1 -1
- data/lib/immunio/plugins/active_record_relation.rb +1 -1
- data/lib/immunio/plugins/environment_reporter.rb +20 -0
- data/lib/immunio/rufus_lua_ext/ref.rb +1 -3
- data/lib/immunio/version.rb +1 -1
- data/lib/immunio/vm.rb +1 -2
- data/lua-hooks/Makefile +97 -0
- data/lua-hooks/ext/all.c +41 -52
- data/lua-hooks/ext/all.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_html5.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_sqli.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_xss.o +0 -0
- data/lua-hooks/ext/libinjection/lualib.c +2 -2
- data/lua-hooks/ext/lpeg/lpcap.c +2 -2
- data/lua-hooks/ext/lpeg/lpcap.o +0 -0
- data/lua-hooks/ext/lpeg/lpcode.c +2 -2
- data/lua-hooks/ext/lpeg/lpcode.h +1 -1
- data/lua-hooks/ext/lpeg/lpcode.o +0 -0
- data/lua-hooks/ext/lpeg/lpprint.o +0 -0
- data/lua-hooks/ext/lpeg/lptree.c +2 -2
- data/lua-hooks/ext/lpeg/lptypes.h +1 -1
- data/lua-hooks/ext/lpeg/lpvm.c +2 -2
- data/lua-hooks/ext/lpeg/lpvm.o +0 -0
- data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +16 -3
- data/lua-hooks/ext/lua-snapshot/snapshot.c +14 -7
- data/lua-hooks/ext/luajit/COPYRIGHT +56 -0
- data/lua-hooks/ext/luajit/Makefile +159 -0
- data/lua-hooks/ext/luajit/README +16 -0
- data/lua-hooks/ext/luajit/doc/bluequad-print.css +166 -0
- data/lua-hooks/ext/luajit/doc/bluequad.css +325 -0
- data/lua-hooks/ext/luajit/doc/changes.html +804 -0
- data/lua-hooks/ext/luajit/doc/contact.html +104 -0
- data/lua-hooks/ext/luajit/doc/ext_c_api.html +189 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi.html +332 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +570 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +1261 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +603 -0
- data/lua-hooks/ext/luajit/doc/ext_jit.html +201 -0
- data/lua-hooks/ext/luajit/doc/ext_profiler.html +365 -0
- data/lua-hooks/ext/luajit/doc/extensions.html +448 -0
- data/lua-hooks/ext/luajit/doc/faq.html +186 -0
- data/lua-hooks/ext/luajit/doc/img/contact.png +0 -0
- data/lua-hooks/ext/luajit/doc/install.html +659 -0
- data/lua-hooks/ext/luajit/doc/luajit.html +236 -0
- data/lua-hooks/ext/luajit/doc/running.html +309 -0
- data/lua-hooks/ext/luajit/doc/status.html +118 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +456 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1125 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +518 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1166 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +416 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +953 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +419 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1919 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +83 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +12 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +471 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +1945 -0
- data/lua-hooks/ext/luajit/dynasm/dynasm.lua +1094 -0
- data/lua-hooks/ext/luajit/etc/luajit.1 +88 -0
- data/lua-hooks/ext/luajit/etc/luajit.pc +25 -0
- data/lua-hooks/ext/luajit/src/Makefile +697 -0
- data/lua-hooks/ext/luajit/src/Makefile.dep +244 -0
- data/lua-hooks/ext/luajit/src/host/README +4 -0
- data/lua-hooks/ext/luajit/src/host/buildvm +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.c +518 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.h +105 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_arch.h +7449 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +345 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +229 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +457 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +45 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +368 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.o +0 -0
- data/lua-hooks/ext/luajit/src/host/genlibbc.lua +197 -0
- data/lua-hooks/ext/luajit/src/host/genminilua.lua +428 -0
- data/lua-hooks/ext/luajit/src/host/minilua +0 -0
- data/lua-hooks/ext/luajit/src/host/minilua.c +7770 -0
- data/lua-hooks/ext/luajit/src/host/minilua.o +0 -0
- data/lua-hooks/ext/luajit/src/jit/bc.lua +190 -0
- data/lua-hooks/ext/luajit/src/jit/bcsave.lua +661 -0
- data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +689 -0
- data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +428 -0
- data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +17 -0
- data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +591 -0
- data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +17 -0
- data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +838 -0
- data/lua-hooks/ext/luajit/src/jit/dump.lua +706 -0
- data/lua-hooks/ext/luajit/src/jit/p.lua +310 -0
- data/lua-hooks/ext/luajit/src/jit/v.lua +170 -0
- data/lua-hooks/ext/luajit/src/jit/vmdef.lua +362 -0
- data/lua-hooks/ext/luajit/src/jit/zone.lua +45 -0
- data/lua-hooks/ext/{lua → luajit/src}/lauxlib.h +10 -17
- data/lua-hooks/ext/luajit/src/lib_aux.c +356 -0
- data/lua-hooks/ext/luajit/src/lib_aux.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_aux_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_base.c +664 -0
- data/lua-hooks/ext/luajit/src/lib_base.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_base_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_bit.c +180 -0
- data/lua-hooks/ext/luajit/src/lib_bit.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_bit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_debug.c +405 -0
- data/lua-hooks/ext/luajit/src/lib_debug.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_debug_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_ffi.c +872 -0
- data/lua-hooks/ext/luajit/src/lib_ffi.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_ffi_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_init.c +55 -0
- data/lua-hooks/ext/luajit/src/lib_init.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_init_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_io.c +541 -0
- data/lua-hooks/ext/luajit/src/lib_io.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_io_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_jit.c +767 -0
- data/lua-hooks/ext/luajit/src/lib_jit.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_jit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_math.c +230 -0
- data/lua-hooks/ext/luajit/src/lib_math.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_math_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_os.c +292 -0
- data/lua-hooks/ext/luajit/src/lib_os.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_os_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_package.c +610 -0
- data/lua-hooks/ext/luajit/src/lib_package.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_package_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_string.c +752 -0
- data/lua-hooks/ext/luajit/src/lib_string.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_string_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_table.c +307 -0
- data/lua-hooks/ext/luajit/src/lib_table.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_table_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/libluajit.a +0 -0
- data/lua-hooks/ext/luajit/src/libluajit.so +0 -0
- data/lua-hooks/ext/luajit/src/lj.supp +26 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.c +1398 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.h +17 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_alloc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_api.c +1210 -0
- data/lua-hooks/ext/luajit/src/lj_api.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_api_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_arch.h +509 -0
- data/lua-hooks/ext/luajit/src/lj_asm.c +2278 -0
- data/lua-hooks/ext/luajit/src/lj_asm.h +17 -0
- data/lua-hooks/ext/luajit/src/lj_asm.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_asm_arm.h +2217 -0
- data/lua-hooks/ext/luajit/src/lj_asm_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_asm_mips.h +1833 -0
- data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2015 -0
- data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2634 -0
- data/lua-hooks/ext/luajit/src/lj_bc.c +14 -0
- data/lua-hooks/ext/luajit/src/lj_bc.h +265 -0
- data/lua-hooks/ext/luajit/src/lj_bc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcdef.h +220 -0
- data/lua-hooks/ext/luajit/src/lj_bcdump.h +68 -0
- data/lua-hooks/ext/luajit/src/lj_bcread.c +457 -0
- data/lua-hooks/ext/luajit/src/lj_bcread.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcread_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite.c +361 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_buf.c +234 -0
- data/lua-hooks/ext/luajit/src/lj_buf.h +105 -0
- data/lua-hooks/ext/luajit/src/lj_buf.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_buf_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_carith.c +429 -0
- data/lua-hooks/ext/luajit/src/lj_carith.h +37 -0
- data/lua-hooks/ext/luajit/src/lj_carith.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_carith_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.c +984 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.h +178 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccall_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.c +712 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.h +25 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.c +752 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.h +70 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cconv_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.c +288 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.h +76 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cdata_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_char.c +43 -0
- data/lua-hooks/ext/luajit/src/lj_char.h +42 -0
- data/lua-hooks/ext/luajit/src/lj_char.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_char_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_clib.c +418 -0
- data/lua-hooks/ext/luajit/src/lj_clib.h +29 -0
- data/lua-hooks/ext/luajit/src/lj_clib.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_clib_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.c +1862 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.h +65 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cparse_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.c +1834 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.h +38 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_crecord_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.c +635 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.h +461 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ctype_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_debug.c +699 -0
- data/lua-hooks/ext/luajit/src/lj_debug.h +65 -0
- data/lua-hooks/ext/luajit/src/lj_debug.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_debug_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_def.h +365 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.c +557 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.h +138 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_emit_arm.h +356 -0
- data/lua-hooks/ext/luajit/src/lj_emit_mips.h +211 -0
- data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +238 -0
- data/lua-hooks/ext/luajit/src/lj_emit_x86.h +462 -0
- data/lua-hooks/ext/luajit/src/lj_err.c +794 -0
- data/lua-hooks/ext/luajit/src/lj_err.h +41 -0
- data/lua-hooks/ext/luajit/src/lj_err.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_err_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_errmsg.h +190 -0
- data/lua-hooks/ext/luajit/src/lj_ff.h +18 -0
- data/lua-hooks/ext/luajit/src/lj_ffdef.h +209 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.c +1247 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.h +24 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_folddef.h +1138 -0
- data/lua-hooks/ext/luajit/src/lj_frame.h +259 -0
- data/lua-hooks/ext/luajit/src/lj_func.c +185 -0
- data/lua-hooks/ext/luajit/src/lj_func.h +24 -0
- data/lua-hooks/ext/luajit/src/lj_func.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_func_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gc.c +845 -0
- data/lua-hooks/ext/luajit/src/lj_gc.h +134 -0
- data/lua-hooks/ext/luajit/src/lj_gc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.c +787 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.h +22 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ir.c +505 -0
- data/lua-hooks/ext/luajit/src/lj_ir.h +577 -0
- data/lua-hooks/ext/luajit/src/lj_ir.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ir_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ircall.h +321 -0
- data/lua-hooks/ext/luajit/src/lj_iropt.h +161 -0
- data/lua-hooks/ext/luajit/src/lj_jit.h +440 -0
- data/lua-hooks/ext/luajit/src/lj_lex.c +482 -0
- data/lua-hooks/ext/luajit/src/lj_lex.h +86 -0
- data/lua-hooks/ext/luajit/src/lj_lex.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lex_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lib.c +303 -0
- data/lua-hooks/ext/luajit/src/lj_lib.h +115 -0
- data/lua-hooks/ext/luajit/src/lj_lib.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lib_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_libdef.h +414 -0
- data/lua-hooks/ext/luajit/src/lj_load.c +168 -0
- data/lua-hooks/ext/luajit/src/lj_load.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_load_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.c +386 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.h +30 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_mcode_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_meta.c +477 -0
- data/lua-hooks/ext/luajit/src/lj_meta.h +38 -0
- data/lua-hooks/ext/luajit/src/lj_meta.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_meta_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_obj.c +50 -0
- data/lua-hooks/ext/luajit/src/lj_obj.h +976 -0
- data/lua-hooks/ext/luajit/src/lj_obj.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_obj_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce.c +78 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold.c +2488 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop.c +449 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem.c +935 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +652 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink.c +245 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split.c +856 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_parse.c +2725 -0
- data/lua-hooks/ext/luajit/src/lj_parse.h +18 -0
- data/lua-hooks/ext/luajit/src/lj_parse.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_parse_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_profile.c +368 -0
- data/lua-hooks/ext/luajit/src/lj_profile.h +21 -0
- data/lua-hooks/ext/luajit/src/lj_profile.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_profile_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_recdef.h +270 -0
- data/lua-hooks/ext/luajit/src/lj_record.c +2554 -0
- data/lua-hooks/ext/luajit/src/lj_record.h +45 -0
- data/lua-hooks/ext/luajit/src/lj_record.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_record_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_snap.c +870 -0
- data/lua-hooks/ext/luajit/src/lj_snap.h +34 -0
- data/lua-hooks/ext/luajit/src/lj_snap.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_snap_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_state.c +300 -0
- data/lua-hooks/ext/luajit/src/lj_state.h +35 -0
- data/lua-hooks/ext/luajit/src/lj_state.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_state_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_str.c +197 -0
- data/lua-hooks/ext/luajit/src/lj_str.h +27 -0
- data/lua-hooks/ext/luajit/src/lj_str.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_str_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.c +554 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.h +125 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.c +547 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.h +39 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strscan_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_tab.c +666 -0
- data/lua-hooks/ext/luajit/src/lj_tab.h +73 -0
- data/lua-hooks/ext/luajit/src/lj_tab.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_tab_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_target.h +164 -0
- data/lua-hooks/ext/luajit/src/lj_target_arm.h +270 -0
- data/lua-hooks/ext/luajit/src/lj_target_arm64.h +97 -0
- data/lua-hooks/ext/luajit/src/lj_target_mips.h +260 -0
- data/lua-hooks/ext/luajit/src/lj_target_ppc.h +280 -0
- data/lua-hooks/ext/luajit/src/lj_target_x86.h +345 -0
- data/lua-hooks/ext/luajit/src/lj_trace.c +859 -0
- data/lua-hooks/ext/luajit/src/lj_trace.h +54 -0
- data/lua-hooks/ext/luajit/src/lj_trace.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_trace_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_traceerr.h +63 -0
- data/lua-hooks/ext/luajit/src/lj_udata.c +34 -0
- data/lua-hooks/ext/luajit/src/lj_udata.h +14 -0
- data/lua-hooks/ext/luajit/src/lj_udata.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_udata_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vm.S +2730 -0
- data/lua-hooks/ext/luajit/src/lj_vm.h +114 -0
- data/lua-hooks/ext/luajit/src/lj_vm.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vm_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.c +58 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.h +59 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath.c +152 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/ljamalg.c +96 -0
- data/lua-hooks/ext/{lua → luajit/src}/lua.h +12 -7
- data/lua-hooks/ext/luajit/src/lua.hpp +9 -0
- data/lua-hooks/ext/luajit/src/luaconf.h +156 -0
- data/lua-hooks/ext/luajit/src/luajit +0 -0
- data/lua-hooks/ext/luajit/src/luajit.c +570 -0
- data/lua-hooks/ext/luajit/src/luajit.h +79 -0
- data/lua-hooks/ext/luajit/src/luajit.o +0 -0
- data/lua-hooks/ext/luajit/src/lualib.h +43 -0
- data/lua-hooks/ext/luajit/src/msvcbuild.bat +114 -0
- data/lua-hooks/ext/luajit/src/ps4build.bat +103 -0
- data/lua-hooks/ext/luajit/src/psvitabuild.bat +93 -0
- data/lua-hooks/ext/luajit/src/vm_arm.dasc +4585 -0
- data/lua-hooks/ext/luajit/src/vm_arm64.dasc +3764 -0
- data/lua-hooks/ext/luajit/src/vm_mips.dasc +4355 -0
- data/lua-hooks/ext/luajit/src/vm_ppc.dasc +5252 -0
- data/lua-hooks/ext/luajit/src/vm_x64.dasc +4902 -0
- data/lua-hooks/ext/luajit/src/vm_x86.dasc +5710 -0
- data/lua-hooks/ext/luajit/src/xb1build.bat +101 -0
- data/lua-hooks/ext/luajit/src/xedkbuild.bat +92 -0
- data/lua-hooks/ext/luautf8/lutf8lib.c +3 -3
- data/lua-hooks/lib/boot.lua +37 -2
- metadata +372 -69
- data/lua-hooks/ext/bitop/README +0 -22
- data/lua-hooks/ext/bitop/bit.c +0 -189
- data/lua-hooks/ext/extconf.rb +0 -38
- data/lua-hooks/ext/lua/COPYRIGHT +0 -34
- data/lua-hooks/ext/lua/lapi.c +0 -1087
- data/lua-hooks/ext/lua/lapi.h +0 -16
- data/lua-hooks/ext/lua/lauxlib.c +0 -652
- data/lua-hooks/ext/lua/lbaselib.c +0 -659
- data/lua-hooks/ext/lua/lcode.c +0 -831
- data/lua-hooks/ext/lua/lcode.h +0 -76
- data/lua-hooks/ext/lua/ldblib.c +0 -398
- data/lua-hooks/ext/lua/ldebug.c +0 -638
- data/lua-hooks/ext/lua/ldebug.h +0 -33
- data/lua-hooks/ext/lua/ldo.c +0 -519
- data/lua-hooks/ext/lua/ldo.h +0 -57
- data/lua-hooks/ext/lua/ldump.c +0 -164
- data/lua-hooks/ext/lua/lfunc.c +0 -174
- data/lua-hooks/ext/lua/lfunc.h +0 -34
- data/lua-hooks/ext/lua/lgc.c +0 -710
- data/lua-hooks/ext/lua/lgc.h +0 -110
- data/lua-hooks/ext/lua/linit.c +0 -38
- data/lua-hooks/ext/lua/liolib.c +0 -556
- data/lua-hooks/ext/lua/llex.c +0 -463
- data/lua-hooks/ext/lua/llex.h +0 -81
- data/lua-hooks/ext/lua/llimits.h +0 -128
- data/lua-hooks/ext/lua/lmathlib.c +0 -263
- data/lua-hooks/ext/lua/lmem.c +0 -86
- data/lua-hooks/ext/lua/lmem.h +0 -49
- data/lua-hooks/ext/lua/loadlib.c +0 -705
- data/lua-hooks/ext/lua/loadlib_rel.c +0 -760
- data/lua-hooks/ext/lua/lobject.c +0 -214
- data/lua-hooks/ext/lua/lobject.h +0 -381
- data/lua-hooks/ext/lua/lopcodes.c +0 -102
- data/lua-hooks/ext/lua/lopcodes.h +0 -268
- data/lua-hooks/ext/lua/loslib.c +0 -243
- data/lua-hooks/ext/lua/lparser.c +0 -1339
- data/lua-hooks/ext/lua/lparser.h +0 -82
- data/lua-hooks/ext/lua/lstate.c +0 -214
- data/lua-hooks/ext/lua/lstate.h +0 -169
- data/lua-hooks/ext/lua/lstring.c +0 -111
- data/lua-hooks/ext/lua/lstring.h +0 -31
- data/lua-hooks/ext/lua/lstrlib.c +0 -871
- data/lua-hooks/ext/lua/ltable.c +0 -588
- data/lua-hooks/ext/lua/ltable.h +0 -40
- data/lua-hooks/ext/lua/ltablib.c +0 -287
- data/lua-hooks/ext/lua/ltm.c +0 -75
- data/lua-hooks/ext/lua/ltm.h +0 -54
- data/lua-hooks/ext/lua/lua.c +0 -392
- data/lua-hooks/ext/lua/lua.def +0 -131
- data/lua-hooks/ext/lua/lua.rc +0 -28
- data/lua-hooks/ext/lua/lua_dll.rc +0 -26
- data/lua-hooks/ext/lua/luac.c +0 -200
- data/lua-hooks/ext/lua/luac.rc +0 -1
- data/lua-hooks/ext/lua/luaconf.h +0 -763
- data/lua-hooks/ext/lua/luaconf.h.in +0 -724
- data/lua-hooks/ext/lua/luaconf.h.orig +0 -763
- data/lua-hooks/ext/lua/lualib.h +0 -53
- data/lua-hooks/ext/lua/lundump.c +0 -227
- data/lua-hooks/ext/lua/lundump.h +0 -36
- data/lua-hooks/ext/lua/lvm.c +0 -767
- data/lua-hooks/ext/lua/lvm.h +0 -36
- data/lua-hooks/ext/lua/lzio.c +0 -82
- data/lua-hooks/ext/lua/lzio.h +0 -67
- data/lua-hooks/ext/lua/print.c +0 -227
data/lua-hooks/ext/lua/lua.c
DELETED
@@ -1,392 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $
|
3
|
-
** Lua stand-alone interpreter
|
4
|
-
** See Copyright Notice in lua.h
|
5
|
-
*/
|
6
|
-
|
7
|
-
|
8
|
-
#include <signal.h>
|
9
|
-
#include <stdio.h>
|
10
|
-
#include <stdlib.h>
|
11
|
-
#include <string.h>
|
12
|
-
|
13
|
-
#define lua_c
|
14
|
-
|
15
|
-
#include "lua.h"
|
16
|
-
|
17
|
-
#include "lauxlib.h"
|
18
|
-
#include "lualib.h"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
static lua_State *globalL = NULL;
|
23
|
-
|
24
|
-
static const char *progname = LUA_PROGNAME;
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
static void lstop (lua_State *L, lua_Debug *ar) {
|
29
|
-
(void)ar; /* unused arg. */
|
30
|
-
lua_sethook(L, NULL, 0, 0);
|
31
|
-
luaL_error(L, "interrupted!");
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
static void laction (int i) {
|
36
|
-
signal(i, SIG_DFL); /* if another SIGINT happens before lstop,
|
37
|
-
terminate process (default action) */
|
38
|
-
lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
static void print_usage (void) {
|
43
|
-
fprintf(stderr,
|
44
|
-
"usage: %s [options] [script [args]].\n"
|
45
|
-
"Available options are:\n"
|
46
|
-
" -e stat execute string " LUA_QL("stat") "\n"
|
47
|
-
" -l name require library " LUA_QL("name") "\n"
|
48
|
-
" -i enter interactive mode after executing " LUA_QL("script") "\n"
|
49
|
-
" -v show version information\n"
|
50
|
-
" -- stop handling options\n"
|
51
|
-
" - execute stdin and stop handling options\n"
|
52
|
-
,
|
53
|
-
progname);
|
54
|
-
fflush(stderr);
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
static void l_message (const char *pname, const char *msg) {
|
59
|
-
if (pname) fprintf(stderr, "%s: ", pname);
|
60
|
-
fprintf(stderr, "%s\n", msg);
|
61
|
-
fflush(stderr);
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
static int report (lua_State *L, int status) {
|
66
|
-
if (status && !lua_isnil(L, -1)) {
|
67
|
-
const char *msg = lua_tostring(L, -1);
|
68
|
-
if (msg == NULL) msg = "(error object is not a string)";
|
69
|
-
l_message(progname, msg);
|
70
|
-
lua_pop(L, 1);
|
71
|
-
}
|
72
|
-
return status;
|
73
|
-
}
|
74
|
-
|
75
|
-
|
76
|
-
static int traceback (lua_State *L) {
|
77
|
-
if (!lua_isstring(L, 1)) /* 'message' not a string? */
|
78
|
-
return 1; /* keep it intact */
|
79
|
-
lua_getfield(L, LUA_GLOBALSINDEX, "debug");
|
80
|
-
if (!lua_istable(L, -1)) {
|
81
|
-
lua_pop(L, 1);
|
82
|
-
return 1;
|
83
|
-
}
|
84
|
-
lua_getfield(L, -1, "traceback");
|
85
|
-
if (!lua_isfunction(L, -1)) {
|
86
|
-
lua_pop(L, 2);
|
87
|
-
return 1;
|
88
|
-
}
|
89
|
-
lua_pushvalue(L, 1); /* pass error message */
|
90
|
-
lua_pushinteger(L, 2); /* skip this function and traceback */
|
91
|
-
lua_call(L, 2, 1); /* call debug.traceback */
|
92
|
-
return 1;
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
static int docall (lua_State *L, int narg, int clear) {
|
97
|
-
int status;
|
98
|
-
int base = lua_gettop(L) - narg; /* function index */
|
99
|
-
lua_pushcfunction(L, traceback); /* push traceback function */
|
100
|
-
lua_insert(L, base); /* put it under chunk and args */
|
101
|
-
signal(SIGINT, laction);
|
102
|
-
status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
|
103
|
-
signal(SIGINT, SIG_DFL);
|
104
|
-
lua_remove(L, base); /* remove traceback function */
|
105
|
-
/* force a complete garbage collection in case of errors */
|
106
|
-
if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);
|
107
|
-
return status;
|
108
|
-
}
|
109
|
-
|
110
|
-
|
111
|
-
static void print_version (void) {
|
112
|
-
l_message(NULL, LUA_RELEASE " " LUA_COPYRIGHT);
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
static int getargs (lua_State *L, char **argv, int n) {
|
117
|
-
int narg;
|
118
|
-
int i;
|
119
|
-
int argc = 0;
|
120
|
-
while (argv[argc]) argc++; /* count total number of arguments */
|
121
|
-
narg = argc - (n + 1); /* number of arguments to the script */
|
122
|
-
luaL_checkstack(L, narg + 3, "too many arguments to script");
|
123
|
-
for (i=n+1; i < argc; i++)
|
124
|
-
lua_pushstring(L, argv[i]);
|
125
|
-
lua_createtable(L, narg, n + 1);
|
126
|
-
for (i=0; i < argc; i++) {
|
127
|
-
lua_pushstring(L, argv[i]);
|
128
|
-
lua_rawseti(L, -2, i - n);
|
129
|
-
}
|
130
|
-
return narg;
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
static int dofile (lua_State *L, const char *name) {
|
135
|
-
int status = luaL_loadfile(L, name) || docall(L, 0, 1);
|
136
|
-
return report(L, status);
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
static int dostring (lua_State *L, const char *s, const char *name) {
|
141
|
-
int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1);
|
142
|
-
return report(L, status);
|
143
|
-
}
|
144
|
-
|
145
|
-
|
146
|
-
static int dolibrary (lua_State *L, const char *name) {
|
147
|
-
lua_getglobal(L, "require");
|
148
|
-
lua_pushstring(L, name);
|
149
|
-
return report(L, docall(L, 1, 1));
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
static const char *get_prompt (lua_State *L, int firstline) {
|
154
|
-
const char *p;
|
155
|
-
lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2");
|
156
|
-
p = lua_tostring(L, -1);
|
157
|
-
if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2);
|
158
|
-
lua_pop(L, 1); /* remove global */
|
159
|
-
return p;
|
160
|
-
}
|
161
|
-
|
162
|
-
|
163
|
-
static int incomplete (lua_State *L, int status) {
|
164
|
-
if (status == LUA_ERRSYNTAX) {
|
165
|
-
size_t lmsg;
|
166
|
-
const char *msg = lua_tolstring(L, -1, &lmsg);
|
167
|
-
const char *tp = msg + lmsg - (sizeof(LUA_QL("<eof>")) - 1);
|
168
|
-
if (strstr(msg, LUA_QL("<eof>")) == tp) {
|
169
|
-
lua_pop(L, 1);
|
170
|
-
return 1;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
return 0; /* else... */
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
static int pushline (lua_State *L, int firstline) {
|
178
|
-
char buffer[LUA_MAXINPUT];
|
179
|
-
char *b = buffer;
|
180
|
-
size_t l;
|
181
|
-
const char *prmt = get_prompt(L, firstline);
|
182
|
-
if (lua_readline(L, b, prmt) == 0)
|
183
|
-
return 0; /* no input */
|
184
|
-
l = strlen(b);
|
185
|
-
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
|
186
|
-
b[l-1] = '\0'; /* remove it */
|
187
|
-
if (firstline && b[0] == '=') /* first line starts with `=' ? */
|
188
|
-
lua_pushfstring(L, "return %s", b+1); /* change it to `return' */
|
189
|
-
else
|
190
|
-
lua_pushstring(L, b);
|
191
|
-
lua_freeline(L, b);
|
192
|
-
return 1;
|
193
|
-
}
|
194
|
-
|
195
|
-
|
196
|
-
static int loadline (lua_State *L) {
|
197
|
-
int status;
|
198
|
-
lua_settop(L, 0);
|
199
|
-
if (!pushline(L, 1))
|
200
|
-
return -1; /* no input */
|
201
|
-
for (;;) { /* repeat until gets a complete line */
|
202
|
-
status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin");
|
203
|
-
if (!incomplete(L, status)) break; /* cannot try to add lines? */
|
204
|
-
if (!pushline(L, 0)) /* no more input? */
|
205
|
-
return -1;
|
206
|
-
lua_pushliteral(L, "\n"); /* add a new line... */
|
207
|
-
lua_insert(L, -2); /* ...between the two lines */
|
208
|
-
lua_concat(L, 3); /* join them */
|
209
|
-
}
|
210
|
-
lua_saveline(L, 1);
|
211
|
-
lua_remove(L, 1); /* remove line */
|
212
|
-
return status;
|
213
|
-
}
|
214
|
-
|
215
|
-
|
216
|
-
static void dotty (lua_State *L) {
|
217
|
-
int status;
|
218
|
-
const char *oldprogname = progname;
|
219
|
-
progname = NULL;
|
220
|
-
while ((status = loadline(L)) != -1) {
|
221
|
-
if (status == 0) status = docall(L, 0, 0);
|
222
|
-
report(L, status);
|
223
|
-
if (status == 0 && lua_gettop(L) > 0) { /* any result to print? */
|
224
|
-
lua_getglobal(L, "print");
|
225
|
-
lua_insert(L, 1);
|
226
|
-
if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0)
|
227
|
-
l_message(progname, lua_pushfstring(L,
|
228
|
-
"error calling " LUA_QL("print") " (%s)",
|
229
|
-
lua_tostring(L, -1)));
|
230
|
-
}
|
231
|
-
}
|
232
|
-
lua_settop(L, 0); /* clear stack */
|
233
|
-
fputs("\n", stdout);
|
234
|
-
fflush(stdout);
|
235
|
-
progname = oldprogname;
|
236
|
-
}
|
237
|
-
|
238
|
-
|
239
|
-
static int handle_script (lua_State *L, char **argv, int n) {
|
240
|
-
int status;
|
241
|
-
const char *fname;
|
242
|
-
int narg = getargs(L, argv, n); /* collect arguments */
|
243
|
-
lua_setglobal(L, "arg");
|
244
|
-
fname = argv[n];
|
245
|
-
if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0)
|
246
|
-
fname = NULL; /* stdin */
|
247
|
-
status = luaL_loadfile(L, fname);
|
248
|
-
lua_insert(L, -(narg+1));
|
249
|
-
if (status == 0)
|
250
|
-
status = docall(L, narg, 0);
|
251
|
-
else
|
252
|
-
lua_pop(L, narg);
|
253
|
-
return report(L, status);
|
254
|
-
}
|
255
|
-
|
256
|
-
|
257
|
-
/* check that argument has no extra characters at the end */
|
258
|
-
#define notail(x) {if ((x)[2] != '\0') return -1;}
|
259
|
-
|
260
|
-
|
261
|
-
static int collectargs (char **argv, int *pi, int *pv, int *pe) {
|
262
|
-
int i;
|
263
|
-
for (i = 1; argv[i] != NULL; i++) {
|
264
|
-
if (argv[i][0] != '-') /* not an option? */
|
265
|
-
return i;
|
266
|
-
switch (argv[i][1]) { /* option */
|
267
|
-
case '-':
|
268
|
-
notail(argv[i]);
|
269
|
-
return (argv[i+1] != NULL ? i+1 : 0);
|
270
|
-
case '\0':
|
271
|
-
return i;
|
272
|
-
case 'i':
|
273
|
-
notail(argv[i]);
|
274
|
-
*pi = 1; /* go through */
|
275
|
-
case 'v':
|
276
|
-
notail(argv[i]);
|
277
|
-
*pv = 1;
|
278
|
-
break;
|
279
|
-
case 'e':
|
280
|
-
*pe = 1; /* go through */
|
281
|
-
case 'l':
|
282
|
-
if (argv[i][2] == '\0') {
|
283
|
-
i++;
|
284
|
-
if (argv[i] == NULL) return -1;
|
285
|
-
}
|
286
|
-
break;
|
287
|
-
default: return -1; /* invalid option */
|
288
|
-
}
|
289
|
-
}
|
290
|
-
return 0;
|
291
|
-
}
|
292
|
-
|
293
|
-
|
294
|
-
static int runargs (lua_State *L, char **argv, int n) {
|
295
|
-
int i;
|
296
|
-
for (i = 1; i < n; i++) {
|
297
|
-
if (argv[i] == NULL) continue;
|
298
|
-
lua_assert(argv[i][0] == '-');
|
299
|
-
switch (argv[i][1]) { /* option */
|
300
|
-
case 'e': {
|
301
|
-
const char *chunk = argv[i] + 2;
|
302
|
-
if (*chunk == '\0') chunk = argv[++i];
|
303
|
-
lua_assert(chunk != NULL);
|
304
|
-
if (dostring(L, chunk, "=(command line)") != 0)
|
305
|
-
return 1;
|
306
|
-
break;
|
307
|
-
}
|
308
|
-
case 'l': {
|
309
|
-
const char *filename = argv[i] + 2;
|
310
|
-
if (*filename == '\0') filename = argv[++i];
|
311
|
-
lua_assert(filename != NULL);
|
312
|
-
if (dolibrary(L, filename))
|
313
|
-
return 1; /* stop if file fails */
|
314
|
-
break;
|
315
|
-
}
|
316
|
-
default: break;
|
317
|
-
}
|
318
|
-
}
|
319
|
-
return 0;
|
320
|
-
}
|
321
|
-
|
322
|
-
|
323
|
-
static int handle_luainit (lua_State *L) {
|
324
|
-
const char *init = getenv(LUA_INIT);
|
325
|
-
if (init == NULL) return 0; /* status OK */
|
326
|
-
else if (init[0] == '@')
|
327
|
-
return dofile(L, init+1);
|
328
|
-
else
|
329
|
-
return dostring(L, init, "=" LUA_INIT);
|
330
|
-
}
|
331
|
-
|
332
|
-
|
333
|
-
struct Smain {
|
334
|
-
int argc;
|
335
|
-
char **argv;
|
336
|
-
int status;
|
337
|
-
};
|
338
|
-
|
339
|
-
|
340
|
-
static int pmain (lua_State *L) {
|
341
|
-
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
|
342
|
-
char **argv = s->argv;
|
343
|
-
int script;
|
344
|
-
int has_i = 0, has_v = 0, has_e = 0;
|
345
|
-
globalL = L;
|
346
|
-
if (argv[0] && argv[0][0]) progname = argv[0];
|
347
|
-
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
|
348
|
-
luaL_openlibs(L); /* open libraries */
|
349
|
-
lua_gc(L, LUA_GCRESTART, 0);
|
350
|
-
s->status = handle_luainit(L);
|
351
|
-
if (s->status != 0) return 0;
|
352
|
-
script = collectargs(argv, &has_i, &has_v, &has_e);
|
353
|
-
if (script < 0) { /* invalid args? */
|
354
|
-
print_usage();
|
355
|
-
s->status = 1;
|
356
|
-
return 0;
|
357
|
-
}
|
358
|
-
if (has_v) print_version();
|
359
|
-
s->status = runargs(L, argv, (script > 0) ? script : s->argc);
|
360
|
-
if (s->status != 0) return 0;
|
361
|
-
if (script)
|
362
|
-
s->status = handle_script(L, argv, script);
|
363
|
-
if (s->status != 0) return 0;
|
364
|
-
if (has_i)
|
365
|
-
dotty(L);
|
366
|
-
else if (script == 0 && !has_e && !has_v) {
|
367
|
-
if (lua_stdin_is_tty()) {
|
368
|
-
print_version();
|
369
|
-
dotty(L);
|
370
|
-
}
|
371
|
-
else dofile(L, NULL); /* executes stdin as a file */
|
372
|
-
}
|
373
|
-
return 0;
|
374
|
-
}
|
375
|
-
|
376
|
-
|
377
|
-
int main (int argc, char **argv) {
|
378
|
-
int status;
|
379
|
-
struct Smain s;
|
380
|
-
lua_State *L = lua_open(); /* create state */
|
381
|
-
if (L == NULL) {
|
382
|
-
l_message(argv[0], "cannot create state: not enough memory");
|
383
|
-
return EXIT_FAILURE;
|
384
|
-
}
|
385
|
-
s.argc = argc;
|
386
|
-
s.argv = argv;
|
387
|
-
status = lua_cpcall(L, &pmain, &s);
|
388
|
-
report(L, status);
|
389
|
-
lua_close(L);
|
390
|
-
return (status || s.status) ? EXIT_FAILURE : EXIT_SUCCESS;
|
391
|
-
}
|
392
|
-
|
data/lua-hooks/ext/lua/lua.def
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
EXPORTS
|
2
|
-
lua_tolstring
|
3
|
-
lua_typename
|
4
|
-
lua_pushfstring
|
5
|
-
lua_pushvfstring
|
6
|
-
lua_getlocal
|
7
|
-
lua_getupvalue
|
8
|
-
lua_setlocal
|
9
|
-
lua_setupvalue
|
10
|
-
lua_topointer
|
11
|
-
lua_iscfunction
|
12
|
-
lua_isnumber
|
13
|
-
lua_isstring
|
14
|
-
lua_isuserdata
|
15
|
-
lua_toboolean
|
16
|
-
lua_type
|
17
|
-
lua_equal
|
18
|
-
lua_lessthan
|
19
|
-
lua_rawequal
|
20
|
-
lua_checkstack
|
21
|
-
lua_cpcall
|
22
|
-
lua_error
|
23
|
-
lua_getmetatable
|
24
|
-
lua_gettop
|
25
|
-
lua_load
|
26
|
-
lua_next
|
27
|
-
lua_pcall
|
28
|
-
lua_pushthread
|
29
|
-
lua_setfenv
|
30
|
-
lua_setmetatable
|
31
|
-
lua_resume
|
32
|
-
lua_status
|
33
|
-
lua_yield
|
34
|
-
lua_dump
|
35
|
-
lua_gc
|
36
|
-
lua_gethook
|
37
|
-
lua_gethookcount
|
38
|
-
lua_gethookmask
|
39
|
-
lua_getinfo
|
40
|
-
lua_getstack
|
41
|
-
lua_sethook
|
42
|
-
lua_getallocf
|
43
|
-
lua_tocfunction
|
44
|
-
lua_atpanic
|
45
|
-
lua_tointeger
|
46
|
-
lua_tonumber
|
47
|
-
lua_tothread
|
48
|
-
lua_newstate
|
49
|
-
lua_newthread
|
50
|
-
lua_objlen
|
51
|
-
lua_touserdata
|
52
|
-
lua_close
|
53
|
-
lua_call
|
54
|
-
lua_concat
|
55
|
-
lua_createtable
|
56
|
-
lua_getfenv
|
57
|
-
lua_getfield
|
58
|
-
lua_gettable
|
59
|
-
lua_insert
|
60
|
-
lua_pushboolean
|
61
|
-
lua_pushcclosure
|
62
|
-
lua_pushinteger
|
63
|
-
lua_pushlightuserdata
|
64
|
-
lua_pushlstring
|
65
|
-
lua_pushnil
|
66
|
-
lua_pushnumber
|
67
|
-
lua_pushstring
|
68
|
-
lua_pushvalue
|
69
|
-
lua_rawget
|
70
|
-
lua_rawgeti
|
71
|
-
lua_rawset
|
72
|
-
lua_rawseti
|
73
|
-
lua_remove
|
74
|
-
lua_replace
|
75
|
-
lua_setfield
|
76
|
-
lua_settable
|
77
|
-
lua_settop
|
78
|
-
lua_xmove
|
79
|
-
lua_newuserdata
|
80
|
-
lua_setallocf
|
81
|
-
luaL_prepbuffer
|
82
|
-
luaL_checklstring
|
83
|
-
luaL_findtable
|
84
|
-
luaL_gsub
|
85
|
-
luaL_optlstring
|
86
|
-
luaL_newmetatable
|
87
|
-
luaL_argerror
|
88
|
-
luaL_callmeta
|
89
|
-
luaL_checkoption
|
90
|
-
luaL_error
|
91
|
-
luaL_getmetafield
|
92
|
-
luaL_loadbuffer
|
93
|
-
luaL_loadfile
|
94
|
-
luaL_loadstring
|
95
|
-
luaL_ref
|
96
|
-
luaL_typerror
|
97
|
-
luaL_checkinteger
|
98
|
-
luaL_optinteger
|
99
|
-
luaL_checknumber
|
100
|
-
luaL_optnumber
|
101
|
-
luaL_newstate
|
102
|
-
luaL_openlib
|
103
|
-
luaL_addlstring
|
104
|
-
luaL_addstring
|
105
|
-
luaL_addvalue
|
106
|
-
luaL_buffinit
|
107
|
-
luaL_checkany
|
108
|
-
luaL_checkstack
|
109
|
-
luaL_checktype
|
110
|
-
luaL_pushresult
|
111
|
-
luaL_register
|
112
|
-
luaL_unref
|
113
|
-
luaL_where
|
114
|
-
luaL_checkudata
|
115
|
-
luaopen_base
|
116
|
-
luaopen_debug
|
117
|
-
luaopen_io
|
118
|
-
luaopen_math
|
119
|
-
luaopen_os
|
120
|
-
luaopen_package
|
121
|
-
luaopen_string
|
122
|
-
luaopen_table
|
123
|
-
luaL_openlibs
|
124
|
-
luaU_dump
|
125
|
-
luaM_toobig
|
126
|
-
luaM_realloc_
|
127
|
-
luaS_newlstr
|
128
|
-
luaD_growstack
|
129
|
-
luaF_newproto
|
130
|
-
luaP_opmodes
|
131
|
-
luaP_opnames
|