webruby 0.1.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/driver/driver.c +12 -0
- data/lib/webruby/config.rb +3 -3
- data/lib/webruby/environment.rb +1 -0
- data/lib/webruby/rake/files.rake +22 -22
- data/lib/webruby/rake/general.rake +0 -1
- data/lib/webruby/utility.rb +2 -0
- data/modules/emscripten/AUTHORS +12 -1
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +152 -15
- data/modules/emscripten/em++ +2 -0
- data/modules/emscripten/em++.bat +1 -1
- data/modules/emscripten/em-config.bat +1 -1
- data/modules/emscripten/emar.bat +1 -1
- data/modules/emscripten/emcc +233 -95
- data/modules/emscripten/emcc.bat +1 -1
- data/modules/emscripten/emconfigure.bat +1 -1
- data/modules/emscripten/emmake.bat +1 -1
- data/modules/emscripten/emranlib.bat +1 -1
- data/modules/emscripten/emscripten.py +221 -217
- data/modules/emscripten/package.json +7 -0
- data/modules/emscripten/src/analyzer.js +1437 -1385
- data/modules/emscripten/src/compiler.js +30 -6
- data/modules/emscripten/src/compiler_phase.html +33 -0
- data/modules/emscripten/src/fastLong.js +6 -6
- data/modules/emscripten/src/headless.js +47 -656
- data/modules/emscripten/src/headlessCanvas.js +618 -0
- data/modules/emscripten/src/intertyper.js +1038 -899
- data/modules/emscripten/src/jsifier.js +818 -714
- data/modules/emscripten/src/library.js +1794 -2968
- data/modules/emscripten/src/library_browser.js +81 -16
- data/modules/emscripten/src/library_egl.js +9 -3
- data/modules/emscripten/src/library_fs.js +1585 -0
- data/modules/emscripten/src/library_gl.js +445 -202
- data/modules/emscripten/src/library_glfw.js +4 -1
- data/modules/emscripten/src/library_glut.js +61 -13
- data/modules/emscripten/src/library_idbfs.js +216 -0
- data/modules/emscripten/src/library_memfs.js +279 -0
- data/modules/emscripten/src/library_nodefs.js +234 -0
- data/modules/emscripten/src/library_openal.js +131 -150
- data/modules/emscripten/src/library_path.js +3 -0
- data/modules/emscripten/src/library_sdl.js +499 -229
- data/modules/emscripten/src/library_sockfs.js +576 -0
- data/modules/emscripten/src/library_tty.js +146 -0
- data/modules/emscripten/src/modules.js +30 -35
- data/modules/emscripten/src/parseTools.js +356 -161
- data/modules/emscripten/src/postamble.js +76 -31
- data/modules/emscripten/src/preamble.js +271 -41
- data/modules/emscripten/src/proxyClient.js +82 -0
- data/modules/emscripten/src/proxyWorker.js +143 -0
- data/modules/emscripten/src/relooper/Relooper.cpp +60 -24
- data/modules/emscripten/src/relooper/Relooper.h +3 -2
- data/modules/emscripten/src/relooper/emscripten/glue.js +20 -10
- data/modules/emscripten/src/relooper/fuzzer.py +19 -10
- data/modules/emscripten/src/relooper/test.cpp +50 -50
- data/modules/emscripten/src/relooper/test.txt +147 -30
- data/modules/emscripten/src/relooper/test2.c +13 -13
- data/modules/emscripten/src/relooper/test2.txt +17 -3
- data/modules/emscripten/src/relooper/test3.c +7 -7
- data/modules/emscripten/src/relooper/test3.txt +36 -7
- data/modules/emscripten/src/relooper/test4.cpp +7 -7
- data/modules/emscripten/src/relooper/test4.txt +28 -7
- data/modules/emscripten/src/relooper/test5.cpp +6 -6
- data/modules/emscripten/src/relooper/test5.txt +34 -10
- data/modules/emscripten/src/relooper/test6.cpp +4 -4
- data/modules/emscripten/src/relooper/test6.txt +17 -3
- data/modules/emscripten/src/relooper/test_dead.cpp +2 -2
- data/modules/emscripten/src/relooper/test_debug.cpp +4 -4
- data/modules/emscripten/src/relooper/test_debug.txt +17 -3
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +9 -9
- data/modules/emscripten/src/relooper/test_fuzz1.txt +45 -5
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +4 -4
- data/modules/emscripten/src/relooper/test_fuzz2.txt +18 -1
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +5 -5
- data/modules/emscripten/src/relooper/test_fuzz3.txt +16 -0
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +5 -5
- data/modules/emscripten/src/relooper/test_fuzz4.txt +25 -3
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +10 -10
- data/modules/emscripten/src/relooper/test_fuzz5.txt +49 -15
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +92 -92
- data/modules/emscripten/src/relooper/test_fuzz6.txt +201 -18
- data/modules/emscripten/src/relooper/test_inf.cpp +184 -184
- data/modules/emscripten/src/relooper/test_inf.txt +1078 -332
- data/modules/emscripten/src/runtime.js +69 -45
- data/modules/emscripten/src/settings.js +48 -919
- data/modules/emscripten/src/shell.html +1 -1
- data/modules/emscripten/src/shell.js +14 -8
- data/modules/emscripten/src/shell_sharedlib.js +18 -1
- data/modules/emscripten/src/simd.js +958 -0
- data/modules/emscripten/src/struct_info.json +1045 -0
- data/modules/emscripten/src/utility.js +11 -0
- data/modules/emscripten/system/bin/sdl-config +13 -0
- data/modules/emscripten/system/include/compat/ctype.h +17 -0
- data/modules/emscripten/system/include/compat/malloc.h +48 -0
- data/modules/emscripten/system/include/compat/math.h +14 -0
- data/modules/emscripten/system/include/compat/netdb.h +22 -0
- data/modules/emscripten/system/include/compat/stdarg.h +16 -0
- data/modules/emscripten/system/include/compat/stdlib.h +16 -0
- data/modules/emscripten/system/include/compat/string.h +17 -0
- data/modules/emscripten/system/include/compat/sys/socketvar.h +14 -0
- data/modules/emscripten/system/include/compat/sys/stat.h +20 -0
- data/modules/emscripten/system/include/{libc → compat}/sys/timeb.h +3 -7
- data/modules/emscripten/system/include/compat/time.h +18 -0
- data/modules/emscripten/system/include/compat/unistd.h +16 -0
- data/modules/emscripten/system/include/compat/xlocale.h +19 -0
- data/modules/emscripten/system/include/emscripten/emscripten.h +48 -7
- data/modules/emscripten/system/include/emscripten/vector.h +6 -0
- data/modules/emscripten/system/include/libc/aio.h +69 -0
- data/modules/emscripten/system/include/libc/alloca.h +13 -13
- data/modules/emscripten/system/include/libc/ar.h +19 -63
- data/modules/emscripten/system/include/libc/arpa/ftp.h +35 -0
- data/modules/emscripten/system/include/libc/arpa/inet.h +36 -0
- data/modules/emscripten/system/include/libc/arpa/nameser.h +467 -0
- data/modules/emscripten/system/include/libc/arpa/nameser_compat.h +2 -0
- data/modules/emscripten/system/include/libc/arpa/telnet.h +251 -0
- data/modules/emscripten/system/include/libc/arpa/tftp.h +31 -0
- data/modules/emscripten/system/include/libc/assert.h +9 -36
- data/modules/emscripten/system/include/libc/bits/alltypes.h +397 -0
- data/modules/emscripten/system/include/libc/bits/endian.h +1 -0
- data/modules/emscripten/system/include/libc/bits/errno.h +134 -0
- data/modules/emscripten/system/include/libc/bits/fcntl.h +38 -0
- data/modules/emscripten/system/include/libc/bits/fenv.h +34 -0
- data/modules/emscripten/system/include/libc/bits/float.h +17 -0
- data/modules/emscripten/system/include/libc/bits/io.h +0 -0
- data/modules/emscripten/system/include/libc/bits/ioctl.h +197 -0
- data/modules/emscripten/system/include/libc/bits/ipc.h +14 -0
- data/modules/emscripten/system/include/libc/bits/limits.h +8 -0
- data/modules/emscripten/system/include/libc/bits/mman.h +62 -0
- data/modules/emscripten/system/include/libc/bits/msg.h +16 -0
- data/modules/emscripten/system/include/libc/bits/posix.h +2 -0
- data/modules/emscripten/system/include/libc/bits/reg.h +19 -0
- data/modules/emscripten/system/include/libc/bits/setjmp.h +1 -0
- data/modules/emscripten/system/include/libc/bits/shm.h +18 -0
- data/modules/emscripten/system/include/libc/bits/signal.h +112 -0
- data/modules/emscripten/system/include/libc/bits/socket.h +17 -0
- data/modules/emscripten/system/include/libc/bits/stat.h +22 -0
- data/modules/emscripten/system/include/libc/bits/statfs.h +7 -0
- data/modules/emscripten/system/include/libc/bits/stdarg.h +4 -0
- data/modules/emscripten/system/include/libc/bits/stdint.h +20 -0
- data/modules/emscripten/system/include/libc/bits/syscall.h +696 -0
- data/modules/emscripten/system/include/libc/bits/termios.h +160 -0
- data/modules/emscripten/system/include/libc/bits/user.h +48 -0
- data/modules/emscripten/system/include/libc/byteswap.h +26 -0
- data/modules/emscripten/system/include/libc/complex.h +55 -54
- data/modules/emscripten/system/include/libc/cpio.h +29 -0
- data/modules/emscripten/system/include/libc/crypt.h +20 -0
- data/modules/emscripten/system/include/libc/ctype.h +58 -187
- data/modules/emscripten/system/include/libc/dirent.h +69 -6
- data/modules/emscripten/system/include/libc/dlfcn.h +42 -0
- data/modules/emscripten/system/include/libc/elf.h +2555 -0
- data/modules/emscripten/system/include/libc/endian.h +80 -1
- data/modules/emscripten/system/include/libc/err.h +25 -0
- data/modules/emscripten/system/include/libc/errno.h +23 -7
- data/modules/emscripten/system/include/libc/fcntl.h +175 -1
- data/modules/emscripten/system/include/libc/features.h +32 -0
- data/modules/emscripten/system/include/libc/fenv.h +28 -0
- data/modules/emscripten/system/include/libc/float.h +34 -0
- data/modules/emscripten/system/include/libc/fnmatch.h +24 -50
- data/modules/emscripten/system/include/libc/ftw.h +42 -0
- data/modules/emscripten/system/include/libc/getopt.h +22 -187
- data/modules/emscripten/system/include/libc/glob.h +42 -83
- data/modules/emscripten/system/include/libc/grp.h +37 -79
- data/modules/emscripten/system/include/libc/iconv.h +18 -56
- data/modules/emscripten/system/include/libc/ifaddrs.h +24 -53
- data/modules/emscripten/system/include/libc/inttypes.h +208 -271
- data/modules/emscripten/system/include/libc/iso646.h +5 -28
- data/modules/emscripten/system/include/libc/langinfo.h +88 -316
- data/modules/emscripten/system/include/libc/lastlog.h +1 -0
- data/modules/emscripten/system/include/libc/libgen.h +5 -13
- data/modules/emscripten/system/include/libc/libintl.h +25 -0
- data/modules/emscripten/system/include/libc/limits.h +140 -149
- data/modules/emscripten/system/include/libc/link.h +54 -0
- data/modules/emscripten/system/include/libc/locale.h +72 -70
- data/modules/emscripten/system/include/libc/malloc.h +0 -169
- data/modules/emscripten/system/include/libc/math.h +393 -573
- data/modules/emscripten/system/include/libc/memory.h +1 -0
- data/modules/emscripten/system/include/libc/mntent.h +44 -0
- data/modules/emscripten/system/include/libc/monetary.h +23 -0
- data/modules/emscripten/system/include/libc/mqueue.h +36 -0
- data/modules/emscripten/system/include/libc/net/ethernet.h +55 -0
- data/modules/emscripten/system/include/libc/net/if.h +135 -0
- data/modules/emscripten/system/include/libc/net/if_arp.h +133 -0
- data/modules/emscripten/system/include/libc/net/route.h +124 -0
- data/modules/emscripten/system/include/libc/netdb.h +161 -0
- data/modules/emscripten/system/include/libc/netinet/ether.h +14 -0
- data/modules/emscripten/system/include/libc/netinet/icmp6.h +305 -0
- data/modules/emscripten/system/include/libc/netinet/if_ether.h +126 -0
- data/modules/emscripten/system/include/libc/netinet/in.h +336 -0
- data/modules/emscripten/system/include/libc/netinet/in_systm.h +9 -0
- data/modules/emscripten/system/include/libc/netinet/ip.h +186 -0
- data/modules/emscripten/system/include/libc/netinet/ip6.h +142 -0
- data/modules/emscripten/system/include/libc/netinet/ip_icmp.h +192 -0
- data/modules/emscripten/system/include/libc/netinet/tcp.h +71 -0
- data/modules/emscripten/system/include/libc/netinet/udp.h +35 -0
- data/modules/emscripten/system/include/libc/netpacket/packet.h +44 -0
- data/modules/emscripten/system/include/libc/nl_types.h +22 -0
- data/modules/emscripten/system/include/libc/paths.h +30 -5
- data/modules/emscripten/system/include/libc/poll.h +46 -0
- data/modules/emscripten/system/include/libc/pthread.h +191 -331
- data/modules/emscripten/system/include/libc/pty.h +18 -0
- data/modules/emscripten/system/include/libc/pwd.h +33 -62
- data/modules/emscripten/system/include/libc/readme.txt +2 -2
- data/modules/emscripten/system/include/libc/regex.h +53 -93
- data/modules/emscripten/system/include/libc/resolv.h +144 -0
- data/modules/emscripten/system/include/libc/sched.h +124 -89
- data/modules/emscripten/system/include/libc/search.h +40 -48
- data/modules/emscripten/system/include/libc/semaphore.h +35 -0
- data/modules/emscripten/system/include/libc/setjmp.h +35 -13
- data/modules/emscripten/system/include/libc/shadow.h +44 -0
- data/modules/emscripten/system/include/libc/signal.h +245 -20
- data/modules/emscripten/system/include/libc/spawn.h +74 -0
- data/modules/emscripten/system/include/libc/stdalign.h +15 -0
- data/modules/emscripten/system/include/libc/stdarg.h +18 -43
- data/modules/emscripten/system/include/libc/stdbool.h +14 -0
- data/modules/emscripten/system/include/libc/stddef.h +12 -58
- data/modules/emscripten/system/include/libc/stdint.h +82 -458
- data/modules/emscripten/system/include/libc/stdio.h +184 -679
- data/modules/emscripten/system/include/libc/stdio_ext.h +34 -0
- data/modules/emscripten/system/include/libc/stdlib.h +146 -205
- data/modules/emscripten/system/include/libc/stdnoreturn.h +5 -0
- data/modules/emscripten/system/include/libc/string.h +86 -89
- data/modules/emscripten/system/include/libc/strings.h +27 -27
- data/modules/emscripten/system/include/libc/stropts.h +139 -0
- data/modules/emscripten/system/include/libc/sys/acct.h +75 -0
- data/modules/emscripten/system/include/libc/sys/cachectl.h +22 -0
- data/modules/emscripten/system/include/libc/sys/dir.h +0 -8
- data/modules/emscripten/system/include/libc/sys/epoll.h +67 -0
- data/modules/emscripten/system/include/libc/sys/errno.h +2 -190
- data/modules/emscripten/system/include/libc/sys/eventfd.h +26 -0
- data/modules/emscripten/system/include/libc/sys/fcntl.h +2 -4
- data/modules/emscripten/system/include/libc/sys/file.h +20 -1
- data/modules/emscripten/system/include/libc/sys/fsuid.h +20 -0
- data/modules/emscripten/system/include/libc/sys/inotify.h +57 -0
- data/modules/emscripten/system/include/libc/sys/io.h +17 -0
- data/modules/emscripten/system/include/libc/sys/ioctl.h +14 -0
- data/modules/emscripten/system/include/libc/sys/ipc.h +42 -0
- data/modules/emscripten/system/include/{sys/sysctl.h → libc/sys/klog.h} +4 -4
- data/modules/emscripten/system/include/libc/sys/mman.h +55 -0
- data/modules/emscripten/system/include/libc/sys/mount.h +72 -0
- data/modules/emscripten/system/include/libc/sys/msg.h +52 -0
- data/modules/emscripten/system/include/libc/sys/mtio.h +188 -0
- data/modules/emscripten/system/include/libc/sys/param.h +29 -19
- data/modules/emscripten/system/include/libc/sys/personality.h +46 -0
- data/modules/emscripten/system/include/libc/sys/poll.h +2 -0
- data/modules/emscripten/system/include/libc/sys/prctl.h +101 -0
- data/modules/emscripten/system/include/libc/sys/procfs.h +65 -0
- data/modules/emscripten/system/include/libc/sys/ptrace.h +96 -0
- data/modules/emscripten/system/include/libc/sys/reboot.h +20 -0
- data/modules/emscripten/system/include/libc/sys/reg.h +9 -0
- data/modules/emscripten/system/include/libc/sys/resource.h +89 -45
- data/modules/emscripten/system/include/libc/sys/select.h +42 -0
- data/modules/emscripten/system/include/libc/sys/sem.h +82 -0
- data/modules/emscripten/system/include/libc/sys/sendfile.h +22 -0
- data/modules/emscripten/system/include/libc/sys/shm.h +61 -0
- data/modules/emscripten/system/include/libc/sys/signal.h +1 -315
- data/modules/emscripten/system/include/libc/sys/signalfd.h +44 -0
- data/modules/emscripten/system/include/libc/sys/socket.h +299 -0
- data/modules/emscripten/system/include/libc/sys/stat.h +95 -204
- data/modules/emscripten/system/include/libc/sys/statfs.h +32 -0
- data/modules/emscripten/system/include/libc/sys/statvfs.h +57 -0
- data/modules/emscripten/system/include/libc/sys/stropts.h +1 -0
- data/modules/emscripten/system/include/libc/sys/swap.h +21 -0
- data/modules/emscripten/system/include/libc/sys/syscall.h +6 -0
- data/modules/emscripten/system/include/libc/sys/sysctl.h +17 -0
- data/modules/emscripten/system/include/libc/sys/sysinfo.h +36 -0
- data/modules/emscripten/system/include/libc/sys/syslog.h +1 -0
- data/modules/emscripten/system/include/libc/sys/sysmacros.h +15 -0
- data/modules/emscripten/system/include/libc/sys/termios.h +2 -280
- data/modules/emscripten/system/include/libc/sys/time.h +40 -68
- data/modules/emscripten/system/include/libc/sys/timerfd.h +24 -0
- data/modules/emscripten/system/include/libc/sys/times.h +14 -16
- data/modules/emscripten/system/include/libc/sys/timex.h +98 -0
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +34 -92
- data/modules/emscripten/system/include/libc/sys/types.h +87 -481
- data/modules/emscripten/system/include/libc/sys/ucontext.h +1 -0
- data/modules/emscripten/system/include/libc/sys/uio.h +48 -0
- data/modules/emscripten/system/include/libc/sys/un.h +32 -0
- data/modules/emscripten/system/include/libc/sys/user.h +16 -0
- data/modules/emscripten/system/include/libc/sys/utsname.h +30 -0
- data/modules/emscripten/system/include/libc/sys/vfs.h +1 -0
- data/modules/emscripten/system/include/libc/sys/wait.h +41 -26
- data/modules/emscripten/system/include/libc/sys/xattr.h +30 -0
- data/modules/emscripten/system/include/libc/syscall.h +1 -0
- data/modules/emscripten/system/include/libc/sysexits.h +21 -0
- data/modules/emscripten/system/include/libc/syslog.h +104 -0
- data/modules/emscripten/system/include/libc/tar.h +27 -33
- data/modules/emscripten/system/include/libc/termios.h +40 -1
- data/modules/emscripten/system/include/libc/tgmath.h +270 -0
- data/modules/emscripten/system/include/libc/time.h +96 -237
- data/modules/emscripten/system/include/libc/ucontext.h +25 -0
- data/modules/emscripten/system/include/libc/ulimit.h +17 -0
- data/modules/emscripten/system/include/libc/unistd.h +517 -4
- data/modules/emscripten/system/include/libc/utime.h +15 -3
- data/modules/emscripten/system/include/libc/utmp.h +40 -1
- data/modules/emscripten/system/include/libc/utmpx.h +58 -0
- data/modules/emscripten/system/include/libc/values.h +39 -0
- data/modules/emscripten/system/include/libc/wchar.h +164 -175
- data/modules/emscripten/system/include/libc/wctype.h +67 -37
- data/modules/emscripten/system/include/libc/wordexp.h +31 -42
- data/modules/emscripten/system/include/libcxx/__locale +6 -6
- data/modules/emscripten/system/include/libcxx/locale +1 -1
- data/modules/emscripten/system/lib/libc/musl/readme.txt +9 -1
- data/modules/emscripten/system/lib/libc/musl/src/internal/locale_impl.h +5 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/stdio_impl.h +92 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/big5.h +1085 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/codepages.h +238 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/gb18030.h +1836 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/hkscs.h +390 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iconv.c +454 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalnum_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalpha_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswblank_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswcntrl_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswctype_l.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswdigit_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswgraph_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswlower_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswprint_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswpunct_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswspace_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswupper_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswxdigit_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/jis0208.h +550 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/ksc.h +640 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/legacychars.h +39 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/strfmon.c +101 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/strxfrm.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/towctrans_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/towlower_l.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/towupper_l.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll.c +16 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm.c +21 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctrans_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctype_l.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/fwprintf.c +13 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/swprintf.c +14 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vfwprintf.c +361 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vswprintf.c +53 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vwprintf.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/stdio/wprintf.c +13 -0
- data/modules/emscripten/system/lib/libcextra.symbols +44 -0
- data/modules/emscripten/system/lib/libcxx/exception.cpp +3 -3
- data/modules/emscripten/system/lib/libcxx/locale.cpp +12 -12
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +1 -1
- data/modules/emscripten/tools/asm_module.py +2 -0
- data/modules/emscripten/tools/autodebugger.py +3 -1
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +0 -4835
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +0 -6495
- data/modules/emscripten/tools/file_packager.py +53 -56
- data/modules/emscripten/tools/find_bigfuncs.py +2 -2
- data/modules/emscripten/tools/find_bigvars.py +24 -0
- data/modules/emscripten/tools/gen_struct_info.py +509 -0
- data/modules/emscripten/tools/gen_struct_info.pyc +0 -0
- data/modules/emscripten/tools/js-optimizer.js +177 -86
- data/modules/emscripten/tools/js_optimizer.py +54 -19
- data/modules/emscripten/tools/js_optimizer.pyc +0 -0
- data/modules/emscripten/tools/jsrun.py +17 -7
- data/modules/emscripten/tools/jsrun.pyc +0 -0
- data/modules/emscripten/tools/response_file.py +2 -2
- data/modules/emscripten/tools/response_file.pyc +0 -0
- data/modules/emscripten/tools/shared.py +257 -123
- data/modules/emscripten/tools/shared.pyc +0 -0
- data/modules/emscripten/tools/source-maps/sourcemapper.js +37 -6
- data/modules/emscripten/tools/tempfiles.py +1 -0
- data/modules/emscripten/tools/tempfiles.pyc +0 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast-output.js +2 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast.js +8 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1-output.js +412 -169
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1.js +88 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline2-output.js +311 -265
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +0 -20
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +0 -21
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +2 -2
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +8 -8
- data/modules/emscripten/tools/test-js-optimizer-regs.js +1 -1
- data/modules/emscripten/tools/validate_asmjs.py +82 -0
- data/modules/mruby/Rakefile +2 -2
- data/modules/mruby/include/mruby/class.h +2 -2
- data/modules/mruby/include/mruby/compile.h +12 -4
- data/modules/mruby/include/mruby/data.h +8 -3
- data/modules/mruby/include/mruby/debug.h +65 -0
- data/modules/mruby/include/mruby/dump.h +10 -2
- data/modules/mruby/include/mruby/irep.h +1 -0
- data/modules/mruby/include/mruby/string.h +2 -1
- data/modules/mruby/include/mruby/value.h +20 -13
- data/modules/mruby/include/mruby/variable.h +1 -0
- data/modules/mruby/include/mruby.h +5 -6
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +6 -4
- data/modules/mruby/mrbgems/mruby-math/src/math.c +4 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -1
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +1 -1
- data/modules/mruby/mrbgems/mruby-random/src/random.c +1 -4
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +25 -16
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +4 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +1 -1
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +51 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +22 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +38 -60
- data/modules/mruby/mrblib/class.rb +2 -2
- data/modules/mruby/src/backtrace.c +96 -23
- data/modules/mruby/src/class.c +43 -41
- data/modules/mruby/src/codegen.c +52 -46
- data/modules/mruby/src/debug.c +214 -0
- data/modules/mruby/src/dump.c +245 -17
- data/modules/mruby/src/error.c +14 -6
- data/modules/mruby/src/etc.c +17 -10
- data/modules/mruby/src/gc.c +9 -9
- data/modules/mruby/src/kernel.c +1 -1
- data/modules/mruby/src/load.c +137 -1
- data/modules/mruby/src/object.c +1 -1
- data/modules/mruby/src/parse.y +162 -37
- data/modules/mruby/src/state.c +2 -0
- data/modules/mruby/src/string.c +28 -19
- data/modules/mruby/src/symbol.c +0 -1
- data/modules/mruby/src/variable.c +12 -15
- data/modules/mruby/src/vm.c +38 -22
- data/modules/mruby/tasks/mrbgem_spec.rake +6 -4
- data/modules/mruby/tasks/mrbgems_test.rake +9 -9
- data/modules/mruby/tasks/mruby_build_gem.rake +9 -0
- data/modules/mruby/tasks/toolchains/androideabi.rake +2 -0
- data/modules/mruby/test/driver.c +3 -3
- data/modules/mruby/test/t/array.rb +13 -0
- data/modules/mruby/test/t/class.rb +28 -0
- data/modules/mruby/test/t/exception.rb +10 -0
- data/modules/mruby/test/t/literals.rb +50 -0
- data/modules/mruby/test/t/module.rb +22 -0
- data/modules/mruby/test/t/proc.rb +37 -0
- data/modules/mruby/test/t/string.rb +20 -21
- data/modules/mruby/tools/mrbc/mrbc.c +2 -4
- data/scripts/gen_post.rb +1 -0
- data/scripts/gen_require.rb +107 -0
- data/templates/minimal/Rakefile +20 -0
- metadata +210 -88
- data/driver/main.c +0 -40
- data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +0 -24
- data/modules/emscripten/emlibtool +0 -11
- data/modules/emscripten/emlibtool.bat +0 -2
- data/modules/emscripten/src/framework.js +0 -257
- data/modules/emscripten/system/include/bsd/float.h +0 -91
- data/modules/emscripten/system/include/bsd/readme.txt +0 -2
- data/modules/emscripten/system/include/bsd/sys/mman.h +0 -180
- data/modules/emscripten/system/include/bsd/sys/utsname.h +0 -70
- data/modules/emscripten/system/include/dlfcn.h +0 -31
- data/modules/emscripten/system/include/err.h +0 -95
- data/modules/emscripten/system/include/features.h +0 -3
- data/modules/emscripten/system/include/libc/_ansi.h +0 -135
- data/modules/emscripten/system/include/libc/_syslist.h +0 -40
- data/modules/emscripten/system/include/libc/argz.h +0 -33
- data/modules/emscripten/system/include/libc/envlock.h +0 -15
- data/modules/emscripten/system/include/libc/envz.h +0 -16
- data/modules/emscripten/system/include/libc/fastmath.h +0 -13
- data/modules/emscripten/system/include/libc/ieeefp.h +0 -256
- data/modules/emscripten/system/include/libc/machine/_default_types.h +0 -121
- data/modules/emscripten/system/include/libc/machine/_types.h +0 -8
- data/modules/emscripten/system/include/libc/machine/ansi.h +0 -1
- data/modules/emscripten/system/include/libc/machine/endian.h +0 -31
- data/modules/emscripten/system/include/libc/machine/fastmath.h +0 -100
- data/modules/emscripten/system/include/libc/machine/ieeefp.h +0 -376
- data/modules/emscripten/system/include/libc/machine/malloc.h +0 -8
- data/modules/emscripten/system/include/libc/machine/param.h +0 -1
- data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +0 -43
- data/modules/emscripten/system/include/libc/machine/setjmp.h +0 -361
- data/modules/emscripten/system/include/libc/machine/stdlib.h +0 -8
- data/modules/emscripten/system/include/libc/machine/termios.h +0 -1
- data/modules/emscripten/system/include/libc/machine/time.h +0 -19
- data/modules/emscripten/system/include/libc/machine/types.h +0 -30
- data/modules/emscripten/system/include/libc/newlib.h +0 -2
- data/modules/emscripten/system/include/libc/process.h +0 -44
- data/modules/emscripten/system/include/libc/reent.h +0 -183
- data/modules/emscripten/system/include/libc/regdef.h +0 -7
- data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +0 -223
- data/modules/emscripten/system/include/libc/sys/_types.h +0 -93
- data/modules/emscripten/system/include/libc/sys/cdefs.h +0 -123
- data/modules/emscripten/system/include/libc/sys/config.h +0 -255
- data/modules/emscripten/system/include/libc/sys/custom_file.h +0 -2
- data/modules/emscripten/system/include/libc/sys/dirent.h +0 -58
- data/modules/emscripten/system/include/libc/sys/features.h +0 -212
- data/modules/emscripten/system/include/libc/sys/iconvnls.h +0 -77
- data/modules/emscripten/system/include/libc/sys/lock.h +0 -24
- data/modules/emscripten/system/include/libc/sys/queue.h +0 -471
- data/modules/emscripten/system/include/libc/sys/reent.h +0 -843
- data/modules/emscripten/system/include/libc/sys/sched.h +0 -67
- data/modules/emscripten/system/include/libc/sys/stdio.h +0 -27
- data/modules/emscripten/system/include/libc/sys/string.h +0 -2
- data/modules/emscripten/system/include/libc/sys/syslimits.h +0 -65
- data/modules/emscripten/system/include/libc/sys/unistd.h +0 -514
- data/modules/emscripten/system/include/libc/sys/utime.h +0 -26
- data/modules/emscripten/system/include/libc/unctrl.h +0 -46
- data/modules/emscripten/system/include/memory.h +0 -10
- data/modules/emscripten/system/include/mntent.h +0 -23
- data/modules/emscripten/system/include/net/arpa/inet.h +0 -32
- data/modules/emscripten/system/include/net/arpa/nameser.h +0 -535
- data/modules/emscripten/system/include/net/arpa/nameser_compat.h +0 -187
- data/modules/emscripten/system/include/net/if.h +0 -106
- data/modules/emscripten/system/include/net/netinet/in.h +0 -230
- data/modules/emscripten/system/include/net/netinet/tcp.h +0 -246
- data/modules/emscripten/system/include/net/resolv.h +0 -389
- data/modules/emscripten/system/include/netdb.h +0 -130
- data/modules/emscripten/system/include/nl_types.h +0 -19
- data/modules/emscripten/system/include/poll.h +0 -3
- data/modules/emscripten/system/include/pty.h +0 -6
- data/modules/emscripten/system/include/semaphore.h +0 -31
- data/modules/emscripten/system/include/spawn.h +0 -105
- data/modules/emscripten/system/include/stdbool.h +0 -16
- data/modules/emscripten/system/include/sys/bitypes.h +0 -3
- data/modules/emscripten/system/include/sys/io.h +0 -14
- data/modules/emscripten/system/include/sys/ioctl.h +0 -78
- data/modules/emscripten/system/include/sys/poll.h +0 -31
- data/modules/emscripten/system/include/sys/select.h +0 -16
- data/modules/emscripten/system/include/sys/sendfile.h +0 -16
- data/modules/emscripten/system/include/sys/socket.h +0 -247
- data/modules/emscripten/system/include/sys/socketvar.h +0 -3
- data/modules/emscripten/system/include/sys/statvfs.h +0 -32
- data/modules/emscripten/system/include/sys/uio.h +0 -22
- data/modules/emscripten/system/include/sys/un.h +0 -66
- data/modules/emscripten/system/include/sysexits.h +0 -108
- data/modules/emscripten/system/include/xlocale.h +0 -47
@@ -1,471 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (c) 1991, 1993
|
3
|
-
* The Regents of the University of California. All rights reserved.
|
4
|
-
*
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
6
|
-
* modification, are permitted provided that the following conditions
|
7
|
-
* are met:
|
8
|
-
* 1. Redistributions of source code must retain the above copyright
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
13
|
-
* 3. All advertising materials mentioning features or use of this software
|
14
|
-
* must display the following acknowledgement:
|
15
|
-
* This product includes software developed by the University of
|
16
|
-
* California, Berkeley and its contributors.
|
17
|
-
* 4. Neither the name of the University nor the names of its contributors
|
18
|
-
* may be used to endorse or promote products derived from this software
|
19
|
-
* without specific prior written permission.
|
20
|
-
*
|
21
|
-
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
22
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
25
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
27
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
28
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
29
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
30
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
31
|
-
* SUCH DAMAGE.
|
32
|
-
*
|
33
|
-
* @(#)queue.h 8.5 (Berkeley) 8/20/94
|
34
|
-
* $FreeBSD: src/sys/sys/queue.h,v 1.48 2002/04/17 14:00:37 tmm Exp $
|
35
|
-
*/
|
36
|
-
|
37
|
-
#ifndef _SYS_QUEUE_H_
|
38
|
-
#define _SYS_QUEUE_H_
|
39
|
-
|
40
|
-
#include <machine/ansi.h> /* for __offsetof */
|
41
|
-
|
42
|
-
/*
|
43
|
-
* This file defines four types of data structures: singly-linked lists,
|
44
|
-
* singly-linked tail queues, lists and tail queues.
|
45
|
-
*
|
46
|
-
* A singly-linked list is headed by a single forward pointer. The elements
|
47
|
-
* are singly linked for minimum space and pointer manipulation overhead at
|
48
|
-
* the expense of O(n) removal for arbitrary elements. New elements can be
|
49
|
-
* added to the list after an existing element or at the head of the list.
|
50
|
-
* Elements being removed from the head of the list should use the explicit
|
51
|
-
* macro for this purpose for optimum efficiency. A singly-linked list may
|
52
|
-
* only be traversed in the forward direction. Singly-linked lists are ideal
|
53
|
-
* for applications with large datasets and few or no removals or for
|
54
|
-
* implementing a LIFO queue.
|
55
|
-
*
|
56
|
-
* A singly-linked tail queue is headed by a pair of pointers, one to the
|
57
|
-
* head of the list and the other to the tail of the list. The elements are
|
58
|
-
* singly linked for minimum space and pointer manipulation overhead at the
|
59
|
-
* expense of O(n) removal for arbitrary elements. New elements can be added
|
60
|
-
* to the list after an existing element, at the head of the list, or at the
|
61
|
-
* end of the list. Elements being removed from the head of the tail queue
|
62
|
-
* should use the explicit macro for this purpose for optimum efficiency.
|
63
|
-
* A singly-linked tail queue may only be traversed in the forward direction.
|
64
|
-
* Singly-linked tail queues are ideal for applications with large datasets
|
65
|
-
* and few or no removals or for implementing a FIFO queue.
|
66
|
-
*
|
67
|
-
* A list is headed by a single forward pointer (or an array of forward
|
68
|
-
* pointers for a hash table header). The elements are doubly linked
|
69
|
-
* so that an arbitrary element can be removed without a need to
|
70
|
-
* traverse the list. New elements can be added to the list before
|
71
|
-
* or after an existing element or at the head of the list. A list
|
72
|
-
* may only be traversed in the forward direction.
|
73
|
-
*
|
74
|
-
* A tail queue is headed by a pair of pointers, one to the head of the
|
75
|
-
* list and the other to the tail of the list. The elements are doubly
|
76
|
-
* linked so that an arbitrary element can be removed without a need to
|
77
|
-
* traverse the list. New elements can be added to the list before or
|
78
|
-
* after an existing element, at the head of the list, or at the end of
|
79
|
-
* the list. A tail queue may be traversed in either direction.
|
80
|
-
*
|
81
|
-
* For details on the use of these macros, see the queue(3) manual page.
|
82
|
-
*
|
83
|
-
*
|
84
|
-
* SLIST LIST STAILQ TAILQ
|
85
|
-
* _HEAD + + + +
|
86
|
-
* _HEAD_INITIALIZER + + + +
|
87
|
-
* _ENTRY + + + +
|
88
|
-
* _INIT + + + +
|
89
|
-
* _EMPTY + + + +
|
90
|
-
* _FIRST + + + +
|
91
|
-
* _NEXT + + + +
|
92
|
-
* _PREV - - - +
|
93
|
-
* _LAST - - + +
|
94
|
-
* _FOREACH + + + +
|
95
|
-
* _FOREACH_REVERSE - - - +
|
96
|
-
* _INSERT_HEAD + + + +
|
97
|
-
* _INSERT_BEFORE - + - +
|
98
|
-
* _INSERT_AFTER + + + +
|
99
|
-
* _INSERT_TAIL - - + +
|
100
|
-
* _CONCAT - - + +
|
101
|
-
* _REMOVE_HEAD + - + -
|
102
|
-
* _REMOVE + + + +
|
103
|
-
*
|
104
|
-
*/
|
105
|
-
|
106
|
-
/*
|
107
|
-
* Singly-linked List declarations.
|
108
|
-
*/
|
109
|
-
#define SLIST_HEAD(name, type) \
|
110
|
-
struct name { \
|
111
|
-
struct type *slh_first; /* first element */ \
|
112
|
-
}
|
113
|
-
|
114
|
-
#define SLIST_HEAD_INITIALIZER(head) \
|
115
|
-
{ NULL }
|
116
|
-
|
117
|
-
#define SLIST_ENTRY(type) \
|
118
|
-
struct { \
|
119
|
-
struct type *sle_next; /* next element */ \
|
120
|
-
}
|
121
|
-
|
122
|
-
/*
|
123
|
-
* Singly-linked List functions.
|
124
|
-
*/
|
125
|
-
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
126
|
-
|
127
|
-
#define SLIST_FIRST(head) ((head)->slh_first)
|
128
|
-
|
129
|
-
#define SLIST_FOREACH(var, head, field) \
|
130
|
-
for ((var) = SLIST_FIRST((head)); \
|
131
|
-
(var); \
|
132
|
-
(var) = SLIST_NEXT((var), field))
|
133
|
-
|
134
|
-
#define SLIST_INIT(head) do { \
|
135
|
-
SLIST_FIRST((head)) = NULL; \
|
136
|
-
} while (0)
|
137
|
-
|
138
|
-
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
139
|
-
SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
|
140
|
-
SLIST_NEXT((slistelm), field) = (elm); \
|
141
|
-
} while (0)
|
142
|
-
|
143
|
-
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
144
|
-
SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
|
145
|
-
SLIST_FIRST((head)) = (elm); \
|
146
|
-
} while (0)
|
147
|
-
|
148
|
-
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
149
|
-
|
150
|
-
#define SLIST_REMOVE(head, elm, type, field) do { \
|
151
|
-
if (SLIST_FIRST((head)) == (elm)) { \
|
152
|
-
SLIST_REMOVE_HEAD((head), field); \
|
153
|
-
} \
|
154
|
-
else { \
|
155
|
-
struct type *curelm = SLIST_FIRST((head)); \
|
156
|
-
while (SLIST_NEXT(curelm, field) != (elm)) \
|
157
|
-
curelm = SLIST_NEXT(curelm, field); \
|
158
|
-
SLIST_NEXT(curelm, field) = \
|
159
|
-
SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
|
160
|
-
} \
|
161
|
-
} while (0)
|
162
|
-
|
163
|
-
#define SLIST_REMOVE_HEAD(head, field) do { \
|
164
|
-
SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
|
165
|
-
} while (0)
|
166
|
-
|
167
|
-
/*
|
168
|
-
* Singly-linked Tail queue declarations.
|
169
|
-
*/
|
170
|
-
#define STAILQ_HEAD(name, type) \
|
171
|
-
struct name { \
|
172
|
-
struct type *stqh_first;/* first element */ \
|
173
|
-
struct type **stqh_last;/* addr of last next element */ \
|
174
|
-
}
|
175
|
-
|
176
|
-
#define STAILQ_HEAD_INITIALIZER(head) \
|
177
|
-
{ NULL, &(head).stqh_first }
|
178
|
-
|
179
|
-
#define STAILQ_ENTRY(type) \
|
180
|
-
struct { \
|
181
|
-
struct type *stqe_next; /* next element */ \
|
182
|
-
}
|
183
|
-
|
184
|
-
/*
|
185
|
-
* Singly-linked Tail queue functions.
|
186
|
-
*/
|
187
|
-
#define STAILQ_CONCAT(head1, head2) do { \
|
188
|
-
if (!STAILQ_EMPTY((head2))) { \
|
189
|
-
*(head1)->stqh_last = (head2)->stqh_first; \
|
190
|
-
(head1)->stqh_last = (head2)->stqh_last; \
|
191
|
-
STAILQ_INIT((head2)); \
|
192
|
-
} \
|
193
|
-
} while (0)
|
194
|
-
|
195
|
-
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
|
196
|
-
|
197
|
-
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
198
|
-
|
199
|
-
#define STAILQ_FOREACH(var, head, field) \
|
200
|
-
for((var) = STAILQ_FIRST((head)); \
|
201
|
-
(var); \
|
202
|
-
(var) = STAILQ_NEXT((var), field))
|
203
|
-
|
204
|
-
#define STAILQ_INIT(head) do { \
|
205
|
-
STAILQ_FIRST((head)) = NULL; \
|
206
|
-
(head)->stqh_last = &STAILQ_FIRST((head)); \
|
207
|
-
} while (0)
|
208
|
-
|
209
|
-
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
|
210
|
-
if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
|
211
|
-
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
212
|
-
STAILQ_NEXT((tqelm), field) = (elm); \
|
213
|
-
} while (0)
|
214
|
-
|
215
|
-
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
|
216
|
-
if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
|
217
|
-
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
218
|
-
STAILQ_FIRST((head)) = (elm); \
|
219
|
-
} while (0)
|
220
|
-
|
221
|
-
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
|
222
|
-
STAILQ_NEXT((elm), field) = NULL; \
|
223
|
-
*(head)->stqh_last = (elm); \
|
224
|
-
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
|
225
|
-
} while (0)
|
226
|
-
|
227
|
-
#define STAILQ_LAST(head, type, field) \
|
228
|
-
(STAILQ_EMPTY((head)) ? \
|
229
|
-
NULL : \
|
230
|
-
((struct type *) \
|
231
|
-
((char *)((head)->stqh_last) - __offsetof(struct type, field))))
|
232
|
-
|
233
|
-
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
|
234
|
-
|
235
|
-
#define STAILQ_REMOVE(head, elm, type, field) do { \
|
236
|
-
if (STAILQ_FIRST((head)) == (elm)) { \
|
237
|
-
STAILQ_REMOVE_HEAD((head), field); \
|
238
|
-
} \
|
239
|
-
else { \
|
240
|
-
struct type *curelm = STAILQ_FIRST((head)); \
|
241
|
-
while (STAILQ_NEXT(curelm, field) != (elm)) \
|
242
|
-
curelm = STAILQ_NEXT(curelm, field); \
|
243
|
-
if ((STAILQ_NEXT(curelm, field) = \
|
244
|
-
STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
|
245
|
-
(head)->stqh_last = &STAILQ_NEXT((curelm), field);\
|
246
|
-
} \
|
247
|
-
} while (0)
|
248
|
-
|
249
|
-
#define STAILQ_REMOVE_HEAD(head, field) do { \
|
250
|
-
if ((STAILQ_FIRST((head)) = \
|
251
|
-
STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
|
252
|
-
(head)->stqh_last = &STAILQ_FIRST((head)); \
|
253
|
-
} while (0)
|
254
|
-
|
255
|
-
#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
|
256
|
-
if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
|
257
|
-
(head)->stqh_last = &STAILQ_FIRST((head)); \
|
258
|
-
} while (0)
|
259
|
-
|
260
|
-
/*
|
261
|
-
* List declarations.
|
262
|
-
*/
|
263
|
-
#define LIST_HEAD(name, type) \
|
264
|
-
struct name { \
|
265
|
-
struct type *lh_first; /* first element */ \
|
266
|
-
}
|
267
|
-
|
268
|
-
#define LIST_HEAD_INITIALIZER(head) \
|
269
|
-
{ NULL }
|
270
|
-
|
271
|
-
#define LIST_ENTRY(type) \
|
272
|
-
struct { \
|
273
|
-
struct type *le_next; /* next element */ \
|
274
|
-
struct type **le_prev; /* address of previous next element */ \
|
275
|
-
}
|
276
|
-
|
277
|
-
/*
|
278
|
-
* List functions.
|
279
|
-
*/
|
280
|
-
|
281
|
-
#define LIST_EMPTY(head) ((head)->lh_first == NULL)
|
282
|
-
|
283
|
-
#define LIST_FIRST(head) ((head)->lh_first)
|
284
|
-
|
285
|
-
#define LIST_FOREACH(var, head, field) \
|
286
|
-
for ((var) = LIST_FIRST((head)); \
|
287
|
-
(var); \
|
288
|
-
(var) = LIST_NEXT((var), field))
|
289
|
-
|
290
|
-
#define LIST_INIT(head) do { \
|
291
|
-
LIST_FIRST((head)) = NULL; \
|
292
|
-
} while (0)
|
293
|
-
|
294
|
-
#define LIST_INSERT_AFTER(listelm, elm, field) do { \
|
295
|
-
if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
|
296
|
-
LIST_NEXT((listelm), field)->field.le_prev = \
|
297
|
-
&LIST_NEXT((elm), field); \
|
298
|
-
LIST_NEXT((listelm), field) = (elm); \
|
299
|
-
(elm)->field.le_prev = &LIST_NEXT((listelm), field); \
|
300
|
-
} while (0)
|
301
|
-
|
302
|
-
#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
|
303
|
-
(elm)->field.le_prev = (listelm)->field.le_prev; \
|
304
|
-
LIST_NEXT((elm), field) = (listelm); \
|
305
|
-
*(listelm)->field.le_prev = (elm); \
|
306
|
-
(listelm)->field.le_prev = &LIST_NEXT((elm), field); \
|
307
|
-
} while (0)
|
308
|
-
|
309
|
-
#define LIST_INSERT_HEAD(head, elm, field) do { \
|
310
|
-
if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
|
311
|
-
LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
|
312
|
-
LIST_FIRST((head)) = (elm); \
|
313
|
-
(elm)->field.le_prev = &LIST_FIRST((head)); \
|
314
|
-
} while (0)
|
315
|
-
|
316
|
-
#define LIST_NEXT(elm, field) ((elm)->field.le_next)
|
317
|
-
|
318
|
-
#define LIST_REMOVE(elm, field) do { \
|
319
|
-
if (LIST_NEXT((elm), field) != NULL) \
|
320
|
-
LIST_NEXT((elm), field)->field.le_prev = \
|
321
|
-
(elm)->field.le_prev; \
|
322
|
-
*(elm)->field.le_prev = LIST_NEXT((elm), field); \
|
323
|
-
} while (0)
|
324
|
-
|
325
|
-
/*
|
326
|
-
* Tail queue declarations.
|
327
|
-
*/
|
328
|
-
#define TAILQ_HEAD(name, type) \
|
329
|
-
struct name { \
|
330
|
-
struct type *tqh_first; /* first element */ \
|
331
|
-
struct type **tqh_last; /* addr of last next element */ \
|
332
|
-
}
|
333
|
-
|
334
|
-
#define TAILQ_HEAD_INITIALIZER(head) \
|
335
|
-
{ NULL, &(head).tqh_first }
|
336
|
-
|
337
|
-
#define TAILQ_ENTRY(type) \
|
338
|
-
struct { \
|
339
|
-
struct type *tqe_next; /* next element */ \
|
340
|
-
struct type **tqe_prev; /* address of previous next element */ \
|
341
|
-
}
|
342
|
-
|
343
|
-
/*
|
344
|
-
* Tail queue functions.
|
345
|
-
*/
|
346
|
-
#define TAILQ_CONCAT(head1, head2, field) do { \
|
347
|
-
if (!TAILQ_EMPTY(head2)) { \
|
348
|
-
*(head1)->tqh_last = (head2)->tqh_first; \
|
349
|
-
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
|
350
|
-
(head1)->tqh_last = (head2)->tqh_last; \
|
351
|
-
TAILQ_INIT((head2)); \
|
352
|
-
} \
|
353
|
-
} while (0)
|
354
|
-
|
355
|
-
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
|
356
|
-
|
357
|
-
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
358
|
-
|
359
|
-
#define TAILQ_FOREACH(var, head, field) \
|
360
|
-
for ((var) = TAILQ_FIRST((head)); \
|
361
|
-
(var); \
|
362
|
-
(var) = TAILQ_NEXT((var), field))
|
363
|
-
|
364
|
-
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
|
365
|
-
for ((var) = TAILQ_LAST((head), headname); \
|
366
|
-
(var); \
|
367
|
-
(var) = TAILQ_PREV((var), headname, field))
|
368
|
-
|
369
|
-
#define TAILQ_INIT(head) do { \
|
370
|
-
TAILQ_FIRST((head)) = NULL; \
|
371
|
-
(head)->tqh_last = &TAILQ_FIRST((head)); \
|
372
|
-
} while (0)
|
373
|
-
|
374
|
-
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
375
|
-
if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
|
376
|
-
TAILQ_NEXT((elm), field)->field.tqe_prev = \
|
377
|
-
&TAILQ_NEXT((elm), field); \
|
378
|
-
else \
|
379
|
-
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
|
380
|
-
TAILQ_NEXT((listelm), field) = (elm); \
|
381
|
-
(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
|
382
|
-
} while (0)
|
383
|
-
|
384
|
-
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
|
385
|
-
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
|
386
|
-
TAILQ_NEXT((elm), field) = (listelm); \
|
387
|
-
*(listelm)->field.tqe_prev = (elm); \
|
388
|
-
(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
|
389
|
-
} while (0)
|
390
|
-
|
391
|
-
#define TAILQ_INSERT_HEAD(head, elm, field) do { \
|
392
|
-
if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
|
393
|
-
TAILQ_FIRST((head))->field.tqe_prev = \
|
394
|
-
&TAILQ_NEXT((elm), field); \
|
395
|
-
else \
|
396
|
-
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
|
397
|
-
TAILQ_FIRST((head)) = (elm); \
|
398
|
-
(elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
|
399
|
-
} while (0)
|
400
|
-
|
401
|
-
#define TAILQ_INSERT_TAIL(head, elm, field) do { \
|
402
|
-
TAILQ_NEXT((elm), field) = NULL; \
|
403
|
-
(elm)->field.tqe_prev = (head)->tqh_last; \
|
404
|
-
*(head)->tqh_last = (elm); \
|
405
|
-
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
|
406
|
-
} while (0)
|
407
|
-
|
408
|
-
#define TAILQ_LAST(head, headname) \
|
409
|
-
(*(((struct headname *)((head)->tqh_last))->tqh_last))
|
410
|
-
|
411
|
-
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
412
|
-
|
413
|
-
#define TAILQ_PREV(elm, headname, field) \
|
414
|
-
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
|
415
|
-
|
416
|
-
#define TAILQ_REMOVE(head, elm, field) do { \
|
417
|
-
if ((TAILQ_NEXT((elm), field)) != NULL) \
|
418
|
-
TAILQ_NEXT((elm), field)->field.tqe_prev = \
|
419
|
-
(elm)->field.tqe_prev; \
|
420
|
-
else \
|
421
|
-
(head)->tqh_last = (elm)->field.tqe_prev; \
|
422
|
-
*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
|
423
|
-
} while (0)
|
424
|
-
|
425
|
-
|
426
|
-
#ifdef _KERNEL
|
427
|
-
|
428
|
-
/*
|
429
|
-
* XXX insque() and remque() are an old way of handling certain queues.
|
430
|
-
* They bogusly assumes that all queue heads look alike.
|
431
|
-
*/
|
432
|
-
|
433
|
-
struct quehead {
|
434
|
-
struct quehead *qh_link;
|
435
|
-
struct quehead *qh_rlink;
|
436
|
-
};
|
437
|
-
|
438
|
-
#ifdef __GNUC__
|
439
|
-
|
440
|
-
static __inline void
|
441
|
-
insque(void *a, void *b)
|
442
|
-
{
|
443
|
-
struct quehead *element = (struct quehead *)a,
|
444
|
-
*head = (struct quehead *)b;
|
445
|
-
|
446
|
-
element->qh_link = head->qh_link;
|
447
|
-
element->qh_rlink = head;
|
448
|
-
head->qh_link = element;
|
449
|
-
element->qh_link->qh_rlink = element;
|
450
|
-
}
|
451
|
-
|
452
|
-
static __inline void
|
453
|
-
remque(void *a)
|
454
|
-
{
|
455
|
-
struct quehead *element = (struct quehead *)a;
|
456
|
-
|
457
|
-
element->qh_link->qh_rlink = element->qh_rlink;
|
458
|
-
element->qh_rlink->qh_link = element->qh_link;
|
459
|
-
element->qh_rlink = 0;
|
460
|
-
}
|
461
|
-
|
462
|
-
#else /* !__GNUC__ */
|
463
|
-
|
464
|
-
void insque(void *a, void *b);
|
465
|
-
void remque(void *a);
|
466
|
-
|
467
|
-
#endif /* __GNUC__ */
|
468
|
-
|
469
|
-
#endif /* _KERNEL */
|
470
|
-
|
471
|
-
#endif /* !_SYS_QUEUE_H_ */
|