├── .clang-format ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── README.md ├── appveyor.yml ├── build_script ├── lua_exe │ ├── CMakeLists.txt │ ├── buildLua51.ps1 │ ├── buildLua52.ps1 │ ├── buildLua53.ps1 │ ├── buildLua54.ps1 │ └── readme.md └── xlua_emmy_core │ ├── CMakeLists.txt │ └── readme.md ├── cmake ├── flags_override.cmake └── zig-build.cmake ├── docs └── EmmyLua全平台调试的一种解决方案.md ├── emmy_core ├── CMakeLists.txt └── src │ └── emmy_core.cpp ├── emmy_debugger ├── CMakeLists.txt ├── include │ └── emmy_debugger │ │ ├── api │ │ ├── lua_api.h │ │ ├── lua_api_loader.h │ │ ├── lua_state.h │ │ └── lua_version.h │ │ ├── arena │ │ └── arena.h │ │ ├── debugger │ │ ├── emmy_debugger.h │ │ ├── emmy_debugger_lib.h │ │ ├── emmy_debugger_manager.h │ │ ├── extension_point.h │ │ └── hook_state.h │ │ ├── emmy_facade.h │ │ ├── proto │ │ ├── proto.h │ │ ├── proto.ts │ │ └── proto_handler.h │ │ ├── transporter │ │ ├── pipeline_client_transporter.h │ │ ├── pipeline_server_transporter.h │ │ ├── socket_client_transporter.h │ │ ├── socket_server_transporter.h │ │ └── transporter.h │ │ └── util.h └── src │ ├── api │ ├── lua_api.cpp │ ├── lua_api_loader.cpp │ ├── lua_state.cpp │ ├── lua_state │ │ ├── lua_state_51.cpp │ │ ├── lua_state_52.cpp │ │ ├── lua_state_53.cpp │ │ ├── lua_state_54.cpp │ │ └── lua_state_jit.cpp │ └── lua_version.cpp │ ├── arena │ └── arena.cpp │ ├── debugger │ ├── emmy_debugger.cpp │ ├── emmy_debugger_lib.cpp │ ├── emmy_debugger_manager.cpp │ ├── extension_point.cpp │ └── hook_state.cpp │ ├── emmy_facade.cpp │ ├── proto │ ├── proto.cpp │ └── proto_handler.cpp │ ├── transporter │ ├── pipeline_client_transporter.cpp │ ├── pipeline_server_transporter.cpp │ ├── socket_client_transporter.cpp │ ├── socket_server_transporter.cpp │ └── transporter.cpp │ └── util.cpp ├── emmy_hook ├── CMakeLists.txt └── src │ ├── dllmain.cpp │ ├── emmy_hook.cpp │ ├── emmy_hook.h │ ├── emmy_hook.windows.cpp │ └── libpe │ ├── ReadMe.txt │ ├── htable.cpp │ ├── htable.h │ ├── libpe.cpp │ ├── libpe.h │ ├── llist.cpp │ └── llist.h ├── emmy_tool ├── CMakeLists.txt └── src │ ├── command_line.cpp │ ├── command_line.h │ ├── emmy_tool.cpp │ ├── emmy_tool.h │ ├── main.cpp │ └── windows │ ├── emmy_tool.windows.cpp │ ├── utility.cpp │ └── utility.h ├── shared ├── CMakeLists.txt ├── include │ └── shared │ │ └── shme.h └── src │ └── shme.cpp └── third-party ├── EasyHook ├── CMakeLists.txt ├── DriverShared │ ├── ASM │ │ ├── HookSpecific_x64.asm │ │ └── HookSpecific_x86.asm │ ├── Disassembler │ │ ├── libudis86 │ │ │ ├── decode.c │ │ │ ├── decode.h │ │ │ ├── extern.h │ │ │ ├── itab.c │ │ │ ├── itab.h │ │ │ ├── syn-att.c │ │ │ ├── syn-intel.c │ │ │ ├── syn.c │ │ │ ├── syn.h │ │ │ ├── types.h │ │ │ ├── udint.h │ │ │ └── udis86.c │ │ ├── udis86-LICENSE.txt │ │ ├── udis86-README.txt │ │ └── udis86.h │ ├── DriverShared.h │ ├── LocalHook │ │ ├── alloc.c │ │ ├── barrier.c │ │ ├── caller.c │ │ ├── install.c │ │ ├── reloc.c │ │ └── uninstall.c │ ├── Rtl │ │ ├── error.c │ │ └── string.c │ └── rtl.h └── EasyHookDll │ ├── AUX_ULIB.H │ ├── AUX_ULIB_x64.LIB │ ├── AUX_ULIB_x86.LIB │ ├── EasyHookDll_32.rc │ ├── EasyHookDll_64.rc │ ├── LocalHook │ ├── acl.c │ └── debug.cpp │ ├── RemoteHook │ ├── driver.cpp │ ├── entry.cpp │ ├── service.c │ ├── stealth.c │ └── thread.c │ ├── Rtl │ ├── file.c │ └── memory.c │ ├── dllmain.c │ ├── easyhook.h │ ├── gacutil.cpp │ ├── ntstatus.h │ ├── resource.h │ └── stdafx.h ├── libuv-1.46.0 ├── .gitattributes ├── .github │ ├── ISSUE_TEMPLATE.md │ ├── stale.yml │ └── workflows │ │ ├── CI-docs.yml │ │ ├── CI-sample.yml │ │ ├── CI-unix.yml │ │ ├── CI-win.yml │ │ └── sanitizer.yml ├── .gitignore ├── .mailmap ├── .readthedocs.yaml ├── AUTHORS ├── CMakeLists.txt ├── CONTRIBUTING.md ├── ChangeLog ├── LICENSE ├── LICENSE-docs ├── LICENSE-extra ├── LINKS.md ├── MAINTAINERS.md ├── Makefile.am ├── README.md ├── SUPPORTED_PLATFORMS.md ├── autogen.sh ├── cmake-toolchains │ └── cross-mingw32.cmake ├── configure.ac ├── docs │ ├── code │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── cgi │ │ │ ├── main.c │ │ │ └── tick.c │ │ ├── default-loop │ │ │ └── main.c │ │ ├── detach │ │ │ └── main.c │ │ ├── dns │ │ │ └── main.c │ │ ├── helloworld │ │ │ └── main.c │ │ ├── idle-basic │ │ │ └── main.c │ │ ├── idle-compute │ │ │ └── main.c │ │ ├── interfaces │ │ │ └── main.c │ │ ├── locks │ │ │ └── main.c │ │ ├── multi-echo-server │ │ │ ├── main.c │ │ │ └── worker.c │ │ ├── onchange │ │ │ └── main.c │ │ ├── pipe-echo-server │ │ │ └── main.c │ │ ├── plugin │ │ │ ├── hello.c │ │ │ ├── main.c │ │ │ └── plugin.h │ │ ├── proc-streams │ │ │ ├── main.c │ │ │ └── test.c │ │ ├── progress │ │ │ └── main.c │ │ ├── queue-cancel │ │ │ └── main.c │ │ ├── queue-work │ │ │ └── main.c │ │ ├── ref-timer │ │ │ └── main.c │ │ ├── signal │ │ │ └── main.c │ │ ├── spawn │ │ │ └── main.c │ │ ├── tcp-echo-server │ │ │ └── main.c │ │ ├── thread-create │ │ │ └── main.c │ │ ├── tty-gravity │ │ │ └── main.c │ │ ├── tty │ │ │ └── main.c │ │ ├── udp-dhcp │ │ │ └── main.c │ │ ├── uvcat │ │ │ └── main.c │ │ ├── uvstop │ │ │ └── main.c │ │ ├── uvtee │ │ │ └── main.c │ │ └── uvwget │ │ │ └── main.c │ ├── make.bat │ ├── requirements.txt │ └── src │ │ ├── api.rst │ │ ├── async.rst │ │ ├── check.rst │ │ ├── conf.py │ │ ├── design.rst │ │ ├── dll.rst │ │ ├── dns.rst │ │ ├── errors.rst │ │ ├── fs.rst │ │ ├── fs_event.rst │ │ ├── fs_poll.rst │ │ ├── guide.rst │ │ ├── guide │ │ ├── about.rst │ │ ├── basics.rst │ │ ├── eventloops.rst │ │ ├── filesystem.rst │ │ ├── introduction.rst │ │ ├── networking.rst │ │ ├── processes.rst │ │ ├── threads.rst │ │ └── utilities.rst │ │ ├── handle.rst │ │ ├── idle.rst │ │ ├── index.rst │ │ ├── loop.rst │ │ ├── metrics.rst │ │ ├── migration_010_100.rst │ │ ├── misc.rst │ │ ├── pipe.rst │ │ ├── poll.rst │ │ ├── prepare.rst │ │ ├── process.rst │ │ ├── request.rst │ │ ├── signal.rst │ │ ├── sphinx-plugins │ │ └── manpage.py │ │ ├── static │ │ ├── architecture.png │ │ ├── diagrams.key │ │ │ ├── Data │ │ │ │ ├── st0-311.jpg │ │ │ │ └── st1-475.jpg │ │ │ ├── Index.zip │ │ │ ├── Metadata │ │ │ │ ├── BuildVersionHistory.plist │ │ │ │ ├── DocumentIdentifier │ │ │ │ └── Properties.plist │ │ │ ├── preview-micro.jpg │ │ │ ├── preview-web.jpg │ │ │ └── preview.jpg │ │ ├── favicon.ico │ │ ├── logo.png │ │ └── loop_iteration.png │ │ ├── stream.rst │ │ ├── tcp.rst │ │ ├── threading.rst │ │ ├── threadpool.rst │ │ ├── timer.rst │ │ ├── tty.rst │ │ ├── udp.rst │ │ ├── upgrading.rst │ │ └── version.rst ├── img │ ├── banner.png │ └── logos.svg ├── include │ ├── uv.h │ └── uv │ │ ├── aix.h │ │ ├── bsd.h │ │ ├── darwin.h │ │ ├── errno.h │ │ ├── linux.h │ │ ├── os390.h │ │ ├── posix.h │ │ ├── sunos.h │ │ ├── threadpool.h │ │ ├── tree.h │ │ ├── unix.h │ │ ├── version.h │ │ └── win.h ├── libuv-static.pc.in ├── libuv.pc.in ├── m4 │ ├── .gitignore │ ├── as_case.m4 │ ├── ax_pthread.m4 │ └── libuv-check-flags.m4 ├── src │ ├── fs-poll.c │ ├── heap-inl.h │ ├── idna.c │ ├── idna.h │ ├── inet.c │ ├── queue.h │ ├── random.c │ ├── strscpy.c │ ├── strscpy.h │ ├── strtok.c │ ├── strtok.h │ ├── thread-common.c │ ├── threadpool.c │ ├── timer.c │ ├── unix │ │ ├── aix-common.c │ │ ├── aix.c │ │ ├── async.c │ │ ├── bsd-ifaddrs.c │ │ ├── bsd-proctitle.c │ │ ├── core.c │ │ ├── cygwin.c │ │ ├── darwin-proctitle.c │ │ ├── darwin-stub.h │ │ ├── darwin.c │ │ ├── dl.c │ │ ├── freebsd.c │ │ ├── fs.c │ │ ├── fsevents.c │ │ ├── getaddrinfo.c │ │ ├── getnameinfo.c │ │ ├── haiku.c │ │ ├── hurd.c │ │ ├── ibmi.c │ │ ├── internal.h │ │ ├── kqueue.c │ │ ├── linux.c │ │ ├── loop-watcher.c │ │ ├── loop.c │ │ ├── netbsd.c │ │ ├── no-fsevents.c │ │ ├── no-proctitle.c │ │ ├── openbsd.c │ │ ├── os390-proctitle.c │ │ ├── os390-syscalls.c │ │ ├── os390-syscalls.h │ │ ├── os390.c │ │ ├── pipe.c │ │ ├── poll.c │ │ ├── posix-hrtime.c │ │ ├── posix-poll.c │ │ ├── process.c │ │ ├── procfs-exepath.c │ │ ├── proctitle.c │ │ ├── qnx.c │ │ ├── random-devurandom.c │ │ ├── random-getentropy.c │ │ ├── random-getrandom.c │ │ ├── random-sysctl-linux.c │ │ ├── signal.c │ │ ├── stream.c │ │ ├── sunos.c │ │ ├── sysinfo-loadavg.c │ │ ├── sysinfo-memory.c │ │ ├── tcp.c │ │ ├── thread.c │ │ ├── tty.c │ │ └── udp.c │ ├── uv-common.c │ ├── uv-common.h │ ├── uv-data-getter-setters.c │ ├── version.c │ └── win │ │ ├── async.c │ │ ├── atomicops-inl.h │ │ ├── core.c │ │ ├── detect-wakeup.c │ │ ├── dl.c │ │ ├── error.c │ │ ├── fs-event.c │ │ ├── fs-fd-hash-inl.h │ │ ├── fs.c │ │ ├── getaddrinfo.c │ │ ├── getnameinfo.c │ │ ├── handle-inl.h │ │ ├── handle.c │ │ ├── internal.h │ │ ├── loop-watcher.c │ │ ├── pipe.c │ │ ├── poll.c │ │ ├── process-stdio.c │ │ ├── process.c │ │ ├── req-inl.h │ │ ├── signal.c │ │ ├── snprintf.c │ │ ├── stream-inl.h │ │ ├── stream.c │ │ ├── tcp.c │ │ ├── thread.c │ │ ├── tty.c │ │ ├── udp.c │ │ ├── util.c │ │ ├── winapi.c │ │ ├── winapi.h │ │ ├── winsock.c │ │ └── winsock.h ├── test │ ├── benchmark-async-pummel.c │ ├── benchmark-async.c │ ├── benchmark-fs-stat.c │ ├── benchmark-getaddrinfo.c │ ├── benchmark-list.h │ ├── benchmark-loop-count.c │ ├── benchmark-million-async.c │ ├── benchmark-million-timers.c │ ├── benchmark-multi-accept.c │ ├── benchmark-ping-pongs.c │ ├── benchmark-ping-udp.c │ ├── benchmark-pound.c │ ├── benchmark-pump.c │ ├── benchmark-queue-work.c │ ├── benchmark-sizes.c │ ├── benchmark-spawn.c │ ├── benchmark-tcp-write-batch.c │ ├── benchmark-thread.c │ ├── benchmark-udp-pummel.c │ ├── blackhole-server.c │ ├── echo-server.c │ ├── fixtures │ │ ├── empty_file │ │ ├── load_error.node │ │ ├── lorem_ipsum.txt │ │ └── one_file │ │ │ └── one_file │ ├── run-benchmarks.c │ ├── run-tests.c │ ├── runner-unix.c │ ├── runner-unix.h │ ├── runner-win.c │ ├── runner-win.h │ ├── runner.c │ ├── runner.h │ ├── task.h │ ├── test-active.c │ ├── test-async-null-cb.c │ ├── test-async.c │ ├── test-barrier.c │ ├── test-callback-stack.c │ ├── test-close-fd.c │ ├── test-close-order.c │ ├── test-condvar.c │ ├── test-connect-unspecified.c │ ├── test-connection-fail.c │ ├── test-cwd-and-chdir.c │ ├── test-default-loop-close.c │ ├── test-delayed-accept.c │ ├── test-dlerror.c │ ├── test-eintr-handling.c │ ├── test-embed.c │ ├── test-emfile.c │ ├── test-env-vars.c │ ├── test-error.c │ ├── test-fail-always.c │ ├── test-fork.c │ ├── test-fs-copyfile.c │ ├── test-fs-event.c │ ├── test-fs-fd-hash.c │ ├── test-fs-open-flags.c │ ├── test-fs-poll.c │ ├── test-fs-readdir.c │ ├── test-fs.c │ ├── test-get-currentexe.c │ ├── test-get-loadavg.c │ ├── test-get-memory.c │ ├── test-get-passwd.c │ ├── test-getaddrinfo.c │ ├── test-gethostname.c │ ├── test-getnameinfo.c │ ├── test-getsockname.c │ ├── test-getters-setters.c │ ├── test-gettimeofday.c │ ├── test-handle-fileno.c │ ├── test-homedir.c │ ├── test-hrtime.c │ ├── test-idle.c │ ├── test-idna.c │ ├── test-ip-name.c │ ├── test-ip4-addr.c │ ├── test-ip6-addr.c │ ├── test-ipc-heavy-traffic-deadlock-bug.c │ ├── test-ipc-send-recv.c │ ├── test-ipc.c │ ├── test-list.h │ ├── test-loop-alive.c │ ├── test-loop-close.c │ ├── test-loop-configure.c │ ├── test-loop-handles.c │ ├── test-loop-stop.c │ ├── test-loop-time.c │ ├── test-metrics.c │ ├── test-multiple-listen.c │ ├── test-mutexes.c │ ├── test-not-readable-nor-writable-on-read-error.c │ ├── test-not-writable-after-shutdown.c │ ├── test-osx-select.c │ ├── test-pass-always.c │ ├── test-ping-pong.c │ ├── test-pipe-bind-error.c │ ├── test-pipe-close-stdout-read-stdin.c │ ├── test-pipe-connect-error.c │ ├── test-pipe-connect-multiple.c │ ├── test-pipe-connect-prepare.c │ ├── test-pipe-getsockname.c │ ├── test-pipe-pending-instances.c │ ├── test-pipe-sendmsg.c │ ├── test-pipe-server-close.c │ ├── test-pipe-set-fchmod.c │ ├── test-pipe-set-non-blocking.c │ ├── test-platform-output.c │ ├── test-poll-close-doesnt-corrupt-stack.c │ ├── test-poll-close.c │ ├── test-poll-closesocket.c │ ├── test-poll-multiple-handles.c │ ├── test-poll-oob.c │ ├── test-poll.c │ ├── test-process-priority.c │ ├── test-process-title-threadsafe.c │ ├── test-process-title.c │ ├── test-queue-foreach-delete.c │ ├── test-random.c │ ├── test-readable-on-eof.c │ ├── test-ref.c │ ├── test-run-nowait.c │ ├── test-run-once.c │ ├── test-semaphore.c │ ├── test-shutdown-close.c │ ├── test-shutdown-eof.c │ ├── test-shutdown-simultaneous.c │ ├── test-shutdown-twice.c │ ├── test-signal-multiple-loops.c │ ├── test-signal-pending-on-close.c │ ├── test-signal.c │ ├── test-socket-buffer-size.c │ ├── test-spawn.c │ ├── test-stdio-over-pipes.c │ ├── test-strscpy.c │ ├── test-strtok.c │ ├── test-tcp-alloc-cb-fail.c │ ├── test-tcp-bind-error.c │ ├── test-tcp-bind6-error.c │ ├── test-tcp-close-accept.c │ ├── test-tcp-close-after-read-timeout.c │ ├── test-tcp-close-reset.c │ ├── test-tcp-close-while-connecting.c │ ├── test-tcp-close.c │ ├── test-tcp-connect-error-after-write.c │ ├── test-tcp-connect-error.c │ ├── test-tcp-connect-timeout.c │ ├── test-tcp-connect6-error.c │ ├── test-tcp-create-socket-early.c │ ├── test-tcp-flags.c │ ├── test-tcp-oob.c │ ├── test-tcp-open.c │ ├── test-tcp-read-stop-start.c │ ├── test-tcp-read-stop.c │ ├── test-tcp-rst.c │ ├── test-tcp-shutdown-after-write.c │ ├── test-tcp-try-write-error.c │ ├── test-tcp-try-write.c │ ├── test-tcp-unexpected-read.c │ ├── test-tcp-write-after-connect.c │ ├── test-tcp-write-fail.c │ ├── test-tcp-write-in-a-row.c │ ├── test-tcp-write-queue-order.c │ ├── test-tcp-write-to-half-open-connection.c │ ├── test-tcp-writealot.c │ ├── test-test-macros.c │ ├── test-thread-affinity.c │ ├── test-thread-equal.c │ ├── test-thread.c │ ├── test-threadpool-cancel.c │ ├── test-threadpool.c │ ├── test-timer-again.c │ ├── test-timer-from-check.c │ ├── test-timer.c │ ├── test-tmpdir.c │ ├── test-tty-duplicate-key.c │ ├── test-tty-escape-sequence-processing.c │ ├── test-tty.c │ ├── test-udp-alloc-cb-fail.c │ ├── test-udp-bind.c │ ├── test-udp-connect.c │ ├── test-udp-connect6.c │ ├── test-udp-create-socket-early.c │ ├── test-udp-dgram-too-big.c │ ├── test-udp-ipv6.c │ ├── test-udp-mmsg.c │ ├── test-udp-multicast-interface.c │ ├── test-udp-multicast-interface6.c │ ├── test-udp-multicast-join.c │ ├── test-udp-multicast-join6.c │ ├── test-udp-multicast-ttl.c │ ├── test-udp-open.c │ ├── test-udp-options.c │ ├── test-udp-recv-in-a-row.c │ ├── test-udp-send-and-recv.c │ ├── test-udp-send-hang-loop.c │ ├── test-udp-send-immediate.c │ ├── test-udp-send-unreachable.c │ ├── test-udp-sendmmsg-error.c │ ├── test-udp-try-send.c │ ├── test-uname.c │ ├── test-walk-handles.c │ └── test-watcher-cross-stop.c ├── tools │ ├── make_dist_html.py │ └── vswhere_usability_wrapper.cmd ├── tsansupp.txt └── uv_win_longpath.manifest ├── lua-5.1.5 ├── CMakeLists.txt ├── COPYRIGHT ├── HISTORY ├── INSTALL ├── Makefile ├── README ├── doc │ ├── contents.html │ ├── cover.png │ ├── logo.gif │ ├── lua.1 │ ├── lua.css │ ├── lua.html │ ├── luac.1 │ ├── luac.html │ ├── manual.css │ ├── manual.html │ └── readme.html ├── etc │ ├── Makefile │ ├── README │ ├── all.c │ ├── lua.hpp │ ├── lua.ico │ ├── lua.pc │ ├── luavs.bat │ ├── min.c │ ├── noparser.c │ └── strict.lua ├── src │ ├── Makefile │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lcode.c │ ├── lcode.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ ├── lzio.h │ └── print.c └── test │ ├── README │ ├── bisect.lua │ ├── cf.lua │ ├── echo.lua │ ├── env.lua │ ├── factorial.lua │ ├── fib.lua │ ├── fibfor.lua │ ├── globals.lua │ ├── hello.lua │ ├── life.lua │ ├── luac.lua │ ├── printf.lua │ ├── readonly.lua │ ├── sieve.lua │ ├── sort.lua │ ├── table.lua │ ├── trace-calls.lua │ ├── trace-globals.lua │ └── xd.lua ├── lua-5.2.4 ├── CMakeLists.txt ├── Makefile ├── README ├── doc │ ├── contents.html │ ├── logo.gif │ ├── lua.1 │ ├── lua.css │ ├── luac.1 │ ├── manual.css │ ├── manual.html │ ├── osi-certified-72x60.png │ └── readme.html └── src │ ├── Makefile │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lbitlib.c │ ├── lcode.c │ ├── lcode.h │ ├── lcorolib.c │ ├── lctype.c │ ├── lctype.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── lua.hpp │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ └── lzio.h ├── lua-5.3.5 ├── CMakeLists.txt ├── Makefile ├── README ├── doc │ ├── contents.html │ ├── index.css │ ├── logo.gif │ ├── lua.1 │ ├── lua.css │ ├── luac.1 │ ├── manual.css │ ├── manual.html │ ├── osi-certified-72x60.png │ └── readme.html └── src │ ├── Makefile │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lbitlib.c │ ├── lcode.c │ ├── lcode.h │ ├── lcorolib.c │ ├── lctype.c │ ├── lctype.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lprefix.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── lua.hpp │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lutf8lib.c │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ └── lzio.h ├── lua-5.4.6 ├── CMakeLists.txt ├── Makefile ├── README ├── doc │ ├── contents.html │ ├── index.css │ ├── logo.gif │ ├── lua.1 │ ├── lua.css │ ├── luac.1 │ ├── manual.css │ ├── manual.html │ ├── osi-certified-72x60.png │ └── readme.html └── src │ ├── Makefile │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lcode.c │ ├── lcode.h │ ├── lcorolib.c │ ├── lctype.c │ ├── lctype.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── ljumptab.h │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── lopnames.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lprefix.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── lua.hpp │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lutf8lib.c │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ └── lzio.h ├── luajit └── README.txt └── nlohmann ├── LICENSE.MIT └── include └── nlohmann ├── adl_serializer.hpp ├── byte_container_with_subtype.hpp ├── detail ├── conversions │ ├── from_json.hpp │ ├── to_chars.hpp │ └── to_json.hpp ├── exceptions.hpp ├── hash.hpp ├── input │ ├── binary_reader.hpp │ ├── input_adapters.hpp │ ├── json_sax.hpp │ ├── lexer.hpp │ ├── parser.hpp │ └── position_t.hpp ├── iterators │ ├── internal_iterator.hpp │ ├── iter_impl.hpp │ ├── iteration_proxy.hpp │ ├── iterator_traits.hpp │ ├── json_reverse_iterator.hpp │ └── primitive_iterator.hpp ├── json_pointer.hpp ├── json_ref.hpp ├── macro_scope.hpp ├── macro_unscope.hpp ├── meta │ ├── call_std │ │ ├── begin.hpp │ │ └── end.hpp │ ├── cpp_future.hpp │ ├── detected.hpp │ ├── identity_tag.hpp │ ├── is_sax.hpp │ ├── type_traits.hpp │ └── void_t.hpp ├── output │ ├── binary_writer.hpp │ ├── output_adapters.hpp │ └── serializer.hpp ├── string_escape.hpp └── value_t.hpp ├── json.hpp ├── json_fwd.hpp ├── ordered_map.hpp └── thirdparty └── hedley ├── hedley.hpp └── hedley_undef.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | build 3 | .vs 4 | out 5 | build_script 6 | cmake-build-debug 7 | cmake-build-release 8 | .idea 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | os: 3 | - osx 4 | - linux 5 | script: 6 | - mkdir build 7 | - cd build 8 | - cmake -DCMAKE_BUILD_TYPE=Release ../ 9 | - make install 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EmmyLuaDebugger 2 | OS | CI status 3 | ---------- | ---------- 4 | MAC & Linux|[![Build Status](https://travis-ci.org/EmmyLua/EmmyLuaDebugger.svg?branch=master)](https://travis-ci.org/EmmyLua/EmmyLuaDebugger) 5 | Windows|[![Build status](https://ci.appveyor.com/api/projects/status/dp7yb09v07lq80t7?svg=true)](https://ci.appveyor.com/project/EmmyLua/emmyluadebugger) 6 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.2.0.{build} 2 | image: Visual Studio 2017 3 | build_script: 4 | - cmd: >- 5 | mkdir x86 6 | 7 | cd x86 8 | 9 | cmake ../ 10 | 11 | cmake --build . --config RelWithDebInfo --target install 12 | 13 | cd ../ 14 | 15 | mkdir x64 16 | 17 | cd x64 18 | 19 | cmake ../ -G "Visual Studio 15 2017 Win64" 20 | 21 | cmake --build . --config RelWithDebInfo --target install 22 | 23 | artifacts: 24 | - path: x64/install/bin 25 | name: emmy_core@x64 26 | - path: x86/install/bin 27 | name: emmy_core@x86 28 | -------------------------------------------------------------------------------- /build_script/lua_exe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.11) 2 | 3 | project (lua) 4 | 5 | add_executable(lua) 6 | 7 | set(EMMY_LUA_VERSION "54" CACHE STRING "Lua version: 51/52/53/54") 8 | 9 | if(${EMMY_LUA_VERSION} STREQUAL "54") 10 | set(EMMY_LUA_DIR "lua-5.4.0") 11 | elseif(${EMMY_LUA_VERSION} STREQUAL "53") 12 | set(EMMY_LUA_DIR "lua-5.3.5") 13 | elseif(${EMMY_LUA_VERSION} STREQUAL "52") 14 | set(EMMY_LUA_DIR "lua-5.2.4") 15 | elseif(${EMMY_LUA_VERSION} STREQUAL "51") 16 | set(EMMY_LUA_DIR "lua-5.1.5") 17 | endif() 18 | 19 | option(LUA_BUILD_AS_DLL "USE" ON) 20 | set(lua_dll_SOURCE_DIR "../../third-party/${EMMY_LUA_DIR}") 21 | 22 | add_subdirectory("${lua_dll_SOURCE_DIR}" luadll.out) 23 | 24 | add_dependencies(lua "lua${EMMY_LUA_VERSION}") 25 | 26 | target_sources(lua PUBLIC 27 | 28 | #SOURCES 29 | ${lua_dll_SOURCE_DIR}/src/lua.c 30 | ) 31 | 32 | target_link_libraries(lua "lua${EMMY_LUA_VERSION}") 33 | 34 | 35 | install( 36 | TARGETS lua 37 | LIBRARY DESTINATION ./ 38 | RUNTIME DESTINATION ./ 39 | ) 40 | 41 | install( 42 | TARGETS "lua${EMMY_LUA_VERSION}" 43 | LIBRARY DESTINATION ./ 44 | RUNTIME DESTINATION ./ 45 | ) -------------------------------------------------------------------------------- /build_script/lua_exe/buildLua51.ps1: -------------------------------------------------------------------------------- 1 | mkdir buildLua51 2 | cd buildLua51 3 | cmake .. -A x64 -DEMMY_LUA_VERSION=51 4 | cmake --build . --config Debug 5 | cmake --install . --config Debug --prefix ../Lua51 6 | cd .. -------------------------------------------------------------------------------- /build_script/lua_exe/buildLua52.ps1: -------------------------------------------------------------------------------- 1 | mkdir buildLua52 2 | cd buildLua52 3 | cmake .. -A x64 -DEMMY_LUA_VERSION=52 4 | cmake --build . --config Debug 5 | cmake --install . --config Debug --prefix ../Lua52 6 | cd .. -------------------------------------------------------------------------------- /build_script/lua_exe/buildLua53.ps1: -------------------------------------------------------------------------------- 1 | mkdir buildLua53 2 | cd buildLua53 3 | cmake .. -A x64 -DEMMY_LUA_VERSION=53 4 | cmake --build . --config Debug 5 | cmake --install . --config Debug --prefix ../Lua53 6 | cd .. -------------------------------------------------------------------------------- /build_script/lua_exe/buildLua54.ps1: -------------------------------------------------------------------------------- 1 | mkdir buildLua54 2 | cd buildLua54 3 | cmake .. -A x64 -DEMMY_LUA_VERSION=54 4 | cmake --build . --config Debug 5 | cmake --install . --config Debug --prefix ../Lua54 6 | cd .. -------------------------------------------------------------------------------- /build_script/lua_exe/readme.md: -------------------------------------------------------------------------------- 1 | 如果你希望编译lua解释器,并且这个解释器能够被emmylua 调试,那么只需要按照标准的方式先编译出lua dll 再链接生成lua可执行文件就行了。 2 | 这里提供简单的powershell脚本 3 | 4 | Q:如果我希望编译linux 和macosx下的lua解释器怎么做? 5 | A:自己改个后缀为.sh 再改下换行为LF 就能用了 -------------------------------------------------------------------------------- /build_script/xlua_emmy_core/readme.md: -------------------------------------------------------------------------------- 1 | 如果希望将emmylua 调试器静态集成进项目(比如远程调试手机)可以参考这里 2 | 3 | 这里以xlua为例 4 | 1.在下载xlua源代码 5 | 2.将emmylua调试器目录复制到xlua源代码build目录下取名EmmyDebugger 6 | 3.到build目录下打开CMakeLists.txt在最下面加上 7 | 8 | add_subdirectory(EmmyDebugger/build_script/xlua_emmy_core) 9 | add_dependencies(xlua emmy_core) 10 | target_link_libraries(xlua PRIVATE emmy_core) 11 | 12 | 之后就可以通过xlua的各种构建脚本编译出对应的带emmy_core 调试器的xlua了 13 | 5.构建完之后复制xlua.dll/libxlua.so到unity对应的目录中 14 | 6.在自己的C#代码中加上 15 | 16 | ```C# 17 | 18 | namespace LuaDLL 19 | { 20 | public partial class Lua 21 | { 22 | [DllImport("xlua", CallingConvention = CallingConvention.Cdecl)] 23 | public static extern int luaopen_emmy_core(System.IntPtr L); 24 | 25 | [MonoPInvokeCallback(typeof(lua_CSFunction))] 26 | public static int LoadEmmyCore(System.IntPtr L) 27 | { 28 | return luaopen_emmy_core(L); 29 | } 30 | } 31 | } 32 | ``` 33 | 34 | 并且在创建LuaEnv实例之后加上 35 | 36 | luaEnv.AddBuildin("emmy_core",LuaDLL.Lua.LoadEmmyCore); 37 | 38 | 就可以在其他平台使用emmy_core调试了 -------------------------------------------------------------------------------- /cmake/flags_override.cmake: -------------------------------------------------------------------------------- 1 | # see https://cloud.tencent.com/developer/article/1011688 2 | if(MSVC) 3 | # Use the static C library for all build types 4 | MESSAGE(STATUS "link to static C and C++ runtime lirbary(/MT /MTd)") 5 | foreach(var 6 | CMAKE_C_FLAGS_DEBUG_INIT 7 | CMAKE_C_FLAGS_RELEASE_INIT 8 | CMAKE_C_FLAGS_MINSIZEREL_INIT 9 | CMAKE_C_FLAGS_RELWITHDEBINFO_INIT 10 | CMAKE_CXX_FLAGS_DEBUG_INIT 11 | CMAKE_CXX_FLAGS_RELEASE_INIT 12 | CMAKE_CXX_FLAGS_MINSIZEREL_INIT 13 | CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT 14 | ) 15 | if(${var} MATCHES "/MD") 16 | string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}") 17 | MESSAGE(STATUS "${var}:${${var}}") 18 | endif() 19 | endforeach() 20 | endif(MSVC) 21 | -------------------------------------------------------------------------------- /emmy_core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | project(emmy_core) 4 | 5 | add_library(emmy_core SHARED) 6 | 7 | add_dependencies( 8 | emmy_core 9 | emmy_debugger 10 | ) 11 | 12 | set_target_properties(emmy_core PROPERTIES PREFIX "") 13 | 14 | target_include_directories(emmy_core 15 | PRIVATE src 16 | ) 17 | 18 | target_sources(emmy_core PRIVATE 19 | src/emmy_core.cpp 20 | ) 21 | 22 | target_link_libraries( 23 | emmy_core 24 | PRIVATE emmy_debugger 25 | ) 26 | 27 | install( 28 | TARGETS emmy_core 29 | LIBRARY DESTINATION bin 30 | RUNTIME DESTINATION bin 31 | ) -------------------------------------------------------------------------------- /emmy_core/src/emmy_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "emmy_debugger/debugger/emmy_debugger_lib.h" 18 | #include "emmy_debugger/emmy_facade.h" 19 | #ifdef _MSC_VER 20 | #define EMMY_CORE_EXPORT __declspec(dllexport) 21 | #else 22 | #define EMMY_CORE_EXPORT extern 23 | #endif 24 | 25 | static const luaL_Reg lib[] = { 26 | {"tcpListen", tcpListen}, 27 | {"tcpConnect", tcpConnect}, 28 | {"pipeListen", pipeListen}, 29 | {"pipeConnect", pipeConnect}, 30 | {"waitIDE", waitIDE}, 31 | {"breakHere", breakHere}, 32 | {"stop", stop}, 33 | {"tcpSharedListen", tcpSharedListen}, 34 | {"registerTypeName", registerTypeName}, 35 | {nullptr, nullptr} 36 | }; 37 | 38 | extern "C" { 39 | EMMY_CORE_EXPORT int luaopen_emmy_core(struct lua_State* L) { 40 | EmmyFacade::Get().SetWorkMode(WorkMode::EmmyCore); 41 | if (!install_emmy_debugger(L)) 42 | return false; 43 | luaL_newlibtable(L, lib); 44 | luaL_setfuncs(L, lib, 0); 45 | 46 | // _G.emmy_core 47 | lua_pushglobaltable(L); 48 | lua_pushstring(L, "emmy_core"); 49 | lua_pushvalue(L, -3); 50 | lua_rawset(L, -3); 51 | lua_pop(L, 1); 52 | 53 | return 1; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/api/lua_state.h: -------------------------------------------------------------------------------- 1 |  2 | #include 3 | typedef struct lua_State lua_State; 4 | 5 | std::vector FindAllCoroutine(lua_State* L); 6 | 7 | std::vector FindAllCoroutine_lua51(lua_State* L); 8 | 9 | std::vector FindAllCoroutine_lua52(lua_State* L); 10 | 11 | std::vector FindAllCoroutine_lua53(lua_State* L); 12 | 13 | std::vector FindAllCoroutine_lua54(lua_State* L); 14 | 15 | // std::vector FindAllCoroutine_luaJIT(lua_State* L); 16 | 17 | lua_State* GetMainState(lua_State* L); 18 | 19 | lua_State* GetMainState_lua54(lua_State* L); 20 | 21 | lua_State* GetMainState_lua53(lua_State* L); 22 | 23 | lua_State* GetMainState_lua52(lua_State* L); 24 | 25 | lua_State* GetMainState_lua51(lua_State* L); 26 | 27 | lua_State* GetMainState_luaJIT(lua_State* L); 28 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/api/lua_version.h: -------------------------------------------------------------------------------- 1 |  2 | #pragma once 3 | 4 | // lua version 5 | enum class LuaVersion { 6 | UNKNOWN, 7 | LUA_JIT = 50, 8 | LUA_51 = 51, 9 | LUA_52 = 52, 10 | LUA_53 = 53, 11 | LUA_54 = 54, 12 | }; 13 | 14 | extern LuaVersion luaVersion; -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/arena/arena.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | template 9 | class Arena; 10 | 11 | 12 | 13 | template 14 | struct Idx { 15 | using ArenaClass = Arena; 16 | 17 | Idx() 18 | : Raw(0), _arena(nullptr) { 19 | } 20 | 21 | Idx(uint32_t raw, ArenaClass *arena) 22 | : Raw(raw), 23 | _arena(arena) { 24 | } 25 | 26 | T &operator*() { 27 | return _arena->Index(*this); 28 | } 29 | 30 | T *operator->() { 31 | return &(_arena->Index(*this)); 32 | } 33 | 34 | 35 | ArenaClass *GetArena() { 36 | return _arena; 37 | } 38 | 39 | uint32_t Raw; 40 | 41 | private: 42 | ArenaClass *_arena; 43 | }; 44 | 45 | template 46 | class Arena { 47 | public: 48 | T &Index(Idx id) { 49 | if (id.Raw < _data.size()) { 50 | return _data[id.Raw]; 51 | } 52 | throw std::runtime_error("index out of range"); 53 | } 54 | 55 | Idx Alloc() { 56 | uint32_t rawId = static_cast(_data.size()); 57 | _data.emplace_back(); 58 | return Idx(rawId, this); 59 | } 60 | 61 | void Clear() { 62 | _data.clear(); 63 | } 64 | 65 | private: 66 | std::vector _data; 67 | }; 68 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/debugger/emmy_debugger_lib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "emmy_debugger/api/lua_api.h" 4 | #include "emmy_debugger/proto/proto.h" 5 | 6 | bool query_variable(lua_State* L, std::shared_ptr variable, const char* typeName, int object, int depth); 7 | 8 | // emmy.tcpListen(host: string, port: int): bool 9 | int tcpListen(struct lua_State* L); 10 | 11 | // emmy.tcpConnect(host: string, port: int): bool 12 | int tcpConnect(lua_State* L); 13 | 14 | // emmy.pipeListen(pipeName: string): bool 15 | int pipeListen(lua_State* L); 16 | 17 | // emmy.pipeConnect(pipeName: string): bool 18 | int pipeConnect(lua_State* L); 19 | 20 | // emmy.breakHere(): bool 21 | int breakHere(lua_State* L); 22 | 23 | // emmy.waitIDE(timeout: number): void 24 | int waitIDE(lua_State* L); 25 | 26 | int tcpSharedListen(lua_State* L); 27 | 28 | // emmy.stop() 29 | int stop(lua_State* L); 30 | 31 | // emmy.registerTypeName(typeName: string): bool 32 | int registerTypeName(lua_State* L); 33 | 34 | bool install_emmy_debugger(struct lua_State* L); 35 | 36 | std::string prepareEvalExpr(const std::string& eval); 37 | 38 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/debugger/extension_point.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "emmy_debugger/api/lua_api.h" 5 | #include "emmy_debugger/proto/proto.h" 6 | 7 | class ExtensionPoint { 8 | public: 9 | static std::string ExtensionTable; 10 | 11 | ExtensionPoint(); 12 | 13 | void Initialize(lua_State *L); 14 | // 15 | bool QueryVariable(lua_State *L, Idx variable, const char *typeName, int object, int depth); 16 | bool QueryVariableCustom(lua_State *L, Idx variable, const char *typeName, int object, int depth); 17 | 18 | lua_State *QueryParentThread(lua_State *L); 19 | 20 | private: 21 | bool QueryVariableGeneric(lua_State *L, Idx variable, const char *typeName, int object, int depth, const char* queryFunction); 22 | }; 23 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/proto/proto_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "proto.h" 3 | #include "nlohmann/json_fwd.hpp" 4 | 5 | class EmmyFacade; 6 | 7 | class ProtoHandler { 8 | public: 9 | explicit ProtoHandler(EmmyFacade *owner); 10 | 11 | void OnDispatch(nlohmann::json params); 12 | 13 | private: 14 | void OnInitReq(InitParams ¶ms); 15 | 16 | void OnReadyReq(); 17 | 18 | void OnAddBreakPointReq(AddBreakpointParams ¶ms); 19 | 20 | void OnRemoveBreakPointReq(RemoveBreakpointParams ¶ms); 21 | 22 | void OnActionReq(ActionParams& params); 23 | 24 | void OnEvalReq(EvalParams& params); 25 | 26 | EmmyFacade *_owner; 27 | }; 28 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/transporter/pipeline_client_transporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | #include "uv.h" 20 | #include "transporter.h" 21 | 22 | class PipelineClientTransporter : public Transporter { 23 | uv_pipe_t uvClient; 24 | std::mutex mutex; 25 | std::condition_variable cv; 26 | public: 27 | PipelineClientTransporter(); 28 | ~PipelineClientTransporter(); 29 | 30 | bool Connect(const std::string& name, std::string& err); 31 | int Stop() override; 32 | void Send(int cmd, const char* data, size_t len) override; 33 | void OnPipeConnection(uv_connect_t* req, int status); 34 | }; 35 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/transporter/pipeline_server_transporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "uv.h" 3 | #include "transporter.h" 4 | 5 | class PipelineServerTransporter : public Transporter { 6 | uv_pipe_t uvServer; 7 | uv_pipe_t* uvClient; 8 | public: 9 | PipelineServerTransporter(); 10 | ~PipelineServerTransporter(); 11 | 12 | bool pipe(const std::string& name, std::string& err); 13 | int Stop() override; 14 | void Send(int cmd, const char* data, size_t len) override; 15 | void OnPipeConnection(uv_stream_t* pipe, int status); 16 | }; 17 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/transporter/socket_client_transporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | #include 18 | #include 19 | #include "uv.h" 20 | #include "transporter.h" 21 | 22 | class SocketClientTransporter : public Transporter { 23 | uv_tcp_t uvClient; 24 | uv_connect_t connect_req; 25 | std::mutex mutex; 26 | std::condition_variable cv; 27 | int connectionStatus; 28 | public: 29 | SocketClientTransporter(); 30 | ~SocketClientTransporter(); 31 | 32 | bool Connect(const std::string& host, int port, std::string& err); 33 | int Stop() override; 34 | void Send(int cmd, const char* data, size_t len) override; 35 | void OnConnection(uv_connect_t* req, int status); 36 | }; 37 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/transporter/socket_server_transporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | #include "uv.h" 18 | #include "transporter.h" 19 | 20 | class SocketServerTransporter : public Transporter { 21 | uv_tcp_t uvServer; 22 | uv_stream_t* uvClient; 23 | public: 24 | SocketServerTransporter(); 25 | ~SocketServerTransporter(); 26 | void OnNewConnection(uv_stream_t* server, int status); 27 | bool Listen(const std::string& host, int port, std::string& err); 28 | void Send(const char* data, size_t len); 29 | private: 30 | int Stop() override; 31 | void Send(int cmd, const char* data, size_t len) override; 32 | void OnDisconnect() override; 33 | }; 34 | -------------------------------------------------------------------------------- /emmy_debugger/include/emmy_debugger/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // 等于0表示相等 5 | bool CompareIgnoreCase(const std::string &lh, const std::string &rh); 6 | 7 | struct CaseInsensitiveLess final { 8 | bool operator()(const std::string &lhs, const std::string &rhs) const; 9 | }; 10 | 11 | // 直到C++ 20才有endwith,这里自己写一个 12 | bool EndWith(const std::string &source, const std::string &end); 13 | 14 | 15 | -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_api.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | 19 | #ifdef EMMY_USE_LUA_SOURCE 20 | #if defined(EMMY_LUA_51) || defined(EMMY_LUA_JIT) 21 | #include "emmy_debugger/api/lua_api.h" 22 | int lua_absindex(lua_State *L, int idx) { 23 | if (idx > 0) { 24 | return idx; 25 | } 26 | return lua_gettop(L) + idx + 1; 27 | } 28 | #ifndef EMMY_LUA_JIT_SUPPORT_LUA_SETFUNCS 29 | void luaL_setfuncs(lua_State* L, const luaL_Reg* l, int nup) { 30 | for (; l->name != nullptr; l++) { 31 | for (int i = 0; i < nup; i++) 32 | lua_pushvalue(L, -nup); 33 | lua_pushcclosure(L, l->func, nup); 34 | lua_setfield(L, -(nup + 2), l->name); 35 | } 36 | } 37 | #endif 38 | 39 | void lua_pushglobaltable(lua_State* L) 40 | { 41 | lua_pushvalue(L, LUA_GLOBALSINDEX); 42 | } 43 | 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_state/lua_state_51.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_state.h" 2 | #ifdef EMMY_USE_LUA_SOURCE 3 | #include "lstate.h" 4 | #else 5 | #include "lua-5.1.5/src/lstate.h" 6 | #endif 7 | 8 | 9 | lua_State* GetMainState_lua51(lua_State* L) 10 | { 11 | return G(L)->mainthread; 12 | } 13 | 14 | 15 | std::vector FindAllCoroutine_lua51(lua_State* L) 16 | { 17 | std::vector result; 18 | auto head = G(L)->rootgc; 19 | 20 | while (head) 21 | { 22 | if (head->gch.tt == LUA_TTHREAD) 23 | { 24 | result.push_back(reinterpret_cast(head)); 25 | } 26 | head = head->gch.next; 27 | } 28 | 29 | return result; 30 | } -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_state/lua_state_52.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_state.h" 2 | 3 | #ifdef EMMY_USE_LUA_SOURCE 4 | #include "lstate.h" 5 | #else 6 | #include "lua-5.2.4/src/lstate.h" 7 | #endif 8 | 9 | lua_State* GetMainState_lua52(lua_State* L) 10 | { 11 | return G(L)->mainthread; 12 | } 13 | 14 | 15 | std::vector FindAllCoroutine_lua52(lua_State* L) 16 | { 17 | std::vector result; 18 | auto head = G(L)->allgc; 19 | 20 | while (head) 21 | { 22 | if (head->gch.tt == LUA_TTHREAD) 23 | { 24 | result.push_back(reinterpret_cast(head)); 25 | } 26 | head = head->gch.next; 27 | } 28 | 29 | return result; 30 | } -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_state/lua_state_53.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_state.h" 2 | #ifdef EMMY_USE_LUA_SOURCE 3 | #include "lstate.h" 4 | #else 5 | #include "lua-5.3.5/src/lstate.h" 6 | #endif 7 | 8 | lua_State* GetMainState_lua53(lua_State* L) 9 | { 10 | return G(L)->mainthread; 11 | } 12 | 13 | 14 | std::vector FindAllCoroutine_lua53(lua_State* L) 15 | { 16 | std::vector result; 17 | auto head = G(L)->allgc; 18 | 19 | while (head) 20 | { 21 | if (head->tt == LUA_TTHREAD) 22 | { 23 | result.push_back(reinterpret_cast(head)); 24 | } 25 | head = head->next; 26 | } 27 | 28 | return result; 29 | } -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_state/lua_state_54.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_state.h" 2 | #ifdef EMMY_USE_LUA_SOURCE 3 | #include "lstate.h" 4 | #else 5 | #include "lua-5.4.6/src/lstate.h" 6 | #endif 7 | 8 | lua_State* GetMainState_lua54(lua_State* L) 9 | { 10 | return G(L)->mainthread; 11 | } 12 | 13 | std::vector FindAllCoroutine_lua54(lua_State* L) 14 | { 15 | std::vector result; 16 | auto head = G(L)->allgc; 17 | 18 | while (head) 19 | { 20 | if (head->tt == LUA_TTHREAD) 21 | { 22 | result.push_back(reinterpret_cast(head)); 23 | } 24 | head = head->next; 25 | } 26 | 27 | return result; 28 | } -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_state/lua_state_jit.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_state.h" 2 | 3 | // luajit不包含luajit头文件,所以本质上getmainstate 结果是错的 4 | // 但是luajit有global hook,所以不影响调试 5 | 6 | lua_State* GetMainState_luaJIT(lua_State* L) 7 | { 8 | return L; 9 | } 10 | -------------------------------------------------------------------------------- /emmy_debugger/src/api/lua_version.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/api/lua_version.h" 2 | 3 | #if EMMY_LUA_51 4 | LuaVersion luaVersion = LuaVersion::LUA_51; 5 | #elif EMMY_LUA_52 6 | LuaVersion luaVersion = LuaVersion::LUA_52; 7 | #elif EMMY_LUA_53 8 | LuaVersion luaVersion = LuaVersion::LUA_53; 9 | #elif EMMY_LUA_54 10 | LuaVersion luaVersion = LuaVersion::LUA_54; 11 | #elif EMMY_LUA_JIT 12 | LuaVersion luaVersion = LuaVersion::LUA_JIT; 13 | #else 14 | LuaVersion luaVersion = LuaVersion::UNKNOWN; 15 | #endif -------------------------------------------------------------------------------- /emmy_debugger/src/arena/arena.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/arena/arena.h" -------------------------------------------------------------------------------- /emmy_debugger/src/util.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_debugger/util.h" 2 | #include 3 | #include 4 | 5 | // glibc 函数 6 | int __strncasecmp(const char *s1, const char *s2, int n) { 7 | if (n && s1 != s2) { 8 | do { 9 | int d = ::tolower(*s1) - ::tolower(*s2); 10 | if (d || *s1 == '\0' || *s2 == '\0') 11 | return d; 12 | s1++; 13 | s2++; 14 | } while (--n); 15 | } 16 | return 0; 17 | } 18 | 19 | bool CompareIgnoreCase(const std::string &lh, const std::string &rh) { 20 | std::size_t llen = lh.size(); 21 | std::size_t rlen = rh.size(); 22 | int ret = __strncasecmp(lh.data(), rh.data(), static_cast((std::min)(llen, rlen))); 23 | return ret; 24 | } 25 | 26 | bool CaseInsensitiveLess::operator()(const std::string &lhs, const std::string &rhs) const { 27 | std::size_t llen = lhs.size(); 28 | std::size_t rlen = rhs.size(); 29 | 30 | int ret = CompareIgnoreCase(lhs, rhs); 31 | 32 | if (ret < 0) { 33 | return true; 34 | } 35 | if (ret == 0 && llen < rlen) { 36 | return true; 37 | } 38 | return false; 39 | } 40 | 41 | bool EndWith(const std::string &source, const std::string &end) { 42 | auto endSize = end.size(); 43 | auto sourceSize = source.size(); 44 | 45 | if (endSize > sourceSize) { 46 | return false; 47 | } 48 | 49 | return strncmp(end.data(), source.data() + (sourceSize - endSize), endSize) == 0; 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /emmy_hook/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.11) 2 | 3 | project(emmy_hook) 4 | 5 | add_library(emmy_hook SHARED) 6 | 7 | set_target_properties(emmy_hook PROPERTIES PREFIX "") 8 | 9 | target_include_directories(emmy_hook PUBLIC 10 | ${emmy_SOURCE_DIR}/include 11 | ${emmy_SOURCE_DIR}/third-party/EasyHook/EasyHookDll 12 | PRIVATE src 13 | ) 14 | 15 | target_sources(emmy_hook PRIVATE 16 | #src 17 | src/dllmain.cpp 18 | src/emmy_hook.cpp 19 | src/emmy_hook.windows.cpp 20 | 21 | 22 | #src/libpe 23 | src/libpe/htable.cpp 24 | src/libpe/htable.h 25 | src/libpe/libpe.cpp 26 | src/libpe/libpe.h 27 | src/libpe/llist.cpp 28 | src/libpe/llist.h 29 | 30 | ) 31 | 32 | add_dependencies( 33 | emmy_hook 34 | emmy_debugger 35 | EasyHook 36 | shared 37 | ) 38 | 39 | target_link_libraries( 40 | emmy_hook 41 | PRIVATE 42 | emmy_debugger 43 | EasyHook 44 | shared 45 | ) 46 | 47 | install( 48 | TARGETS emmy_hook 49 | LIBRARY DESTINATION bin 50 | RUNTIME DESTINATION bin 51 | ) -------------------------------------------------------------------------------- /emmy_hook/src/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019. tangzx(love.tangzx@qq.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "emmy_debugger/emmy_facade.h" 18 | #include "emmy_hook.h" 19 | #if WIN32 20 | #include 21 | #include "shared/shme.h" 22 | static SharedFile file; 23 | 24 | HINSTANCE g_hInstance = NULL; 25 | 26 | BOOL WINAPI DllMain(HINSTANCE hModule, DWORD reason, LPVOID reserved) { 27 | g_hInstance = hModule; 28 | EmmyFacade::Get().SetWorkMode(WorkMode::Attach); 29 | EmmyFacade::Get().StartHook = FindAndHook; 30 | 31 | if (reason == DLL_PROCESS_ATTACH) { 32 | TSharedData data; 33 | DisableThreadLibraryCalls(hModule); 34 | if (!CreateMemFile(&file)) { 35 | return FALSE; 36 | } 37 | // Set shared memory to hold what our remote process needs 38 | memset(file.lpMemFile, 0, SHMEMSIZE); 39 | data.hModule = hModule; 40 | data.lpInit = (LPDWORD)(StartupHookMode); 41 | data.dwOffset = (DWORD)(data.lpInit) - (DWORD)(data.hModule); 42 | memcpy(file.lpMemFile, &data, sizeof(TSharedData)); 43 | } 44 | else if (reason == DLL_PROCESS_DETACH) { 45 | // Destroy(); 46 | CloseMemFile(&file); 47 | } 48 | 49 | return TRUE; 50 | } 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /emmy_hook/src/emmy_hook.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_hook.h" -------------------------------------------------------------------------------- /emmy_hook/src/emmy_hook.h: -------------------------------------------------------------------------------- 1 |  2 | #pragma once 3 | 4 | 5 | 6 | int StartupHookMode(void* lpParam); 7 | 8 | void FindAndHook(); 9 | -------------------------------------------------------------------------------- /emmy_hook/src/libpe/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | LIBRERIA STATICA: cenni preliminari sul progetto libpe 3 | ======================================================================== 4 | 5 | La creazione guidata applicazione ha creato questo progetto di libreria libpe. 6 | 7 | Non è stato creato alcun file di origine come parte del progetto. 8 | 9 | 10 | libpe.vcxproj 11 | File di progetto principale per i progetti VC++ generati tramite una creazione guidata applicazione. Contiene informazioni sulla versione di Visual C++ che ha generato il file e informazioni sulle piattaforme, le configurazioni e le caratteristiche del progetto selezionate con la Creazione guidata applicazione. 12 | 13 | libpe.vcxproj.filters 14 | File dei filtri per i progetti VC++ generati tramite una Creazione guidata applicazione. Contiene informazioni sull'associazione tra i file del progetto e i filtri. Tale associazione viene utilizzata nell'IDE per la visualizzazione di raggruppamenti di file con estensioni simili in un nodo specifico, ad esempio: i file con estensione cpp sono associati al filtro "File di origine". 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | Altre note: 18 | 19 | La creazione guidata applicazione utilizza i commenti "TODO:" per indicare le 20 | parti del codice sorgente da aggiungere o personalizzare. 21 | 22 | ///////////////////////////////////////////////////////////////////////////// 23 | -------------------------------------------------------------------------------- /emmy_tool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | project(emmy_tool) 4 | 5 | add_executable(emmy_tool) 6 | 7 | add_dependencies( 8 | emmy_tool 9 | shared 10 | ) 11 | 12 | target_include_directories(emmy_tool PRIVATE 13 | src 14 | ) 15 | 16 | target_sources(emmy_tool PRIVATE 17 | src/windows/utility.cpp 18 | src/windows/emmy_tool.windows.cpp 19 | src/command_line.cpp 20 | src/main.cpp 21 | src/emmy_tool.cpp 22 | ) 23 | 24 | target_link_libraries( 25 | emmy_tool 26 | imagehlp 27 | ws2_32 28 | shared 29 | ) 30 | 31 | 32 | install( 33 | TARGETS emmy_tool 34 | LIBRARY DESTINATION lib 35 | RUNTIME DESTINATION bin 36 | ) -------------------------------------------------------------------------------- /emmy_tool/src/emmy_tool.cpp: -------------------------------------------------------------------------------- 1 | #include "emmy_tool.h" 2 | 3 | EmmyTool::EmmyTool(CommandLine &cmd) 4 | : _cmd(cmd) { 5 | } 6 | -------------------------------------------------------------------------------- /emmy_tool/src/emmy_tool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command_line.h" 4 | 5 | class EmmyTool { 6 | public: 7 | explicit EmmyTool(CommandLine &cmd); 8 | 9 | int Launch(); 10 | 11 | int Attach(); 12 | 13 | int ListProcesses(); 14 | 15 | int ArchFile(); 16 | 17 | int ArchPid(); 18 | 19 | int ReceiveLog(); 20 | 21 | private: 22 | 23 | CommandLine _cmd; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /emmy_tool/src/windows/utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "shared/shme.h" 9 | 10 | struct ExeInfo { 11 | size_t entryPoint; 12 | bool managed; 13 | bool i386; 14 | }; 15 | 16 | bool GetExeInfo(LPCSTR fileName, ExeInfo&info); 17 | 18 | /** 19 | * Returns the top level window for the specified process. The first such window 20 | * that's found is returned. 21 | */ 22 | HWND GetProcessWindow(DWORD processId); 23 | 24 | struct Process { 25 | unsigned int id; // Windows process identifier 26 | std::string name; // Executable name 27 | std::string title; // Name from the main window of the process. 28 | std::string path; // Full path 29 | std::string iconPath;// Icon path 30 | }; 31 | 32 | /** 33 | * Returns all of the processes on the machine that can be debugged. 34 | */ 35 | void GetProcesses(std::vector& processes); 36 | 37 | int GetProcessByName(const char* name); 38 | 39 | void SetBreakpoint(HANDLE hProcess, LPVOID entryPoint, bool set, BYTE *data); 40 | 41 | bool InjectDllForProcess(HANDLE hProcess, const char *dllDir, const char *dllFileName); 42 | 43 | bool InjectDll(DWORD processId, const char *dllDir, const char *dllFileName, bool capture); 44 | 45 | void ReceiveLog(DWORD processId); 46 | 47 | -------------------------------------------------------------------------------- /shared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | project(shared) 4 | 5 | add_library(shared STATIC) 6 | 7 | target_include_directories(shared PUBLIC 8 | ${shared_SOURCE_DIR}/include 9 | ) 10 | 11 | target_sources(shared PRIVATE 12 | src/shme.cpp 13 | ) 14 | 15 | target_link_libraries( 16 | shared 17 | ) 18 | -------------------------------------------------------------------------------- /shared/include/shared/shme.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHME_H_ 2 | #define _SHME_H_ 3 | 4 | #include 5 | 6 | // Data struct to be shared between processes 7 | struct TSharedData { 8 | DWORD dwOffset = 0; 9 | HMODULE hModule = nullptr; 10 | LPDWORD lpInit = nullptr; 11 | }; 12 | 13 | struct SharedFile { 14 | HANDLE hMapFile; 15 | LPVOID lpMemFile; 16 | }; 17 | 18 | struct RemoteThreadParam 19 | { 20 | BOOL bRedirect; 21 | }; 22 | 23 | // Size (in bytes) of data to be shared 24 | #define SHMEMSIZE sizeof(TSharedData) 25 | // Name of the shared file map (NOTE: Global namespaces must have the SeCreateGlobalPrivilege privilege) 26 | #define SHMEMNAME "InjectedDllName_SHMEM" 27 | 28 | bool CreateMemFile(SharedFile* file); 29 | 30 | bool CloseMemFile(SharedFile* file); 31 | 32 | bool ReadSharedData(TSharedData& data); 33 | 34 | bool WriteSharedData(HANDLE hMapFile, LPVOID lpMemFile, TSharedData& data); 35 | #endif -------------------------------------------------------------------------------- /shared/src/shme.cpp: -------------------------------------------------------------------------------- 1 | #include "shared/shme.h" 2 | 3 | bool CreateMemFile(SharedFile* file) { 4 | // Get a handle to our file map 5 | const auto MapFile = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, SHMEMSIZE, SHMEMNAME); 6 | if (MapFile == nullptr) { 7 | MessageBoxA(nullptr, "Failed to create file mapping!", "DLL_PROCESS_ATTACH", MB_OK | MB_ICONERROR); 8 | return false; 9 | } 10 | 11 | // Get our shared memory pointer 12 | const auto MemFile = MapViewOfFile(MapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0); 13 | if (MemFile == nullptr) { 14 | MessageBoxA(nullptr, "Failed to map shared memory!", "DLL_PROCESS_ATTACH", MB_OK | MB_ICONERROR); 15 | return false; 16 | } 17 | file->lpMemFile = MemFile; 18 | file->hMapFile = MapFile; 19 | return true; 20 | } 21 | 22 | bool CloseMemFile(SharedFile* file) { 23 | UnmapViewOfFile(file->lpMemFile); 24 | CloseHandle(file->hMapFile); 25 | return true; 26 | } 27 | 28 | bool ReadSharedData(TSharedData& data) { 29 | SharedFile file = {}; 30 | if (!CreateMemFile(&file)) { 31 | return false; 32 | } 33 | memcpy(&data, file.lpMemFile, SHMEMSIZE); 34 | // Clean up 35 | CloseMemFile(&file); 36 | return true; 37 | } 38 | 39 | bool WriteSharedData(HANDLE hMapFile, LPVOID lpMemFile, TSharedData& data) { 40 | memset(lpMemFile, 0, SHMEMSIZE); 41 | memcpy(lpMemFile, &data, sizeof(TSharedData)); 42 | return true; 43 | } -------------------------------------------------------------------------------- /third-party/EasyHook/DriverShared/Disassembler/udis86-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2012, Vivek Thampi 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /third-party/EasyHook/DriverShared/Disassembler/udis86.h: -------------------------------------------------------------------------------- 1 | /* udis86 - udis86.h 2 | * 3 | * Copyright (c) 2002-2009 Vivek Thampi 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | #ifndef UDIS86_H 27 | #define UDIS86_H 28 | 29 | #include "libudis86/types.h" 30 | #include "libudis86/extern.h" 31 | #include "libudis86/itab.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /third-party/EasyHook/EasyHookDll/AUX_ULIB_x64.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/EasyHook/EasyHookDll/AUX_ULIB_x64.LIB -------------------------------------------------------------------------------- /third-party/EasyHook/EasyHookDll/AUX_ULIB_x86.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/EasyHook/EasyHookDll/AUX_ULIB_x86.LIB -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.gitattributes: -------------------------------------------------------------------------------- 1 | test/fixtures/lorem_ipsum.txt text eol=lf 2 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 12 | * **Version**: 13 | * **Platform**: 14 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 28 3 | # Number of days of inactivity before a stale issue is closed 4 | # Set to false to disable. If disabled, issues still need to be closed 5 | # manually, but will remain marked as stale. 6 | daysUntilClose: false 7 | # Issues with these labels will never be considered stale 8 | exemptLabels: 9 | - v2 10 | - enhancement 11 | - good first issue 12 | - feature-request 13 | - doc 14 | - bug 15 | - not-stale 16 | # Label to use when marking an issue as stale 17 | staleLabel: stale 18 | # Comment to post when marking an issue as stale. Set to `false` to disable 19 | markComment: > 20 | This issue has been automatically marked as stale because it has not had 21 | recent activity. Thank you for your contributions. 22 | # Comment to post when closing a stale issue. Set to `false` to disable 23 | closeComment: false 24 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.github/workflows/CI-docs.yml: -------------------------------------------------------------------------------- 1 | name: CI-docs 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'docs/**' 7 | - '!docs/code/**' 8 | - '.github/workflows/CI-docs.yml' 9 | 10 | jobs: 11 | docs-src: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: actions/setup-python@v4 16 | with: 17 | python-version: '3.9' 18 | cache: 'pip' # caching pip dependencies 19 | - run: pip install -r docs/requirements.txt 20 | - name: html 21 | run: | 22 | make -C docs html 23 | - name: linkcheck 24 | run: | 25 | make -C docs linkcheck 26 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.github/workflows/CI-sample.yml: -------------------------------------------------------------------------------- 1 | name: ci-sample 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - '**' 7 | - '!docs/**' 8 | - '!.**' 9 | - '.github/workflows/CI-sample.yml' 10 | push: 11 | branches: 12 | - v[0-9].* 13 | - master 14 | 15 | jobs: 16 | build: 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | os: [macos-latest, ubuntu-latest, windows-latest] 21 | runs-on: ${{matrix.os}} 22 | steps: 23 | - uses: actions/checkout@v2 24 | - name: setup 25 | run: cmake -E make_directory ${{runner.workspace}}/libuv/docs/code/build 26 | - name: configure 27 | # you may like use Ninja on unix-like OS, but for windows, the only easy way is to use Visual Studio if you want Ninja 28 | run: cmake .. 29 | working-directory: ${{runner.workspace}}/libuv/docs/code/build 30 | - name: build 31 | run: cmake --build . 32 | working-directory: ${{runner.workspace}}/libuv/docs/code/build 33 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.[oa] 3 | *.l[oa] 4 | *.opensdf 5 | *.orig 6 | *.pyc 7 | *.sdf 8 | *.suo 9 | .vs/ 10 | *.VC.db 11 | *.VC.opendb 12 | core 13 | vgcore.* 14 | .buildstamp 15 | .dirstamp 16 | .deps/ 17 | /.libs/ 18 | /aclocal.m4 19 | /ar-lib 20 | /autom4te.cache/ 21 | /compile 22 | /config.guess 23 | /config.log 24 | /config.status 25 | /config.sub 26 | /configure 27 | /depcomp 28 | /install-sh 29 | /libtool 30 | /libuv.a 31 | /libuv.dylib 32 | /libuv.pc 33 | /libuv.so 34 | /ltmain.sh 35 | /missing 36 | /test-driver 37 | Makefile 38 | Makefile.in 39 | 40 | /build/ 41 | 42 | /test/.libs/ 43 | /test/run-tests 44 | /test/run-tests.exe 45 | /test/run-tests.dSYM 46 | /test/run-benchmarks 47 | /test/run-benchmarks.exe 48 | /test/run-benchmarks.dSYM 49 | test_file_* 50 | 51 | *.sln 52 | *.sln.cache 53 | *.ncb 54 | *.vcproj 55 | *.vcproj*.user 56 | *.vcxproj 57 | *.vcxproj.filters 58 | *.vcxproj.user 59 | _UpgradeReport_Files/ 60 | UpgradeLog*.XML 61 | Debug 62 | Release 63 | ipch 64 | 65 | # sphinx generated files 66 | /docs/build/ 67 | 68 | # Clion / IntelliJ project files 69 | /.idea/ 70 | cmake-build-debug/ 71 | 72 | *.xcodeproj 73 | *.xcworkspace 74 | 75 | # make dist output 76 | libuv-*.tar.* 77 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | builder: html 5 | configuration: null 6 | fail_on_warning: false 7 | 8 | build: 9 | os: "ubuntu-22.04" 10 | tools: 11 | python: "3.9" 12 | 13 | python: 14 | install: 15 | - requirements: docs/requirements.txt 16 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present libuv project contributors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/cmake-toolchains/cross-mingw32.cmake: -------------------------------------------------------------------------------- 1 | if(NOT HOST_ARCH) 2 | message(SEND_ERROR "-DHOST_ARCH required to be specified") 3 | endif() 4 | 5 | list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES 6 | HOST_ARCH 7 | ) 8 | 9 | SET(CMAKE_SYSTEM_NAME Windows) 10 | set(COMPILER_PREFIX "${HOST_ARCH}-w64-mingw32") 11 | find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) 12 | find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) 13 | find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) 14 | 15 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 18 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/.gitignore: -------------------------------------------------------------------------------- 1 | */* 2 | !*.c 3 | !*.h 4 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(libuv_sample) 4 | 5 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 6 | 7 | add_subdirectory("../../" build) 8 | 9 | set(SIMPLE_SAMPLES 10 | cgi 11 | helloworld 12 | dns 13 | detach 14 | default-loop 15 | idle-basic 16 | idle-compute 17 | interfaces 18 | locks 19 | onchange 20 | pipe-echo-server 21 | ref-timer 22 | spawn 23 | tcp-echo-server 24 | thread-create 25 | udp-dhcp 26 | uvcat 27 | uvstop 28 | uvtee 29 | ) 30 | IF (NOT WIN32) 31 | list(APPEND SIMPLE_SAMPLES 32 | signal 33 | progress 34 | queue-cancel 35 | queue-work 36 | tty 37 | tty-gravity 38 | ) 39 | ENDIF() 40 | 41 | foreach (X IN LISTS SIMPLE_SAMPLES) 42 | add_executable(${X} ${X}/main.c) 43 | target_link_libraries(${X} uv_a) 44 | endforeach () 45 | 46 | 47 | FIND_PACKAGE(CURL) 48 | IF(CURL_FOUND) 49 | add_executable(uvwget uvwget/main.c) 50 | target_link_libraries(uvwget uv_a ${CURL_LIBRARIES}) 51 | ENDIF(CURL_FOUND) 52 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/cgi/tick.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() { 5 | int i; 6 | for (i = 0; i < 10; i++) { 7 | printf("tick\n"); 8 | fflush(stdout); 9 | sleep(1); 10 | } 11 | printf("BOOM!\n"); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/default-loop/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() { 5 | uv_loop_t *loop = uv_default_loop(); 6 | 7 | printf("Default loop.\n"); 8 | uv_run(loop, UV_RUN_DEFAULT); 9 | 10 | uv_loop_close(loop); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/detach/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | uv_loop_t *loop; 6 | uv_process_t child_req; 7 | uv_process_options_t options; 8 | 9 | int main() { 10 | loop = uv_default_loop(); 11 | 12 | char* args[3]; 13 | args[0] = "sleep"; 14 | args[1] = "100"; 15 | args[2] = NULL; 16 | 17 | options.exit_cb = NULL; 18 | options.file = "sleep"; 19 | options.args = args; 20 | options.flags = UV_PROCESS_DETACHED; 21 | 22 | int r; 23 | if ((r = uv_spawn(loop, &child_req, &options))) { 24 | fprintf(stderr, "%s\n", uv_strerror(r)); 25 | return 1; 26 | } 27 | fprintf(stderr, "Launched sleep with PID %d\n", child_req.pid); 28 | uv_unref((uv_handle_t*) &child_req); 29 | 30 | return uv_run(loop, UV_RUN_DEFAULT); 31 | } 32 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/helloworld/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | uv_loop_t *loop = malloc(sizeof(uv_loop_t)); 7 | uv_loop_init(loop); 8 | 9 | printf("Now quitting.\n"); 10 | uv_run(loop, UV_RUN_DEFAULT); 11 | 12 | uv_loop_close(loop); 13 | free(loop); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/idle-basic/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int64_t counter = 0; 5 | 6 | void wait_for_a_while(uv_idle_t* handle) { 7 | counter++; 8 | 9 | if (counter >= 10e6) 10 | uv_idle_stop(handle); 11 | } 12 | 13 | int main() { 14 | uv_idle_t idler; 15 | 16 | uv_idle_init(uv_default_loop(), &idler); 17 | uv_idle_start(&idler, wait_for_a_while); 18 | 19 | printf("Idling...\n"); 20 | uv_run(uv_default_loop(), UV_RUN_DEFAULT); 21 | 22 | uv_loop_close(uv_default_loop()); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/idle-compute/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | uv_loop_t *loop; 6 | uv_fs_t stdin_watcher; 7 | uv_idle_t idler; 8 | char buffer[1024]; 9 | 10 | void crunch_away(uv_idle_t* handle) { 11 | // Compute extra-terrestrial life 12 | // fold proteins 13 | // computer another digit of PI 14 | // or similar 15 | fprintf(stderr, "Computing PI...\n"); 16 | // just to avoid overwhelming your terminal emulator 17 | uv_idle_stop(handle); 18 | } 19 | 20 | void on_type(uv_fs_t *req) { 21 | if (stdin_watcher.result > 0) { 22 | buffer[stdin_watcher.result] = '\0'; 23 | printf("Typed %s\n", buffer); 24 | 25 | uv_buf_t buf = uv_buf_init(buffer, 1024); 26 | uv_fs_read(loop, &stdin_watcher, 0, &buf, 1, -1, on_type); 27 | uv_idle_start(&idler, crunch_away); 28 | } 29 | else if (stdin_watcher.result < 0) { 30 | fprintf(stderr, "error opening file: %s\n", uv_strerror(req->result)); 31 | } 32 | } 33 | 34 | int main() { 35 | loop = uv_default_loop(); 36 | 37 | uv_idle_init(loop, &idler); 38 | 39 | uv_buf_t buf = uv_buf_init(buffer, 1024); 40 | uv_fs_read(loop, &stdin_watcher, 0, &buf, 1, -1, on_type); 41 | uv_idle_start(&idler, crunch_away); 42 | return uv_run(loop, UV_RUN_DEFAULT); 43 | } 44 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/interfaces/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() { 5 | char buf[512]; 6 | uv_interface_address_t *info; 7 | int count, i; 8 | 9 | uv_interface_addresses(&info, &count); 10 | i = count; 11 | 12 | printf("Number of interfaces: %d\n", count); 13 | while (i--) { 14 | uv_interface_address_t interface_a = info[i]; 15 | 16 | printf("Name: %s\n", interface_a.name); 17 | printf("Internal? %s\n", interface_a.is_internal ? "Yes" : "No"); 18 | 19 | if (interface_a.address.address4.sin_family == AF_INET) { 20 | uv_ip4_name(&interface_a.address.address4, buf, sizeof(buf)); 21 | printf("IPv4 address: %s\n", buf); 22 | } 23 | else if (interface_a.address.address4.sin_family == AF_INET6) { 24 | uv_ip6_name(&interface_a.address.address6, buf, sizeof(buf)); 25 | printf("IPv6 address: %s\n", buf); 26 | } 27 | 28 | printf("\n"); 29 | } 30 | 31 | uv_free_interface_addresses(info, count); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/locks/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | uv_barrier_t blocker; 5 | uv_rwlock_t numlock; 6 | int shared_num; 7 | 8 | void reader(void *n) 9 | { 10 | int num = *(int *)n; 11 | int i; 12 | for (i = 0; i < 20; i++) { 13 | uv_rwlock_rdlock(&numlock); 14 | printf("Reader %d: acquired lock\n", num); 15 | printf("Reader %d: shared num = %d\n", num, shared_num); 16 | uv_rwlock_rdunlock(&numlock); 17 | printf("Reader %d: released lock\n", num); 18 | } 19 | uv_barrier_wait(&blocker); 20 | } 21 | 22 | void writer(void *n) 23 | { 24 | int num = *(int *)n; 25 | int i; 26 | for (i = 0; i < 20; i++) { 27 | uv_rwlock_wrlock(&numlock); 28 | printf("Writer %d: acquired lock\n", num); 29 | shared_num++; 30 | printf("Writer %d: incremented shared num = %d\n", num, shared_num); 31 | uv_rwlock_wrunlock(&numlock); 32 | printf("Writer %d: released lock\n", num); 33 | } 34 | uv_barrier_wait(&blocker); 35 | } 36 | 37 | int main() 38 | { 39 | uv_barrier_init(&blocker, 4); 40 | 41 | shared_num = 0; 42 | uv_rwlock_init(&numlock); 43 | 44 | uv_thread_t threads[3]; 45 | 46 | int thread_nums[] = {1, 2, 1}; 47 | uv_thread_create(&threads[0], reader, &thread_nums[0]); 48 | uv_thread_create(&threads[1], reader, &thread_nums[1]); 49 | 50 | uv_thread_create(&threads[2], writer, &thread_nums[2]); 51 | 52 | uv_barrier_wait(&blocker); 53 | uv_barrier_destroy(&blocker); 54 | 55 | uv_rwlock_destroy(&numlock); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/onchange/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | uv_loop_t *loop; 7 | const char *command; 8 | 9 | void run_command(uv_fs_event_t *handle, const char *filename, int events, int status) { 10 | char path[1024]; 11 | size_t size = 1023; 12 | // Does not handle error if path is longer than 1023. 13 | uv_fs_event_getpath(handle, path, &size); 14 | path[size] = '\0'; 15 | 16 | fprintf(stderr, "Change detected in %s: ", path); 17 | if (events & UV_RENAME) 18 | fprintf(stderr, "renamed"); 19 | if (events & UV_CHANGE) 20 | fprintf(stderr, "changed"); 21 | 22 | fprintf(stderr, " %s\n", filename ? filename : ""); 23 | system(command); 24 | } 25 | 26 | int main(int argc, char **argv) { 27 | if (argc <= 2) { 28 | fprintf(stderr, "Usage: %s [file2 ...]\n", argv[0]); 29 | return 1; 30 | } 31 | 32 | loop = uv_default_loop(); 33 | command = argv[1]; 34 | 35 | while (argc-- > 2) { 36 | fprintf(stderr, "Adding watch on %s\n", argv[argc]); 37 | uv_fs_event_t *fs_event_req = malloc(sizeof(uv_fs_event_t)); 38 | uv_fs_event_init(loop, fs_event_req); 39 | // The recursive flag watches subdirectories too. 40 | uv_fs_event_start(fs_event_req, run_command, argv[argc], UV_FS_EVENT_RECURSIVE); 41 | } 42 | 43 | return uv_run(loop, UV_RUN_DEFAULT); 44 | } 45 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/plugin/hello.c: -------------------------------------------------------------------------------- 1 | #include "plugin.h" 2 | 3 | void initialize() { 4 | mfp_register("Hello World!"); 5 | } 6 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/plugin/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "plugin.h" 8 | 9 | typedef void (*init_plugin_function)(); 10 | 11 | void mfp_register(const char *name) { 12 | fprintf(stderr, "Registered plugin \"%s\"\n", name); 13 | } 14 | 15 | int main(int argc, char **argv) { 16 | if (argc == 1) { 17 | fprintf(stderr, "Usage: %s [plugin1] [plugin2] ...\n", argv[0]); 18 | return 0; 19 | } 20 | 21 | uv_lib_t *lib = (uv_lib_t*) malloc(sizeof(uv_lib_t)); 22 | while (--argc) { 23 | fprintf(stderr, "Loading %s\n", argv[argc]); 24 | if (uv_dlopen(argv[argc], lib)) { 25 | fprintf(stderr, "Error: %s\n", uv_dlerror(lib)); 26 | continue; 27 | } 28 | 29 | init_plugin_function init_plugin; 30 | if (uv_dlsym(lib, "initialize", (void **) &init_plugin)) { 31 | fprintf(stderr, "dlsym error: %s\n", uv_dlerror(lib)); 32 | continue; 33 | } 34 | 35 | init_plugin(); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/plugin/plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef UVBOOK_PLUGIN_SYSTEM 2 | #define UVBOOK_PLUGIN_SYSTEM 3 | 4 | // Plugin authors should use this to register their plugins with mfp. 5 | void mfp_register(const char *name); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/proc-streams/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | uv_loop_t *loop; 8 | uv_process_t child_req; 9 | uv_process_options_t options; 10 | 11 | void on_exit(uv_process_t *req, int64_t exit_status, int term_signal) { 12 | fprintf(stderr, "Process exited with status %" PRId64 ", signal %d\n", exit_status, term_signal); 13 | uv_close((uv_handle_t*) req, NULL); 14 | } 15 | 16 | int main() { 17 | loop = uv_default_loop(); 18 | 19 | size_t size = 500; 20 | char path[size]; 21 | uv_exepath(path, &size); 22 | strcpy(path + (strlen(path) - strlen("proc-streams")), "test"); 23 | 24 | char* args[2]; 25 | args[0] = path; 26 | args[1] = NULL; 27 | 28 | /* ... */ 29 | 30 | options.stdio_count = 3; 31 | uv_stdio_container_t child_stdio[3]; 32 | child_stdio[0].flags = UV_IGNORE; 33 | child_stdio[1].flags = UV_IGNORE; 34 | child_stdio[2].flags = UV_INHERIT_FD; 35 | child_stdio[2].data.fd = 2; 36 | options.stdio = child_stdio; 37 | 38 | options.exit_cb = on_exit; 39 | options.file = args[0]; 40 | options.args = args; 41 | 42 | int r; 43 | if ((r = uv_spawn(loop, &child_req, &options))) { 44 | fprintf(stderr, "%s\n", uv_strerror(r)); 45 | return 1; 46 | } 47 | 48 | return uv_run(loop, UV_RUN_DEFAULT); 49 | } 50 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/proc-streams/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | fprintf(stderr, "This is stderr\n"); 6 | printf("This is stdout\n"); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/progress/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | uv_loop_t *loop; 8 | uv_async_t async; 9 | 10 | double percentage; 11 | 12 | void fake_download(uv_work_t *req) { 13 | int size = *((int*) req->data); 14 | int downloaded = 0; 15 | while (downloaded < size) { 16 | percentage = downloaded*100.0/size; 17 | async.data = (void*) &percentage; 18 | uv_async_send(&async); 19 | 20 | sleep(1); 21 | downloaded += (200+random())%1000; // can only download max 1000bytes/sec, 22 | // but at least a 200; 23 | } 24 | } 25 | 26 | void after(uv_work_t *req, int status) { 27 | fprintf(stderr, "Download complete\n"); 28 | uv_close((uv_handle_t*) &async, NULL); 29 | } 30 | 31 | void print_progress(uv_async_t *handle) { 32 | double percentage = *((double*) handle->data); 33 | fprintf(stderr, "Downloaded %.2f%%\n", percentage); 34 | } 35 | 36 | int main() { 37 | loop = uv_default_loop(); 38 | 39 | uv_work_t req; 40 | int size = 10240; 41 | req.data = (void*) &size; 42 | 43 | uv_async_init(loop, &async, print_progress); 44 | uv_queue_work(loop, &req, fake_download, after); 45 | 46 | return uv_run(loop, UV_RUN_DEFAULT); 47 | } 48 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/queue-cancel/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #define FIB_UNTIL 25 8 | uv_loop_t *loop; 9 | uv_work_t fib_reqs[FIB_UNTIL]; 10 | 11 | long fib_(long t) { 12 | if (t == 0 || t == 1) 13 | return 1; 14 | else 15 | return fib_(t-1) + fib_(t-2); 16 | } 17 | 18 | void fib(uv_work_t *req) { 19 | int n = *(int *) req->data; 20 | if (random() % 2) 21 | sleep(1); 22 | else 23 | sleep(3); 24 | long fib = fib_(n); 25 | fprintf(stderr, "%dth fibonacci is %lu\n", n, fib); 26 | } 27 | 28 | void after_fib(uv_work_t *req, int status) { 29 | if (status == UV_ECANCELED) 30 | fprintf(stderr, "Calculation of %d cancelled.\n", *(int *) req->data); 31 | } 32 | 33 | void signal_handler(uv_signal_t *req, int signum) 34 | { 35 | printf("Signal received!\n"); 36 | int i; 37 | for (i = 0; i < FIB_UNTIL; i++) { 38 | uv_cancel((uv_req_t*) &fib_reqs[i]); 39 | } 40 | uv_signal_stop(req); 41 | } 42 | 43 | int main() { 44 | loop = uv_default_loop(); 45 | 46 | int data[FIB_UNTIL]; 47 | int i; 48 | for (i = 0; i < FIB_UNTIL; i++) { 49 | data[i] = i; 50 | fib_reqs[i].data = (void *) &data[i]; 51 | uv_queue_work(loop, &fib_reqs[i], fib, after_fib); 52 | } 53 | 54 | uv_signal_t sig; 55 | uv_signal_init(loop, &sig); 56 | uv_signal_start(&sig, signal_handler, SIGINT); 57 | 58 | return uv_run(loop, UV_RUN_DEFAULT); 59 | } 60 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/queue-work/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #define FIB_UNTIL 25 8 | uv_loop_t *loop; 9 | 10 | long fib_(long t) { 11 | if (t == 0 || t == 1) 12 | return 1; 13 | else 14 | return fib_(t-1) + fib_(t-2); 15 | } 16 | 17 | void fib(uv_work_t *req) { 18 | int n = *(int *) req->data; 19 | if (random() % 2) 20 | sleep(1); 21 | else 22 | sleep(3); 23 | long fib = fib_(n); 24 | fprintf(stderr, "%dth fibonacci is %lu\n", n, fib); 25 | } 26 | 27 | void after_fib(uv_work_t *req, int status) { 28 | fprintf(stderr, "Done calculating %dth fibonacci\n", *(int *) req->data); 29 | } 30 | 31 | int main() { 32 | loop = uv_default_loop(); 33 | 34 | int data[FIB_UNTIL]; 35 | uv_work_t req[FIB_UNTIL]; 36 | int i; 37 | for (i = 0; i < FIB_UNTIL; i++) { 38 | data[i] = i; 39 | req[i].data = (void *) &data[i]; 40 | uv_queue_work(loop, &req[i], fib, after_fib); 41 | } 42 | 43 | return uv_run(loop, UV_RUN_DEFAULT); 44 | } 45 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/ref-timer/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | uv_loop_t *loop; 6 | uv_timer_t gc_req; 7 | uv_timer_t fake_job_req; 8 | 9 | void gc(uv_timer_t *handle) { 10 | fprintf(stderr, "Freeing unused objects\n"); 11 | } 12 | 13 | void fake_job(uv_timer_t *handle) { 14 | fprintf(stdout, "Fake job done\n"); 15 | } 16 | 17 | int main() { 18 | loop = uv_default_loop(); 19 | 20 | uv_timer_init(loop, &gc_req); 21 | uv_unref((uv_handle_t*) &gc_req); 22 | 23 | uv_timer_start(&gc_req, gc, 0, 2000); 24 | 25 | // could actually be a TCP download or something 26 | uv_timer_init(loop, &fake_job_req); 27 | uv_timer_start(&fake_job_req, fake_job, 9000, 0); 28 | return uv_run(loop, UV_RUN_DEFAULT); 29 | } 30 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/signal/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | uv_loop_t* create_loop() 7 | { 8 | uv_loop_t *loop = malloc(sizeof(uv_loop_t)); 9 | if (loop) { 10 | uv_loop_init(loop); 11 | } 12 | return loop; 13 | } 14 | 15 | void signal_handler(uv_signal_t *handle, int signum) 16 | { 17 | printf("Signal received: %d\n", signum); 18 | uv_signal_stop(handle); 19 | } 20 | 21 | // two signal handlers in one loop 22 | void thread1_worker(void *userp) 23 | { 24 | uv_loop_t *loop1 = create_loop(); 25 | 26 | uv_signal_t sig1a, sig1b; 27 | uv_signal_init(loop1, &sig1a); 28 | uv_signal_start(&sig1a, signal_handler, SIGUSR1); 29 | 30 | uv_signal_init(loop1, &sig1b); 31 | uv_signal_start(&sig1b, signal_handler, SIGUSR1); 32 | 33 | uv_run(loop1, UV_RUN_DEFAULT); 34 | } 35 | 36 | // two signal handlers, each in its own loop 37 | void thread2_worker(void *userp) 38 | { 39 | uv_loop_t *loop2 = create_loop(); 40 | uv_loop_t *loop3 = create_loop(); 41 | 42 | uv_signal_t sig2; 43 | uv_signal_init(loop2, &sig2); 44 | uv_signal_start(&sig2, signal_handler, SIGUSR1); 45 | 46 | uv_signal_t sig3; 47 | uv_signal_init(loop3, &sig3); 48 | uv_signal_start(&sig3, signal_handler, SIGUSR1); 49 | 50 | while (uv_run(loop2, UV_RUN_NOWAIT) || uv_run(loop3, UV_RUN_NOWAIT)) { 51 | } 52 | } 53 | 54 | int main() 55 | { 56 | printf("PID %d\n", getpid()); 57 | 58 | uv_thread_t thread1, thread2; 59 | 60 | uv_thread_create(&thread1, thread1_worker, 0); 61 | uv_thread_create(&thread2, thread2_worker, 0); 62 | 63 | uv_thread_join(&thread1); 64 | uv_thread_join(&thread2); 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/spawn/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | uv_loop_t *loop; 7 | uv_process_t child_req; 8 | uv_process_options_t options; 9 | 10 | void on_exit(uv_process_t *req, int64_t exit_status, int term_signal) { 11 | fprintf(stderr, "Process exited with status %" PRId64 ", signal %d\n", exit_status, term_signal); 12 | uv_close((uv_handle_t*) req, NULL); 13 | } 14 | 15 | int main() { 16 | loop = uv_default_loop(); 17 | 18 | char* args[3]; 19 | args[0] = "mkdir"; 20 | args[1] = "test-dir"; 21 | args[2] = NULL; 22 | 23 | options.exit_cb = on_exit; 24 | options.file = "mkdir"; 25 | options.args = args; 26 | 27 | int r; 28 | if ((r = uv_spawn(loop, &child_req, &options))) { 29 | fprintf(stderr, "%s\n", uv_strerror(r)); 30 | return 1; 31 | } else { 32 | fprintf(stderr, "Launched process with ID %d\n", child_req.pid); 33 | } 34 | 35 | return uv_run(loop, UV_RUN_DEFAULT); 36 | } 37 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/thread-create/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | void hare(void *arg) { 6 | int tracklen = *((int *) arg); 7 | while (tracklen) { 8 | tracklen--; 9 | uv_sleep(1000); 10 | fprintf(stderr, "Hare ran another step\n"); 11 | } 12 | fprintf(stderr, "Hare done running!\n"); 13 | } 14 | 15 | void tortoise(void *arg) { 16 | int tracklen = *((int *) arg); 17 | while (tracklen) { 18 | tracklen--; 19 | fprintf(stderr, "Tortoise ran another step\n"); 20 | uv_sleep(3000); 21 | } 22 | fprintf(stderr, "Tortoise done running!\n"); 23 | } 24 | 25 | int main() { 26 | int tracklen = 10; 27 | uv_thread_t hare_id; 28 | uv_thread_t tortoise_id; 29 | uv_thread_create(&hare_id, hare, &tracklen); 30 | uv_thread_create(&tortoise_id, tortoise, &tracklen); 31 | 32 | uv_thread_join(&hare_id); 33 | uv_thread_join(&tortoise_id); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/tty-gravity/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | uv_loop_t *loop; 7 | uv_tty_t tty; 8 | uv_timer_t tick; 9 | uv_write_t write_req; 10 | int width, height; 11 | int pos = 0; 12 | char *message = " Hello TTY "; 13 | 14 | void update(uv_timer_t *req) { 15 | char data[500]; 16 | 17 | uv_buf_t buf; 18 | buf.base = data; 19 | buf.len = sprintf(data, "\033[2J\033[H\033[%dB\033[%luC\033[42;37m%s", 20 | pos, 21 | (unsigned long) (width-strlen(message))/2, 22 | message); 23 | uv_write(&write_req, (uv_stream_t*) &tty, &buf, 1, NULL); 24 | 25 | pos++; 26 | if (pos > height) { 27 | uv_tty_reset_mode(); 28 | uv_timer_stop(&tick); 29 | } 30 | } 31 | 32 | int main() { 33 | loop = uv_default_loop(); 34 | 35 | uv_tty_init(loop, &tty, STDOUT_FILENO, 0); 36 | uv_tty_set_mode(&tty, 0); 37 | 38 | if (uv_tty_get_winsize(&tty, &width, &height)) { 39 | fprintf(stderr, "Could not get TTY information\n"); 40 | uv_tty_reset_mode(); 41 | return 1; 42 | } 43 | 44 | fprintf(stderr, "Width %d, height %d\n", width, height); 45 | uv_timer_init(loop, &tick); 46 | uv_timer_start(&tick, update, 200, 200); 47 | return uv_run(loop, UV_RUN_DEFAULT); 48 | } 49 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/tty/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | uv_loop_t *loop; 7 | uv_tty_t tty; 8 | int main() { 9 | loop = uv_default_loop(); 10 | 11 | uv_tty_init(loop, &tty, STDOUT_FILENO, 0); 12 | uv_tty_set_mode(&tty, UV_TTY_MODE_NORMAL); 13 | 14 | if (uv_guess_handle(1) == UV_TTY) { 15 | uv_write_t req; 16 | uv_buf_t buf; 17 | buf.base = "\033[41;37m"; 18 | buf.len = strlen(buf.base); 19 | uv_write(&req, (uv_stream_t*) &tty, &buf, 1, NULL); 20 | } 21 | 22 | uv_write_t req; 23 | uv_buf_t buf; 24 | buf.base = "Hello TTY\n"; 25 | buf.len = strlen(buf.base); 26 | uv_write(&req, (uv_stream_t*) &tty, &buf, 1, NULL); 27 | uv_tty_reset_mode(); 28 | return uv_run(loop, UV_RUN_DEFAULT); 29 | } 30 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/code/uvstop/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int64_t counter = 0; 5 | 6 | void idle_cb(uv_idle_t *handle) { 7 | printf("Idle callback\n"); 8 | counter++; 9 | 10 | if (counter >= 5) { 11 | uv_stop(uv_default_loop()); 12 | printf("uv_stop() called\n"); 13 | } 14 | } 15 | 16 | void prep_cb(uv_prepare_t *handle) { 17 | printf("Prep callback\n"); 18 | } 19 | 20 | int main() { 21 | uv_idle_t idler; 22 | uv_prepare_t prep; 23 | 24 | uv_idle_init(uv_default_loop(), &idler); 25 | uv_idle_start(&idler, idle_cb); 26 | 27 | uv_prepare_init(uv_default_loop(), &prep); 28 | uv_prepare_start(&prep, prep_cb); 29 | 30 | uv_run(uv_default_loop(), UV_RUN_DEFAULT); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # primary 2 | sphinx==6.1.3 3 | 4 | # dependencies 5 | alabaster==0.7.13 6 | Babel==2.11.0 7 | certifi==2022.12.7 8 | charset-normalizer==3.0.1 9 | docutils==0.19 10 | idna==3.4 11 | imagesize==1.4.1 12 | importlib-metadata==6.0.0 13 | Jinja2==3.1.2 14 | MarkupSafe==2.1.2 15 | packaging==23.0 16 | Pygments==2.14.0 17 | pytz==2022.7.1 18 | requests==2.28.2 19 | snowballstemmer==2.2.0 20 | sphinxcontrib-applehelp==1.0.3 21 | sphinxcontrib-devhelp==1.0.2 22 | sphinxcontrib-htmlhelp==2.0.0 23 | sphinxcontrib-jsmath==1.0.1 24 | sphinxcontrib-qthelp==1.0.3 25 | sphinxcontrib-serializinghtml==1.1.5 26 | urllib3==1.26.14 27 | zipp==3.11.0 28 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/api.rst: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | API documentation 4 | ================= 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | errors 10 | version 11 | loop 12 | handle 13 | request 14 | timer 15 | prepare 16 | check 17 | idle 18 | async 19 | poll 20 | signal 21 | process 22 | stream 23 | tcp 24 | pipe 25 | tty 26 | udp 27 | fs_event 28 | fs_poll 29 | fs 30 | threadpool 31 | dns 32 | dll 33 | threading 34 | misc 35 | metrics 36 | 37 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/check.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _check: 3 | 4 | :c:type:`uv_check_t` --- Check handle 5 | ===================================== 6 | 7 | Check handles will run the given callback once per loop iteration, right 8 | after polling for i/o. 9 | 10 | 11 | Data types 12 | ---------- 13 | 14 | .. c:type:: uv_check_t 15 | 16 | Check handle type. 17 | 18 | .. c:type:: void (*uv_check_cb)(uv_check_t* handle) 19 | 20 | Type definition for callback passed to :c:func:`uv_check_start`. 21 | 22 | 23 | Public members 24 | ^^^^^^^^^^^^^^ 25 | 26 | N/A 27 | 28 | .. seealso:: The :c:type:`uv_handle_t` members also apply. 29 | 30 | 31 | API 32 | --- 33 | 34 | .. c:function:: int uv_check_init(uv_loop_t* loop, uv_check_t* check) 35 | 36 | Initialize the handle. This function always succeeds. 37 | 38 | :returns: 0 39 | 40 | .. c:function:: int uv_check_start(uv_check_t* check, uv_check_cb cb) 41 | 42 | Start the handle with the given callback. This function always succeeds, 43 | except when `cb` is `NULL`. 44 | 45 | :returns: 0 on success, or `UV_EINVAL` when `cb == NULL`. 46 | 47 | .. c:function:: int uv_check_stop(uv_check_t* check) 48 | 49 | Stop the handle, the callback will no longer be called. 50 | This function always succeeds. 51 | 52 | :returns: 0 53 | 54 | .. seealso:: The :c:type:`uv_handle_t` API functions also apply. 55 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/dll.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _dll: 3 | 4 | Shared library handling 5 | ======================= 6 | 7 | libuv provides cross platform utilities for loading shared libraries and 8 | retrieving symbols from them, using the following API. 9 | 10 | 11 | Data types 12 | ---------- 13 | 14 | .. c:type:: uv_lib_t 15 | 16 | Shared library data type. 17 | 18 | 19 | Public members 20 | ^^^^^^^^^^^^^^ 21 | 22 | N/A 23 | 24 | 25 | API 26 | --- 27 | 28 | .. c:function:: int uv_dlopen(const char* filename, uv_lib_t* lib) 29 | 30 | Opens a shared library. The filename is in utf-8. Returns 0 on success and 31 | -1 on error. Call :c:func:`uv_dlerror` to get the error message. 32 | 33 | .. c:function:: void uv_dlclose(uv_lib_t* lib) 34 | 35 | Close the shared library. 36 | 37 | .. c:function:: int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr) 38 | 39 | Retrieves a data pointer from a dynamic library. It is legal for a symbol 40 | to map to NULL. Returns 0 on success and -1 if the symbol was not found. 41 | 42 | .. c:function:: const char* uv_dlerror(const uv_lib_t* lib) 43 | 44 | Returns the last uv_dlopen() or uv_dlsym() error message. 45 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/guide.rst: -------------------------------------------------------------------------------- 1 | .. _guide: 2 | 3 | User guide 4 | ========== 5 | 6 | .. warning:: 7 | The contents of this guide have been recently incorporated into the libuv documentation 8 | and it hasn't gone through thorough review yet. If you spot a mistake please file an 9 | issue, or better yet, open a pull request! 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | guide/introduction 15 | guide/basics 16 | guide/filesystem 17 | guide/networking 18 | guide/threads 19 | guide/processes 20 | guide/eventloops 21 | guide/utilities 22 | guide/about 23 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/guide/about.rst: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | `Nikhil Marathe `_ started writing this book one 5 | afternoon (June 16, 2012) when he didn't feel like programming. He had recently 6 | been stung by the lack of good documentation on libuv while working on 7 | `node-taglib `_. Although reference 8 | documentation was present, there were no comprehensive tutorials. This book is 9 | the output of that need and tries to be accurate. That said, the book may have 10 | mistakes. Pull requests are encouraged. 11 | 12 | Nikhil is indebted to Marc Lehmann's comprehensive `man page 13 | `_ about libev which 14 | describes much of the semantics of the two libraries. 15 | 16 | This book was made using `Sphinx `_ and `vim 17 | `_. 18 | 19 | .. note:: 20 | In 2017 the libuv project incorporated the Nikhil's work into the official 21 | documentation and it's maintained there henceforth. 22 | 23 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/idle.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _idle: 3 | 4 | :c:type:`uv_idle_t` --- Idle handle 5 | =================================== 6 | 7 | Idle handles will run the given callback once per loop iteration, right 8 | before the :c:type:`uv_prepare_t` handles. 9 | 10 | .. note:: 11 | The notable difference with prepare handles is that when there are active idle handles, 12 | the loop will perform a zero timeout poll instead of blocking for i/o. 13 | 14 | .. warning:: 15 | Despite the name, idle handles will get their callbacks called on every loop iteration, 16 | not when the loop is actually "idle". 17 | 18 | 19 | Data types 20 | ---------- 21 | 22 | .. c:type:: uv_idle_t 23 | 24 | Idle handle type. 25 | 26 | .. c:type:: void (*uv_idle_cb)(uv_idle_t* handle) 27 | 28 | Type definition for callback passed to :c:func:`uv_idle_start`. 29 | 30 | 31 | Public members 32 | ^^^^^^^^^^^^^^ 33 | 34 | N/A 35 | 36 | .. seealso:: The :c:type:`uv_handle_t` members also apply. 37 | 38 | 39 | API 40 | --- 41 | 42 | .. c:function:: int uv_idle_init(uv_loop_t* loop, uv_idle_t* idle) 43 | 44 | Initialize the handle. This function always succeeds. 45 | 46 | :returns: 0 47 | 48 | .. c:function:: int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb) 49 | 50 | Start the handle with the given callback. This function always succeeds, 51 | except when `cb` is `NULL`. 52 | 53 | :returns: 0 on success, or `UV_EINVAL` when `cb == NULL`. 54 | 55 | .. c:function:: int uv_idle_stop(uv_idle_t* idle) 56 | 57 | Stop the handle, the callback will no longer be called. 58 | This function always succeeds. 59 | 60 | :returns: 0 61 | 62 | .. seealso:: The :c:type:`uv_handle_t` API functions also apply. 63 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Welcome to the libuv documentation 3 | ================================== 4 | 5 | Overview 6 | -------- 7 | 8 | libuv is a multi-platform support library with a focus on asynchronous I/O. It 9 | was primarily developed for use by `Node.js`_, but it's also used by `Luvit`_, 10 | `Julia`_, `uvloop`_, and `others`_. 11 | 12 | .. note:: 13 | In case you find errors in this documentation you can help by sending 14 | `pull requests `_! 15 | 16 | .. _Node.js: https://nodejs.org 17 | .. _Luvit: https://luvit.io 18 | .. _Julia: https://julialang.org 19 | .. _uvloop: https://github.com/MagicStack/uvloop 20 | .. _others: https://github.com/libuv/libuv/blob/v1.x/LINKS.md 21 | 22 | 23 | Features 24 | -------- 25 | 26 | * Full-featured event loop backed by epoll, kqueue, IOCP, event ports. 27 | * Asynchronous TCP and UDP sockets 28 | * Asynchronous DNS resolution 29 | * Asynchronous file and file system operations 30 | * File system events 31 | * ANSI escape code controlled TTY 32 | * IPC with socket sharing, using Unix domain sockets or named pipes (Windows) 33 | * Child processes 34 | * Thread pool 35 | * Signal handling 36 | * High resolution clock 37 | * Threading and synchronization primitives 38 | 39 | 40 | Documentation 41 | ------------- 42 | 43 | .. toctree:: 44 | :maxdepth: 1 45 | 46 | design 47 | api 48 | guide 49 | upgrading 50 | 51 | 52 | Downloads 53 | --------- 54 | 55 | libuv can be downloaded from `here `_. 56 | 57 | 58 | Installation 59 | ------------ 60 | 61 | Installation instructions can be found in `the README `_. 62 | 63 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/prepare.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _prepare: 3 | 4 | :c:type:`uv_prepare_t` --- Prepare handle 5 | ========================================= 6 | 7 | Prepare handles will run the given callback once per loop iteration, right 8 | before polling for i/o. 9 | 10 | 11 | Data types 12 | ---------- 13 | 14 | .. c:type:: uv_prepare_t 15 | 16 | Prepare handle type. 17 | 18 | .. c:type:: void (*uv_prepare_cb)(uv_prepare_t* handle) 19 | 20 | Type definition for callback passed to :c:func:`uv_prepare_start`. 21 | 22 | 23 | Public members 24 | ^^^^^^^^^^^^^^ 25 | 26 | N/A 27 | 28 | .. seealso:: The :c:type:`uv_handle_t` members also apply. 29 | 30 | 31 | API 32 | --- 33 | 34 | .. c:function:: int uv_prepare_init(uv_loop_t* loop, uv_prepare_t* prepare) 35 | 36 | Initialize the handle. This function always succeeds. 37 | 38 | :returns: 0 39 | 40 | .. c:function:: int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb) 41 | 42 | Start the handle with the given callback. This function always succeeds, 43 | except when `cb` is `NULL`. 44 | 45 | :returns: 0 on success, or `UV_EINVAL` when `cb == NULL`. 46 | 47 | .. c:function:: int uv_prepare_stop(uv_prepare_t* prepare) 48 | 49 | Stop the handle, the callback will no longer be called. 50 | This function always succeeds. 51 | 52 | :returns: 0 53 | 54 | .. seealso:: The :c:type:`uv_handle_t` API functions also apply. 55 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/sphinx-plugins/manpage.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # 4 | # Copyright (c) 2013 Dariusz Dwornikowski. All rights reserved. 5 | # 6 | # Adapted from https://github.com/tdi/sphinxcontrib-manpage 7 | # License: Apache 2 8 | # 9 | 10 | 11 | import re 12 | 13 | from docutils import nodes, utils 14 | from docutils.parsers.rst.roles import set_classes 15 | from string import Template 16 | 17 | 18 | def make_link_node(rawtext, app, name, manpage_num, options): 19 | ref = app.config.man_url_regex 20 | if not ref: 21 | ref = "https://man7.org/linux/man-pages/man%s/%s.%s.html" %(manpage_num, name, manpage_num) 22 | else: 23 | s = Template(ref) 24 | ref = s.substitute(num=manpage_num, topic=name) 25 | set_classes(options) 26 | node = nodes.reference(rawtext, "%s(%s)" % (name, manpage_num), refuri=ref, **options) 27 | return node 28 | 29 | 30 | def man_role(name, rawtext, text, lineno, inliner, options={}, content=[]): 31 | app = inliner.document.settings.env.app 32 | p = re.compile("([a-zA-Z0-9_\.-_]+)\((\d)\)") 33 | m = p.match(text) 34 | 35 | manpage_num = m.group(2) 36 | name = m.group(1) 37 | node = make_link_node(rawtext, app, name, manpage_num, options) 38 | return [node], [] 39 | 40 | 41 | def setup(app): 42 | app.add_role('man', man_role) 43 | app.add_config_value('man_url_regex', None, 'env') 44 | return 45 | 46 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/architecture.png -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Data/st0-311.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/Data/st0-311.jpg -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Data/st1-475.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/Data/st1-475.jpg -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/Index.zip -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Template: White (2014-02-28 09:41) 6 | M6.2.2-1878-1 7 | 8 | 9 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Metadata/DocumentIdentifier: -------------------------------------------------------------------------------- 1 | F69E9CD9-EEF1-4223-9DA4-A1EA7FE112BA -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/Metadata/Properties.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/Metadata/Properties.plist -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview-micro.jpg -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview-web.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview-web.jpg -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/diagrams.key/preview.jpg -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/favicon.ico -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/logo.png -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/static/loop_iteration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/docs/src/static/loop_iteration.png -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/docs/src/upgrading.rst: -------------------------------------------------------------------------------- 1 | .. _upgrading: 2 | 3 | Upgrading 4 | ========= 5 | 6 | Migration guides for different libuv versions, starting with 1.0. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | 11 | migration_010_100 12 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/img/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/img/banner.png -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/include/uv/os390.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_MVS_H 23 | #define UV_MVS_H 24 | 25 | #define UV_PLATFORM_SEM_T long 26 | 27 | #define UV_PLATFORM_LOOP_FIELDS \ 28 | void* ep; \ 29 | 30 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 31 | char rfis_rftok[8]; \ 32 | 33 | #endif /* UV_MVS_H */ 34 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/include/uv/posix.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_POSIX_H 23 | #define UV_POSIX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | struct pollfd* poll_fds; \ 27 | size_t poll_fds_used; \ 28 | size_t poll_fds_size; \ 29 | unsigned char poll_fds_iterating; \ 30 | 31 | #endif /* UV_POSIX_H */ 32 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/include/uv/threadpool.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | /* 23 | * This file is private to libuv. It provides common functionality to both 24 | * Windows and Unix backends. 25 | */ 26 | 27 | #ifndef UV_THREADPOOL_H_ 28 | #define UV_THREADPOOL_H_ 29 | 30 | struct uv__work { 31 | void (*work)(struct uv__work *w); 32 | void (*done)(struct uv__work *w, int status); 33 | struct uv_loop_s* loop; 34 | struct uv__queue wq; 35 | }; 36 | 37 | #endif /* UV_THREADPOOL_H_ */ 38 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/libuv-static.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libuv-static 7 | Version: @PACKAGE_VERSION@ 8 | Description: multi-platform support library with a focus on asynchronous I/O. 9 | URL: http://libuv.org/ 10 | 11 | Libs: -L${libdir} -l:libuv.a @LIBS@ 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/libuv.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | LIBUV_STATIC=-L${libdir} -l:libuv.a @LIBS@ 6 | 7 | Name: libuv 8 | Version: @PACKAGE_VERSION@ 9 | Description: multi-platform support library with a focus on asynchronous I/O. 10 | URL: http://libuv.org/ 11 | 12 | Libs: -L${libdir} -luv @LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/m4/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore libtoolize-generated files. 2 | *.m4 3 | !as_case.m4 4 | !ax_pthread.m4 5 | !libuv-check-flags.m4 6 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/m4/as_case.m4: -------------------------------------------------------------------------------- 1 | # AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT]) 2 | # ---------------------------------------------------- 3 | # Expand into 4 | # | case WORD in 5 | # | PATTERN1) IF-MATCHED1 ;; 6 | # | ... 7 | # | *) DEFAULT ;; 8 | # | esac 9 | m4_define([_AS_CASE], 10 | [m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])], 11 | [$#], 1, [ *) $1 ;;], 12 | [$#], 2, [ $1) m4_default([$2], [:]) ;;], 13 | [ $1) m4_default([$2], [:]) ;; 14 | $0(m4_shiftn(2, $@))])dnl 15 | ]) 16 | m4_defun([AS_CASE], 17 | [m4_ifval([$2$3], 18 | [case $1 in 19 | _AS_CASE(m4_shift($@)) 20 | esac])]) 21 | 22 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/idna.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, 2018 Ben Noordhuis 2 | * 3 | * Permission to use, copy, modify, and/or distribute this software for any 4 | * purpose with or without fee is hereby granted, provided that the above 5 | * copyright notice and this permission notice appear in all copies. 6 | * 7 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | */ 15 | 16 | #ifndef UV_SRC_IDNA_H_ 17 | #define UV_SRC_IDNA_H_ 18 | 19 | /* Decode a single codepoint. Returns the codepoint or UINT32_MAX on error. 20 | * |p| is updated on success _and_ error, i.e., bad multi-byte sequences are 21 | * skipped in their entirety, not just the first bad byte. 22 | */ 23 | unsigned uv__utf8_decode1(const char** p, const char* pe); 24 | 25 | /* Convert a UTF-8 domain name to IDNA 2008 / Punycode. A return value >= 0 26 | * is the number of bytes written to |d|, including the trailing nul byte. 27 | * A return value < 0 is a libuv error code. |s| and |d| can not overlap. 28 | */ 29 | long uv__idna_toascii(const char* s, const char* se, char* d, char* de); 30 | 31 | #endif /* UV_SRC_IDNA_H_ */ 32 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/strscpy.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "strscpy.h" 23 | #include /* SSIZE_MAX */ 24 | 25 | ssize_t uv__strscpy(char* d, const char* s, size_t n) { 26 | size_t i; 27 | 28 | for (i = 0; i < n; i++) 29 | if ('\0' == (d[i] = s[i])) 30 | return i > SSIZE_MAX ? UV_E2BIG : (ssize_t) i; 31 | 32 | if (i == 0) 33 | return 0; 34 | 35 | d[--i] = '\0'; 36 | 37 | return UV_E2BIG; 38 | } 39 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/strtok.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_STRTOK_H_ 23 | #define UV_STRTOK_H_ 24 | 25 | char* uv__strtok(char* str, const char* sep, char** itr); 26 | 27 | #endif /* UV_STRTOK_H_ */ 28 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/unix/no-proctitle.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "internal.h" 24 | 25 | #include 26 | #include 27 | 28 | char** uv_setup_args(int argc, char** argv) { 29 | return argv; 30 | } 31 | 32 | void uv__process_title_cleanup(void) { 33 | } 34 | 35 | int uv_set_process_title(const char* title) { 36 | return 0; 37 | } 38 | 39 | int uv_get_process_title(char* buffer, size_t size) { 40 | if (buffer == NULL || size == 0) 41 | return UV_EINVAL; 42 | 43 | buffer[0] = '\0'; 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/unix/posix-hrtime.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "internal.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | uint64_t uv__hrtime(uv_clocktype_t type) { 30 | struct timespec t; 31 | 32 | if (clock_gettime(CLOCK_MONOTONIC, &t)) 33 | abort(); 34 | 35 | return t.tv_sec * (uint64_t) 1e9 + t.tv_nsec; 36 | } 37 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/unix/procfs-exepath.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "internal.h" 24 | 25 | #include 26 | #include 27 | 28 | int uv_exepath(char* buffer, size_t* size) { 29 | ssize_t n; 30 | 31 | if (buffer == NULL || size == NULL || *size == 0) 32 | return UV_EINVAL; 33 | 34 | n = *size - 1; 35 | if (n > 0) 36 | n = readlink("/proc/self/exe", buffer, n); 37 | 38 | if (n == -1) 39 | return UV__ERR(errno); 40 | 41 | buffer[n] = '\0'; 42 | *size = n; 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/unix/sysinfo-loadavg.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "internal.h" 24 | 25 | #include 26 | #include 27 | 28 | void uv_loadavg(double avg[3]) { 29 | struct sysinfo info; 30 | 31 | if (sysinfo(&info) < 0) return; 32 | 33 | avg[0] = (double) info.loads[0] / 65536.0; 34 | avg[1] = (double) info.loads[1] / 65536.0; 35 | avg[2] = (double) info.loads[2] / 65536.0; 36 | } 37 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/unix/sysinfo-memory.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "internal.h" 24 | 25 | #include 26 | #include 27 | 28 | uint64_t uv_get_free_memory(void) { 29 | struct sysinfo info; 30 | 31 | if (sysinfo(&info) == 0) 32 | return (uint64_t) info.freeram * info.mem_unit; 33 | return 0; 34 | } 35 | 36 | uint64_t uv_get_total_memory(void) { 37 | struct sysinfo info; 38 | 39 | if (sysinfo(&info) == 0) 40 | return (uint64_t) info.totalram * info.mem_unit; 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/src/win/snprintf.c: -------------------------------------------------------------------------------- 1 | /* Copyright the libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #if defined(_MSC_VER) && _MSC_VER < 1900 23 | 24 | #include 25 | #include 26 | 27 | /* Emulate snprintf() on MSVC<2015, _snprintf() doesn't zero-terminate the buffer 28 | * on overflow... 29 | */ 30 | int snprintf(char* buf, size_t len, const char* fmt, ...) { 31 | int n; 32 | va_list ap; 33 | va_start(ap, fmt); 34 | 35 | n = _vscprintf(fmt, ap); 36 | vsnprintf_s(buf, len, _TRUNCATE, fmt, ap); 37 | 38 | va_end(ap); 39 | return n; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/fixtures/empty_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/test/fixtures/empty_file -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/fixtures/load_error.node: -------------------------------------------------------------------------------- 1 | foobar 2 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/fixtures/lorem_ipsum.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 2 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/fixtures/one_file/one_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/libuv-1.46.0/test/fixtures/one_file/one_file -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/runner-unix.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef TEST_RUNNER_UNIX_H 23 | #define TEST_RUNNER_UNIX_H 24 | 25 | #include 26 | #include /* FILE */ 27 | 28 | typedef struct { 29 | FILE* stdout_file; 30 | pid_t pid; 31 | char* name; 32 | int status; 33 | int terminated; 34 | } process_info_t; 35 | 36 | #endif /* TEST_RUNNER_UNIX_H */ 37 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-fail-always.c: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "task.h" 23 | 24 | 25 | TEST_IMPL(fail_always) { 26 | /* This test always fails. It is used to test the test runner. */ 27 | FATAL("Yes, it always fails"); 28 | return 2; 29 | } 30 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-get-loadavg.c: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "task.h" 24 | 25 | TEST_IMPL(get_loadavg) { 26 | 27 | double avg[3] = {-1, -1, -1}; 28 | uv_loadavg(avg); 29 | 30 | ASSERT(avg[0] >= 0); 31 | ASSERT(avg[1] >= 0); 32 | ASSERT(avg[2] >= 0); 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-gettimeofday.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "uv.h" 23 | #include "task.h" 24 | 25 | TEST_IMPL(gettimeofday) { 26 | uv_timeval64_t tv; 27 | int r; 28 | 29 | tv.tv_sec = 0; 30 | r = uv_gettimeofday(&tv); 31 | ASSERT(r == 0); 32 | ASSERT(tv.tv_sec != 0); 33 | 34 | /* Test invalid input. */ 35 | r = uv_gettimeofday(NULL); 36 | ASSERT(r == UV_EINVAL); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-loop-configure.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, Ben Noordhuis 2 | * 3 | * Permission to use, copy, modify, and/or distribute this software for any 4 | * purpose with or without fee is hereby granted, provided that the above 5 | * copyright notice and this permission notice appear in all copies. 6 | * 7 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | */ 15 | 16 | #include "uv.h" 17 | #include "task.h" 18 | 19 | static void timer_cb(uv_timer_t* handle) { 20 | uv_close((uv_handle_t*) handle, NULL); 21 | } 22 | 23 | 24 | TEST_IMPL(loop_configure) { 25 | uv_timer_t timer_handle; 26 | uv_loop_t loop; 27 | ASSERT(0 == uv_loop_init(&loop)); 28 | #ifdef _WIN32 29 | ASSERT(UV_ENOSYS == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, 0)); 30 | #else 31 | ASSERT(0 == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, SIGPROF)); 32 | #endif 33 | ASSERT(0 == uv_timer_init(&loop, &timer_handle)); 34 | ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 10, 0)); 35 | ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); 36 | ASSERT(0 == uv_loop_close(&loop)); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-pass-always.c: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "task.h" 23 | 24 | 25 | TEST_IMPL(pass_always) { 26 | /* This test always passes. It is used to test the test runner. */ 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/test/test-test-macros.c: -------------------------------------------------------------------------------- 1 | /* Copyright libuv contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #include "task.h" 23 | 24 | int test_macros_evil(void) { 25 | static int x; 26 | return x++; 27 | } 28 | 29 | 30 | TEST_IMPL(test_macros) { 31 | char* a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 32 | char* b = "ABCDEFGHIJKLMNOPQRSTUVWXYz"; 33 | char* c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 34 | int i; 35 | 36 | i = test_macros_evil(); 37 | ASSERT_STR_NE(a, b); 38 | ASSERT_STR_EQ(a, c); 39 | ASSERT_EQ(i + 1, test_macros_evil()); 40 | ASSERT_EQ(i + 2, test_macros_evil()); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/tools/vswhere_usability_wrapper.cmd: -------------------------------------------------------------------------------- 1 | :: Copyright 2017 - Refael Ackermann 2 | :: Distributed under MIT style license or the libuv license 3 | :: See accompanying file LICENSE at https://github.com/node4good/windows-autoconf 4 | :: or libuv LICENSE file at https://github.com/libuv/libuv 5 | :: version: 2.0.0 6 | 7 | @if not defined DEBUG_HELPER @ECHO OFF 8 | setlocal 9 | if "%~1"=="prerelease" set VSWHERE_WITH_PRERELEASE=1 10 | set "InstallerPath=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" 11 | if not exist "%InstallerPath%" set "InstallerPath=%ProgramFiles%\Microsoft Visual Studio\Installer" 12 | if not exist "%InstallerPath%" goto :no-vswhere 13 | :: Manipulate %Path% for easier " handeling 14 | set "Path=%Path%;%InstallerPath%" 15 | where vswhere 2> nul > nul 16 | if errorlevel 1 goto :no-vswhere 17 | set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 18 | set VSWHERE_PRP=-property installationPath 19 | set VSWHERE_LMT=-version "[15.0,16.0)" 20 | vswhere -prerelease > nul 21 | if not errorlevel 1 if "%VSWHERE_WITH_PRERELEASE%"=="1" set "VSWHERE_LMT=%VSWHERE_LMT% -prerelease" 22 | SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT% 23 | for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do ( 24 | endlocal 25 | set "VCINSTALLDIR=%%i\VC\" 26 | set "VS150COMNTOOLS=%%i\Common7\Tools\" 27 | exit /B 0 28 | ) 29 | 30 | :no-vswhere 31 | endlocal 32 | echo could not find "vswhere" 33 | exit /B 1 -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/tsansupp.txt: -------------------------------------------------------------------------------- 1 | # glibc reads `count` field unsynchronized, not a libuv bug 2 | race:pthread_barrier_destroy 3 | -------------------------------------------------------------------------------- /third-party/libuv-1.46.0/uv_win_longpath.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Lua License 2 | ----------- 3 | 4 | Lua is licensed under the terms of the MIT license reproduced below. 5 | This means that Lua is free software and can be used for both academic 6 | and commercial purposes at absolutely no cost. 7 | 8 | For details and rationale, see http://www.lua.org/license.html . 9 | 10 | =============================================================================== 11 | 12 | Copyright (C) 1994-2012 Lua.org, PUC-Rio. 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in 22 | all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | THE SOFTWARE. 31 | 32 | =============================================================================== 33 | 34 | (end of COPYRIGHT) 35 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/README: -------------------------------------------------------------------------------- 1 | README for Lua 5.1 2 | 3 | See INSTALL for installation instructions. 4 | See HISTORY for a summary of changes since the last released version. 5 | 6 | * What is Lua? 7 | ------------ 8 | Lua is a powerful, light-weight programming language designed for extending 9 | applications. Lua is also frequently used as a general-purpose, stand-alone 10 | language. Lua is free software. 11 | 12 | For complete information, visit Lua's web site at http://www.lua.org/ . 13 | For an executive summary, see http://www.lua.org/about.html . 14 | 15 | Lua has been used in many different projects around the world. 16 | For a short list, see http://www.lua.org/uses.html . 17 | 18 | * Availability 19 | ------------ 20 | Lua is freely available for both academic and commercial purposes. 21 | See COPYRIGHT and http://www.lua.org/license.html for details. 22 | Lua can be downloaded at http://www.lua.org/download.html . 23 | 24 | * Installation 25 | ------------ 26 | Lua is implemented in pure ANSI C, and compiles unmodified in all known 27 | platforms that have an ANSI C compiler. In most Unix-like platforms, simply 28 | do "make" with a suitable target. See INSTALL for detailed instructions. 29 | 30 | * Origin 31 | ------ 32 | Lua is developed at Lua.org, a laboratory of the Department of Computer 33 | Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro 34 | in Brazil). 35 | For more information about the authors, see http://www.lua.org/authors.html . 36 | 37 | (end of README) 38 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/doc/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.1.5/doc/cover.png -------------------------------------------------------------------------------- /third-party/lua-5.1.5/doc/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.1.5/doc/logo.gif -------------------------------------------------------------------------------- /third-party/lua-5.1.5/doc/lua.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #000000 ; 3 | background-color: #FFFFFF ; 4 | font-family: Helvetica, Arial, sans-serif ; 5 | text-align: justify ; 6 | margin-right: 30px ; 7 | margin-left: 30px ; 8 | } 9 | 10 | h1, h2, h3, h4 { 11 | font-family: Verdana, Geneva, sans-serif ; 12 | font-weight: normal ; 13 | font-style: italic ; 14 | } 15 | 16 | h2 { 17 | padding-top: 0.4em ; 18 | padding-bottom: 0.4em ; 19 | padding-left: 30px ; 20 | padding-right: 30px ; 21 | margin-left: -30px ; 22 | background-color: #E0E0FF ; 23 | } 24 | 25 | h3 { 26 | padding-left: 0.5em ; 27 | border-left: solid #E0E0FF 1em ; 28 | } 29 | 30 | table h3 { 31 | padding-left: 0px ; 32 | border-left: none ; 33 | } 34 | 35 | a:link { 36 | color: #000080 ; 37 | background-color: inherit ; 38 | text-decoration: none ; 39 | } 40 | 41 | a:visited { 42 | background-color: inherit ; 43 | text-decoration: none ; 44 | } 45 | 46 | a:link:hover, a:visited:hover { 47 | color: #000080 ; 48 | background-color: #E0E0FF ; 49 | } 50 | 51 | a:link:active, a:visited:active { 52 | color: #FF0000 ; 53 | } 54 | 55 | hr { 56 | border: 0 ; 57 | height: 1px ; 58 | color: #a0a0a0 ; 59 | background-color: #a0a0a0 ; 60 | } 61 | 62 | :target { 63 | background-color: #F8F8F8 ; 64 | padding: 8px ; 65 | border: solid #a0a0a0 2px ; 66 | } 67 | 68 | .footer { 69 | color: gray ; 70 | font-size: small ; 71 | } 72 | 73 | input[type=text] { 74 | border: solid #a0a0a0 2px ; 75 | border-radius: 2em ; 76 | -moz-border-radius: 2em ; 77 | background-image: url('images/search.png') ; 78 | background-repeat: no-repeat; 79 | background-position: 4px center ; 80 | padding-left: 20px ; 81 | height: 2em ; 82 | } 83 | 84 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/doc/manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | font-size: inherit ; 4 | } 5 | 6 | pre, code { 7 | font-size: 12pt ; 8 | } 9 | 10 | span.apii { 11 | float: right ; 12 | font-family: inherit ; 13 | font-style: normal ; 14 | font-size: small ; 15 | color: gray ; 16 | } 17 | 18 | p+h1, ul+h1 { 19 | padding-top: 0.4em ; 20 | padding-bottom: 0.4em ; 21 | padding-left: 30px ; 22 | margin-left: -30px ; 23 | background-color: #E0E0FF ; 24 | } 25 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/doc/readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Lua documentation 4 | 5 | 6 | 7 | 8 | 9 |
10 |

11 | Lua 12 | Documentation 13 |

14 | 15 | This is the documentation included in the source distribution of Lua 5.1.5. 16 | 17 | 25 | 26 | Lua's 27 | official web site 28 | contains updated documentation, 29 | especially the 30 | reference manual. 31 |

32 | 33 |


34 | 35 | Last update: 36 | Fri Feb 3 09:44:42 BRST 2012 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for Lua etc 2 | 3 | TOP= .. 4 | LIB= $(TOP)/src 5 | INC= $(TOP)/src 6 | BIN= $(TOP)/src 7 | SRC= $(TOP)/src 8 | TST= $(TOP)/test 9 | 10 | CC= gcc 11 | CFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS) 12 | MYCFLAGS= 13 | MYLDFLAGS= -Wl,-E 14 | MYLIBS= -lm 15 | #MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses 16 | RM= rm -f 17 | 18 | default: 19 | @echo 'Please choose a target: min noparser one strict clean' 20 | 21 | min: min.c 22 | $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS) 23 | echo 'print"Hello there!"' | ./a.out 24 | 25 | noparser: noparser.o 26 | $(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS) 27 | $(BIN)/luac $(TST)/hello.lua 28 | -./a.out luac.out 29 | -./a.out -e'a=1' 30 | 31 | one: 32 | $(CC) $(CFLAGS) all.c $(MYLIBS) 33 | ./a.out $(TST)/hello.lua 34 | 35 | strict: 36 | -$(BIN)/lua -e 'print(a);b=2' 37 | -$(BIN)/lua -lstrict -e 'print(a)' 38 | -$(BIN)/lua -e 'function f() b=2 end f()' 39 | -$(BIN)/lua -lstrict -e 'function f() b=2 end f()' 40 | 41 | clean: 42 | $(RM) a.out core core.* *.o luac.out 43 | 44 | .PHONY: default min noparser one strict clean 45 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/README: -------------------------------------------------------------------------------- 1 | This directory contains some useful files and code. 2 | Unlike the code in ../src, everything here is in the public domain. 3 | 4 | If any of the makes fail, you're probably not using the same libraries 5 | used to build Lua. Set MYLIBS in Makefile accordingly. 6 | 7 | all.c 8 | Full Lua interpreter in a single file. 9 | Do "make one" for a demo. 10 | 11 | lua.hpp 12 | Lua header files for C++ using 'extern "C"'. 13 | 14 | lua.ico 15 | A Lua icon for Windows (and web sites: save as favicon.ico). 16 | Drawn by hand by Markus Gritsch . 17 | 18 | lua.pc 19 | pkg-config data for Lua 20 | 21 | luavs.bat 22 | Script to build Lua under "Visual Studio .NET Command Prompt". 23 | Run it from the toplevel as etc\luavs.bat. 24 | 25 | min.c 26 | A minimal Lua interpreter. 27 | Good for learning and for starting your own. 28 | Do "make min" for a demo. 29 | 30 | noparser.c 31 | Linking with noparser.o avoids loading the parsing modules in lualib.a. 32 | Do "make noparser" for a demo. 33 | 34 | strict.lua 35 | Traps uses of undeclared global variables. 36 | Do "make strict" for a demo. 37 | 38 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/all.c: -------------------------------------------------------------------------------- 1 | /* 2 | * all.c -- Lua core, libraries and interpreter in a single file 3 | */ 4 | 5 | #define luaall_c 6 | 7 | #include "lapi.c" 8 | #include "lcode.c" 9 | #include "ldebug.c" 10 | #include "ldo.c" 11 | #include "ldump.c" 12 | #include "lfunc.c" 13 | #include "lgc.c" 14 | #include "llex.c" 15 | #include "lmem.c" 16 | #include "lobject.c" 17 | #include "lopcodes.c" 18 | #include "lparser.c" 19 | #include "lstate.c" 20 | #include "lstring.c" 21 | #include "ltable.c" 22 | #include "ltm.c" 23 | #include "lundump.c" 24 | #include "lvm.c" 25 | #include "lzio.c" 26 | 27 | #include "lauxlib.c" 28 | #include "lbaselib.c" 29 | #include "ldblib.c" 30 | #include "liolib.c" 31 | #include "linit.c" 32 | #include "lmathlib.c" 33 | #include "loadlib.c" 34 | #include "loslib.c" 35 | #include "lstrlib.c" 36 | #include "ltablib.c" 37 | 38 | #include "lua.c" 39 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/lua.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.1.5/etc/lua.ico -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/lua.pc: -------------------------------------------------------------------------------- 1 | # lua.pc -- pkg-config data for Lua 2 | 3 | # vars from install Makefile 4 | 5 | # grep '^V=' ../Makefile 6 | V= 5.1 7 | # grep '^R=' ../Makefile 8 | R= 5.1.5 9 | 10 | # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' 11 | prefix= /usr/local 12 | INSTALL_BIN= ${prefix}/bin 13 | INSTALL_INC= ${prefix}/include 14 | INSTALL_LIB= ${prefix}/lib 15 | INSTALL_MAN= ${prefix}/man/man1 16 | INSTALL_LMOD= ${prefix}/share/lua/${V} 17 | INSTALL_CMOD= ${prefix}/lib/lua/${V} 18 | 19 | # canonical vars 20 | exec_prefix=${prefix} 21 | libdir=${exec_prefix}/lib 22 | includedir=${prefix}/include 23 | 24 | Name: Lua 25 | Description: An Extensible Extension Language 26 | Version: ${R} 27 | Requires: 28 | Libs: -L${libdir} -llua -lm 29 | Cflags: -I${includedir} 30 | 31 | # (end of lua.pc) 32 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/luavs.bat: -------------------------------------------------------------------------------- 1 | @rem Script to build Lua under "Visual Studio .NET Command Prompt". 2 | @rem Do not run from this directory; run it from the toplevel: etc\luavs.bat . 3 | @rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src. 4 | @rem (contributed by David Manura and Mike Pall) 5 | 6 | @setlocal 7 | @set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE 8 | @set MYLINK=link /nologo 9 | @set MYMT=mt /nologo 10 | 11 | cd src 12 | %MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c 13 | del lua.obj luac.obj 14 | %MYLINK% /DLL /out:lua51.dll l*.obj 15 | if exist lua51.dll.manifest^ 16 | %MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2 17 | %MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c 18 | %MYLINK% /out:lua.exe lua.obj lua51.lib 19 | if exist lua.exe.manifest^ 20 | %MYMT% -manifest lua.exe.manifest -outputresource:lua.exe 21 | %MYCOMPILE% l*.c print.c 22 | del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^ 23 | loslib.obj ltablib.obj lstrlib.obj loadlib.obj 24 | %MYLINK% /out:luac.exe *.obj 25 | if exist luac.exe.manifest^ 26 | %MYMT% -manifest luac.exe.manifest -outputresource:luac.exe 27 | del *.obj *.manifest 28 | cd .. 29 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/min.c: -------------------------------------------------------------------------------- 1 | /* 2 | * min.c -- a minimal Lua interpreter 3 | * loads stdin only with minimal error handling. 4 | * no interaction, and no standard library, only a "print" function. 5 | */ 6 | 7 | #include 8 | 9 | #include "lua.h" 10 | #include "lauxlib.h" 11 | 12 | static int print(lua_State *L) 13 | { 14 | int n=lua_gettop(L); 15 | int i; 16 | for (i=1; i<=n; i++) 17 | { 18 | if (i>1) printf("\t"); 19 | if (lua_isstring(L,i)) 20 | printf("%s",lua_tostring(L,i)); 21 | else if (lua_isnil(L,i)) 22 | printf("%s","nil"); 23 | else if (lua_isboolean(L,i)) 24 | printf("%s",lua_toboolean(L,i) ? "true" : "false"); 25 | else 26 | printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); 27 | } 28 | printf("\n"); 29 | return 0; 30 | } 31 | 32 | int main(void) 33 | { 34 | lua_State *L=lua_open(); 35 | lua_register(L,"print",print); 36 | if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); 37 | lua_close(L); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/noparser.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The code below can be used to make a Lua core that does not contain the 3 | * parsing modules (lcode, llex, lparser), which represent 35% of the total core. 4 | * You'll only be able to load binary files and strings, precompiled with luac. 5 | * (Of course, you'll have to build luac with the original parsing modules!) 6 | * 7 | * To use this module, simply compile it ("make noparser" does that) and list 8 | * its object file before the Lua libraries. The linker should then not load 9 | * the parsing modules. To try it, do "make luab". 10 | * 11 | * If you also want to avoid the dump module (ldump.o), define NODUMP. 12 | * #define NODUMP 13 | */ 14 | 15 | #define LUA_CORE 16 | 17 | #include "llex.h" 18 | #include "lparser.h" 19 | #include "lzio.h" 20 | 21 | LUAI_FUNC void luaX_init (lua_State *L) { 22 | UNUSED(L); 23 | } 24 | 25 | LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { 26 | UNUSED(z); 27 | UNUSED(buff); 28 | UNUSED(name); 29 | lua_pushliteral(L,"parser not loaded"); 30 | lua_error(L); 31 | return NULL; 32 | } 33 | 34 | #ifdef NODUMP 35 | #include "lundump.h" 36 | 37 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) { 38 | UNUSED(f); 39 | UNUSED(w); 40 | UNUSED(data); 41 | UNUSED(strip); 42 | #if 1 43 | UNUSED(L); 44 | return 0; 45 | #else 46 | lua_pushliteral(L,"dumper not loaded"); 47 | lua_error(L); 48 | #endif 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/etc/strict.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- strict.lua 3 | -- checks uses of undeclared global variables 4 | -- All global variables must be 'declared' through a regular assignment 5 | -- (even assigning nil will do) in a main chunk before being used 6 | -- anywhere or assigned to inside a function. 7 | -- 8 | 9 | local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget 10 | 11 | local mt = getmetatable(_G) 12 | if mt == nil then 13 | mt = {} 14 | setmetatable(_G, mt) 15 | end 16 | 17 | mt.__declared = {} 18 | 19 | local function what () 20 | local d = getinfo(3, "S") 21 | return d and d.what or "C" 22 | end 23 | 24 | mt.__newindex = function (t, n, v) 25 | if not mt.__declared[n] then 26 | local w = what() 27 | if w ~= "main" and w ~= "C" then 28 | error("assign to undeclared variable '"..n.."'", 2) 29 | end 30 | mt.__declared[n] = true 31 | end 32 | rawset(t, n, v) 33 | end 34 | 35 | mt.__index = function (t, n) 36 | if not mt.__declared[n] and what() ~= "C" then 37 | error("variable '"..n.."' is not declared", 2) 38 | end 39 | return rawget(t, n) 40 | end 41 | 42 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); 24 | LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, 25 | const TValue *p2); 26 | LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, 27 | const TValue *p2); 28 | LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); 29 | LUAI_FUNC void luaG_errormsg (lua_State *L); 30 | LUAI_FUNC int luaG_checkcode (const Proto *pt); 31 | LUAI_FUNC int luaG_checkopenop (Instruction i); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); 23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); 24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L); 25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 28 | LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); 29 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); 30 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 31 | int pc); 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/linit.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Initialization of libraries for lua.c 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #define linit_c 9 | #define LUA_LIB 10 | 11 | #include "lua.h" 12 | 13 | #include "lualib.h" 14 | #include "lauxlib.h" 15 | 16 | 17 | static const luaL_Reg lualibs[] = { 18 | {"", luaopen_base}, 19 | {LUA_LOADLIBNAME, luaopen_package}, 20 | {LUA_TABLIBNAME, luaopen_table}, 21 | {LUA_IOLIBNAME, luaopen_io}, 22 | {LUA_OSLIBNAME, luaopen_os}, 23 | {LUA_STRLIBNAME, luaopen_string}, 24 | {LUA_MATHLIBNAME, luaopen_math}, 25 | {LUA_DBLIBNAME, luaopen_debug}, 26 | {NULL, NULL} 27 | }; 28 | 29 | 30 | LUALIB_API void luaL_openlibs (lua_State *L) { 31 | const luaL_Reg *lib = lualibs; 32 | for (; lib->func; lib++) { 33 | lua_pushcfunction(L, lib->func); 34 | lua_pushstring(L, lib->name); 35 | lua_call(L, 1, 0); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lmem.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Interface to Memory Manager 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lmem_h 8 | #define lmem_h 9 | 10 | 11 | #include 12 | 13 | #include "llimits.h" 14 | #include "lua.h" 15 | 16 | #define MEMERRMSG "not enough memory" 17 | 18 | 19 | #define luaM_reallocv(L,b,on,n,e) \ 20 | ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ 21 | luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ 22 | luaM_toobig(L)) 23 | 24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) 25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) 26 | #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) 27 | 28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) 29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) 30 | #define luaM_newvector(L,n,t) \ 31 | cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) 32 | 33 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \ 34 | if ((nelems)+1 > (size)) \ 35 | ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) 36 | 37 | #define luaM_reallocvector(L, v,oldn,n,t) \ 38 | ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) 39 | 40 | 41 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, 42 | size_t size); 43 | LUAI_FUNC void *luaM_toobig (lua_State *L); 44 | LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, 45 | size_t size_elem, int limit, 46 | const char *errormsg); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | 11 | #include "lgc.h" 12 | #include "lobject.h" 13 | #include "lstate.h" 14 | 15 | 16 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) 17 | 18 | #define sizeudata(u) (sizeof(union Udata)+(u)->len) 19 | 20 | #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) 21 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 22 | (sizeof(s)/sizeof(char))-1)) 23 | 24 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) 25 | 26 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 27 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 28 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/ltable.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua tables (hash) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltable_h 8 | #define ltable_h 9 | 10 | #include "lobject.h" 11 | 12 | 13 | #define gnode(t,i) (&(t)->node[i]) 14 | #define gkey(n) (&(n)->i_key.nk) 15 | #define gval(n) (&(n)->i_val) 16 | #define gnext(n) ((n)->i_key.nk.next) 17 | 18 | #define key2tval(n) (&(n)->i_key.tvk) 19 | 20 | 21 | LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); 22 | LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); 23 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); 24 | LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); 25 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); 26 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); 27 | LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); 28 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); 29 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); 30 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); 31 | LUAI_FUNC int luaH_getn (Table *t); 32 | 33 | 34 | #if defined(LUA_DEBUG) 35 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); 36 | LUAI_FUNC int luaH_isdummy (Node *n); 37 | #endif 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/ltm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltm_h 8 | #define ltm_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | /* 15 | * WARNING: if you change the order of this enumeration, 16 | * grep "ORDER TM" 17 | */ 18 | typedef enum { 19 | TM_INDEX, 20 | TM_NEWINDEX, 21 | TM_GC, 22 | TM_MODE, 23 | TM_EQ, /* last tag method with `fast' access */ 24 | TM_ADD, 25 | TM_SUB, 26 | TM_MUL, 27 | TM_DIV, 28 | TM_MOD, 29 | TM_POW, 30 | TM_UNM, 31 | TM_LEN, 32 | TM_LT, 33 | TM_LE, 34 | TM_CONCAT, 35 | TM_CALL, 36 | TM_N /* number of elements in the enum */ 37 | } TMS; 38 | 39 | 40 | 41 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 42 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 43 | 44 | #define fasttm(l,et,e) gfasttm(G(l), et, e) 45 | 46 | LUAI_DATA const char *const luaT_typenames[]; 47 | 48 | 49 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 50 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, 51 | TMS event); 52 | LUAI_FUNC void luaT_init (lua_State *L); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* Key to file-handle type */ 15 | #define LUA_FILEHANDLE "FILE*" 16 | 17 | 18 | #define LUA_COLIBNAME "coroutine" 19 | LUALIB_API int (luaopen_base) (lua_State *L); 20 | 21 | #define LUA_TABLIBNAME "table" 22 | LUALIB_API int (luaopen_table) (lua_State *L); 23 | 24 | #define LUA_IOLIBNAME "io" 25 | LUALIB_API int (luaopen_io) (lua_State *L); 26 | 27 | #define LUA_OSLIBNAME "os" 28 | LUALIB_API int (luaopen_os) (lua_State *L); 29 | 30 | #define LUA_STRLIBNAME "string" 31 | LUALIB_API int (luaopen_string) (lua_State *L); 32 | 33 | #define LUA_MATHLIBNAME "math" 34 | LUALIB_API int (luaopen_math) (lua_State *L); 35 | 36 | #define LUA_DBLIBNAME "debug" 37 | LUALIB_API int (luaopen_debug) (lua_State *L); 38 | 39 | #define LUA_LOADLIBNAME "package" 40 | LUALIB_API int (luaopen_package) (lua_State *L); 41 | 42 | 43 | /* open all previous libraries */ 44 | LUALIB_API void (luaL_openlibs) (lua_State *L); 45 | 46 | 47 | 48 | #ifndef lua_assert 49 | #define lua_assert(x) ((void)0) 50 | #endif 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "lobject.h" 11 | #include "lzio.h" 12 | 13 | /* load one chunk; from lundump.c */ 14 | LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); 15 | 16 | /* make header; from lundump.c */ 17 | LUAI_FUNC void luaU_header (char* h); 18 | 19 | /* dump one chunk; from ldump.c */ 20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); 21 | 22 | #ifdef luac_c 23 | /* print one chunk; from print.c */ 24 | LUAI_FUNC void luaU_print (const Proto* f, int full); 25 | #endif 26 | 27 | /* for header of binary files -- this is Lua 5.1 */ 28 | #define LUAC_VERSION 0x51 29 | 30 | /* for header of binary files -- this is the official format */ 31 | #define LUAC_FORMAT 0 32 | 33 | /* size of header of binary files */ 34 | #define LUAC_HEADERSIZE 12 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/src/lvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua virtual machine 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lvm_h 8 | #define lvm_h 9 | 10 | 11 | #include "ldo.h" 12 | #include "lobject.h" 13 | #include "ltm.h" 14 | 15 | 16 | #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) 17 | 18 | #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ 19 | (((o) = luaV_tonumber(o,n)) != NULL)) 20 | 21 | #define equalobj(L,o1,o2) \ 22 | (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) 23 | 24 | 25 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); 26 | LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); 27 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); 28 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); 29 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, 30 | StkId val); 31 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, 32 | StkId val); 33 | LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); 34 | LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/test/README: -------------------------------------------------------------------------------- 1 | These are simple tests for Lua. Some of them contain useful code. 2 | They are meant to be run to make sure Lua is built correctly and also 3 | to be read, to see how Lua programs look. 4 | 5 | Here is a one-line summary of each program: 6 | 7 | bisect.lua bisection method for solving non-linear equations 8 | cf.lua temperature conversion table (celsius to farenheit) 9 | echo.lua echo command line arguments 10 | env.lua environment variables as automatic global variables 11 | factorial.lua factorial without recursion 12 | fib.lua fibonacci function with cache 13 | fibfor.lua fibonacci numbers with coroutines and generators 14 | globals.lua report global variable usage 15 | hello.lua the first program in every language 16 | life.lua Conway's Game of Life 17 | luac.lua bare-bones luac 18 | printf.lua an implementation of printf 19 | readonly.lua make global variables readonly 20 | sieve.lua the sieve of of Eratosthenes programmed with coroutines 21 | sort.lua two implementations of a sort function 22 | table.lua make table, grouping all data for the same item 23 | trace-calls.lua trace calls 24 | trace-globals.lua trace assigments to global variables 25 | xd.lua hex dump 26 | 27 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/test/bisect.lua: -------------------------------------------------------------------------------- 1 | -- bisection method for solving non-linear equations 2 | 3 | delta=1e-6 -- tolerance 4 | 5 | function bisect(f,a,b,fa,fb) 6 | local c=(a+b)/2 7 | io.write(n," c=",c," a=",a," b=",b,"\n") 8 | if c==a or c==b or math.abs(a-b)>> ",string.rep(" ",level)) 9 | if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end 10 | t=debug.getinfo(2) 11 | if event=="call" then 12 | level=level+1 13 | else 14 | level=level-1 if level<0 then level=0 end 15 | end 16 | if t.what=="main" then 17 | if event=="call" then 18 | io.write("begin ",t.short_src) 19 | else 20 | io.write("end ",t.short_src) 21 | end 22 | elseif t.what=="Lua" then 23 | -- table.foreach(t,print) 24 | io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">") 25 | else 26 | io.write(event," ",t.name or "(C)"," [",t.what,"] ") 27 | end 28 | io.write("\n") 29 | end 30 | 31 | debug.sethook(hook,"cr") 32 | level=0 33 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/test/trace-globals.lua: -------------------------------------------------------------------------------- 1 | -- trace assigments to global variables 2 | 3 | do 4 | -- a tostring that quotes strings. note the use of the original tostring. 5 | local _tostring=tostring 6 | local tostring=function(a) 7 | if type(a)=="string" then 8 | return string.format("%q",a) 9 | else 10 | return _tostring(a) 11 | end 12 | end 13 | 14 | local log=function (name,old,new) 15 | local t=debug.getinfo(3,"Sl") 16 | local line=t.currentline 17 | io.write(t.short_src) 18 | if line>=0 then io.write(":",line) end 19 | io.write(": ",name," is now ",tostring(new)," (was ",tostring(old),")","\n") 20 | end 21 | 22 | local g={} 23 | local set=function (t,name,value) 24 | log(name,g[name],value) 25 | g[name]=value 26 | end 27 | setmetatable(getfenv(),{__index=g,__newindex=set}) 28 | end 29 | 30 | -- an example 31 | 32 | a=1 33 | b=2 34 | a=10 35 | b=20 36 | b=nil 37 | b=200 38 | print(a,b,c) 39 | -------------------------------------------------------------------------------- /third-party/lua-5.1.5/test/xd.lua: -------------------------------------------------------------------------------- 1 | -- hex dump 2 | -- usage: lua xd.lua < file 3 | 4 | local offset=0 5 | while true do 6 | local s=io.read(16) 7 | if s==nil then return end 8 | io.write(string.format("%08X ",offset)) 9 | string.gsub(s,"(.)", 10 | function (c) io.write(string.format("%02X ",string.byte(c))) end) 11 | io.write(string.rep(" ",3*(16-string.len(s)))) 12 | io.write(" ",string.gsub(s,"%c","."),"\n") 13 | offset=offset+16 14 | end 15 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/README: -------------------------------------------------------------------------------- 1 | 2 | This is Lua 5.2.4, released on 25 Feb 2015. 3 | 4 | For installation instructions, license details, and 5 | further information about Lua, see doc/readme.html. 6 | 7 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/doc/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.2.4/doc/logo.gif -------------------------------------------------------------------------------- /third-party/lua-5.2.4/doc/manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | font-size: inherit ; 4 | } 5 | 6 | pre, code { 7 | font-size: 12pt ; 8 | } 9 | 10 | span.apii { 11 | float: right ; 12 | font-family: inherit ; 13 | font-style: normal ; 14 | font-size: small ; 15 | color: gray ; 16 | } 17 | 18 | p+h1, ul+h1 { 19 | font-style: normal ; 20 | padding-top: 0.4em ; 21 | padding-bottom: 0.4em ; 22 | padding-left: 16px ; 23 | margin-left: -16px ; 24 | background-color: #D0D0FF ; 25 | border-radius: 8px ; 26 | border: solid #000080 1px ; 27 | } 28 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/doc/osi-certified-72x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.2.4/doc/osi-certified-72x60.png -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | /* Active Lua function (given call info) */ 21 | #define ci_func(ci) (clLvalue((ci)->func)) 22 | 23 | 24 | LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, 25 | const char *opname); 26 | LUAI_FUNC l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2); 27 | LUAI_FUNC l_noret luaG_aritherror (lua_State *L, const TValue *p1, 28 | const TValue *p2); 29 | LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, 30 | const TValue *p2); 31 | LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); 32 | LUAI_FUNC l_noret luaG_errormsg (lua_State *L); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/ldo.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldo.h,v 2.20.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Stack and Call structure of Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldo_h 8 | #define ldo_h 9 | 10 | 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | #include "lzio.h" 14 | 15 | 16 | #define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \ 17 | luaD_growstack(L, n); else condmovestack(L); 18 | 19 | 20 | #define incr_top(L) {L->top++; luaD_checkstack(L,0);} 21 | 22 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) 23 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) 24 | 25 | 26 | /* type of protected functions, to be ran by `runprotected' */ 27 | typedef void (*Pfunc) (lua_State *L, void *ud); 28 | 29 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, 30 | const char *mode); 31 | LUAI_FUNC void luaD_hook (lua_State *L, int event, int line); 32 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); 33 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults, 34 | int allowyield); 35 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, 36 | ptrdiff_t oldtop, ptrdiff_t ef); 37 | LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); 38 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); 39 | LUAI_FUNC void luaD_growstack (lua_State *L, int n); 40 | LUAI_FUNC void luaD_shrinkstack (lua_State *L); 41 | 42 | LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); 43 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.8.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems); 23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems); 24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L); 25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 28 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); 29 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 30 | int pc); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.49.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include "lgc.h" 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | 14 | 15 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) 16 | 17 | #define sizeudata(u) (sizeof(union Udata)+(u)->len) 18 | 19 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 20 | (sizeof(s)/sizeof(char))-1)) 21 | 22 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) 23 | 24 | 25 | /* 26 | ** test whether a string is a reserved word 27 | */ 28 | #define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0) 29 | 30 | 31 | /* 32 | ** equality for short strings, which are always internalized 33 | */ 34 | #define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b)) 35 | 36 | 37 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 39 | LUAI_FUNC int luaS_eqstr (TString *a, TString *b); 40 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 41 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 42 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 43 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/ltable.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltable.h,v 2.16.1.2 2013/08/30 15:49:41 roberto Exp $ 3 | ** Lua tables (hash) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltable_h 8 | #define ltable_h 9 | 10 | #include "lobject.h" 11 | 12 | 13 | #define gnode(t,i) (&(t)->node[i]) 14 | #define gkey(n) (&(n)->i_key.tvk) 15 | #define gval(n) (&(n)->i_val) 16 | #define gnext(n) ((n)->i_key.nk.next) 17 | 18 | #define invalidateTMcache(t) ((t)->flags = 0) 19 | 20 | /* returns the key, given the value of a table entry */ 21 | #define keyfromval(v) \ 22 | (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) 23 | 24 | 25 | LUAI_FUNC const TValue *luaH_getint (Table *t, int key); 26 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); 27 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); 28 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); 29 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); 30 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); 31 | LUAI_FUNC Table *luaH_new (lua_State *L); 32 | LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize); 33 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); 34 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); 35 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); 36 | LUAI_FUNC int luaH_getn (Table *t); 37 | 38 | 39 | #if defined(LUA_DEBUG) 40 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); 41 | LUAI_FUNC int luaH_isdummy (Node *n); 42 | #endif 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/ltm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.h,v 2.11.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltm_h 8 | #define ltm_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | /* 15 | * WARNING: if you change the order of this enumeration, 16 | * grep "ORDER TM" 17 | */ 18 | typedef enum { 19 | TM_INDEX, 20 | TM_NEWINDEX, 21 | TM_GC, 22 | TM_MODE, 23 | TM_LEN, 24 | TM_EQ, /* last tag method with `fast' access */ 25 | TM_ADD, 26 | TM_SUB, 27 | TM_MUL, 28 | TM_DIV, 29 | TM_MOD, 30 | TM_POW, 31 | TM_UNM, 32 | TM_LT, 33 | TM_LE, 34 | TM_CONCAT, 35 | TM_CALL, 36 | TM_N /* number of elements in the enum */ 37 | } TMS; 38 | 39 | 40 | 41 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 42 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 43 | 44 | #define fasttm(l,et,e) gfasttm(G(l), et, e) 45 | 46 | #define ttypename(x) luaT_typenames_[(x) + 1] 47 | #define objtypename(x) ttypename(ttypenv(x)) 48 | 49 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; 50 | 51 | 52 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 53 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, 54 | TMS event); 55 | LUAI_FUNC void luaT_init (lua_State *L); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.43.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | 15 | LUAMOD_API int (luaopen_base) (lua_State *L); 16 | 17 | #define LUA_COLIBNAME "coroutine" 18 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 19 | 20 | #define LUA_TABLIBNAME "table" 21 | LUAMOD_API int (luaopen_table) (lua_State *L); 22 | 23 | #define LUA_IOLIBNAME "io" 24 | LUAMOD_API int (luaopen_io) (lua_State *L); 25 | 26 | #define LUA_OSLIBNAME "os" 27 | LUAMOD_API int (luaopen_os) (lua_State *L); 28 | 29 | #define LUA_STRLIBNAME "string" 30 | LUAMOD_API int (luaopen_string) (lua_State *L); 31 | 32 | #define LUA_BITLIBNAME "bit32" 33 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 34 | 35 | #define LUA_MATHLIBNAME "math" 36 | LUAMOD_API int (luaopen_math) (lua_State *L); 37 | 38 | #define LUA_DBLIBNAME "debug" 39 | LUAMOD_API int (luaopen_debug) (lua_State *L); 40 | 41 | #define LUA_LOADLIBNAME "package" 42 | LUAMOD_API int (luaopen_package) (lua_State *L); 43 | 44 | 45 | /* open all previous libraries */ 46 | LUALIB_API void (luaL_openlibs) (lua_State *L); 47 | 48 | 49 | 50 | #if !defined(lua_assert) 51 | #define lua_assert(x) ((void)0) 52 | #endif 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.39.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "lobject.h" 11 | #include "lzio.h" 12 | 13 | /* load one chunk; from lundump.c */ 14 | LUAI_FUNC Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); 15 | 16 | /* make header; from lundump.c */ 17 | LUAI_FUNC void luaU_header (lu_byte* h); 18 | 19 | /* dump one chunk; from ldump.c */ 20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); 21 | 22 | /* data to catch conversion errors */ 23 | #define LUAC_TAIL "\x19\x93\r\n\x1a\n" 24 | 25 | /* size in bytes of header of binary files */ 26 | #define LUAC_HEADERSIZE (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char)) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /third-party/lua-5.2.4/src/lvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lvm.h,v 2.18.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** Lua virtual machine 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lvm_h 8 | #define lvm_h 9 | 10 | 11 | #include "ldo.h" 12 | #include "lobject.h" 13 | #include "ltm.h" 14 | 15 | 16 | #define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o))) 17 | 18 | #define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) 19 | 20 | #define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalobj_(L, o1, o2)) 21 | 22 | #define luaV_rawequalobj(o1,o2) equalobj(NULL,o1,o2) 23 | 24 | 25 | /* not to called directly */ 26 | LUAI_FUNC int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2); 27 | 28 | 29 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); 30 | LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); 31 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); 32 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); 33 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, 34 | StkId val); 35 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, 36 | StkId val); 37 | LUAI_FUNC void luaV_finishOp (lua_State *L); 38 | LUAI_FUNC void luaV_execute (lua_State *L); 39 | LUAI_FUNC void luaV_concat (lua_State *L, int total); 40 | LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb, 41 | const TValue *rc, TMS op); 42 | LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/README: -------------------------------------------------------------------------------- 1 | 2 | This is Lua 5.3.5, released on 26 Jun 2018. 3 | 4 | For installation instructions, license details, and 5 | further information about Lua, see doc/readme.html. 6 | 7 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/doc/index.css: -------------------------------------------------------------------------------- 1 | ul { 2 | list-style-type: none ; 3 | } 4 | 5 | ul.contents { 6 | padding: 0 ; 7 | } 8 | 9 | table { 10 | border: none ; 11 | border-spacing: 0 ; 12 | border-collapse: collapse ; 13 | } 14 | 15 | td { 16 | vertical-align: top ; 17 | padding: 0 ; 18 | text-align: left ; 19 | line-height: 1.25 ; 20 | width: 15% ; 21 | } 22 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/doc/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.3.5/doc/logo.gif -------------------------------------------------------------------------------- /third-party/lua-5.3.5/doc/manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | font-size: inherit ; 4 | } 5 | 6 | pre, code { 7 | font-size: 12pt ; 8 | } 9 | 10 | span.apii { 11 | color: gray ; 12 | float: right ; 13 | font-family: inherit ; 14 | font-style: normal ; 15 | font-size: small ; 16 | } 17 | 18 | h2:before { 19 | content: "" ; 20 | padding-right: 0em ; 21 | } 22 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/doc/osi-certified-72x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.3.5/doc/osi-certified-72x60.png -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, 24 | const TValue *p2); 25 | LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, 26 | const TValue *p2, 27 | const char *msg); 28 | LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, 29 | const TValue *p2); 30 | LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, 31 | const TValue *p2); 32 | LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); 33 | LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, 34 | TString *src, int line); 35 | LUAI_FUNC l_noret luaG_errormsg (lua_State *L); 36 | LUAI_FUNC void luaG_traceexec (lua_State *L); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.61.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include "lgc.h" 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | 14 | 15 | #define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) 16 | 17 | #define sizeludata(l) (sizeof(union UUdata) + (l)) 18 | #define sizeudata(u) sizeludata((u)->len) 19 | 20 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 21 | (sizeof(s)/sizeof(char))-1)) 22 | 23 | 24 | /* 25 | ** test whether a string is a reserved word 26 | */ 27 | #define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) 28 | 29 | 30 | /* 31 | ** equality for short strings, which are always internalized 32 | */ 33 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) 34 | 35 | 36 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 37 | LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 39 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 40 | LUAI_FUNC void luaS_clearcache (global_State *g); 41 | LUAI_FUNC void luaS_init (lua_State *L); 42 | LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); 43 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); 44 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 45 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 46 | LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /third-party/lua-5.3.5/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c,v 1.37.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lzio_c 8 | #define LUA_CORE 9 | 10 | #include "lprefix.h" 11 | 12 | 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | #include "llimits.h" 18 | #include "lmem.h" 19 | #include "lstate.h" 20 | #include "lzio.h" 21 | 22 | 23 | int luaZ_fill (ZIO *z) { 24 | size_t size; 25 | lua_State *L = z->L; 26 | const char *buff; 27 | lua_unlock(L); 28 | buff = z->reader(L, z->data, &size); 29 | lua_lock(L); 30 | if (buff == NULL || size == 0) 31 | return EOZ; 32 | z->n = size - 1; /* discount char being returned */ 33 | z->p = buff; 34 | return cast_uchar(*(z->p++)); 35 | } 36 | 37 | 38 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 39 | z->L = L; 40 | z->reader = reader; 41 | z->data = data; 42 | z->n = 0; 43 | z->p = NULL; 44 | } 45 | 46 | 47 | /* --------------------------------------------------------------- read --- */ 48 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 49 | while (n) { 50 | size_t m; 51 | if (z->n == 0) { /* no bytes in buffer? */ 52 | if (luaZ_fill(z) == EOZ) /* try to read more */ 53 | return n; /* no more input; return number of missing bytes */ 54 | else { 55 | z->n++; /* luaZ_fill consumed first byte; put it back */ 56 | z->p--; 57 | } 58 | } 59 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 60 | memcpy(b, z->p, m); 61 | z->n -= m; 62 | z->p += m; 63 | b = (char *)b + m; 64 | n -= m; 65 | } 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/README: -------------------------------------------------------------------------------- 1 | 2 | This is Lua 5.4.6, released on 02 May 2023. 3 | 4 | For installation instructions, license details, and 5 | further information about Lua, see doc/readme.html. 6 | 7 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/doc/index.css: -------------------------------------------------------------------------------- 1 | ul { 2 | list-style-type: none ; 3 | } 4 | 5 | ul.contents { 6 | padding: 0 ; 7 | } 8 | 9 | table { 10 | border: none ; 11 | border-spacing: 0 ; 12 | border-collapse: collapse ; 13 | } 14 | 15 | td { 16 | vertical-align: top ; 17 | padding: 0 ; 18 | text-align: left ; 19 | line-height: 1.25 ; 20 | width: 15% ; 21 | } 22 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/doc/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.4.6/doc/logo.gif -------------------------------------------------------------------------------- /third-party/lua-5.4.6/doc/manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | font-size: inherit ; 4 | } 5 | 6 | pre, code { 7 | font-size: 12pt ; 8 | } 9 | 10 | span.apii { 11 | color: gray ; 12 | float: right ; 13 | font-family: inherit ; 14 | font-style: normal ; 15 | font-size: small ; 16 | } 17 | 18 | h2:before { 19 | content: "" ; 20 | padding-right: 0em ; 21 | } 22 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/doc/osi-certified-72x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmmyLua/EmmyLuaDebugger/7d0a4a90a2653a63310b9a83c30832441b851993/third-party/lua-5.4.6/doc/osi-certified-72x60.png -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | 15 | /* Increments 'L->top.p', checking for stack overflows */ 16 | #define api_incr_top(L) {L->top.p++; \ 17 | api_check(L, L->top.p <= L->ci->top.p, \ 18 | "stack overflow");} 19 | 20 | 21 | /* 22 | ** If a call returns too many multiple returns, the callee may not have 23 | ** stack space to accommodate all results. In this case, this macro 24 | ** increases its stack space ('L->ci->top.p'). 25 | */ 26 | #define adjustresults(L,nres) \ 27 | { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \ 28 | L->ci->top.p = L->top.p; } 29 | 30 | 31 | /* Ensure the stack has at least 'n' elements */ 32 | #define api_checknelems(L,n) \ 33 | api_check(L, (n) < (L->top.p - L->ci->func.p), \ 34 | "not enough elements in the stack") 35 | 36 | 37 | /* 38 | ** To reduce the overhead of returning from C functions, the presence of 39 | ** to-be-closed variables in these functions is coded in the CallInfo's 40 | ** field 'nresults', in a way that functions with no to-be-closed variables 41 | ** with zero, one, or "all" wanted results have no overhead. Functions 42 | ** with other number of wanted results, as well as functions with 43 | ** variables to be closed, have an extra check. 44 | */ 45 | 46 | #define hastocloseCfunc(n) ((n) < LUA_MULTRET) 47 | 48 | /* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ 49 | #define codeNresults(n) (-(n) - 3) 50 | #define decodeNresults(n) (-(n) - 3) 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lopnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lopnames.h $ 3 | ** Opcode names 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #if !defined(lopnames_h) 8 | #define lopnames_h 9 | 10 | #include 11 | 12 | 13 | /* ORDER OP */ 14 | 15 | static const char *const opnames[] = { 16 | "MOVE", 17 | "LOADI", 18 | "LOADF", 19 | "LOADK", 20 | "LOADKX", 21 | "LOADFALSE", 22 | "LFALSESKIP", 23 | "LOADTRUE", 24 | "LOADNIL", 25 | "GETUPVAL", 26 | "SETUPVAL", 27 | "GETTABUP", 28 | "GETTABLE", 29 | "GETI", 30 | "GETFIELD", 31 | "SETTABUP", 32 | "SETTABLE", 33 | "SETI", 34 | "SETFIELD", 35 | "NEWTABLE", 36 | "SELF", 37 | "ADDI", 38 | "ADDK", 39 | "SUBK", 40 | "MULK", 41 | "MODK", 42 | "POWK", 43 | "DIVK", 44 | "IDIVK", 45 | "BANDK", 46 | "BORK", 47 | "BXORK", 48 | "SHRI", 49 | "SHLI", 50 | "ADD", 51 | "SUB", 52 | "MUL", 53 | "MOD", 54 | "POW", 55 | "DIV", 56 | "IDIV", 57 | "BAND", 58 | "BOR", 59 | "BXOR", 60 | "SHL", 61 | "SHR", 62 | "MMBIN", 63 | "MMBINI", 64 | "MMBINK", 65 | "UNM", 66 | "BNOT", 67 | "NOT", 68 | "LEN", 69 | "CONCAT", 70 | "CLOSE", 71 | "TBC", 72 | "JMP", 73 | "EQ", 74 | "LT", 75 | "LE", 76 | "EQK", 77 | "EQI", 78 | "LTI", 79 | "LEI", 80 | "GTI", 81 | "GEI", 82 | "TEST", 83 | "TESTSET", 84 | "CALL", 85 | "TAILCALL", 86 | "RETURN", 87 | "RETURN0", 88 | "RETURN1", 89 | "FORLOOP", 90 | "FORPREP", 91 | "TFORPREP", 92 | "TFORCALL", 93 | "TFORLOOP", 94 | "SETLIST", 95 | "CLOSURE", 96 | "VARARG", 97 | "VARARGPREP", 98 | "EXTRAARG", 99 | NULL 100 | }; 101 | 102 | #endif 103 | 104 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_MATHLIBNAME "math" 39 | LUAMOD_API int (luaopen_math) (lua_State *L); 40 | 41 | #define LUA_DBLIBNAME "debug" 42 | LUAMOD_API int (luaopen_debug) (lua_State *L); 43 | 44 | #define LUA_LOADLIBNAME "package" 45 | LUAMOD_API int (luaopen_package) (lua_State *L); 46 | 47 | 48 | /* open all previous libraries */ 49 | LUALIB_API void (luaL_openlibs) (lua_State *L); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | /* 22 | ** Encode major-minor version in one byte, one nibble for each 23 | */ 24 | #define MYINT(s) (s[0]-'0') /* assume one-digit numerals */ 25 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 26 | 27 | #define LUAC_FORMAT 0 /* this is the official format */ 28 | 29 | /* load one chunk; from lundump.c */ 30 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 31 | 32 | /* dump one chunk; from ldump.c */ 33 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 34 | void* data, int strip); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #define lzio_c 8 | #define LUA_CORE 9 | 10 | #include "lprefix.h" 11 | 12 | 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | #include "llimits.h" 18 | #include "lmem.h" 19 | #include "lstate.h" 20 | #include "lzio.h" 21 | 22 | 23 | int luaZ_fill (ZIO *z) { 24 | size_t size; 25 | lua_State *L = z->L; 26 | const char *buff; 27 | lua_unlock(L); 28 | buff = z->reader(L, z->data, &size); 29 | lua_lock(L); 30 | if (buff == NULL || size == 0) 31 | return EOZ; 32 | z->n = size - 1; /* discount char being returned */ 33 | z->p = buff; 34 | return cast_uchar(*(z->p++)); 35 | } 36 | 37 | 38 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 39 | z->L = L; 40 | z->reader = reader; 41 | z->data = data; 42 | z->n = 0; 43 | z->p = NULL; 44 | } 45 | 46 | 47 | /* --------------------------------------------------------------- read --- */ 48 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 49 | while (n) { 50 | size_t m; 51 | if (z->n == 0) { /* no bytes in buffer? */ 52 | if (luaZ_fill(z) == EOZ) /* try to read more */ 53 | return n; /* no more input; return number of missing bytes */ 54 | else { 55 | z->n++; /* luaZ_fill consumed first byte; put it back */ 56 | z->p--; 57 | } 58 | } 59 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 60 | memcpy(b, z->p, m); 61 | z->n -= m; 62 | z->p += m; 63 | b = (char *)b + m; 64 | n -= m; 65 | } 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /third-party/lua-5.4.6/src/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include "lua.h" 12 | 13 | #include "lmem.h" 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 21 | 22 | 23 | typedef struct Mbuffer { 24 | char *buffer; 25 | size_t n; 26 | size_t buffsize; 27 | } Mbuffer; 28 | 29 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30 | 31 | #define luaZ_buffer(buff) ((buff)->buffer) 32 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 33 | #define luaZ_bufflen(buff) ((buff)->n) 34 | 35 | #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 | (buff)->buffsize, size), \ 42 | (buff)->buffsize = size) 43 | 44 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 45 | 46 | 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ 50 | 51 | 52 | 53 | /* --------- Private Part ------------------ */ 54 | 55 | struct Zio { 56 | size_t n; /* bytes still unread */ 57 | const char *p; /* current position in buffer */ 58 | lua_Reader reader; /* reader function */ 59 | void *data; /* additional data */ 60 | lua_State *L; /* Lua state (for reader) */ 61 | }; 62 | 63 | 64 | LUAI_FUNC int luaZ_fill (ZIO *z); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /third-party/luajit/README.txt: -------------------------------------------------------------------------------- 1 | 1. 将自己的luajit目录复制到这个目录,保持该目录下有src目录 2 | 3 | 2. 自己使用luajit提供的构建脚本编译出正确的lua51静态库 4 | 3. 然后就可以把luajit编译进emmy_core了 -------------------------------------------------------------------------------- /third-party/nlohmann/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2022 Niels Lohmann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/input/position_t.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // size_t 4 | 5 | namespace nlohmann 6 | { 7 | namespace detail 8 | { 9 | /// struct to capture the start position of the current token 10 | struct position_t 11 | { 12 | /// the total number of characters read 13 | std::size_t chars_read_total = 0; 14 | /// the number of characters read in the current line 15 | std::size_t chars_read_current_line = 0; 16 | /// the number of lines read 17 | std::size_t lines_read = 0; 18 | 19 | /// conversion to size_t to preserve SAX interface 20 | constexpr operator size_t() const 21 | { 22 | return chars_read_total; 23 | } 24 | }; 25 | 26 | } // namespace detail 27 | } // namespace nlohmann 28 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/iterators/internal_iterator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace nlohmann 6 | { 7 | namespace detail 8 | { 9 | /*! 10 | @brief an iterator value 11 | 12 | @note This structure could easily be a union, but MSVC currently does not allow 13 | unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. 14 | */ 15 | template struct internal_iterator 16 | { 17 | /// iterator for JSON objects 18 | typename BasicJsonType::object_t::iterator object_iterator {}; 19 | /// iterator for JSON arrays 20 | typename BasicJsonType::array_t::iterator array_iterator {}; 21 | /// generic iterator for all other types 22 | primitive_iterator_t primitive_iterator {}; 23 | }; 24 | } // namespace detail 25 | } // namespace nlohmann 26 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/iterators/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // random_access_iterator_tag 4 | 5 | #include 6 | #include 7 | 8 | namespace nlohmann 9 | { 10 | namespace detail 11 | { 12 | template 13 | struct iterator_types {}; 14 | 15 | template 16 | struct iterator_types < 17 | It, 18 | void_t> 20 | { 21 | using difference_type = typename It::difference_type; 22 | using value_type = typename It::value_type; 23 | using pointer = typename It::pointer; 24 | using reference = typename It::reference; 25 | using iterator_category = typename It::iterator_category; 26 | }; 27 | 28 | // This is required as some compilers implement std::iterator_traits in a way that 29 | // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. 30 | template 31 | struct iterator_traits 32 | { 33 | }; 34 | 35 | template 36 | struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> 37 | : iterator_types 38 | { 39 | }; 40 | 41 | template 42 | struct iterator_traits::value>> 43 | { 44 | using iterator_category = std::random_access_iterator_tag; 45 | using value_type = T; 46 | using difference_type = ptrdiff_t; 47 | using pointer = T*; 48 | using reference = T&; 49 | }; 50 | } // namespace detail 51 | } // namespace nlohmann 52 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/macro_unscope.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // restore clang diagnostic settings 4 | #if defined(__clang__) 5 | #pragma clang diagnostic pop 6 | #endif 7 | 8 | // clean up 9 | #undef JSON_ASSERT 10 | #undef JSON_INTERNAL_CATCH 11 | #undef JSON_CATCH 12 | #undef JSON_THROW 13 | #undef JSON_TRY 14 | #undef JSON_PRIVATE_UNLESS_TESTED 15 | #undef JSON_HAS_CPP_11 16 | #undef JSON_HAS_CPP_14 17 | #undef JSON_HAS_CPP_17 18 | #undef JSON_HAS_CPP_20 19 | #undef JSON_HAS_FILESYSTEM 20 | #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM 21 | #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION 22 | #undef NLOHMANN_BASIC_JSON_TPL 23 | #undef JSON_EXPLICIT 24 | #undef NLOHMANN_CAN_CALL_STD_FUNC_IMPL 25 | 26 | #include 27 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/meta/call_std/begin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace nlohmann 6 | { 7 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); 8 | } // namespace nlohmann 9 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/meta/call_std/end.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace nlohmann 6 | { 7 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); 8 | } // namespace nlohmann 9 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/meta/identity_tag.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace nlohmann 4 | { 5 | namespace detail 6 | { 7 | // dispatching helper struct 8 | template struct identity_tag {}; 9 | } // namespace detail 10 | } // namespace nlohmann 11 | -------------------------------------------------------------------------------- /third-party/nlohmann/include/nlohmann/detail/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace nlohmann 4 | { 5 | namespace detail 6 | { 7 | template struct make_void 8 | { 9 | using type = void; 10 | }; 11 | template using void_t = typename make_void::type; 12 | } // namespace detail 13 | } // namespace nlohmann 14 | --------------------------------------------------------------------------------