webruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/webruby +36 -0
- data/driver/driver.c +50 -0
- data/driver/main.c +40 -0
- data/lib/webruby/app.rb +13 -0
- data/lib/webruby/config.rb +61 -0
- data/lib/webruby/environment.rb +32 -0
- data/lib/webruby/rake/files.rake +66 -0
- data/lib/webruby/rake/general.rake +22 -0
- data/lib/webruby/rake/mruby.rake +44 -0
- data/lib/webruby/utility.rb +132 -0
- data/lib/webruby.rb +10 -0
- data/modules/emscripten/AUTHORS +89 -0
- data/modules/emscripten/LICENSE +68 -0
- data/modules/emscripten/README.markdown +14 -0
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +61 -0
- data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +24 -0
- data/modules/emscripten/em++ +12 -0
- data/modules/emscripten/em++.bat +2 -0
- data/modules/emscripten/em-config +24 -0
- data/modules/emscripten/em-config.bat +2 -0
- data/modules/emscripten/emar +24 -0
- data/modules/emscripten/emar.bat +2 -0
- data/modules/emscripten/emcc +1744 -0
- data/modules/emscripten/emcc.bat +2 -0
- data/modules/emscripten/emcc.py +5 -0
- data/modules/emscripten/emconfigure +27 -0
- data/modules/emscripten/emconfigure.bat +2 -0
- data/modules/emscripten/emlibtool +11 -0
- data/modules/emscripten/emlibtool.bat +2 -0
- data/modules/emscripten/emlink.py +293 -0
- data/modules/emscripten/emmake +29 -0
- data/modules/emscripten/emmake.bat +2 -0
- data/modules/emscripten/emranlib +9 -0
- data/modules/emscripten/emranlib.bat +2 -0
- data/modules/emscripten/emscons +20 -0
- data/modules/emscripten/emscripten.py +835 -0
- data/modules/emscripten/patches/README +4 -0
- data/modules/emscripten/patches/series +2 -0
- data/modules/emscripten/scons-tools/closure.py +28 -0
- data/modules/emscripten/scons-tools/emscripten.py +359 -0
- data/modules/emscripten/scons-tools/llvm.py +33 -0
- data/modules/emscripten/src/analyzer.js +1695 -0
- data/modules/emscripten/src/compiler.html +48 -0
- data/modules/emscripten/src/compiler.js +298 -0
- data/modules/emscripten/src/corruptionCheck.js +98 -0
- data/modules/emscripten/src/determinstic.js +20 -0
- data/modules/emscripten/src/embind/embind.js +1677 -0
- data/modules/emscripten/src/embind/emval.js +283 -0
- data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +97 -0
- data/modules/emscripten/src/experimental/batching.diff +44 -0
- data/modules/emscripten/src/experimental/functypeopt.diff +113 -0
- data/modules/emscripten/src/experimental/multiple_heaps.diff +175 -0
- data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +197 -0
- data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +124 -0
- data/modules/emscripten/src/experimental/remove__label__s.diff +140 -0
- data/modules/emscripten/src/experimental/renderer_cache_hash.diff +99 -0
- data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +57 -0
- data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +336 -0
- data/modules/emscripten/src/experimental/stringCache.diff +147 -0
- data/modules/emscripten/src/fastLong.js +299 -0
- data/modules/emscripten/src/framework.js +257 -0
- data/modules/emscripten/src/gl-matrix.js +1952 -0
- data/modules/emscripten/src/headless.js +904 -0
- data/modules/emscripten/src/intertyper.js +1050 -0
- data/modules/emscripten/src/jsifier.js +1827 -0
- data/modules/emscripten/src/library.js +8270 -0
- data/modules/emscripten/src/library_browser.js +911 -0
- data/modules/emscripten/src/library_egl.js +491 -0
- data/modules/emscripten/src/library_gc.js +236 -0
- data/modules/emscripten/src/library_gl.js +4452 -0
- data/modules/emscripten/src/library_glfw.js +576 -0
- data/modules/emscripten/src/library_glut.js +449 -0
- data/modules/emscripten/src/library_jansson.js +320 -0
- data/modules/emscripten/src/library_openal.js +602 -0
- data/modules/emscripten/src/library_sdl.js +2024 -0
- data/modules/emscripten/src/library_strtok_r.c +97 -0
- data/modules/emscripten/src/library_xlib.js +23 -0
- data/modules/emscripten/src/long.js +1609 -0
- data/modules/emscripten/src/modules.js +491 -0
- data/modules/emscripten/src/parseTools.js +2474 -0
- data/modules/emscripten/src/postamble.js +170 -0
- data/modules/emscripten/src/postamble_sharedlib.js +16 -0
- data/modules/emscripten/src/preamble.js +914 -0
- data/modules/emscripten/src/preamble_sharedlib.js +25 -0
- data/modules/emscripten/src/relooper/README.markdown +14 -0
- data/modules/emscripten/src/relooper/Relooper.cpp +1236 -0
- data/modules/emscripten/src/relooper/Relooper.h +250 -0
- data/modules/emscripten/src/relooper/doit.sh +70 -0
- data/modules/emscripten/src/relooper/emscripten/glue.js +57 -0
- data/modules/emscripten/src/relooper/emscripten/test.js +44 -0
- data/modules/emscripten/src/relooper/fuzzer.py +116 -0
- data/modules/emscripten/src/relooper/ministring.h +35 -0
- data/modules/emscripten/src/relooper/paper.pdf +0 -0
- data/modules/emscripten/src/relooper/test.cpp +262 -0
- data/modules/emscripten/src/relooper/test.txt +155 -0
- data/modules/emscripten/src/relooper/test2.c +44 -0
- data/modules/emscripten/src/relooper/test2.txt +12 -0
- data/modules/emscripten/src/relooper/test3.c +42 -0
- data/modules/emscripten/src/relooper/test3.txt +27 -0
- data/modules/emscripten/src/relooper/test4.cpp +40 -0
- data/modules/emscripten/src/relooper/test4.txt +23 -0
- data/modules/emscripten/src/relooper/test5.cpp +40 -0
- data/modules/emscripten/src/relooper/test5.txt +32 -0
- data/modules/emscripten/src/relooper/test6.cpp +31 -0
- data/modules/emscripten/src/relooper/test6.txt +12 -0
- data/modules/emscripten/src/relooper/test_dead.cpp +28 -0
- data/modules/emscripten/src/relooper/test_dead.txt +9 -0
- data/modules/emscripten/src/relooper/test_debug.cpp +30 -0
- data/modules/emscripten/src/relooper/test_debug.txt +128 -0
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +52 -0
- data/modules/emscripten/src/relooper/test_fuzz1.txt +32 -0
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +34 -0
- data/modules/emscripten/src/relooper/test_fuzz2.txt +13 -0
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +36 -0
- data/modules/emscripten/src/relooper/test_fuzz3.txt +9 -0
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +38 -0
- data/modules/emscripten/src/relooper/test_fuzz4.txt +19 -0
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +57 -0
- data/modules/emscripten/src/relooper/test_fuzz5.txt +52 -0
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +322 -0
- data/modules/emscripten/src/relooper/test_fuzz6.txt +108 -0
- data/modules/emscripten/src/relooper/test_inf.cpp +813 -0
- data/modules/emscripten/src/relooper/test_inf.txt +385 -0
- data/modules/emscripten/src/relooper/testit.sh +62 -0
- data/modules/emscripten/src/relooper/updateit.sh +17 -0
- data/modules/emscripten/src/relooper.js +11516 -0
- data/modules/emscripten/src/relooper.js.raw.js +11511 -0
- data/modules/emscripten/src/runtime.js +546 -0
- data/modules/emscripten/src/settings.js +1284 -0
- data/modules/emscripten/src/shell.html +92 -0
- data/modules/emscripten/src/shell.js +153 -0
- data/modules/emscripten/src/shell_sharedlib.js +12 -0
- data/modules/emscripten/src/socket.io.js +3870 -0
- data/modules/emscripten/src/utility.js +379 -0
- data/modules/emscripten/src/wrtcp.js +821 -0
- data/modules/emscripten/system/include/AL/al.h +172 -0
- data/modules/emscripten/system/include/AL/alc.h +84 -0
- data/modules/emscripten/system/include/EGL/egl.h +329 -0
- data/modules/emscripten/system/include/EGL/eglext.h +398 -0
- data/modules/emscripten/system/include/EGL/eglplatform.h +141 -0
- data/modules/emscripten/system/include/GL/freeglut_std.h +628 -0
- data/modules/emscripten/system/include/GL/gl.h +2241 -0
- data/modules/emscripten/system/include/GL/glew.h +6 -0
- data/modules/emscripten/system/include/GL/glext.h +11127 -0
- data/modules/emscripten/system/include/GL/glfw.h +518 -0
- data/modules/emscripten/system/include/GL/glu.h +353 -0
- data/modules/emscripten/system/include/GL/glut.h +21 -0
- data/modules/emscripten/system/include/GLES/gl.h +770 -0
- data/modules/emscripten/system/include/GLES/glext.h +1278 -0
- data/modules/emscripten/system/include/GLES/glplatform.h +30 -0
- data/modules/emscripten/system/include/GLES2/gl2.h +621 -0
- data/modules/emscripten/system/include/GLES2/gl2ext.h +803 -0
- data/modules/emscripten/system/include/GLES2/gl2platform.h +30 -0
- data/modules/emscripten/system/include/KHR/khrplatform.h +277 -0
- data/modules/emscripten/system/include/SDL/COPYING +19 -0
- data/modules/emscripten/system/include/SDL/SDL.h +162 -0
- data/modules/emscripten/system/include/SDL/SDL_assert.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_atomic.h +318 -0
- data/modules/emscripten/system/include/SDL/SDL_audio.h +509 -0
- data/modules/emscripten/system/include/SDL/SDL_blendmode.h +60 -0
- data/modules/emscripten/system/include/SDL/SDL_clipboard.h +75 -0
- data/modules/emscripten/system/include/SDL/SDL_compat.h +365 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h +48 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h.in +297 -0
- data/modules/emscripten/system/include/SDL/SDL_config_android.h +133 -0
- data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +148 -0
- data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +172 -0
- data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +74 -0
- data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +129 -0
- data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +125 -0
- data/modules/emscripten/system/include/SDL/SDL_config_windows.h +207 -0
- data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +119 -0
- data/modules/emscripten/system/include/SDL/SDL_copying.h +20 -0
- data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +150 -0
- data/modules/emscripten/system/include/SDL/SDL_endian.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_error.h +77 -0
- data/modules/emscripten/system/include/SDL/SDL_events.h +639 -0
- data/modules/emscripten/system/include/SDL/SDL_gesture.h +91 -0
- data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +246 -0
- data/modules/emscripten/system/include/SDL/SDL_haptic.h +1200 -0
- data/modules/emscripten/system/include/SDL/SDL_hints.h +206 -0
- data/modules/emscripten/system/include/SDL/SDL_image.h +138 -0
- data/modules/emscripten/system/include/SDL/SDL_input.h +87 -0
- data/modules/emscripten/system/include/SDL/SDL_joystick.h +208 -0
- data/modules/emscripten/system/include/SDL/SDL_keyboard.h +169 -0
- data/modules/emscripten/system/include/SDL/SDL_keycode.h +344 -0
- data/modules/emscripten/system/include/SDL/SDL_loadso.h +85 -0
- data/modules/emscripten/system/include/SDL/SDL_log.h +211 -0
- data/modules/emscripten/system/include/SDL/SDL_main.h +98 -0
- data/modules/emscripten/system/include/SDL/SDL_mixer.h +634 -0
- data/modules/emscripten/system/include/SDL/SDL_mouse.h +213 -0
- data/modules/emscripten/system/include/SDL/SDL_mutex.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_name.h +11 -0
- data/modules/emscripten/system/include/SDL/SDL_opengl.h +11116 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles2.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_pixels.h +423 -0
- data/modules/emscripten/system/include/SDL/SDL_platform.h +160 -0
- data/modules/emscripten/system/include/SDL/SDL_power.h +79 -0
- data/modules/emscripten/system/include/SDL/SDL_quit.h +58 -0
- data/modules/emscripten/system/include/SDL/SDL_rect.h +136 -0
- data/modules/emscripten/system/include/SDL/SDL_render.h +615 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h +2 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +2 -0
- data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +123 -0
- data/modules/emscripten/system/include/SDL/SDL_rwops.h +220 -0
- data/modules/emscripten/system/include/SDL/SDL_scancode.h +398 -0
- data/modules/emscripten/system/include/SDL/SDL_shape.h +147 -0
- data/modules/emscripten/system/include/SDL/SDL_stdinc.h +764 -0
- data/modules/emscripten/system/include/SDL/SDL_surface.h +499 -0
- data/modules/emscripten/system/include/SDL/SDL_syswm.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_thread.h +182 -0
- data/modules/emscripten/system/include/SDL/SDL_timer.h +108 -0
- data/modules/emscripten/system/include/SDL/SDL_touch.h +124 -0
- data/modules/emscripten/system/include/SDL/SDL_ttf.h +249 -0
- data/modules/emscripten/system/include/SDL/SDL_types.h +29 -0
- data/modules/emscripten/system/include/SDL/SDL_version.h +166 -0
- data/modules/emscripten/system/include/SDL/SDL_video.h +820 -0
- data/modules/emscripten/system/include/SDL/begin_code.h +135 -0
- data/modules/emscripten/system/include/SDL/close_code.h +37 -0
- data/modules/emscripten/system/include/X11/X.h +717 -0
- data/modules/emscripten/system/include/X11/Xatom.h +79 -0
- data/modules/emscripten/system/include/X11/Xfuncproto.h +127 -0
- data/modules/emscripten/system/include/X11/Xlib.h +4023 -0
- data/modules/emscripten/system/include/X11/Xosdefs.h +116 -0
- data/modules/emscripten/system/include/X11/Xutil.h +826 -0
- data/modules/emscripten/system/include/X11/keysym.h +73 -0
- data/modules/emscripten/system/include/X11/keysymdef.h +2389 -0
- data/modules/emscripten/system/include/bsd/float.h +91 -0
- data/modules/emscripten/system/include/bsd/readme.txt +2 -0
- data/modules/emscripten/system/include/bsd/sys/mman.h +180 -0
- data/modules/emscripten/system/include/bsd/sys/utsname.h +70 -0
- data/modules/emscripten/system/include/dlfcn.h +31 -0
- data/modules/emscripten/system/include/emscripten/bind.h +1210 -0
- data/modules/emscripten/system/include/emscripten/emscripten.h +388 -0
- data/modules/emscripten/system/include/emscripten/val.h +311 -0
- data/modules/emscripten/system/include/emscripten/wire.h +393 -0
- data/modules/emscripten/system/include/err.h +95 -0
- data/modules/emscripten/system/include/execinfo.h +44 -0
- data/modules/emscripten/system/include/features.h +3 -0
- data/modules/emscripten/system/include/gc.h +70 -0
- data/modules/emscripten/system/include/gfx/png.h +3798 -0
- data/modules/emscripten/system/include/gfx/pngconf.h +1665 -0
- data/modules/emscripten/system/include/gfx/tiff.h +654 -0
- data/modules/emscripten/system/include/gfx/tiffconf.h +104 -0
- data/modules/emscripten/system/include/gfx/tiffio.h +526 -0
- data/modules/emscripten/system/include/gfx/tiffvers.h +9 -0
- data/modules/emscripten/system/include/jansson.h +323 -0
- data/modules/emscripten/system/include/jansson_config.h +54 -0
- data/modules/emscripten/system/include/libc/_ansi.h +135 -0
- data/modules/emscripten/system/include/libc/_syslist.h +40 -0
- data/modules/emscripten/system/include/libc/alloca.h +21 -0
- data/modules/emscripten/system/include/libc/ar.h +69 -0
- data/modules/emscripten/system/include/libc/argz.h +33 -0
- data/modules/emscripten/system/include/libc/assert.h +46 -0
- data/modules/emscripten/system/include/libc/complex.h +124 -0
- data/modules/emscripten/system/include/libc/ctype.h +196 -0
- data/modules/emscripten/system/include/libc/dirent.h +16 -0
- data/modules/emscripten/system/include/libc/endian.h +3 -0
- data/modules/emscripten/system/include/libc/envlock.h +15 -0
- data/modules/emscripten/system/include/libc/envz.h +16 -0
- data/modules/emscripten/system/include/libc/errno.h +11 -0
- data/modules/emscripten/system/include/libc/fastmath.h +13 -0
- data/modules/emscripten/system/include/libc/fcntl.h +1 -0
- data/modules/emscripten/system/include/libc/fnmatch.h +55 -0
- data/modules/emscripten/system/include/libc/getopt.h +196 -0
- data/modules/emscripten/system/include/libc/glob.h +89 -0
- data/modules/emscripten/system/include/libc/grp.h +94 -0
- data/modules/emscripten/system/include/libc/iconv.h +62 -0
- data/modules/emscripten/system/include/libc/ieeefp.h +256 -0
- data/modules/emscripten/system/include/libc/ifaddrs.h +64 -0
- data/modules/emscripten/system/include/libc/inttypes.h +290 -0
- data/modules/emscripten/system/include/libc/iso646.h +43 -0
- data/modules/emscripten/system/include/libc/langinfo.h +316 -0
- data/modules/emscripten/system/include/libc/libgen.h +23 -0
- data/modules/emscripten/system/include/libc/limits.h +155 -0
- data/modules/emscripten/system/include/libc/locale.h +80 -0
- data/modules/emscripten/system/include/libc/machine/_default_types.h +121 -0
- data/modules/emscripten/system/include/libc/machine/_types.h +8 -0
- data/modules/emscripten/system/include/libc/machine/ansi.h +1 -0
- data/modules/emscripten/system/include/libc/machine/endian.h +31 -0
- data/modules/emscripten/system/include/libc/machine/fastmath.h +100 -0
- data/modules/emscripten/system/include/libc/machine/ieeefp.h +376 -0
- data/modules/emscripten/system/include/libc/machine/malloc.h +8 -0
- data/modules/emscripten/system/include/libc/machine/param.h +1 -0
- data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +43 -0
- data/modules/emscripten/system/include/libc/machine/setjmp.h +361 -0
- data/modules/emscripten/system/include/libc/machine/stdlib.h +8 -0
- data/modules/emscripten/system/include/libc/machine/termios.h +1 -0
- data/modules/emscripten/system/include/libc/machine/time.h +19 -0
- data/modules/emscripten/system/include/libc/machine/types.h +30 -0
- data/modules/emscripten/system/include/libc/malloc.h +169 -0
- data/modules/emscripten/system/include/libc/math.h +594 -0
- data/modules/emscripten/system/include/libc/newlib.h +2 -0
- data/modules/emscripten/system/include/libc/paths.h +7 -0
- data/modules/emscripten/system/include/libc/process.h +44 -0
- data/modules/emscripten/system/include/libc/pthread.h +362 -0
- data/modules/emscripten/system/include/libc/pwd.h +78 -0
- data/modules/emscripten/system/include/libc/readme.txt +3 -0
- data/modules/emscripten/system/include/libc/reent.h +183 -0
- data/modules/emscripten/system/include/libc/regdef.h +7 -0
- data/modules/emscripten/system/include/libc/regex.h +102 -0
- data/modules/emscripten/system/include/libc/sched.h +97 -0
- data/modules/emscripten/system/include/libc/search.h +59 -0
- data/modules/emscripten/system/include/libc/setjmp.h +20 -0
- data/modules/emscripten/system/include/libc/signal.h +30 -0
- data/modules/emscripten/system/include/libc/stdarg.h +50 -0
- data/modules/emscripten/system/include/libc/stddef.h +64 -0
- data/modules/emscripten/system/include/libc/stdint.h +493 -0
- data/modules/emscripten/system/include/libc/stdio.h +694 -0
- data/modules/emscripten/system/include/libc/stdlib.h +230 -0
- data/modules/emscripten/system/include/libc/string.h +105 -0
- data/modules/emscripten/system/include/libc/strings.h +35 -0
- data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +223 -0
- data/modules/emscripten/system/include/libc/sys/_types.h +93 -0
- data/modules/emscripten/system/include/libc/sys/cdefs.h +123 -0
- data/modules/emscripten/system/include/libc/sys/config.h +255 -0
- data/modules/emscripten/system/include/libc/sys/custom_file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/dir.h +10 -0
- data/modules/emscripten/system/include/libc/sys/dirent.h +58 -0
- data/modules/emscripten/system/include/libc/sys/errno.h +190 -0
- data/modules/emscripten/system/include/libc/sys/fcntl.h +4 -0
- data/modules/emscripten/system/include/libc/sys/features.h +212 -0
- data/modules/emscripten/system/include/libc/sys/file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/iconvnls.h +77 -0
- data/modules/emscripten/system/include/libc/sys/lock.h +24 -0
- data/modules/emscripten/system/include/libc/sys/param.h +25 -0
- data/modules/emscripten/system/include/libc/sys/queue.h +471 -0
- data/modules/emscripten/system/include/libc/sys/reent.h +843 -0
- data/modules/emscripten/system/include/libc/sys/resource.h +59 -0
- data/modules/emscripten/system/include/libc/sys/sched.h +67 -0
- data/modules/emscripten/system/include/libc/sys/signal.h +314 -0
- data/modules/emscripten/system/include/libc/sys/stat.h +222 -0
- data/modules/emscripten/system/include/libc/sys/stdio.h +27 -0
- data/modules/emscripten/system/include/libc/sys/string.h +2 -0
- data/modules/emscripten/system/include/libc/sys/syslimits.h +65 -0
- data/modules/emscripten/system/include/libc/sys/termios.h +280 -0
- data/modules/emscripten/system/include/libc/sys/time.h +85 -0
- data/modules/emscripten/system/include/libc/sys/timeb.h +39 -0
- data/modules/emscripten/system/include/libc/sys/times.h +28 -0
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +97 -0
- data/modules/emscripten/system/include/libc/sys/types.h +481 -0
- data/modules/emscripten/system/include/libc/sys/unistd.h +514 -0
- data/modules/emscripten/system/include/libc/sys/utime.h +26 -0
- data/modules/emscripten/system/include/libc/sys/wait.h +40 -0
- data/modules/emscripten/system/include/libc/tar.h +39 -0
- data/modules/emscripten/system/include/libc/termios.h +7 -0
- data/modules/emscripten/system/include/libc/time.h +273 -0
- data/modules/emscripten/system/include/libc/unctrl.h +46 -0
- data/modules/emscripten/system/include/libc/unistd.h +6 -0
- data/modules/emscripten/system/include/libc/utime.h +12 -0
- data/modules/emscripten/system/include/libc/utmp.h +8 -0
- data/modules/emscripten/system/include/libc/wchar.h +194 -0
- data/modules/emscripten/system/include/libc/wctype.h +47 -0
- data/modules/emscripten/system/include/libc/wordexp.h +53 -0
- data/modules/emscripten/system/include/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/include/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/include/libcxx/__bit_reference +1268 -0
- data/modules/emscripten/system/include/libcxx/__config +485 -0
- data/modules/emscripten/system/include/libcxx/__debug +193 -0
- data/modules/emscripten/system/include/libcxx/__functional_03 +2130 -0
- data/modules/emscripten/system/include/libcxx/__functional_base +437 -0
- data/modules/emscripten/system/include/libcxx/__functional_base_03 +1087 -0
- data/modules/emscripten/system/include/libcxx/__hash_table +1945 -0
- data/modules/emscripten/system/include/libcxx/__locale +1435 -0
- data/modules/emscripten/system/include/libcxx/__mutex_base +438 -0
- data/modules/emscripten/system/include/libcxx/__split_buffer +654 -0
- data/modules/emscripten/system/include/libcxx/__sso_allocator +77 -0
- data/modules/emscripten/system/include/libcxx/__std_stream +317 -0
- data/modules/emscripten/system/include/libcxx/__tree +2293 -0
- data/modules/emscripten/system/include/libcxx/__tuple +305 -0
- data/modules/emscripten/system/include/libcxx/__tuple_03 +27 -0
- data/modules/emscripten/system/include/libcxx/__undef_min_max +19 -0
- data/modules/emscripten/system/include/libcxx/algorithm +5458 -0
- data/modules/emscripten/system/include/libcxx/array +341 -0
- data/modules/emscripten/system/include/libcxx/atomic +1521 -0
- data/modules/emscripten/system/include/libcxx/bitset +1081 -0
- data/modules/emscripten/system/include/libcxx/cassert +25 -0
- data/modules/emscripten/system/include/libcxx/ccomplex +29 -0
- data/modules/emscripten/system/include/libcxx/cctype +164 -0
- data/modules/emscripten/system/include/libcxx/cerrno +393 -0
- data/modules/emscripten/system/include/libcxx/cfenv +82 -0
- data/modules/emscripten/system/include/libcxx/cfloat +78 -0
- data/modules/emscripten/system/include/libcxx/chrono +898 -0
- data/modules/emscripten/system/include/libcxx/cinttypes +259 -0
- data/modules/emscripten/system/include/libcxx/ciso646 +25 -0
- data/modules/emscripten/system/include/libcxx/climits +48 -0
- data/modules/emscripten/system/include/libcxx/clocale +53 -0
- data/modules/emscripten/system/include/libcxx/cmath +1683 -0
- data/modules/emscripten/system/include/libcxx/codecvt +547 -0
- data/modules/emscripten/system/include/libcxx/complex +1526 -0
- data/modules/emscripten/system/include/libcxx/complex.h +35 -0
- data/modules/emscripten/system/include/libcxx/condition_variable +256 -0
- data/modules/emscripten/system/include/libcxx/csetjmp +52 -0
- data/modules/emscripten/system/include/libcxx/csignal +58 -0
- data/modules/emscripten/system/include/libcxx/cstdarg +48 -0
- data/modules/emscripten/system/include/libcxx/cstdbool +32 -0
- data/modules/emscripten/system/include/libcxx/cstddef +103 -0
- data/modules/emscripten/system/include/libcxx/cstdint +191 -0
- data/modules/emscripten/system/include/libcxx/cstdio +175 -0
- data/modules/emscripten/system/include/libcxx/cstdlib +172 -0
- data/modules/emscripten/system/include/libcxx/cstring +112 -0
- data/modules/emscripten/system/include/libcxx/ctgmath +29 -0
- data/modules/emscripten/system/include/libcxx/ctime +72 -0
- data/modules/emscripten/system/include/libcxx/cwchar +208 -0
- data/modules/emscripten/system/include/libcxx/cwctype +213 -0
- data/modules/emscripten/system/include/libcxx/deque +2846 -0
- data/modules/emscripten/system/include/libcxx/exception +250 -0
- data/modules/emscripten/system/include/libcxx/ext/__hash +46 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_map +1003 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_set +657 -0
- data/modules/emscripten/system/include/libcxx/forward_list +1636 -0
- data/modules/emscripten/system/include/libcxx/fstream +1415 -0
- data/modules/emscripten/system/include/libcxx/functional +2063 -0
- data/modules/emscripten/system/include/libcxx/future +2505 -0
- data/modules/emscripten/system/include/libcxx/initializer_list +105 -0
- data/modules/emscripten/system/include/libcxx/iomanip +504 -0
- data/modules/emscripten/system/include/libcxx/ios +988 -0
- data/modules/emscripten/system/include/libcxx/iosfwd +194 -0
- data/modules/emscripten/system/include/libcxx/iostream +60 -0
- data/modules/emscripten/system/include/libcxx/istream +1713 -0
- data/modules/emscripten/system/include/libcxx/iterator +1869 -0
- data/modules/emscripten/system/include/libcxx/limits +809 -0
- data/modules/emscripten/system/include/libcxx/list +2275 -0
- data/modules/emscripten/system/include/libcxx/locale +4591 -0
- data/modules/emscripten/system/include/libcxx/map +1924 -0
- data/modules/emscripten/system/include/libcxx/memory +5437 -0
- data/modules/emscripten/system/include/libcxx/mutex +566 -0
- data/modules/emscripten/system/include/libcxx/new +117 -0
- data/modules/emscripten/system/include/libcxx/numeric +197 -0
- data/modules/emscripten/system/include/libcxx/ostream +1286 -0
- data/modules/emscripten/system/include/libcxx/queue +717 -0
- data/modules/emscripten/system/include/libcxx/random +6750 -0
- data/modules/emscripten/system/include/libcxx/ratio +487 -0
- data/modules/emscripten/system/include/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/include/libcxx/regex +6439 -0
- data/modules/emscripten/system/include/libcxx/scoped_allocator +578 -0
- data/modules/emscripten/system/include/libcxx/set +1025 -0
- data/modules/emscripten/system/include/libcxx/sstream +888 -0
- data/modules/emscripten/system/include/libcxx/stack +292 -0
- data/modules/emscripten/system/include/libcxx/stdexcept +162 -0
- data/modules/emscripten/system/include/libcxx/streambuf +564 -0
- data/modules/emscripten/system/include/libcxx/string +3987 -0
- data/modules/emscripten/system/include/libcxx/strstream +400 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +5 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +38 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +146 -0
- data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +79 -0
- data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +116 -0
- data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +113 -0
- data/modules/emscripten/system/include/libcxx/support/win32/support.h +115 -0
- data/modules/emscripten/system/include/libcxx/system_error +636 -0
- data/modules/emscripten/system/include/libcxx/tgmath.h +29 -0
- data/modules/emscripten/system/include/libcxx/thread +459 -0
- data/modules/emscripten/system/include/libcxx/tuple +1092 -0
- data/modules/emscripten/system/include/libcxx/type_traits +3040 -0
- data/modules/emscripten/system/include/libcxx/typeindex +103 -0
- data/modules/emscripten/system/include/libcxx/typeinfo +124 -0
- data/modules/emscripten/system/include/libcxx/unordered_map +1864 -0
- data/modules/emscripten/system/include/libcxx/unordered_set +1144 -0
- data/modules/emscripten/system/include/libcxx/utility +583 -0
- data/modules/emscripten/system/include/libcxx/valarray +4779 -0
- data/modules/emscripten/system/include/libcxx/vector +3228 -0
- data/modules/emscripten/system/include/memory.h +10 -0
- data/modules/emscripten/system/include/mntent.h +23 -0
- data/modules/emscripten/system/include/net/arpa/inet.h +32 -0
- data/modules/emscripten/system/include/net/arpa/nameser.h +535 -0
- data/modules/emscripten/system/include/net/arpa/nameser_compat.h +187 -0
- data/modules/emscripten/system/include/net/if.h +87 -0
- data/modules/emscripten/system/include/net/netinet/in.h +166 -0
- data/modules/emscripten/system/include/net/netinet/tcp.h +246 -0
- data/modules/emscripten/system/include/net/resolv.h +389 -0
- data/modules/emscripten/system/include/netdb.h +94 -0
- data/modules/emscripten/system/include/nl_types.h +19 -0
- data/modules/emscripten/system/include/poll.h +3 -0
- data/modules/emscripten/system/include/pty.h +6 -0
- data/modules/emscripten/system/include/semaphore.h +31 -0
- data/modules/emscripten/system/include/spawn.h +105 -0
- data/modules/emscripten/system/include/stdbool.h +16 -0
- data/modules/emscripten/system/include/sys/bitypes.h +3 -0
- data/modules/emscripten/system/include/sys/io.h +14 -0
- data/modules/emscripten/system/include/sys/ioctl.h +26 -0
- data/modules/emscripten/system/include/sys/poll.h +31 -0
- data/modules/emscripten/system/include/sys/select.h +14 -0
- data/modules/emscripten/system/include/sys/socket.h +101 -0
- data/modules/emscripten/system/include/sys/socketvar.h +3 -0
- data/modules/emscripten/system/include/sys/statvfs.h +32 -0
- data/modules/emscripten/system/include/sys/sysctl.h +14 -0
- data/modules/emscripten/system/include/sys/uio.h +22 -0
- data/modules/emscripten/system/include/sys/un.h +66 -0
- data/modules/emscripten/system/include/sysexits.h +108 -0
- data/modules/emscripten/system/include/unwind.h +154 -0
- data/modules/emscripten/system/include/xlocale.h +47 -0
- data/modules/emscripten/system/include/zconf.h +428 -0
- data/modules/emscripten/system/include/zlib.h +1613 -0
- data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +97 -0
- data/modules/emscripten/system/lib/compiler-rt/divdi3.c +47 -0
- data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +116 -0
- data/modules/emscripten/system/lib/compiler-rt/int_lib.h +46 -0
- data/modules/emscripten/system/lib/compiler-rt/int_math.h +67 -0
- data/modules/emscripten/system/lib/compiler-rt/int_types.h +140 -0
- data/modules/emscripten/system/lib/compiler-rt/int_util.h +29 -0
- data/modules/emscripten/system/lib/compiler-rt/muldi3.c +56 -0
- data/modules/emscripten/system/lib/compiler-rt/readme.txt +20 -0
- data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +36 -0
- data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +251 -0
- data/modules/emscripten/system/lib/debugging.cpp +24 -0
- data/modules/emscripten/system/lib/dlmalloc.c +6299 -0
- data/modules/emscripten/system/lib/embind/bind.cpp +63 -0
- data/modules/emscripten/system/lib/libc/gen/err.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/errx.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/verr.c +58 -0
- data/modules/emscripten/system/lib/libc/gen/verrx.c +51 -0
- data/modules/emscripten/system/lib/libc/gen/vwarn.c +55 -0
- data/modules/emscripten/system/lib/libc/gen/vwarnx.c +48 -0
- data/modules/emscripten/system/lib/libc/gen/warn.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/warnx.c +49 -0
- data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +92 -0
- data/modules/emscripten/system/lib/libc/musl/readme.txt +1 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +125 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +14 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +63 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +62 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +109 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +268 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +16 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +29 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +42 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +71 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +57 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +65 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +100 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +53 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +52 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +58 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +11 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +108 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +9 -0
- data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +511 -0
- data/modules/emscripten/system/lib/libc/stdlib/strtod.c +305 -0
- data/modules/emscripten/system/lib/libc.symbols +81 -0
- data/modules/emscripten/system/lib/libcextra.symbols +61 -0
- data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/lib/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/lib/libcxx/algorithm.cpp +83 -0
- data/modules/emscripten/system/lib/libcxx/bind.cpp +30 -0
- data/modules/emscripten/system/lib/libcxx/chrono.cpp +132 -0
- data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +81 -0
- data/modules/emscripten/system/lib/libcxx/debug.cpp +504 -0
- data/modules/emscripten/system/lib/libcxx/exception.cpp +226 -0
- data/modules/emscripten/system/lib/libcxx/future.cpp +285 -0
- data/modules/emscripten/system/lib/libcxx/hash.cpp +564 -0
- data/modules/emscripten/system/lib/libcxx/ios.cpp +455 -0
- data/modules/emscripten/system/lib/libcxx/iostream.cpp +68 -0
- data/modules/emscripten/system/lib/libcxx/locale.cpp +6093 -0
- data/modules/emscripten/system/lib/libcxx/memory.cpp +223 -0
- data/modules/emscripten/system/lib/libcxx/mutex.cpp +250 -0
- data/modules/emscripten/system/lib/libcxx/new.cpp +205 -0
- data/modules/emscripten/system/lib/libcxx/random.cpp +48 -0
- data/modules/emscripten/system/lib/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxx/regex.cpp +325 -0
- data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +196 -0
- data/modules/emscripten/system/lib/libcxx/string.cpp +687 -0
- data/modules/emscripten/system/lib/libcxx/strstream.cpp +329 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/README +4 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +76 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +93 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +245 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +94 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +70 -0
- data/modules/emscripten/system/lib/libcxx/symbols +2927 -0
- data/modules/emscripten/system/lib/libcxx/system_error.cpp +201 -0
- data/modules/emscripten/system/lib/libcxx/thread.cpp +208 -0
- data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +60 -0
- data/modules/emscripten/system/lib/libcxx/utility.cpp +17 -0
- data/modules/emscripten/system/lib/libcxx/valarray.cpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +38 -0
- data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +76 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +167 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +175 -0
- data/modules/emscripten/system/lib/libcxxabi/lib/buildit +99 -0
- data/modules/emscripten/system/lib/libcxxabi/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +50 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +33 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +34 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +11036 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +622 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +123 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +91 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +231 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +125 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +242 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +1055 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +27 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +367 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +31 -0
- data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +41 -0
- data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +174 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +1146 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +248 -0
- data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +169 -0
- data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +53 -0
- data/modules/emscripten/system/lib/libcxxabi/symbols +236 -0
- data/modules/emscripten/system/lib/sdl.cpp +13 -0
- data/modules/emscripten/system/lib/sdl.symbols +1 -0
- data/modules/emscripten/tests/hello_world.js +92 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +2347 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +4 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +657 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +147 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +74 -0
- data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +249 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.html +544 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.txt +226 -0
- data/modules/emscripten/third_party/CppHeaderParser/setup.py +43 -0
- data/modules/emscripten/third_party/ansidecl.h +371 -0
- data/modules/emscripten/third_party/closure-compiler/COPYING +202 -0
- data/modules/emscripten/third_party/closure-compiler/README +292 -0
- data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
- data/modules/emscripten/third_party/closure-compiler/readme.txt +3 -0
- data/modules/emscripten/third_party/cp-demangle.h +161 -0
- data/modules/emscripten/third_party/demangle.h +549 -0
- data/modules/emscripten/third_party/demangler.py +49 -0
- data/modules/emscripten/third_party/gcc_demangler.c +4226 -0
- data/modules/emscripten/third_party/gcc_demangler.js +21282 -0
- data/modules/emscripten/third_party/jni/emjvm.cpp +133 -0
- data/modules/emscripten/third_party/jni/emjvm.h +8 -0
- data/modules/emscripten/third_party/jni/emjvm.js +185 -0
- data/modules/emscripten/third_party/jni/jni.h +1154 -0
- data/modules/emscripten/third_party/libiberty.h +634 -0
- data/modules/emscripten/third_party/lzma.js/README.markdown +37 -0
- data/modules/emscripten/third_party/lzma.js/doit.sh +37 -0
- data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +7 -0
- data/modules/emscripten/third_party/lzma.js/lzip/COPYING +676 -0
- data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +201 -0
- data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +56 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile +160 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +138 -0
- data/modules/emscripten/third_party/lzma.js/lzip/NEWS +22 -0
- data/modules/emscripten/third_party/lzma.js/lzip/README +77 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +204 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +106 -0
- data/modules/emscripten/third_party/lzma.js/lzip/configure +192 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +252 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +268 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +643 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +582 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +378 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +171 -0
- data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +264 -0
- data/modules/emscripten/third_party/lzma.js/lzip/main.cc +545 -0
- data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +27 -0
- data/modules/emscripten/third_party/lzma.js/lzma-full.js +27 -0
- data/modules/emscripten/third_party/lzma.js/native_test.sh +5 -0
- data/modules/emscripten/third_party/lzma.js/post.js +13 -0
- data/modules/emscripten/third_party/lzma.js/pre.js +13 -0
- data/modules/emscripten/third_party/lzma.js/test-decoder.js +39 -0
- data/modules/emscripten/third_party/lzma.js/test-full.html +9 -0
- data/modules/emscripten/third_party/lzma.js/test-full.js +78 -0
- data/modules/emscripten/third_party/ply/ANNOUNCE +40 -0
- data/modules/emscripten/third_party/ply/CHANGES +1093 -0
- data/modules/emscripten/third_party/ply/PKG-INFO +22 -0
- data/modules/emscripten/third_party/ply/README +271 -0
- data/modules/emscripten/third_party/ply/TODO +16 -0
- data/modules/emscripten/third_party/ply/doc/internal.html +874 -0
- data/modules/emscripten/third_party/ply/doc/makedoc.py +194 -0
- data/modules/emscripten/third_party/ply/doc/ply.html +3262 -0
- data/modules/emscripten/third_party/ply/example/BASIC/README +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basic.py +71 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +74 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +441 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +424 -0
- data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +14 -0
- data/modules/emscripten/third_party/ply/example/BASIC/func.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +22 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +17 -0
- data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +12 -0
- data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +20 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +18 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +4 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +709 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/README +5 -0
- data/modules/emscripten/third_party/ply/example/README +10 -0
- data/modules/emscripten/third_party/ply/example/ansic/README +2 -0
- data/modules/emscripten/third_party/ply/example/ansic/clex.py +164 -0
- data/modules/emscripten/third_party/ply/example/ansic/cparse.py +863 -0
- data/modules/emscripten/third_party/ply/example/calc/calc.py +107 -0
- data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +113 -0
- data/modules/emscripten/third_party/ply/example/classcalc/calc.py +157 -0
- data/modules/emscripten/third_party/ply/example/cleanup.sh +2 -0
- data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +130 -0
- data/modules/emscripten/third_party/ply/example/hedit/hedit.py +48 -0
- data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +160 -0
- data/modules/emscripten/third_party/ply/example/optcalc/README +9 -0
- data/modules/emscripten/third_party/ply/example/optcalc/calc.py +119 -0
- data/modules/emscripten/third_party/ply/example/unicalc/calc.py +117 -0
- data/modules/emscripten/third_party/ply/example/yply/README +41 -0
- data/modules/emscripten/third_party/ply/example/yply/ylex.py +112 -0
- data/modules/emscripten/third_party/ply/example/yply/yparse.py +217 -0
- data/modules/emscripten/third_party/ply/example/yply/yply.py +53 -0
- data/modules/emscripten/third_party/ply/ply/__init__.py +4 -0
- data/modules/emscripten/third_party/ply/ply/cpp.py +898 -0
- data/modules/emscripten/third_party/ply/ply/ctokens.py +133 -0
- data/modules/emscripten/third_party/ply/ply/lex.py +1058 -0
- data/modules/emscripten/third_party/ply/ply/yacc.py +3276 -0
- data/modules/emscripten/third_party/ply/setup.py +31 -0
- data/modules/emscripten/third_party/ply/test/README +7 -0
- data/modules/emscripten/third_party/ply/test/calclex.py +49 -0
- data/modules/emscripten/third_party/ply/test/cleanup.sh +4 -0
- data/modules/emscripten/third_party/ply/test/lex_closure.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_doc1.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_dup1.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_dup2.py +33 -0
- data/modules/emscripten/third_party/ply/test/lex_dup3.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_empty.py +20 -0
- data/modules/emscripten/third_party/ply/test/lex_error1.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_error2.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_error3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_error4.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_hedit.py +47 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_literal1.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_literal2.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_module.py +10 -0
- data/modules/emscripten/third_party/ply/test/lex_module_import.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_object.py +55 -0
- data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize2.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize3.py +52 -0
- data/modules/emscripten/third_party/ply/test/lex_re1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re2.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re3.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_rule2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_state1.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state2.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state3.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_state4.py +41 -0
- data/modules/emscripten/third_party/ply/test/lex_state5.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +39 -0
- data/modules/emscripten/third_party/ply/test/lex_state_norule.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_try.py +45 -0
- data/modules/emscripten/third_party/ply/test/lex_token1.py +19 -0
- data/modules/emscripten/third_party/ply/test/lex_token2.py +22 -0
- data/modules/emscripten/third_party/ply/test/lex_token3.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_token4.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_token5.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_token_dup.py +29 -0
- data/modules/emscripten/third_party/ply/test/testlex.py +606 -0
- data/modules/emscripten/third_party/ply/test/testyacc.py +347 -0
- data/modules/emscripten/third_party/ply/test/yacc_badargs.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badid.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec.py +64 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badrule.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badtok.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_dup.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error3.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_error4.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_inf.py +56 -0
- data/modules/emscripten/third_party/ply/test/yacc_literal.py +69 -0
- data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_missing1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_nested.py +33 -0
- data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_noerror.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_nop.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_notok.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_prec1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +30 -0
- data/modules/emscripten/third_party/ply/test/yacc_simple.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_sr.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_term1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +63 -0
- data/modules/emscripten/third_party/readme.txt +7 -0
- data/modules/emscripten/third_party/websockify/CHANGES.txt +23 -0
- data/modules/emscripten/third_party/websockify/LICENSE.txt +16 -0
- data/modules/emscripten/third_party/websockify/MANIFEST.in +1 -0
- data/modules/emscripten/third_party/websockify/Makefile +11 -0
- data/modules/emscripten/third_party/websockify/README.md +168 -0
- data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +39 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +24 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +61 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +19 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +129 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +36 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +37 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +41 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +75 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +20 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +621 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +165 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +373 -0
- data/modules/emscripten/third_party/websockify/docs/TODO +9 -0
- data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +4 -0
- data/modules/emscripten/third_party/websockify/docs/latency_results.txt +114 -0
- data/modules/emscripten/third_party/websockify/docs/notes +17 -0
- data/modules/emscripten/third_party/websockify/docs/release.txt +9 -0
- data/modules/emscripten/third_party/websockify/docs/websockify.1 +110 -0
- data/modules/emscripten/third_party/websockify/include/VT100.js +919 -0
- data/modules/emscripten/third_party/websockify/include/base64.js +114 -0
- data/modules/emscripten/third_party/websockify/include/keysym.js +99 -0
- data/modules/emscripten/third_party/websockify/include/util.js +359 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +109 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +4 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +391 -0
- data/modules/emscripten/third_party/websockify/include/websock.js +422 -0
- data/modules/emscripten/third_party/websockify/include/webutil.js +216 -0
- data/modules/emscripten/third_party/websockify/include/wsirc.js +235 -0
- data/modules/emscripten/third_party/websockify/include/wstelnet.js +335 -0
- data/modules/emscripten/third_party/websockify/other/Makefile +14 -0
- data/modules/emscripten/third_party/websockify/other/README.md +51 -0
- data/modules/emscripten/third_party/websockify/other/launch.sh +108 -0
- data/modules/emscripten/third_party/websockify/other/project.clj +13 -0
- data/modules/emscripten/third_party/websockify/other/websocket.c +802 -0
- data/modules/emscripten/third_party/websockify/other/websocket.h +84 -0
- data/modules/emscripten/third_party/websockify/other/websocket.rb +456 -0
- data/modules/emscripten/third_party/websockify/other/websockify.c +385 -0
- data/modules/emscripten/third_party/websockify/other/websockify.clj +233 -0
- data/modules/emscripten/third_party/websockify/other/websockify.js +196 -0
- data/modules/emscripten/third_party/websockify/other/websockify.rb +171 -0
- data/modules/emscripten/third_party/websockify/other/wswrap +22 -0
- data/modules/emscripten/third_party/websockify/rebind +18 -0
- data/modules/emscripten/third_party/websockify/rebind.c +94 -0
- data/modules/emscripten/third_party/websockify/run +5 -0
- data/modules/emscripten/third_party/websockify/setup.py +30 -0
- data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +29 -0
- data/modules/emscripten/third_party/websockify/tests/base64.html +91 -0
- data/modules/emscripten/third_party/websockify/tests/base64.js +12 -0
- data/modules/emscripten/third_party/websockify/tests/echo.html +148 -0
- data/modules/emscripten/third_party/websockify/tests/echo.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/echo.rb +62 -0
- data/modules/emscripten/third_party/websockify/tests/latency.html +290 -0
- data/modules/emscripten/third_party/websockify/tests/latency.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/load.html +250 -0
- data/modules/emscripten/third_party/websockify/tests/load.py +167 -0
- data/modules/emscripten/third_party/websockify/tests/plain_echo.html +168 -0
- data/modules/emscripten/third_party/websockify/tests/simple.html +68 -0
- data/modules/emscripten/third_party/websockify/tests/utf8-list.py +22 -0
- data/modules/emscripten/third_party/websockify/websockify/__init__.py +2 -0
- data/modules/emscripten/third_party/websockify/websockify/websocket.py +982 -0
- data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +393 -0
- data/modules/emscripten/third_party/websockify/websockify.py +5 -0
- data/modules/emscripten/third_party/websockify/wsirc.html +99 -0
- data/modules/emscripten/third_party/websockify/wstelnet.html +74 -0
- data/modules/emscripten/tools/__init__.py +0 -0
- data/modules/emscripten/tools/__init__.pyc +0 -0
- data/modules/emscripten/tools/autodebugger.py +289 -0
- data/modules/emscripten/tools/autodebugger_c.py +37 -0
- data/modules/emscripten/tools/autodebugger_indenter.py +18 -0
- data/modules/emscripten/tools/autodebugger_js.py +47 -0
- data/modules/emscripten/tools/autodediffer.py +60 -0
- data/modules/emscripten/tools/bindings_generator.py +832 -0
- data/modules/emscripten/tools/bisect_pair.py +88 -0
- data/modules/emscripten/tools/cache.py +198 -0
- data/modules/emscripten/tools/cache.pyc +0 -0
- data/modules/emscripten/tools/clean_webconsole.py +34 -0
- data/modules/emscripten/tools/crunch-worker.js +124 -0
- data/modules/emscripten/tools/diff_autodebugger.py +15 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +5129 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +6861 -0
- data/modules/emscripten/tools/eliminator/eliminator-test-output.js +6122 -0
- data/modules/emscripten/tools/eliminator/eliminator-test.js +8856 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +888 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +463 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +317 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +1363 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +2005 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +51 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +22 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +28 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +402 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +55 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +33 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +97 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +138 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +17 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +85 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +103 -0
- data/modules/emscripten/tools/emconfiguren.py +19 -0
- data/modules/emscripten/tools/emmaken.py +230 -0
- data/modules/emscripten/tools/emmakenxx.py +18 -0
- data/modules/emscripten/tools/exec_llvm.py +50 -0
- data/modules/emscripten/tools/file2json.py +49 -0
- data/modules/emscripten/tools/file_packager.py +649 -0
- data/modules/emscripten/tools/find_bigfuncs.py +23 -0
- data/modules/emscripten/tools/find_bigis.py +18 -0
- data/modules/emscripten/tools/fix_closure.py +88 -0
- data/modules/emscripten/tools/ie7_fix.py +14 -0
- data/modules/emscripten/tools/js-optimizer.js +3440 -0
- data/modules/emscripten/tools/js_optimizer.py +341 -0
- data/modules/emscripten/tools/js_optimizer.pyc +0 -0
- data/modules/emscripten/tools/jsrun.py +27 -0
- data/modules/emscripten/tools/jsrun.pyc +0 -0
- data/modules/emscripten/tools/ll-strip.py +56 -0
- data/modules/emscripten/tools/make_file.py +19 -0
- data/modules/emscripten/tools/make_minigzip.py +13 -0
- data/modules/emscripten/tools/namespacer.py +95 -0
- data/modules/emscripten/tools/nativize_llvm.py +34 -0
- data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +58 -0
- data/modules/emscripten/tools/node_modules/source-map/LICENSE +28 -0
- data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +166 -0
- data/modules/emscripten/tools/node_modules/source-map/README.md +347 -0
- data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +56 -0
- data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +152 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +3 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +96 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +81 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +430 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +381 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +353 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +117 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +119 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +33 -0
- data/modules/emscripten/tools/node_modules/source-map/package.json +74 -0
- data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +73 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +71 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +306 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +391 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +282 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +152 -0
- data/modules/emscripten/tools/reproduceriter.js +216 -0
- data/modules/emscripten/tools/reproduceriter.py +160 -0
- data/modules/emscripten/tools/response_file.py +28 -0
- data/modules/emscripten/tools/response_file.pyc +0 -0
- data/modules/emscripten/tools/scan_js.py +20 -0
- data/modules/emscripten/tools/scan_ll.py +18 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +3 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +46 -0
- data/modules/emscripten/tools/settings_template_readonly.py +47 -0
- data/modules/emscripten/tools/shared.py +1437 -0
- data/modules/emscripten/tools/shared.pyc +0 -0
- data/modules/emscripten/tools/source-maps/sourcemap2json.js +15 -0
- data/modules/emscripten/tools/source-maps/sourcemapper.js +177 -0
- data/modules/emscripten/tools/split.py +97 -0
- data/modules/emscripten/tools/tempfiles.py +40 -0
- data/modules/emscripten/tools/tempfiles.pyc +0 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +75 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline-output.js +570 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline.js +606 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +540 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +550 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +36 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +37 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +106 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +110 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +9 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +12 -0
- data/modules/emscripten/tools/test-js-optimizer-output.js +291 -0
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +232 -0
- data/modules/emscripten/tools/test-js-optimizer-regs.js +237 -0
- data/modules/emscripten/tools/test-js-optimizer-t2-output.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-t2.js +92 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +17 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c.js +18 -0
- data/modules/emscripten/tools/test-js-optimizer-t3-output.js +49 -0
- data/modules/emscripten/tools/test-js-optimizer-t3.js +50 -0
- data/modules/emscripten/tools/test-js-optimizer.js +401 -0
- data/modules/mruby/AUTHORS +18 -0
- data/modules/mruby/CONTRIBUTING.md +65 -0
- data/modules/mruby/ChangeLog +15 -0
- data/modules/mruby/INSTALL +29 -0
- data/modules/mruby/LEGAL +6 -0
- data/modules/mruby/MITL +20 -0
- data/modules/mruby/Makefile +18 -0
- data/modules/mruby/NEWS +13 -0
- data/modules/mruby/README.md +116 -0
- data/modules/mruby/Rakefile +114 -0
- data/modules/mruby/TODO +11 -0
- data/modules/mruby/benchmark/ao-render.rb +315 -0
- data/modules/mruby/benchmark/bm_so_lists.rb +47 -0
- data/modules/mruby/benchmark/fib39.rb +8 -0
- data/modules/mruby/build_config.rb +88 -0
- data/modules/mruby/doc/compile/README.md +376 -0
- data/modules/mruby/doc/mrbgems/README.md +254 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/targets/ArduinoDue.rb +65 -0
- data/modules/mruby/examples/targets/chipKitMax32.rb +68 -0
- data/modules/mruby/include/mrbconf.h +87 -0
- data/modules/mruby/include/mruby/array.h +63 -0
- data/modules/mruby/include/mruby/class.h +75 -0
- data/modules/mruby/include/mruby/compile.h +176 -0
- data/modules/mruby/include/mruby/data.h +53 -0
- data/modules/mruby/include/mruby/dump.h +151 -0
- data/modules/mruby/include/mruby/gc.h +17 -0
- data/modules/mruby/include/mruby/hash.h +54 -0
- data/modules/mruby/include/mruby/irep.h +40 -0
- data/modules/mruby/include/mruby/khash.h +257 -0
- data/modules/mruby/include/mruby/numeric.h +32 -0
- data/modules/mruby/include/mruby/proc.h +62 -0
- data/modules/mruby/include/mruby/range.h +35 -0
- data/modules/mruby/include/mruby/string.h +78 -0
- data/modules/mruby/include/mruby/value.h +483 -0
- data/modules/mruby/include/mruby/variable.h +78 -0
- data/modules/mruby/include/mruby.h +388 -0
- data/modules/mruby/minirake +477 -0
- data/modules/mruby/mrbgems/default.gembox +61 -0
- data/modules/mruby/mrbgems/full-core.gembox +9 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +204 -0
- data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +140 -0
- data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +109 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +365 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +243 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +164 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +44 -0
- data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-eval/src/eval.c +23 -0
- data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +251 -0
- data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +64 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +13 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +62 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +26 -0
- data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-math/src/math.c +685 -0
- data/modules/mruby/mrbgems/mruby-math/test/math.rb +136 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +31 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +10 -0
- data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +108 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/nil.rb +11 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +9 -0
- data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +117 -0
- data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +38 -0
- data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-print/mrblib/print.rb +64 -0
- data/modules/mruby/mrbgems/mruby-print/src/print.c +44 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +40 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +97 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +41 -0
- data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +193 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +48 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.c +231 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.h +12 -0
- data/modules/mruby/mrbgems/mruby-random/test/random.rb +32 -0
- data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +141 -0
- data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +20 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/kernel.c +30 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1102 -0
- data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +3 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +52 -0
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +175 -0
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +112 -0
- data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +50 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +818 -0
- data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +77 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +9 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +55 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +12 -0
- data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +749 -0
- data/modules/mruby/mrbgems/mruby-time/test/time.rb +201 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +11 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +24 -0
- data/modules/mruby/mrblib/array.rb +111 -0
- data/modules/mruby/mrblib/class.rb +26 -0
- data/modules/mruby/mrblib/compar.rb +104 -0
- data/modules/mruby/mrblib/enum.rb +398 -0
- data/modules/mruby/mrblib/error.rb +66 -0
- data/modules/mruby/mrblib/hash.rb +193 -0
- data/modules/mruby/mrblib/init_mrblib.c +14 -0
- data/modules/mruby/mrblib/kernel.rb +46 -0
- data/modules/mruby/mrblib/mrblib.rake +18 -0
- data/modules/mruby/mrblib/numeric.rb +101 -0
- data/modules/mruby/mrblib/print.rb +18 -0
- data/modules/mruby/mrblib/range.rb +40 -0
- data/modules/mruby/mrblib/string.rb +145 -0
- data/modules/mruby/src/array.c +1150 -0
- data/modules/mruby/src/backtrace.c +73 -0
- data/modules/mruby/src/class.c +1942 -0
- data/modules/mruby/src/codegen.c +2864 -0
- data/modules/mruby/src/compar.c +13 -0
- data/modules/mruby/src/crc.c +38 -0
- data/modules/mruby/src/dump.c +542 -0
- data/modules/mruby/src/enum.c +14 -0
- data/modules/mruby/src/error.c +454 -0
- data/modules/mruby/src/error.h +18 -0
- data/modules/mruby/src/etc.c +204 -0
- data/modules/mruby/src/gc.c +1542 -0
- data/modules/mruby/src/hash.c +1261 -0
- data/modules/mruby/src/init.c +62 -0
- data/modules/mruby/src/kernel.c +1105 -0
- data/modules/mruby/src/keywords +50 -0
- data/modules/mruby/src/lex.def +212 -0
- data/modules/mruby/src/load.c +629 -0
- data/modules/mruby/src/mruby_core.rake +28 -0
- data/modules/mruby/src/node.h +117 -0
- data/modules/mruby/src/numeric.c +1418 -0
- data/modules/mruby/src/object.c +593 -0
- data/modules/mruby/src/opcode.h +160 -0
- data/modules/mruby/src/parse.y +6050 -0
- data/modules/mruby/src/pool.c +190 -0
- data/modules/mruby/src/print.c +71 -0
- data/modules/mruby/src/proc.c +209 -0
- data/modules/mruby/src/range.c +442 -0
- data/modules/mruby/src/re.h +13 -0
- data/modules/mruby/src/state.c +200 -0
- data/modules/mruby/src/string.c +2580 -0
- data/modules/mruby/src/symbol.c +456 -0
- data/modules/mruby/src/value_array.h +27 -0
- data/modules/mruby/src/variable.c +1147 -0
- data/modules/mruby/src/vm.c +2129 -0
- data/modules/mruby/tasks/libmruby.rake +18 -0
- data/modules/mruby/tasks/mrbgem_spec.rake +297 -0
- data/modules/mruby/tasks/mrbgems.rake +85 -0
- data/modules/mruby/tasks/mrbgems_test.rake +88 -0
- data/modules/mruby/tasks/mruby_build.rake +211 -0
- data/modules/mruby/tasks/mruby_build_commands.rake +287 -0
- data/modules/mruby/tasks/mruby_build_gem.rake +67 -0
- data/modules/mruby/tasks/ruby_ext.rake +70 -0
- data/modules/mruby/tasks/toolchains/androideabi.rake +126 -0
- data/modules/mruby/tasks/toolchains/clang.rake +8 -0
- data/modules/mruby/tasks/toolchains/gcc.rake +21 -0
- data/modules/mruby/tasks/toolchains/vs2010.rake +3 -0
- data/modules/mruby/tasks/toolchains/vs2012.rake +44 -0
- data/modules/mruby/test/README.md +7 -0
- data/modules/mruby/test/assert.rb +238 -0
- data/modules/mruby/test/driver.c +118 -0
- data/modules/mruby/test/init_mrbtest.c +24 -0
- data/modules/mruby/test/mrbtest.rake +47 -0
- data/modules/mruby/test/report.rb +4 -0
- data/modules/mruby/test/t/argumenterror.rb +21 -0
- data/modules/mruby/test/t/array.rb +309 -0
- data/modules/mruby/test/t/basicobject.rb +11 -0
- data/modules/mruby/test/t/bs_block.rb +489 -0
- data/modules/mruby/test/t/bs_literal.rb +38 -0
- data/modules/mruby/test/t/class.rb +219 -0
- data/modules/mruby/test/t/comparable.rb +72 -0
- data/modules/mruby/test/t/enumerable.rb +108 -0
- data/modules/mruby/test/t/exception.rb +337 -0
- data/modules/mruby/test/t/false.rb +33 -0
- data/modules/mruby/test/t/float.rb +145 -0
- data/modules/mruby/test/t/gc.rb +45 -0
- data/modules/mruby/test/t/hash.rb +310 -0
- data/modules/mruby/test/t/indexerror.rb +10 -0
- data/modules/mruby/test/t/integer.rb +222 -0
- data/modules/mruby/test/t/kernel.rb +425 -0
- data/modules/mruby/test/t/literals.rb +287 -0
- data/modules/mruby/test/t/localjumperror.rb +13 -0
- data/modules/mruby/test/t/methods.rb +109 -0
- data/modules/mruby/test/t/module.rb +344 -0
- data/modules/mruby/test/t/nameerror.rb +32 -0
- data/modules/mruby/test/t/nil.rb +29 -0
- data/modules/mruby/test/t/nomethoderror.rb +13 -0
- data/modules/mruby/test/t/numeric.rb +29 -0
- data/modules/mruby/test/t/object.rb +11 -0
- data/modules/mruby/test/t/proc.rb +56 -0
- data/modules/mruby/test/t/range.rb +82 -0
- data/modules/mruby/test/t/rangeerror.rb +10 -0
- data/modules/mruby/test/t/regexperror.rb +4 -0
- data/modules/mruby/test/t/runtimeerror.rb +6 -0
- data/modules/mruby/test/t/standarderror.rb +10 -0
- data/modules/mruby/test/t/string.rb +483 -0
- data/modules/mruby/test/t/symbol.rb +27 -0
- data/modules/mruby/test/t/syntax.rb +67 -0
- data/modules/mruby/test/t/true.rb +33 -0
- data/modules/mruby/test/t/typeerror.rb +11 -0
- data/modules/mruby/tools/mrbc/mrbc.c +318 -0
- data/modules/mruby/tools/mrbc/mrbc.rake +14 -0
- data/modules/mruby/travis_config.rb +6 -0
- data/modules/mrubymix/LICENSE +21 -0
- data/modules/mrubymix/README.md +6 -0
- data/modules/mrubymix/bin/mrubymix +29 -0
- data/modules/mrubymix/lib/mrubymix.rb +93 -0
- data/modules/mrubymix/mrubymix.gemspec +13 -0
- data/scripts/gen_gems_config.rb +185 -0
- data/scripts/gen_post.rb +104 -0
- data/templates/minimal/Rakefile +36 -0
- data/templates/minimal/app/app.rb +3 -0
- metadata +1408 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
#!/usr/bin/env python2
|
|
2
|
+
|
|
3
|
+
'''
|
|
4
|
+
Python WebSocket library with support for "wss://" encryption.
|
|
5
|
+
Copyright 2011 Joel Martin
|
|
6
|
+
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
|
|
7
|
+
|
|
8
|
+
Supports following protocol versions:
|
|
9
|
+
- http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
|
|
10
|
+
- http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
|
|
11
|
+
- http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10
|
|
12
|
+
|
|
13
|
+
You can make a cert/key with openssl using:
|
|
14
|
+
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
|
|
15
|
+
as taken from http://docs.python.org/dev/library/ssl.html#certificates
|
|
16
|
+
|
|
17
|
+
'''
|
|
18
|
+
|
|
19
|
+
import os, sys, time, errno, signal, socket, traceback, select
|
|
20
|
+
import array, struct
|
|
21
|
+
from base64 import b64encode, b64decode
|
|
22
|
+
|
|
23
|
+
# Imports that vary by python version
|
|
24
|
+
|
|
25
|
+
# python 3.0 differences
|
|
26
|
+
if sys.hexversion > 0x3000000:
|
|
27
|
+
b2s = lambda buf: buf.decode('latin_1')
|
|
28
|
+
s2b = lambda s: s.encode('latin_1')
|
|
29
|
+
s2a = lambda s: s
|
|
30
|
+
else:
|
|
31
|
+
b2s = lambda buf: buf # No-op
|
|
32
|
+
s2b = lambda s: s # No-op
|
|
33
|
+
s2a = lambda s: [ord(c) for c in s]
|
|
34
|
+
try: from io import StringIO
|
|
35
|
+
except: from cStringIO import StringIO
|
|
36
|
+
try: from http.server import SimpleHTTPRequestHandler
|
|
37
|
+
except: from SimpleHTTPServer import SimpleHTTPRequestHandler
|
|
38
|
+
|
|
39
|
+
# python 2.6 differences
|
|
40
|
+
try: from hashlib import md5, sha1
|
|
41
|
+
except: from md5 import md5; from sha import sha as sha1
|
|
42
|
+
|
|
43
|
+
# python 2.5 differences
|
|
44
|
+
try:
|
|
45
|
+
from struct import pack, unpack_from
|
|
46
|
+
except:
|
|
47
|
+
from struct import pack
|
|
48
|
+
def unpack_from(fmt, buf, offset=0):
|
|
49
|
+
slice = buffer(buf, offset, struct.calcsize(fmt))
|
|
50
|
+
return struct.unpack(fmt, slice)
|
|
51
|
+
|
|
52
|
+
# Degraded functionality if these imports are missing
|
|
53
|
+
for mod, sup in [('numpy', 'HyBi protocol'), ('ssl', 'TLS/SSL/wss'),
|
|
54
|
+
('multiprocessing', 'Multi-Processing'),
|
|
55
|
+
('resource', 'daemonizing')]:
|
|
56
|
+
try:
|
|
57
|
+
globals()[mod] = __import__(mod)
|
|
58
|
+
except ImportError:
|
|
59
|
+
globals()[mod] = None
|
|
60
|
+
print("WARNING: no '%s' module, %s is slower or disabled" % (
|
|
61
|
+
mod, sup))
|
|
62
|
+
if multiprocessing and sys.platform == 'win32':
|
|
63
|
+
# make sockets pickle-able/inheritable
|
|
64
|
+
import multiprocessing.reduction
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class WebSocketServer(object):
|
|
68
|
+
"""
|
|
69
|
+
WebSockets server class.
|
|
70
|
+
Must be sub-classed with new_client method definition.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
buffer_size = 65536
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
server_handshake_hixie = """HTTP/1.1 101 Web Socket Protocol Handshake\r
|
|
77
|
+
Upgrade: WebSocket\r
|
|
78
|
+
Connection: Upgrade\r
|
|
79
|
+
%sWebSocket-Origin: %s\r
|
|
80
|
+
%sWebSocket-Location: %s://%s%s\r
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
server_handshake_hybi = """HTTP/1.1 101 Switching Protocols\r
|
|
84
|
+
Upgrade: websocket\r
|
|
85
|
+
Connection: Upgrade\r
|
|
86
|
+
Sec-WebSocket-Accept: %s\r
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
|
90
|
+
|
|
91
|
+
policy_response = """<cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>\n"""
|
|
92
|
+
|
|
93
|
+
# An exception before the WebSocket connection was established
|
|
94
|
+
class EClose(Exception):
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
# An exception while the WebSocket client was connected
|
|
98
|
+
class CClose(Exception):
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
def __init__(self, listen_host='', listen_port=None, source_is_ipv6=False,
|
|
102
|
+
verbose=False, cert='', key='', ssl_only=None,
|
|
103
|
+
daemon=False, record='', web='',
|
|
104
|
+
run_once=False, timeout=0, idle_timeout=0):
|
|
105
|
+
|
|
106
|
+
# settings
|
|
107
|
+
self.verbose = verbose
|
|
108
|
+
self.listen_host = listen_host
|
|
109
|
+
self.listen_port = listen_port
|
|
110
|
+
self.prefer_ipv6 = source_is_ipv6
|
|
111
|
+
self.ssl_only = ssl_only
|
|
112
|
+
self.daemon = daemon
|
|
113
|
+
self.run_once = run_once
|
|
114
|
+
self.timeout = timeout
|
|
115
|
+
self.idle_timeout = idle_timeout
|
|
116
|
+
|
|
117
|
+
self.launch_time = time.time()
|
|
118
|
+
self.ws_connection = False
|
|
119
|
+
self.handler_id = 1
|
|
120
|
+
|
|
121
|
+
# Make paths settings absolute
|
|
122
|
+
self.cert = os.path.abspath(cert)
|
|
123
|
+
self.key = self.web = self.record = ''
|
|
124
|
+
if key:
|
|
125
|
+
self.key = os.path.abspath(key)
|
|
126
|
+
if web:
|
|
127
|
+
self.web = os.path.abspath(web)
|
|
128
|
+
if record:
|
|
129
|
+
self.record = os.path.abspath(record)
|
|
130
|
+
|
|
131
|
+
if self.web:
|
|
132
|
+
os.chdir(self.web)
|
|
133
|
+
|
|
134
|
+
# Sanity checks
|
|
135
|
+
if not ssl and self.ssl_only:
|
|
136
|
+
raise Exception("No 'ssl' module and SSL-only specified")
|
|
137
|
+
if self.daemon and not resource:
|
|
138
|
+
raise Exception("Module 'resource' required to daemonize")
|
|
139
|
+
|
|
140
|
+
# Show configuration
|
|
141
|
+
print("WebSocket server settings:")
|
|
142
|
+
print(" - Listen on %s:%s" % (
|
|
143
|
+
self.listen_host, self.listen_port))
|
|
144
|
+
print(" - Flash security policy server")
|
|
145
|
+
if self.web:
|
|
146
|
+
print(" - Web server. Web root: %s" % self.web)
|
|
147
|
+
if ssl:
|
|
148
|
+
if os.path.exists(self.cert):
|
|
149
|
+
print(" - SSL/TLS support")
|
|
150
|
+
if self.ssl_only:
|
|
151
|
+
print(" - Deny non-SSL/TLS connections")
|
|
152
|
+
else:
|
|
153
|
+
print(" - No SSL/TLS support (no cert file)")
|
|
154
|
+
else:
|
|
155
|
+
print(" - No SSL/TLS support (no 'ssl' module)")
|
|
156
|
+
if self.daemon:
|
|
157
|
+
print(" - Backgrounding (daemon)")
|
|
158
|
+
if self.record:
|
|
159
|
+
print(" - Recording to '%s.*'" % self.record)
|
|
160
|
+
|
|
161
|
+
#
|
|
162
|
+
# WebSocketServer static methods
|
|
163
|
+
#
|
|
164
|
+
|
|
165
|
+
@staticmethod
|
|
166
|
+
def socket(host, port=None, connect=False, prefer_ipv6=False, unix_socket=None, use_ssl=False):
|
|
167
|
+
""" Resolve a host (and optional port) to an IPv4 or IPv6
|
|
168
|
+
address. Create a socket. Bind to it if listen is set,
|
|
169
|
+
otherwise connect to it. Return the socket.
|
|
170
|
+
"""
|
|
171
|
+
flags = 0
|
|
172
|
+
if host == '':
|
|
173
|
+
host = None
|
|
174
|
+
if connect and not (port or unix_socket):
|
|
175
|
+
raise Exception("Connect mode requires a port")
|
|
176
|
+
if use_ssl and not ssl:
|
|
177
|
+
raise Exception("SSL socket requested but Python SSL module not loaded.");
|
|
178
|
+
if not connect and use_ssl:
|
|
179
|
+
raise Exception("SSL only supported in connect mode (for now)")
|
|
180
|
+
if not connect:
|
|
181
|
+
flags = flags | socket.AI_PASSIVE
|
|
182
|
+
|
|
183
|
+
if not unix_socket:
|
|
184
|
+
addrs = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM,
|
|
185
|
+
socket.IPPROTO_TCP, flags)
|
|
186
|
+
if not addrs:
|
|
187
|
+
raise Exception("Could not resolve host '%s'" % host)
|
|
188
|
+
addrs.sort(key=lambda x: x[0])
|
|
189
|
+
if prefer_ipv6:
|
|
190
|
+
addrs.reverse()
|
|
191
|
+
sock = socket.socket(addrs[0][0], addrs[0][1])
|
|
192
|
+
if connect:
|
|
193
|
+
sock.connect(addrs[0][4])
|
|
194
|
+
if use_ssl:
|
|
195
|
+
sock = ssl.wrap_socket(sock)
|
|
196
|
+
else:
|
|
197
|
+
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
198
|
+
sock.bind(addrs[0][4])
|
|
199
|
+
sock.listen(100)
|
|
200
|
+
else:
|
|
201
|
+
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
202
|
+
sock.connect(unix_socket)
|
|
203
|
+
|
|
204
|
+
return sock
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def daemonize(keepfd=None, chdir='/'):
|
|
208
|
+
os.umask(0)
|
|
209
|
+
if chdir:
|
|
210
|
+
os.chdir(chdir)
|
|
211
|
+
else:
|
|
212
|
+
os.chdir('/')
|
|
213
|
+
os.setgid(os.getgid()) # relinquish elevations
|
|
214
|
+
os.setuid(os.getuid()) # relinquish elevations
|
|
215
|
+
|
|
216
|
+
# Double fork to daemonize
|
|
217
|
+
if os.fork() > 0: os._exit(0) # Parent exits
|
|
218
|
+
os.setsid() # Obtain new process group
|
|
219
|
+
if os.fork() > 0: os._exit(0) # Parent exits
|
|
220
|
+
|
|
221
|
+
# Signal handling
|
|
222
|
+
def terminate(a,b): os._exit(0)
|
|
223
|
+
signal.signal(signal.SIGTERM, terminate)
|
|
224
|
+
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
225
|
+
|
|
226
|
+
# Close open files
|
|
227
|
+
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
|
228
|
+
if maxfd == resource.RLIM_INFINITY: maxfd = 256
|
|
229
|
+
for fd in reversed(range(maxfd)):
|
|
230
|
+
try:
|
|
231
|
+
if fd != keepfd:
|
|
232
|
+
os.close(fd)
|
|
233
|
+
except OSError:
|
|
234
|
+
_, exc, _ = sys.exc_info()
|
|
235
|
+
if exc.errno != errno.EBADF: raise
|
|
236
|
+
|
|
237
|
+
# Redirect I/O to /dev/null
|
|
238
|
+
os.dup2(os.open(os.devnull, os.O_RDWR), sys.stdin.fileno())
|
|
239
|
+
os.dup2(os.open(os.devnull, os.O_RDWR), sys.stdout.fileno())
|
|
240
|
+
os.dup2(os.open(os.devnull, os.O_RDWR), sys.stderr.fileno())
|
|
241
|
+
|
|
242
|
+
@staticmethod
|
|
243
|
+
def unmask(buf, hlen, plen):
|
|
244
|
+
pstart = hlen + 4
|
|
245
|
+
pend = pstart + plen
|
|
246
|
+
if numpy:
|
|
247
|
+
b = c = s2b('')
|
|
248
|
+
if plen >= 4:
|
|
249
|
+
mask = numpy.frombuffer(buf, dtype=numpy.dtype('<u4'),
|
|
250
|
+
offset=hlen, count=1)
|
|
251
|
+
data = numpy.frombuffer(buf, dtype=numpy.dtype('<u4'),
|
|
252
|
+
offset=pstart, count=int(plen / 4))
|
|
253
|
+
#b = numpy.bitwise_xor(data, mask).data
|
|
254
|
+
b = numpy.bitwise_xor(data, mask).tostring()
|
|
255
|
+
|
|
256
|
+
if plen % 4:
|
|
257
|
+
#print("Partial unmask")
|
|
258
|
+
mask = numpy.frombuffer(buf, dtype=numpy.dtype('B'),
|
|
259
|
+
offset=hlen, count=(plen % 4))
|
|
260
|
+
data = numpy.frombuffer(buf, dtype=numpy.dtype('B'),
|
|
261
|
+
offset=pend - (plen % 4),
|
|
262
|
+
count=(plen % 4))
|
|
263
|
+
c = numpy.bitwise_xor(data, mask).tostring()
|
|
264
|
+
return b + c
|
|
265
|
+
else:
|
|
266
|
+
# Slower fallback
|
|
267
|
+
mask = buf[hlen:hlen+4]
|
|
268
|
+
data = array.array('B')
|
|
269
|
+
mask = s2a(mask)
|
|
270
|
+
data.fromstring(buf[pstart:pend])
|
|
271
|
+
for i in range(len(data)):
|
|
272
|
+
data[i] ^= mask[i % 4]
|
|
273
|
+
return data.tostring()
|
|
274
|
+
|
|
275
|
+
@staticmethod
|
|
276
|
+
def encode_hybi(buf, opcode, base64=False):
|
|
277
|
+
""" Encode a HyBi style WebSocket frame.
|
|
278
|
+
Optional opcode:
|
|
279
|
+
0x0 - continuation
|
|
280
|
+
0x1 - text frame (base64 encode buf)
|
|
281
|
+
0x2 - binary frame (use raw buf)
|
|
282
|
+
0x8 - connection close
|
|
283
|
+
0x9 - ping
|
|
284
|
+
0xA - pong
|
|
285
|
+
"""
|
|
286
|
+
if base64:
|
|
287
|
+
buf = b64encode(buf)
|
|
288
|
+
|
|
289
|
+
b1 = 0x80 | (opcode & 0x0f) # FIN + opcode
|
|
290
|
+
payload_len = len(buf)
|
|
291
|
+
if payload_len <= 125:
|
|
292
|
+
header = pack('>BB', b1, payload_len)
|
|
293
|
+
elif payload_len > 125 and payload_len < 65536:
|
|
294
|
+
header = pack('>BBH', b1, 126, payload_len)
|
|
295
|
+
elif payload_len >= 65536:
|
|
296
|
+
header = pack('>BBQ', b1, 127, payload_len)
|
|
297
|
+
|
|
298
|
+
#print("Encoded: %s" % repr(header + buf))
|
|
299
|
+
|
|
300
|
+
return header + buf, len(header), 0
|
|
301
|
+
|
|
302
|
+
@staticmethod
|
|
303
|
+
def decode_hybi(buf, base64=False):
|
|
304
|
+
""" Decode HyBi style WebSocket packets.
|
|
305
|
+
Returns:
|
|
306
|
+
{'fin' : 0_or_1,
|
|
307
|
+
'opcode' : number,
|
|
308
|
+
'masked' : boolean,
|
|
309
|
+
'hlen' : header_bytes_number,
|
|
310
|
+
'length' : payload_bytes_number,
|
|
311
|
+
'payload' : decoded_buffer,
|
|
312
|
+
'left' : bytes_left_number,
|
|
313
|
+
'close_code' : number,
|
|
314
|
+
'close_reason' : string}
|
|
315
|
+
"""
|
|
316
|
+
|
|
317
|
+
f = {'fin' : 0,
|
|
318
|
+
'opcode' : 0,
|
|
319
|
+
'masked' : False,
|
|
320
|
+
'hlen' : 2,
|
|
321
|
+
'length' : 0,
|
|
322
|
+
'payload' : None,
|
|
323
|
+
'left' : 0,
|
|
324
|
+
'close_code' : 1000,
|
|
325
|
+
'close_reason' : ''}
|
|
326
|
+
|
|
327
|
+
blen = len(buf)
|
|
328
|
+
f['left'] = blen
|
|
329
|
+
|
|
330
|
+
if blen < f['hlen']:
|
|
331
|
+
return f # Incomplete frame header
|
|
332
|
+
|
|
333
|
+
b1, b2 = unpack_from(">BB", buf)
|
|
334
|
+
f['opcode'] = b1 & 0x0f
|
|
335
|
+
f['fin'] = (b1 & 0x80) >> 7
|
|
336
|
+
f['masked'] = (b2 & 0x80) >> 7
|
|
337
|
+
|
|
338
|
+
f['length'] = b2 & 0x7f
|
|
339
|
+
|
|
340
|
+
if f['length'] == 126:
|
|
341
|
+
f['hlen'] = 4
|
|
342
|
+
if blen < f['hlen']:
|
|
343
|
+
return f # Incomplete frame header
|
|
344
|
+
(f['length'],) = unpack_from('>xxH', buf)
|
|
345
|
+
elif f['length'] == 127:
|
|
346
|
+
f['hlen'] = 10
|
|
347
|
+
if blen < f['hlen']:
|
|
348
|
+
return f # Incomplete frame header
|
|
349
|
+
(f['length'],) = unpack_from('>xxQ', buf)
|
|
350
|
+
|
|
351
|
+
full_len = f['hlen'] + f['masked'] * 4 + f['length']
|
|
352
|
+
|
|
353
|
+
if blen < full_len: # Incomplete frame
|
|
354
|
+
return f # Incomplete frame header
|
|
355
|
+
|
|
356
|
+
# Number of bytes that are part of the next frame(s)
|
|
357
|
+
f['left'] = blen - full_len
|
|
358
|
+
|
|
359
|
+
# Process 1 frame
|
|
360
|
+
if f['masked']:
|
|
361
|
+
# unmask payload
|
|
362
|
+
f['payload'] = WebSocketServer.unmask(buf, f['hlen'],
|
|
363
|
+
f['length'])
|
|
364
|
+
else:
|
|
365
|
+
print("Unmasked frame: %s" % repr(buf))
|
|
366
|
+
f['payload'] = buf[(f['hlen'] + f['masked'] * 4):full_len]
|
|
367
|
+
|
|
368
|
+
if base64 and f['opcode'] in [1, 2]:
|
|
369
|
+
try:
|
|
370
|
+
f['payload'] = b64decode(f['payload'])
|
|
371
|
+
except:
|
|
372
|
+
print("Exception while b64decoding buffer: %s" %
|
|
373
|
+
repr(buf))
|
|
374
|
+
raise
|
|
375
|
+
|
|
376
|
+
if f['opcode'] == 0x08:
|
|
377
|
+
if f['length'] >= 2:
|
|
378
|
+
f['close_code'] = unpack_from(">H", f['payload'])[0]
|
|
379
|
+
if f['length'] > 3:
|
|
380
|
+
f['close_reason'] = f['payload'][2:]
|
|
381
|
+
|
|
382
|
+
return f
|
|
383
|
+
|
|
384
|
+
@staticmethod
|
|
385
|
+
def encode_hixie(buf):
|
|
386
|
+
return s2b("\x00" + b2s(b64encode(buf)) + "\xff"), 1, 1
|
|
387
|
+
|
|
388
|
+
@staticmethod
|
|
389
|
+
def decode_hixie(buf):
|
|
390
|
+
end = buf.find(s2b('\xff'))
|
|
391
|
+
return {'payload': b64decode(buf[1:end]),
|
|
392
|
+
'hlen': 1,
|
|
393
|
+
'masked': False,
|
|
394
|
+
'length': end - 1,
|
|
395
|
+
'left': len(buf) - (end + 1)}
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
@staticmethod
|
|
399
|
+
def gen_md5(keys):
|
|
400
|
+
""" Generate hash value for WebSockets hixie-76. """
|
|
401
|
+
key1 = keys['Sec-WebSocket-Key1']
|
|
402
|
+
key2 = keys['Sec-WebSocket-Key2']
|
|
403
|
+
key3 = keys['key3']
|
|
404
|
+
spaces1 = key1.count(" ")
|
|
405
|
+
spaces2 = key2.count(" ")
|
|
406
|
+
num1 = int("".join([c for c in key1 if c.isdigit()])) / spaces1
|
|
407
|
+
num2 = int("".join([c for c in key2 if c.isdigit()])) / spaces2
|
|
408
|
+
|
|
409
|
+
return b2s(md5(pack('>II8s',
|
|
410
|
+
int(num1), int(num2), key3)).digest())
|
|
411
|
+
|
|
412
|
+
#
|
|
413
|
+
# WebSocketServer logging/output functions
|
|
414
|
+
#
|
|
415
|
+
|
|
416
|
+
def traffic(self, token="."):
|
|
417
|
+
""" Show traffic flow in verbose mode. """
|
|
418
|
+
if self.verbose and not self.daemon:
|
|
419
|
+
sys.stdout.write(token)
|
|
420
|
+
sys.stdout.flush()
|
|
421
|
+
|
|
422
|
+
def msg(self, msg):
|
|
423
|
+
""" Output message with handler_id prefix. """
|
|
424
|
+
if not self.daemon:
|
|
425
|
+
print("% 3d: %s" % (self.handler_id, msg))
|
|
426
|
+
|
|
427
|
+
def vmsg(self, msg):
|
|
428
|
+
""" Same as msg() but only if verbose. """
|
|
429
|
+
if self.verbose:
|
|
430
|
+
self.msg(msg)
|
|
431
|
+
|
|
432
|
+
#
|
|
433
|
+
# Main WebSocketServer methods
|
|
434
|
+
#
|
|
435
|
+
def send_frames(self, bufs=None):
|
|
436
|
+
""" Encode and send WebSocket frames. Any frames already
|
|
437
|
+
queued will be sent first. If buf is not set then only queued
|
|
438
|
+
frames will be sent. Returns the number of pending frames that
|
|
439
|
+
could not be fully sent. If returned pending frames is greater
|
|
440
|
+
than 0, then the caller should call again when the socket is
|
|
441
|
+
ready. """
|
|
442
|
+
|
|
443
|
+
tdelta = int(time.time()*1000) - self.start_time
|
|
444
|
+
|
|
445
|
+
if bufs:
|
|
446
|
+
for buf in bufs:
|
|
447
|
+
if self.version.startswith("hybi"):
|
|
448
|
+
if self.base64:
|
|
449
|
+
encbuf, lenhead, lentail = self.encode_hybi(
|
|
450
|
+
buf, opcode=1, base64=True)
|
|
451
|
+
else:
|
|
452
|
+
encbuf, lenhead, lentail = self.encode_hybi(
|
|
453
|
+
buf, opcode=2, base64=False)
|
|
454
|
+
|
|
455
|
+
else:
|
|
456
|
+
encbuf, lenhead, lentail = self.encode_hixie(buf)
|
|
457
|
+
|
|
458
|
+
if self.rec:
|
|
459
|
+
self.rec.write("%s,\n" %
|
|
460
|
+
repr("{%s{" % tdelta
|
|
461
|
+
+ encbuf[lenhead:len(encbuf)-lentail]))
|
|
462
|
+
|
|
463
|
+
self.send_parts.append(encbuf)
|
|
464
|
+
|
|
465
|
+
while self.send_parts:
|
|
466
|
+
# Send pending frames
|
|
467
|
+
buf = self.send_parts.pop(0)
|
|
468
|
+
sent = self.client.send(buf)
|
|
469
|
+
|
|
470
|
+
if sent == len(buf):
|
|
471
|
+
self.traffic("<")
|
|
472
|
+
else:
|
|
473
|
+
self.traffic("<.")
|
|
474
|
+
self.send_parts.insert(0, buf[sent:])
|
|
475
|
+
break
|
|
476
|
+
|
|
477
|
+
return len(self.send_parts)
|
|
478
|
+
|
|
479
|
+
def recv_frames(self):
|
|
480
|
+
""" Receive and decode WebSocket frames.
|
|
481
|
+
|
|
482
|
+
Returns:
|
|
483
|
+
(bufs_list, closed_string)
|
|
484
|
+
"""
|
|
485
|
+
|
|
486
|
+
closed = False
|
|
487
|
+
bufs = []
|
|
488
|
+
tdelta = int(time.time()*1000) - self.start_time
|
|
489
|
+
|
|
490
|
+
buf = self.client.recv(self.buffer_size)
|
|
491
|
+
if len(buf) == 0:
|
|
492
|
+
closed = {'code': 1000, 'reason': "Client closed abruptly"}
|
|
493
|
+
return bufs, closed
|
|
494
|
+
|
|
495
|
+
if self.recv_part:
|
|
496
|
+
# Add partially received frames to current read buffer
|
|
497
|
+
buf = self.recv_part + buf
|
|
498
|
+
self.recv_part = None
|
|
499
|
+
|
|
500
|
+
while buf:
|
|
501
|
+
if self.version.startswith("hybi"):
|
|
502
|
+
|
|
503
|
+
frame = self.decode_hybi(buf, base64=self.base64)
|
|
504
|
+
#print("Received buf: %s, frame: %s" % (repr(buf), frame))
|
|
505
|
+
|
|
506
|
+
if frame['payload'] == None:
|
|
507
|
+
# Incomplete/partial frame
|
|
508
|
+
self.traffic("}.")
|
|
509
|
+
if frame['left'] > 0:
|
|
510
|
+
self.recv_part = buf[-frame['left']:]
|
|
511
|
+
break
|
|
512
|
+
else:
|
|
513
|
+
if frame['opcode'] == 0x8: # connection close
|
|
514
|
+
closed = {'code': frame['close_code'],
|
|
515
|
+
'reason': frame['close_reason']}
|
|
516
|
+
break
|
|
517
|
+
|
|
518
|
+
else:
|
|
519
|
+
if buf[0:2] == s2b('\xff\x00'):
|
|
520
|
+
closed = {'code': 1000,
|
|
521
|
+
'reason': "Client sent orderly close frame"}
|
|
522
|
+
break
|
|
523
|
+
|
|
524
|
+
elif buf[0:2] == s2b('\x00\xff'):
|
|
525
|
+
buf = buf[2:]
|
|
526
|
+
continue # No-op
|
|
527
|
+
|
|
528
|
+
elif buf.count(s2b('\xff')) == 0:
|
|
529
|
+
# Partial frame
|
|
530
|
+
self.traffic("}.")
|
|
531
|
+
self.recv_part = buf
|
|
532
|
+
break
|
|
533
|
+
|
|
534
|
+
frame = self.decode_hixie(buf)
|
|
535
|
+
|
|
536
|
+
self.traffic("}")
|
|
537
|
+
|
|
538
|
+
if self.rec:
|
|
539
|
+
start = frame['hlen']
|
|
540
|
+
end = frame['hlen'] + frame['length']
|
|
541
|
+
if frame['masked']:
|
|
542
|
+
recbuf = WebSocketServer.unmask(buf, frame['hlen'],
|
|
543
|
+
frame['length'])
|
|
544
|
+
else:
|
|
545
|
+
recbuf = buf[frame['hlen']:frame['hlen'] +
|
|
546
|
+
frame['length']]
|
|
547
|
+
self.rec.write("%s,\n" %
|
|
548
|
+
repr("}%s}" % tdelta + recbuf))
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
bufs.append(frame['payload'])
|
|
552
|
+
|
|
553
|
+
if frame['left']:
|
|
554
|
+
buf = buf[-frame['left']:]
|
|
555
|
+
else:
|
|
556
|
+
buf = ''
|
|
557
|
+
|
|
558
|
+
return bufs, closed
|
|
559
|
+
|
|
560
|
+
def send_close(self, code=1000, reason=''):
|
|
561
|
+
""" Send a WebSocket orderly close frame. """
|
|
562
|
+
|
|
563
|
+
if self.version.startswith("hybi"):
|
|
564
|
+
msg = pack(">H%ds" % len(reason), code, reason)
|
|
565
|
+
|
|
566
|
+
buf, h, t = self.encode_hybi(msg, opcode=0x08, base64=False)
|
|
567
|
+
self.client.send(buf)
|
|
568
|
+
|
|
569
|
+
elif self.version == "hixie-76":
|
|
570
|
+
buf = s2b('\xff\x00')
|
|
571
|
+
self.client.send(buf)
|
|
572
|
+
|
|
573
|
+
# No orderly close for 75
|
|
574
|
+
|
|
575
|
+
def do_websocket_handshake(self, headers, path):
|
|
576
|
+
h = self.headers = headers
|
|
577
|
+
self.path = path
|
|
578
|
+
|
|
579
|
+
prot = 'WebSocket-Protocol'
|
|
580
|
+
protocols = h.get('Sec-'+prot, h.get(prot, '')).split(',')
|
|
581
|
+
|
|
582
|
+
ver = h.get('Sec-WebSocket-Version')
|
|
583
|
+
if ver:
|
|
584
|
+
# HyBi/IETF version of the protocol
|
|
585
|
+
|
|
586
|
+
# HyBi-07 report version 7
|
|
587
|
+
# HyBi-08 - HyBi-12 report version 8
|
|
588
|
+
# HyBi-13 reports version 13
|
|
589
|
+
if ver in ['7', '8', '13']:
|
|
590
|
+
self.version = "hybi-%02d" % int(ver)
|
|
591
|
+
else:
|
|
592
|
+
raise self.EClose('Unsupported protocol version %s' % ver)
|
|
593
|
+
|
|
594
|
+
key = h['Sec-WebSocket-Key']
|
|
595
|
+
|
|
596
|
+
# Choose binary if client supports it
|
|
597
|
+
if 'binary' in protocols:
|
|
598
|
+
self.base64 = False
|
|
599
|
+
elif 'base64' in protocols:
|
|
600
|
+
self.base64 = True
|
|
601
|
+
else:
|
|
602
|
+
raise self.EClose("Client must support 'binary' or 'base64' protocol")
|
|
603
|
+
|
|
604
|
+
# Generate the hash value for the accept header
|
|
605
|
+
accept = b64encode(sha1(s2b(key + self.GUID)).digest())
|
|
606
|
+
|
|
607
|
+
response = self.server_handshake_hybi % b2s(accept)
|
|
608
|
+
if self.base64:
|
|
609
|
+
response += "Sec-WebSocket-Protocol: base64\r\n"
|
|
610
|
+
else:
|
|
611
|
+
response += "Sec-WebSocket-Protocol: binary\r\n"
|
|
612
|
+
response += "\r\n"
|
|
613
|
+
|
|
614
|
+
else:
|
|
615
|
+
# Hixie version of the protocol (75 or 76)
|
|
616
|
+
|
|
617
|
+
if h.get('key3'):
|
|
618
|
+
trailer = self.gen_md5(h)
|
|
619
|
+
pre = "Sec-"
|
|
620
|
+
self.version = "hixie-76"
|
|
621
|
+
else:
|
|
622
|
+
trailer = ""
|
|
623
|
+
pre = ""
|
|
624
|
+
self.version = "hixie-75"
|
|
625
|
+
|
|
626
|
+
# We only support base64 in Hixie era
|
|
627
|
+
self.base64 = True
|
|
628
|
+
|
|
629
|
+
response = self.server_handshake_hixie % (pre,
|
|
630
|
+
h['Origin'], pre, self.scheme, h['Host'], path)
|
|
631
|
+
|
|
632
|
+
if 'base64' in protocols:
|
|
633
|
+
response += "%sWebSocket-Protocol: base64\r\n" % pre
|
|
634
|
+
else:
|
|
635
|
+
self.msg("Warning: client does not report 'base64' protocol support")
|
|
636
|
+
response += "\r\n" + trailer
|
|
637
|
+
|
|
638
|
+
return response
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
def do_handshake(self, sock, address):
|
|
642
|
+
"""
|
|
643
|
+
do_handshake does the following:
|
|
644
|
+
- Peek at the first few bytes from the socket.
|
|
645
|
+
- If the connection is Flash policy request then answer it,
|
|
646
|
+
close the socket and return.
|
|
647
|
+
- If the connection is an HTTPS/SSL/TLS connection then SSL
|
|
648
|
+
wrap the socket.
|
|
649
|
+
- Read from the (possibly wrapped) socket.
|
|
650
|
+
- If we have received a HTTP GET request and the webserver
|
|
651
|
+
functionality is enabled, answer it, close the socket and
|
|
652
|
+
return.
|
|
653
|
+
- Assume we have a WebSockets connection, parse the client
|
|
654
|
+
handshake data.
|
|
655
|
+
- Send a WebSockets handshake server response.
|
|
656
|
+
- Return the socket for this WebSocket client.
|
|
657
|
+
"""
|
|
658
|
+
stype = ""
|
|
659
|
+
ready = select.select([sock], [], [], 3)[0]
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
if not ready:
|
|
663
|
+
raise self.EClose("ignoring socket not ready")
|
|
664
|
+
# Peek, but do not read the data so that we have a opportunity
|
|
665
|
+
# to SSL wrap the socket first
|
|
666
|
+
handshake = sock.recv(1024, socket.MSG_PEEK)
|
|
667
|
+
#self.msg("Handshake [%s]" % handshake)
|
|
668
|
+
|
|
669
|
+
if handshake == "":
|
|
670
|
+
raise self.EClose("ignoring empty handshake")
|
|
671
|
+
|
|
672
|
+
elif handshake.startswith(s2b("<policy-file-request/>")):
|
|
673
|
+
# Answer Flash policy request
|
|
674
|
+
handshake = sock.recv(1024)
|
|
675
|
+
sock.send(s2b(self.policy_response))
|
|
676
|
+
raise self.EClose("Sending flash policy response")
|
|
677
|
+
|
|
678
|
+
elif handshake[0] in ("\x16", "\x80", 22, 128):
|
|
679
|
+
# SSL wrap the connection
|
|
680
|
+
if not ssl:
|
|
681
|
+
raise self.EClose("SSL connection but no 'ssl' module")
|
|
682
|
+
if not os.path.exists(self.cert):
|
|
683
|
+
raise self.EClose("SSL connection but '%s' not found"
|
|
684
|
+
% self.cert)
|
|
685
|
+
retsock = None
|
|
686
|
+
try:
|
|
687
|
+
retsock = ssl.wrap_socket(
|
|
688
|
+
sock,
|
|
689
|
+
server_side=True,
|
|
690
|
+
certfile=self.cert,
|
|
691
|
+
keyfile=self.key)
|
|
692
|
+
except ssl.SSLError:
|
|
693
|
+
_, x, _ = sys.exc_info()
|
|
694
|
+
if x.args[0] == ssl.SSL_ERROR_EOF:
|
|
695
|
+
if len(x.args) > 1:
|
|
696
|
+
raise self.EClose(x.args[1])
|
|
697
|
+
else:
|
|
698
|
+
raise self.EClose("Got SSL_ERROR_EOF")
|
|
699
|
+
else:
|
|
700
|
+
raise
|
|
701
|
+
|
|
702
|
+
self.scheme = "wss"
|
|
703
|
+
stype = "SSL/TLS (wss://)"
|
|
704
|
+
|
|
705
|
+
elif self.ssl_only:
|
|
706
|
+
raise self.EClose("non-SSL connection received but disallowed")
|
|
707
|
+
|
|
708
|
+
else:
|
|
709
|
+
retsock = sock
|
|
710
|
+
self.scheme = "ws"
|
|
711
|
+
stype = "Plain non-SSL (ws://)"
|
|
712
|
+
|
|
713
|
+
wsh = WSRequestHandler(retsock, address, not self.web)
|
|
714
|
+
if wsh.last_code == 101:
|
|
715
|
+
# Continue on to handle WebSocket upgrade
|
|
716
|
+
pass
|
|
717
|
+
elif wsh.last_code == 405:
|
|
718
|
+
raise self.EClose("Normal web request received but disallowed")
|
|
719
|
+
elif wsh.last_code < 200 or wsh.last_code >= 300:
|
|
720
|
+
raise self.EClose(wsh.last_message)
|
|
721
|
+
elif self.verbose:
|
|
722
|
+
raise self.EClose(wsh.last_message)
|
|
723
|
+
else:
|
|
724
|
+
raise self.EClose("")
|
|
725
|
+
|
|
726
|
+
response = self.do_websocket_handshake(wsh.headers, wsh.path)
|
|
727
|
+
|
|
728
|
+
self.msg("%s: %s WebSocket connection" % (address[0], stype))
|
|
729
|
+
self.msg("%s: Version %s, base64: '%s'" % (address[0],
|
|
730
|
+
self.version, self.base64))
|
|
731
|
+
if self.path != '/':
|
|
732
|
+
self.msg("%s: Path: '%s'" % (address[0], self.path))
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
# Send server WebSockets handshake response
|
|
736
|
+
#self.msg("sending response [%s]" % response)
|
|
737
|
+
retsock.send(s2b(response))
|
|
738
|
+
|
|
739
|
+
# Return the WebSockets socket which may be SSL wrapped
|
|
740
|
+
return retsock
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
#
|
|
744
|
+
# Events that can/should be overridden in sub-classes
|
|
745
|
+
#
|
|
746
|
+
def started(self):
|
|
747
|
+
""" Called after WebSockets startup """
|
|
748
|
+
self.vmsg("WebSockets server started")
|
|
749
|
+
|
|
750
|
+
def poll(self):
|
|
751
|
+
""" Run periodically while waiting for connections. """
|
|
752
|
+
#self.vmsg("Running poll()")
|
|
753
|
+
pass
|
|
754
|
+
|
|
755
|
+
def fallback_SIGCHLD(self, sig, stack):
|
|
756
|
+
# Reap zombies when using os.fork() (python 2.4)
|
|
757
|
+
self.vmsg("Got SIGCHLD, reaping zombies")
|
|
758
|
+
try:
|
|
759
|
+
result = os.waitpid(-1, os.WNOHANG)
|
|
760
|
+
while result[0]:
|
|
761
|
+
self.vmsg("Reaped child process %s" % result[0])
|
|
762
|
+
result = os.waitpid(-1, os.WNOHANG)
|
|
763
|
+
except (OSError):
|
|
764
|
+
pass
|
|
765
|
+
|
|
766
|
+
def do_SIGINT(self, sig, stack):
|
|
767
|
+
self.msg("Got SIGINT, exiting")
|
|
768
|
+
sys.exit(0)
|
|
769
|
+
|
|
770
|
+
def top_new_client(self, startsock, address):
|
|
771
|
+
""" Do something with a WebSockets client connection. """
|
|
772
|
+
# Initialize per client settings
|
|
773
|
+
self.send_parts = []
|
|
774
|
+
self.recv_part = None
|
|
775
|
+
self.base64 = False
|
|
776
|
+
self.rec = None
|
|
777
|
+
self.start_time = int(time.time()*1000)
|
|
778
|
+
|
|
779
|
+
# handler process
|
|
780
|
+
try:
|
|
781
|
+
try:
|
|
782
|
+
self.client = self.do_handshake(startsock, address)
|
|
783
|
+
|
|
784
|
+
if self.record:
|
|
785
|
+
# Record raw frame data as JavaScript array
|
|
786
|
+
fname = "%s.%s" % (self.record,
|
|
787
|
+
self.handler_id)
|
|
788
|
+
self.msg("opening record file: %s" % fname)
|
|
789
|
+
self.rec = open(fname, 'w+')
|
|
790
|
+
encoding = "binary"
|
|
791
|
+
if self.base64: encoding = "base64"
|
|
792
|
+
self.rec.write("var VNC_frame_encoding = '%s';\n"
|
|
793
|
+
% encoding)
|
|
794
|
+
self.rec.write("var VNC_frame_data = [\n")
|
|
795
|
+
|
|
796
|
+
self.ws_connection = True
|
|
797
|
+
self.new_client()
|
|
798
|
+
except self.CClose:
|
|
799
|
+
# Close the client
|
|
800
|
+
_, exc, _ = sys.exc_info()
|
|
801
|
+
if self.client:
|
|
802
|
+
self.send_close(exc.args[0], exc.args[1])
|
|
803
|
+
except self.EClose:
|
|
804
|
+
_, exc, _ = sys.exc_info()
|
|
805
|
+
# Connection was not a WebSockets connection
|
|
806
|
+
if exc.args[0]:
|
|
807
|
+
self.msg("%s: %s" % (address[0], exc.args[0]))
|
|
808
|
+
except Exception:
|
|
809
|
+
_, exc, _ = sys.exc_info()
|
|
810
|
+
self.msg("handler exception: %s" % str(exc))
|
|
811
|
+
if self.verbose:
|
|
812
|
+
self.msg(traceback.format_exc())
|
|
813
|
+
finally:
|
|
814
|
+
if self.rec:
|
|
815
|
+
self.rec.write("'EOF'];\n")
|
|
816
|
+
self.rec.close()
|
|
817
|
+
|
|
818
|
+
if self.client and self.client != startsock:
|
|
819
|
+
# Close the SSL wrapped socket
|
|
820
|
+
# Original socket closed by caller
|
|
821
|
+
self.client.close()
|
|
822
|
+
|
|
823
|
+
def new_client(self):
|
|
824
|
+
""" Do something with a WebSockets client connection. """
|
|
825
|
+
raise("WebSocketServer.new_client() must be overloaded")
|
|
826
|
+
|
|
827
|
+
def start_server(self):
|
|
828
|
+
"""
|
|
829
|
+
Daemonize if requested. Listen for for connections. Run
|
|
830
|
+
do_handshake() method for each connection. If the connection
|
|
831
|
+
is a WebSockets client then call new_client() method (which must
|
|
832
|
+
be overridden) for each new client connection.
|
|
833
|
+
"""
|
|
834
|
+
lsock = self.socket(self.listen_host, self.listen_port, False, self.prefer_ipv6)
|
|
835
|
+
|
|
836
|
+
if self.daemon:
|
|
837
|
+
self.daemonize(keepfd=lsock.fileno(), chdir=self.web)
|
|
838
|
+
|
|
839
|
+
self.started() # Some things need to happen after daemonizing
|
|
840
|
+
|
|
841
|
+
# Allow override of SIGINT
|
|
842
|
+
signal.signal(signal.SIGINT, self.do_SIGINT)
|
|
843
|
+
if not multiprocessing:
|
|
844
|
+
# os.fork() (python 2.4) child reaper
|
|
845
|
+
signal.signal(signal.SIGCHLD, self.fallback_SIGCHLD)
|
|
846
|
+
|
|
847
|
+
last_active_time = self.launch_time
|
|
848
|
+
while True:
|
|
849
|
+
try:
|
|
850
|
+
try:
|
|
851
|
+
self.client = None
|
|
852
|
+
startsock = None
|
|
853
|
+
pid = err = 0
|
|
854
|
+
child_count = 0
|
|
855
|
+
|
|
856
|
+
if multiprocessing and self.idle_timeout:
|
|
857
|
+
child_count = len(multiprocessing.active_children())
|
|
858
|
+
|
|
859
|
+
time_elapsed = time.time() - self.launch_time
|
|
860
|
+
if self.timeout and time_elapsed > self.timeout:
|
|
861
|
+
self.msg('listener exit due to --timeout %s'
|
|
862
|
+
% self.timeout)
|
|
863
|
+
break
|
|
864
|
+
|
|
865
|
+
if self.idle_timeout:
|
|
866
|
+
idle_time = 0
|
|
867
|
+
if child_count == 0:
|
|
868
|
+
idle_time = time.time() - last_active_time
|
|
869
|
+
else:
|
|
870
|
+
idle_time = 0
|
|
871
|
+
last_active_time = time.time()
|
|
872
|
+
|
|
873
|
+
if idle_time > self.idle_timeout and child_count == 0:
|
|
874
|
+
self.msg('listener exit due to --idle-timeout %s'
|
|
875
|
+
% self.idle_timeout)
|
|
876
|
+
break
|
|
877
|
+
|
|
878
|
+
try:
|
|
879
|
+
self.poll()
|
|
880
|
+
|
|
881
|
+
ready = select.select([lsock], [], [], 1)[0]
|
|
882
|
+
if lsock in ready:
|
|
883
|
+
startsock, address = lsock.accept()
|
|
884
|
+
else:
|
|
885
|
+
continue
|
|
886
|
+
except Exception:
|
|
887
|
+
_, exc, _ = sys.exc_info()
|
|
888
|
+
if hasattr(exc, 'errno'):
|
|
889
|
+
err = exc.errno
|
|
890
|
+
elif hasattr(exc, 'args'):
|
|
891
|
+
err = exc.args[0]
|
|
892
|
+
else:
|
|
893
|
+
err = exc[0]
|
|
894
|
+
if err == errno.EINTR:
|
|
895
|
+
self.vmsg("Ignoring interrupted syscall")
|
|
896
|
+
continue
|
|
897
|
+
else:
|
|
898
|
+
raise
|
|
899
|
+
|
|
900
|
+
if self.run_once:
|
|
901
|
+
# Run in same process if run_once
|
|
902
|
+
self.top_new_client(startsock, address)
|
|
903
|
+
if self.ws_connection :
|
|
904
|
+
self.msg('%s: exiting due to --run-once'
|
|
905
|
+
% address[0])
|
|
906
|
+
break
|
|
907
|
+
elif multiprocessing:
|
|
908
|
+
self.vmsg('%s: new handler Process' % address[0])
|
|
909
|
+
p = multiprocessing.Process(
|
|
910
|
+
target=self.top_new_client,
|
|
911
|
+
args=(startsock, address))
|
|
912
|
+
p.start()
|
|
913
|
+
# child will not return
|
|
914
|
+
else:
|
|
915
|
+
# python 2.4
|
|
916
|
+
self.vmsg('%s: forking handler' % address[0])
|
|
917
|
+
pid = os.fork()
|
|
918
|
+
if pid == 0:
|
|
919
|
+
# child handler process
|
|
920
|
+
self.top_new_client(startsock, address)
|
|
921
|
+
break # child process exits
|
|
922
|
+
|
|
923
|
+
# parent process
|
|
924
|
+
self.handler_id += 1
|
|
925
|
+
|
|
926
|
+
except KeyboardInterrupt:
|
|
927
|
+
_, exc, _ = sys.exc_info()
|
|
928
|
+
print("In KeyboardInterrupt")
|
|
929
|
+
pass
|
|
930
|
+
except SystemExit:
|
|
931
|
+
_, exc, _ = sys.exc_info()
|
|
932
|
+
print("In SystemExit")
|
|
933
|
+
break
|
|
934
|
+
except Exception:
|
|
935
|
+
_, exc, _ = sys.exc_info()
|
|
936
|
+
self.msg("handler exception: %s" % str(exc))
|
|
937
|
+
if self.verbose:
|
|
938
|
+
self.msg(traceback.format_exc())
|
|
939
|
+
|
|
940
|
+
finally:
|
|
941
|
+
if startsock:
|
|
942
|
+
startsock.close()
|
|
943
|
+
|
|
944
|
+
# Close listen port
|
|
945
|
+
self.vmsg("Closing socket listening at %s:%s"
|
|
946
|
+
% (self.listen_host, self.listen_port))
|
|
947
|
+
lsock.close()
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
# HTTP handler with WebSocket upgrade support
|
|
951
|
+
class WSRequestHandler(SimpleHTTPRequestHandler):
|
|
952
|
+
def __init__(self, req, addr, only_upgrade=False):
|
|
953
|
+
self.only_upgrade = only_upgrade # only allow upgrades
|
|
954
|
+
SimpleHTTPRequestHandler.__init__(self, req, addr, object())
|
|
955
|
+
|
|
956
|
+
def do_GET(self):
|
|
957
|
+
if (self.headers.get('upgrade') and
|
|
958
|
+
self.headers.get('upgrade').lower() == 'websocket'):
|
|
959
|
+
|
|
960
|
+
if (self.headers.get('sec-websocket-key1') or
|
|
961
|
+
self.headers.get('websocket-key1')):
|
|
962
|
+
# For Hixie-76 read out the key hash
|
|
963
|
+
self.headers.__setitem__('key3', self.rfile.read(8))
|
|
964
|
+
|
|
965
|
+
# Just indicate that an WebSocket upgrade is needed
|
|
966
|
+
self.last_code = 101
|
|
967
|
+
self.last_message = "101 Switching Protocols"
|
|
968
|
+
elif self.only_upgrade:
|
|
969
|
+
# Normal web request responses are disabled
|
|
970
|
+
self.last_code = 405
|
|
971
|
+
self.last_message = "405 Method Not Allowed"
|
|
972
|
+
else:
|
|
973
|
+
SimpleHTTPRequestHandler.do_GET(self)
|
|
974
|
+
|
|
975
|
+
def send_response(self, code, message=None):
|
|
976
|
+
# Save the status code
|
|
977
|
+
self.last_code = code
|
|
978
|
+
SimpleHTTPRequestHandler.send_response(self, code, message)
|
|
979
|
+
|
|
980
|
+
def log_message(self, f, *args):
|
|
981
|
+
# Save instead of printing
|
|
982
|
+
self.last_message = f % args
|