rufus-lua-win 5.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/lib/rufus/lua/win.rb +18 -0
- data/lib/rufus/lua/win/version.rb +7 -0
- data/rufus-lua-win.gemspec +23 -0
- data/vendor/lua/bin/liblua.dll +0 -0
- data/vendor/lua/lib/lua/LuaXml.lua +119 -0
- data/vendor/lua/lib/lua/alien.lua +250 -0
- data/vendor/lua/lib/lua/alien/core.dll +0 -0
- data/vendor/lua/lib/lua/alien/struct.dll +0 -0
- data/vendor/lua/lib/lua/base.lua +536 -0
- data/vendor/lua/lib/lua/bin.lua +20 -0
- data/vendor/lua/lib/lua/bit.dll +0 -0
- data/vendor/lua/lib/lua/cdlua.dll +0 -0
- data/vendor/lua/lib/lua/cdluacontextplus.dll +0 -0
- data/vendor/lua/lib/lua/cdluagl.dll +0 -0
- data/vendor/lua/lib/lua/cdluaim.dll +0 -0
- data/vendor/lua/lib/lua/cdluapdf.dll +0 -0
- data/vendor/lua/lib/lua/copas.lua +543 -0
- data/vendor/lua/lib/lua/coxpcall.lua +57 -0
- data/vendor/lua/lib/lua/date.lua +745 -0
- data/vendor/lua/lib/lua/debug_ext.lua +84 -0
- data/vendor/lua/lib/lua/debug_init.lua +2 -0
- data/vendor/lua/lib/lua/des56.dll +0 -0
- data/vendor/lua/lib/lua/dist/config.lua +109 -0
- data/vendor/lua/lib/lua/dist/constraints.lua +271 -0
- data/vendor/lua/lib/lua/dist/depends.lua +601 -0
- data/vendor/lua/lib/lua/dist/git.lua +307 -0
- data/vendor/lua/lib/lua/dist/init.lua +278 -0
- data/vendor/lua/lib/lua/dist/manifest.lua +225 -0
- data/vendor/lua/lib/lua/dist/package.lua +583 -0
- data/vendor/lua/lib/lua/dist/sys.lua +367 -0
- data/vendor/lua/lib/lua/dist/utils.lua +130 -0
- data/vendor/lua/lib/lua/ex.dll +0 -0
- data/vendor/lua/lib/lua/fstable.lua +116 -0
- data/vendor/lua/lib/lua/getopt.lua +273 -0
- data/vendor/lua/lib/lua/git.lua +5 -0
- data/vendor/lua/lib/lua/git/core.dll +0 -0
- data/vendor/lua/lib/lua/git/objects.lua +121 -0
- data/vendor/lua/lib/lua/git/pack.lua +316 -0
- data/vendor/lua/lib/lua/git/protocol.lua +188 -0
- data/vendor/lua/lib/lua/git/repo.lua +283 -0
- data/vendor/lua/lib/lua/git/util.lua +233 -0
- data/vendor/lua/lib/lua/gzio.dll +0 -0
- data/vendor/lua/lib/lua/gzip.lua +81 -0
- data/vendor/lua/lib/lua/iconv.dll +0 -0
- data/vendor/lua/lib/lua/imlua.dll +0 -0
- data/vendor/lua/lib/lua/imlua_fftw.dll +0 -0
- data/vendor/lua/lib/lua/imlua_jp2.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process_omp.dll +0 -0
- data/vendor/lua/lib/lua/io_ext.lua +115 -0
- data/vendor/lua/lib/lua/iuplua.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_mglplot.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_pplot.dll +0 -0
- data/vendor/lua/lib/lua/iupluacd.dll +0 -0
- data/vendor/lua/lib/lua/iupluacontrols.dll +0 -0
- data/vendor/lua/lib/lua/iupluagl.dll +0 -0
- data/vendor/lua/lib/lua/iupluaim.dll +0 -0
- data/vendor/lua/lib/lua/iupluaimglib.dll +0 -0
- data/vendor/lua/lib/lua/iupluatuio.dll +0 -0
- data/vendor/lua/lib/lua/lanes-keeper.lua +302 -0
- data/vendor/lua/lib/lua/lanes.lua +591 -0
- data/vendor/lua/lib/lua/lanes/core.dll +0 -0
- data/vendor/lua/lib/lua/lcs.lua +55 -0
- data/vendor/lua/lib/lua/lemock.lua +659 -0
- data/vendor/lua/lib/lua/lfs.dll +0 -0
- data/vendor/lua/lib/lua/list.lua +375 -0
- data/vendor/lua/lib/lua/logging.lua +189 -0
- data/vendor/lua/lib/lua/logging/console.lua +22 -0
- data/vendor/lua/lib/lua/logging/email.lua +44 -0
- data/vendor/lua/lib/lua/logging/file.lua +55 -0
- data/vendor/lua/lib/lua/logging/rolling_file.lua +81 -0
- data/vendor/lua/lib/lua/logging/socket.lua +35 -0
- data/vendor/lua/lib/lua/logging/sql.lua +64 -0
- data/vendor/lua/lib/lua/loop/base.lua +68 -0
- data/vendor/lua/lib/lua/loop/cached.lua +312 -0
- data/vendor/lua/lib/lua/loop/collection/MapWithArrayOfKeys.lua +64 -0
- data/vendor/lua/lib/lua/loop/collection/ObjectCache.lua +39 -0
- data/vendor/lua/lib/lua/loop/collection/OrderedSet.lua +164 -0
- data/vendor/lua/lib/lua/loop/collection/PriorityQueue.lua +86 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArray.lua +32 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArraySet.lua +56 -0
- data/vendor/lua/lib/lua/loop/compiler/Arguments.lua +108 -0
- data/vendor/lua/lib/lua/loop/compiler/Conditional.lua +50 -0
- data/vendor/lua/lib/lua/loop/compiler/Expression.lua +215 -0
- data/vendor/lua/lib/lua/loop/component/base.lua +221 -0
- data/vendor/lua/lib/lua/loop/component/contained.lua +71 -0
- data/vendor/lua/lib/lua/loop/component/dynamic.lua +223 -0
- data/vendor/lua/lib/lua/loop/component/intercepted.lua +354 -0
- data/vendor/lua/lib/lua/loop/component/wrapped.lua +195 -0
- data/vendor/lua/lib/lua/loop/debug/Inspector.lua +521 -0
- data/vendor/lua/lib/lua/loop/debug/Matcher.lua +192 -0
- data/vendor/lua/lib/lua/loop/debug/Verbose.lua +266 -0
- data/vendor/lua/lib/lua/loop/debug/Viewer.lua +200 -0
- data/vendor/lua/lib/lua/loop/multiple.lua +105 -0
- data/vendor/lua/lib/lua/loop/object/Exception.lua +57 -0
- data/vendor/lua/lib/lua/loop/object/Publisher.lua +43 -0
- data/vendor/lua/lib/lua/loop/object/Wrapper.lua +39 -0
- data/vendor/lua/lib/lua/loop/scoped.lua +585 -0
- data/vendor/lua/lib/lua/loop/serial/FileStream.lua +48 -0
- data/vendor/lua/lib/lua/loop/serial/Serializer.lua +291 -0
- data/vendor/lua/lib/lua/loop/serial/SocketStream.lua +51 -0
- data/vendor/lua/lib/lua/loop/serial/StringStream.lua +47 -0
- data/vendor/lua/lib/lua/loop/simple.lua +75 -0
- data/vendor/lua/lib/lua/loop/table.lua +71 -0
- data/vendor/lua/lib/lua/loop/thread/CoSocket.lua +416 -0
- data/vendor/lua/lib/lua/loop/thread/IOScheduler.lua +170 -0
- data/vendor/lua/lib/lua/loop/thread/Scheduler.lua +327 -0
- data/vendor/lua/lib/lua/loop/thread/SocketScheduler.lua +88 -0
- data/vendor/lua/lib/lua/loop/thread/Timer.lua +54 -0
- data/vendor/lua/lib/lua/lpeg.dll +0 -0
- data/vendor/lua/lib/lua/ltn12.lua +292 -0
- data/vendor/lua/lib/lua/luaXML_lib.dll +0 -0
- data/vendor/lua/lib/lua/luacurl.dll +0 -0
- data/vendor/lua/lib/lua/luadoc/config.lua +34 -0
- data/vendor/lua/lib/lua/luadoc/doclet/debug.lua +46 -0
- data/vendor/lua/lib/lua/luadoc/doclet/formatter.lua +84 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html.lua +289 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/file.lp +113 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/function.lp +64 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/index.lp +70 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/luadoc.css +286 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/menu.lp +55 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/module.lp +109 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/table.lp +15 -0
- data/vendor/lua/lib/lua/luadoc/doclet/raw.lua +12 -0
- data/vendor/lua/lib/lua/luadoc/init.lua +58 -0
- data/vendor/lua/lib/lua/luadoc/lp.lua +130 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard.lua +495 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard/tags.lua +171 -0
- data/vendor/lua/lib/lua/luadoc/util.lua +233 -0
- data/vendor/lua/lib/lua/luagl.dll +0 -0
- data/vendor/lua/lib/lua/luaglu.dll +0 -0
- data/vendor/lua/lib/lua/luaidl.lua +113 -0
- data/vendor/lua/lib/lua/luaidl/lex.lua +793 -0
- data/vendor/lua/lib/lua/luaidl/pre.lua +149 -0
- data/vendor/lua/lib/lua/luaidl/sin.lua +3631 -0
- data/vendor/lua/lib/lua/luarocks/add.lua +108 -0
- data/vendor/lua/lib/lua/luarocks/admin_remove.lua +87 -0
- data/vendor/lua/lib/lua/luarocks/build.lua +330 -0
- data/vendor/lua/lib/lua/luarocks/build/builtin.lua +253 -0
- data/vendor/lua/lib/lua/luarocks/build/cmake.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/build/command.lua +32 -0
- data/vendor/lua/lib/lua/luarocks/build/make.lua +92 -0
- data/vendor/lua/lib/lua/luarocks/cache.lua +85 -0
- data/vendor/lua/lib/lua/luarocks/cfg.lua +449 -0
- data/vendor/lua/lib/lua/luarocks/command_line.lua +163 -0
- data/vendor/lua/lib/lua/luarocks/deps.lua +654 -0
- data/vendor/lua/lib/lua/luarocks/dir.lua +69 -0
- data/vendor/lua/lib/lua/luarocks/download.lua +90 -0
- data/vendor/lua/lib/lua/luarocks/fetch.lua +321 -0
- data/vendor/lua/lib/lua/luarocks/fetch/cvs.lua +44 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git.lua +81 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git_file.lua +17 -0
- data/vendor/lua/lib/lua/luarocks/fetch/hg.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/fetch/sscm.lua +42 -0
- data/vendor/lua/lib/lua/luarocks/fetch/svn.lua +53 -0
- data/vendor/lua/lib/lua/luarocks/fs.lua +40 -0
- data/vendor/lua/lib/lua/luarocks/fs/lua.lua +676 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix.lua +88 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix/tools.lua +325 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32.lua +107 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32/tools.lua +334 -0
- data/vendor/lua/lib/lua/luarocks/help.lua +101 -0
- data/vendor/lua/lib/lua/luarocks/index.lua +172 -0
- data/vendor/lua/lib/lua/luarocks/install.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/list.lua +35 -0
- data/vendor/lua/lib/lua/luarocks/loader.lua +228 -0
- data/vendor/lua/lib/lua/luarocks/make.lua +71 -0
- data/vendor/lua/lib/lua/luarocks/make_manifest.lua +34 -0
- data/vendor/lua/lib/lua/luarocks/manif.lua +360 -0
- data/vendor/lua/lib/lua/luarocks/manif_core.lua +75 -0
- data/vendor/lua/lib/lua/luarocks/new_version.lua +141 -0
- data/vendor/lua/lib/lua/luarocks/pack.lua +205 -0
- data/vendor/lua/lib/lua/luarocks/path.lua +315 -0
- data/vendor/lua/lib/lua/luarocks/persist.lua +173 -0
- data/vendor/lua/lib/lua/luarocks/refresh_cache.lua +30 -0
- data/vendor/lua/lib/lua/luarocks/remove.lua +135 -0
- data/vendor/lua/lib/lua/luarocks/rep.lua +313 -0
- data/vendor/lua/lib/lua/luarocks/require.lua +6 -0
- data/vendor/lua/lib/lua/luarocks/search.lua +399 -0
- data/vendor/lua/lib/lua/luarocks/show.lua +138 -0
- data/vendor/lua/lib/lua/luarocks/site_config.lua +23 -0
- data/vendor/lua/lib/lua/luarocks/tools/patch.lua +712 -0
- data/vendor/lua/lib/lua/luarocks/tools/tar.lua +144 -0
- data/vendor/lua/lib/lua/luarocks/tools/zip.lua +245 -0
- data/vendor/lua/lib/lua/luarocks/type_check.lua +267 -0
- data/vendor/lua/lib/lua/luarocks/unpack.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/util.lua +420 -0
- data/vendor/lua/lib/lua/luarocks/validate.lua +164 -0
- data/vendor/lua/lib/lua/luars232.dll +0 -0
- data/vendor/lua/lib/lua/luasql/mysql.dll +0 -0
- data/vendor/lua/lib/lua/luasql/postgres.dll +0 -0
- data/vendor/lua/lib/lua/luasql/sqlite3.dll +0 -0
- data/vendor/lua/lib/lua/luaunit.lua +601 -0
- data/vendor/lua/lib/lua/lxp.dll +0 -0
- data/vendor/lua/lib/lua/lxp/lom.lua +60 -0
- data/vendor/lua/lib/lua/math_ext.lua +27 -0
- data/vendor/lua/lib/lua/mbox.lua +53 -0
- data/vendor/lua/lib/lua/md5.lua +19 -0
- data/vendor/lua/lib/lua/md5/core.dll +0 -0
- data/vendor/lua/lib/lua/metalua.lua +0 -0
- data/vendor/lua/lib/lua/metalua/ast_to_string.mlua +553 -0
- data/vendor/lua/lib/lua/metalua/base.lua +104 -0
- data/vendor/lua/lib/lua/metalua/bytecode.lua +0 -0
- data/vendor/lua/lib/lua/metalua/clopts.mlua +204 -0
- data/vendor/lua/lib/lua/metalua/compiler.lua +3 -0
- data/vendor/lua/lib/lua/metalua/dollar.mlua +24 -0
- data/vendor/lua/lib/lua/metalua/extension/H-runtime.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/extension/H.mlua +22 -0
- data/vendor/lua/lib/lua/metalua/extension/anaphoric.mlua +54 -0
- data/vendor/lua/lib/lua/metalua/extension/clist.mlua +149 -0
- data/vendor/lua/lib/lua/metalua/extension/continue.mlua +53 -0
- data/vendor/lua/lib/lua/metalua/extension/localin.mlua +2 -0
- data/vendor/lua/lib/lua/metalua/extension/log.mlua +39 -0
- data/vendor/lua/lib/lua/metalua/extension/match.mlua +374 -0
- data/vendor/lua/lib/lua/metalua/extension/ternary.mlua +10 -0
- data/vendor/lua/lib/lua/metalua/extension/trycatch.mlua +189 -0
- data/vendor/lua/lib/lua/metalua/extension/types-runtime.mlua +159 -0
- data/vendor/lua/lib/lua/metalua/extension/types.mlua +352 -0
- data/vendor/lua/lib/lua/metalua/extension/withdo.mlua +30 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal-runtime.lua +41 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal.mlua +20 -0
- data/vendor/lua/lib/lua/metalua/extension/xloop.mlua +100 -0
- data/vendor/lua/lib/lua/metalua/extension/xmatch.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/metaloop.mlua +76 -0
- data/vendor/lua/lib/lua/metalua/mlc.lua +0 -0
- data/vendor/lua/lib/lua/metalua/mlc_xcall.lua +119 -0
- data/vendor/lua/lib/lua/metalua/mlp.lua +0 -0
- data/vendor/lua/lib/lua/metalua/package2.lua +101 -0
- data/vendor/lua/lib/lua/metalua/runtime.lua +3 -0
- data/vendor/lua/lib/lua/metalua/string2.lua +44 -0
- data/vendor/lua/lib/lua/metalua/table2.lua +372 -0
- data/vendor/lua/lib/lua/metalua/walk.mlua +304 -0
- data/vendor/lua/lib/lua/metalua/walk/bindings.mlua +41 -0
- data/vendor/lua/lib/lua/metalua/walk/id.mlua +186 -0
- data/vendor/lua/lib/lua/metalua/walk/scope.lua +54 -0
- data/vendor/lua/lib/lua/mime.lua +87 -0
- data/vendor/lua/lib/lua/mime/core.dll +0 -0
- data/vendor/lua/lib/lua/mobdebug.lua +1484 -0
- data/vendor/lua/lib/lua/modules.lua +16 -0
- data/vendor/lua/lib/lua/object.lua +56 -0
- data/vendor/lua/lib/lua/oil/Exception.lua +26 -0
- data/vendor/lua/lib/lua/oil/arch.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/basic/client.lua +29 -0
- data/vendor/lua/lib/lua/oil/arch/basic/common.lua +13 -0
- data/vendor/lua/lib/lua/oil/arch/basic/server.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/common.lua +10 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/server.lua +16 -0
- data/vendor/lua/lib/lua/oil/arch/corba/client.lua +39 -0
- data/vendor/lua/lib/lua/oil/arch/corba/common.lua +58 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/client.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/server.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/server.lua +35 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/byref.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/client.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/common.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/server.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/typed/client.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/typed/common.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/typed/server.lua +18 -0
- data/vendor/lua/lib/lua/oil/assert.lua +87 -0
- data/vendor/lua/lib/lua/oil/builder.lua +45 -0
- data/vendor/lua/lib/lua/oil/builder/basic/client.lua +31 -0
- data/vendor/lua/lib/lua/oil/builder/basic/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/basic/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/common.lua +24 -0
- data/vendor/lua/lib/lua/oil/builder/corba/gencode.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/lua/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/lua/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/byref.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/common.lua +14 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/typed/client.lua +16 -0
- data/vendor/lua/lib/lua/oil/builder/typed/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/compat.lua +846 -0
- data/vendor/lua/lib/lua/oil/component.lua +1 -0
- data/vendor/lua/lib/lua/oil/corba/giop.lua +301 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Codec.lua +1568 -0
- data/vendor/lua/lib/lua/oil/corba/giop/CodecGen.lua +589 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Exception.lua +25 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Indexer.lua +63 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Listener.lua +343 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Messenger.lua +228 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Referrer.lua +180 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Requester.lua +462 -0
- data/vendor/lua/lib/lua/oil/corba/idl.lua +597 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Compiler.lua +133 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Importer.lua +235 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Indexer.lua +95 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Registry.lua +1821 -0
- data/vendor/lua/lib/lua/oil/corba/idl/ir.lua +847 -0
- data/vendor/lua/lib/lua/oil/corba/idl/sysex.lua +21 -0
- data/vendor/lua/lib/lua/oil/corba/iiop/Profiler.lua +200 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Listener.lua +158 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Requester.lua +181 -0
- data/vendor/lua/lib/lua/oil/corba/services/event.lua +126 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ConsumerAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventFactory.lua +15 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventQueue.lua +37 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushConsumer.lua +75 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushSupplier.lua +62 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleDeferredDispatcher.lua +60 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleSynchronousDispatcher.lua +39 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SupplierAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/naming.lua +436 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Acceptor.lua +268 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Channels.lua +121 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Connector.lua +147 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Dispatcher.lua +99 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies.lua +86 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/asynchronous.lua +56 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/protected.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/synchronous.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/utils.lua +29 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Receiver.lua +110 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Servants.lua +207 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Sockets.lua +44 -0
- data/vendor/lua/lib/lua/oil/kernel/cooperative/Receiver.lua +139 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Listener.lua +47 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Requester.lua +58 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Dispatcher.lua +76 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Proxies.lua +69 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Dispatcher.lua +91 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Proxies.lua +153 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Servants.lua +137 -0
- data/vendor/lua/lib/lua/oil/ludo/Codec.lua +66 -0
- data/vendor/lua/lib/lua/oil/ludo/CodecByRef.lua +103 -0
- data/vendor/lua/lib/lua/oil/ludo/Listener.lua +151 -0
- data/vendor/lua/lib/lua/oil/ludo/Referrer.lua +72 -0
- data/vendor/lua/lib/lua/oil/ludo/Requester.lua +107 -0
- data/vendor/lua/lib/lua/oil/oo.lua +1 -0
- data/vendor/lua/lib/lua/oil/port.lua +1 -0
- data/vendor/lua/lib/lua/oil/properties.lua +57 -0
- data/vendor/lua/lib/lua/oil/verbose.lua +133 -0
- data/vendor/lua/lib/lua/package_ext.lua +15 -0
- data/vendor/lua/lib/lua/parser.lua +268 -0
- data/vendor/lua/lib/lua/pl/Date.lua +555 -0
- data/vendor/lua/lib/lua/pl/List.lua +613 -0
- data/vendor/lua/lib/lua/pl/Map.lua +113 -0
- data/vendor/lua/lib/lua/pl/MultiMap.lua +62 -0
- data/vendor/lua/lib/lua/pl/OrderedMap.lua +151 -0
- data/vendor/lua/lib/lua/pl/Set.lua +153 -0
- data/vendor/lua/lib/lua/pl/app.lua +165 -0
- data/vendor/lua/lib/lua/pl/array2d.lua +501 -0
- data/vendor/lua/lib/lua/pl/class.lua +180 -0
- data/vendor/lua/lib/lua/pl/comprehension.lua +286 -0
- data/vendor/lua/lib/lua/pl/config.lua +176 -0
- data/vendor/lua/lib/lua/pl/data.lua +606 -0
- data/vendor/lua/lib/lua/pl/dir.lua +475 -0
- data/vendor/lua/lib/lua/pl/file.lua +70 -0
- data/vendor/lua/lib/lua/pl/func.lua +376 -0
- data/vendor/lua/lib/lua/pl/init.lua +68 -0
- data/vendor/lua/lib/lua/pl/input.lua +173 -0
- data/vendor/lua/lib/lua/pl/lapp.lua +407 -0
- data/vendor/lua/lib/lua/pl/lexer.lua +456 -0
- data/vendor/lua/lib/lua/pl/luabalanced.lua +264 -0
- data/vendor/lua/lib/lua/pl/operator.lua +201 -0
- data/vendor/lua/lib/lua/pl/path.lua +398 -0
- data/vendor/lua/lib/lua/pl/permute.lua +63 -0
- data/vendor/lua/lib/lua/pl/platf/luajava.lua +101 -0
- data/vendor/lua/lib/lua/pl/pretty.lua +285 -0
- data/vendor/lua/lib/lua/pl/seq.lua +551 -0
- data/vendor/lua/lib/lua/pl/sip.lua +344 -0
- data/vendor/lua/lib/lua/pl/strict.lua +70 -0
- data/vendor/lua/lib/lua/pl/stringio.lua +158 -0
- data/vendor/lua/lib/lua/pl/stringx.lua +440 -0
- data/vendor/lua/lib/lua/pl/tablex.lua +817 -0
- data/vendor/lua/lib/lua/pl/template.lua +103 -0
- data/vendor/lua/lib/lua/pl/test.lua +135 -0
- data/vendor/lua/lib/lua/pl/text.lua +243 -0
- data/vendor/lua/lib/lua/pl/utils.lua +550 -0
- data/vendor/lua/lib/lua/pl/xml.lua +689 -0
- data/vendor/lua/lib/lua/profiler.dll +0 -0
- data/vendor/lua/lib/lua/re.lua +248 -0
- data/vendor/lua/lib/lua/rex_onig.dll +0 -0
- data/vendor/lua/lib/lua/rex_pcre.dll +0 -0
- data/vendor/lua/lib/lua/rex_posix.dll +0 -0
- data/vendor/lua/lib/lua/rings.dll +0 -0
- data/vendor/lua/lib/lua/serialize.lua +193 -0
- data/vendor/lua/lib/lua/set.lua +149 -0
- data/vendor/lua/lib/lua/socket.lua +133 -0
- data/vendor/lua/lib/lua/socket/core.dll +0 -0
- data/vendor/lua/lib/lua/socket/ftp.lua +281 -0
- data/vendor/lua/lib/lua/socket/http.lua +350 -0
- data/vendor/lua/lib/lua/socket/smtp.lua +251 -0
- data/vendor/lua/lib/lua/socket/tp.lua +123 -0
- data/vendor/lua/lib/lua/socket/url.lua +297 -0
- data/vendor/lua/lib/lua/ssl.dll +0 -0
- data/vendor/lua/lib/lua/ssl.lua +93 -0
- data/vendor/lua/lib/lua/ssl/https.lua +138 -0
- data/vendor/lua/lib/lua/stable.lua +28 -0
- data/vendor/lua/lib/lua/std.lua +16 -0
- data/vendor/lua/lib/lua/strbuf.lua +32 -0
- data/vendor/lua/lib/lua/strict.lua +45 -0
- data/vendor/lua/lib/lua/string_ext.lua +274 -0
- data/vendor/lua/lib/lua/table_ext.lua +117 -0
- data/vendor/lua/lib/lua/tar.lua +262 -0
- data/vendor/lua/lib/lua/task.dll +0 -0
- data/vendor/lua/lib/lua/tree.lua +81 -0
- data/vendor/lua/lib/lua/unicode.dll +0 -0
- data/vendor/lua/lib/lua/verbose_require.lua +11 -0
- data/vendor/lua/lib/lua/vstruct.lua +86 -0
- data/vendor/lua/lib/lua/vstruct/ast.lua +192 -0
- data/vendor/lua/lib/lua/vstruct/ast/Bitpack.lua +33 -0
- data/vendor/lua/lib/lua/vstruct/ast/Generator.lua +174 -0
- data/vendor/lua/lib/lua/vstruct/ast/IO.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/ast/List.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/ast/Name.lua +20 -0
- data/vendor/lua/lib/lua/vstruct/ast/Repeat.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/ast/Root.lua +19 -0
- data/vendor/lua/lib/lua/vstruct/ast/Table.lua +65 -0
- data/vendor/lua/lib/lua/vstruct/cursor.lua +81 -0
- data/vendor/lua/lib/lua/vstruct/io.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/io/a.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/b.lua +28 -0
- data/vendor/lua/lib/lua/vstruct/io/bigendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/c.lua +25 -0
- data/vendor/lua/lib/lua/vstruct/io/defaults.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/endianness.lua +41 -0
- data/vendor/lua/lib/lua/vstruct/io/f.lua +129 -0
- data/vendor/lua/lib/lua/vstruct/io/hostendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/i.lua +42 -0
- data/vendor/lua/lib/lua/vstruct/io/littleendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/m.lua +62 -0
- data/vendor/lua/lib/lua/vstruct/io/p.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/io/s.lua +27 -0
- data/vendor/lua/lib/lua/vstruct/io/seekb.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekf.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekto.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/u.lua +54 -0
- data/vendor/lua/lib/lua/vstruct/io/x.lua +34 -0
- data/vendor/lua/lib/lua/vstruct/io/z.lua +63 -0
- data/vendor/lua/lib/lua/vstruct/lexer.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/pack.lua +142 -0
- data/vendor/lua/lib/lua/vstruct/test.lua +47 -0
- data/vendor/lua/lib/lua/vstruct/test/basic.lua +73 -0
- data/vendor/lua/lib/lua/vstruct/test/common.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-bigendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-littleendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/struct-test-gen.lua +1230 -0
- data/vendor/lua/lib/lua/vstruct/unpack.lua +126 -0
- data/vendor/lua/lib/lua/wx.dll +0 -0
- data/vendor/lua/lib/lua/xml.lua +75 -0
- data/vendor/lua/lib/lua/zip.dll +0 -0
- data/vendor/lua/lib/lua/zlib.dll +0 -0
- metadata +529 -0
Binary file
|
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
--[===================================================================[
|
3
|
+
TODO:
|
4
|
+
- add a nice header with license and stuff..
|
5
|
+
- detect plain text files
|
6
|
+
- proper testing
|
7
|
+
- improve implementation?
|
8
|
+
- check gzopen flags for consistency (ex: strategy flag)
|
9
|
+
--]===================================================================]
|
10
|
+
|
11
|
+
local io = require 'io'
|
12
|
+
local zlib = require 'zlib'
|
13
|
+
|
14
|
+
local error, assert, setmetatable, tostring = error, assert, setmetatable, tostring
|
15
|
+
|
16
|
+
module('gzip')
|
17
|
+
|
18
|
+
function open(filename, mode)
|
19
|
+
mode = mode or 'r'
|
20
|
+
local r = mode:find('r', 1, true) and true
|
21
|
+
local w = mode:find('w', 1, true) and true
|
22
|
+
local level = -1
|
23
|
+
|
24
|
+
local lstart, lend = mode:find('%d')
|
25
|
+
if (lstart and lend) then
|
26
|
+
level = mode:sub(lstart, lend)
|
27
|
+
end
|
28
|
+
|
29
|
+
if (not (r or w)) then
|
30
|
+
error('file open mode must specify read or write operation')
|
31
|
+
end
|
32
|
+
|
33
|
+
local f, z
|
34
|
+
|
35
|
+
local mt = {
|
36
|
+
__index = {
|
37
|
+
read = function(self, ...)
|
38
|
+
return z:read(...)
|
39
|
+
end,
|
40
|
+
write = function(self, ...)
|
41
|
+
return z:write(...)
|
42
|
+
end,
|
43
|
+
seek = function(self, ...)
|
44
|
+
error 'seek not supported on gzip files'
|
45
|
+
end,
|
46
|
+
lines = function(self, ...)
|
47
|
+
return z:lines(...)
|
48
|
+
end,
|
49
|
+
flush = function(self, ...)
|
50
|
+
return z:flush(...) and f:flush()
|
51
|
+
end,
|
52
|
+
close = function(self, ...)
|
53
|
+
return z:close() and f:close()
|
54
|
+
end,
|
55
|
+
},
|
56
|
+
__tostring = function(self)
|
57
|
+
return 'gzip object (' .. mode .. ') [' .. tostring(z) .. '] [' .. tostring(f) .. ']'
|
58
|
+
end,
|
59
|
+
}
|
60
|
+
|
61
|
+
if r then
|
62
|
+
f = assert(io.open(filename, 'rb'))
|
63
|
+
z = assert(zlib.inflate(f))
|
64
|
+
else
|
65
|
+
f = assert(io.open(filename, 'wb'))
|
66
|
+
z = assert(zlib.deflate(f, level, nil, 15 + 16))
|
67
|
+
end
|
68
|
+
|
69
|
+
return setmetatable({}, mt)
|
70
|
+
end
|
71
|
+
|
72
|
+
function lines(filename)
|
73
|
+
local gz = open(filename, 'r')
|
74
|
+
return function()
|
75
|
+
local line = gz and gz:read()
|
76
|
+
if line == nil then
|
77
|
+
gz:close()
|
78
|
+
end
|
79
|
+
return line
|
80
|
+
end
|
81
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,115 @@
|
|
1
|
+
--- Additions to the io module
|
2
|
+
module ("io", package.seeall)
|
3
|
+
|
4
|
+
require "base"
|
5
|
+
require "package_ext"
|
6
|
+
|
7
|
+
|
8
|
+
-- Get file handle metatable
|
9
|
+
local file_metatable = getmetatable (io.stdin)
|
10
|
+
|
11
|
+
|
12
|
+
-- Get an input file handle.
|
13
|
+
-- @param h file handle or name (default: <code>io.input ()</code>)
|
14
|
+
-- @return file handle, or nil on error
|
15
|
+
local function input_handle (h)
|
16
|
+
if h == nil then
|
17
|
+
h = input ()
|
18
|
+
elseif _G.type (h) == "string" then
|
19
|
+
h = io.open (h)
|
20
|
+
end
|
21
|
+
return h
|
22
|
+
end
|
23
|
+
|
24
|
+
--- Slurp a file handle.
|
25
|
+
-- @param h file handle or name (default: <code>io.input ()</code>)
|
26
|
+
-- @return contents of file or handle, or nil if error
|
27
|
+
function slurp (h)
|
28
|
+
h = input_handle (h)
|
29
|
+
if h then
|
30
|
+
local s = h:read ("*a")
|
31
|
+
h:close ()
|
32
|
+
return s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
--- Read a file or file handle into a list of lines.
|
37
|
+
-- @param h file handle or name (default: <code>io.input ()</code>);
|
38
|
+
-- if h is a handle, the file is closed after reading
|
39
|
+
-- @return list of lines
|
40
|
+
function readlines (h)
|
41
|
+
h = input_handle (h)
|
42
|
+
local l = {}
|
43
|
+
for line in h:lines () do
|
44
|
+
table.insert (l, line)
|
45
|
+
end
|
46
|
+
h:close ()
|
47
|
+
return l
|
48
|
+
end
|
49
|
+
file_metatable.readlines = readlines
|
50
|
+
|
51
|
+
--- Write values adding a newline after each.
|
52
|
+
-- @param h file handle (default: <code>io.output ()</code>
|
53
|
+
-- @param ... values to write (as for write)
|
54
|
+
function writelines (h, ...)
|
55
|
+
if io.type (h) ~= "file" then
|
56
|
+
io.write (h, "\n")
|
57
|
+
h = io.output ()
|
58
|
+
end
|
59
|
+
for v in ileaves ({...}) do
|
60
|
+
h:write (v, "\n")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
file_metatable.writelines = writelines
|
64
|
+
|
65
|
+
--- Split a directory path into components.
|
66
|
+
-- Empty components are retained: the root directory becomes <code>{"", ""}</code>.
|
67
|
+
-- @param path path
|
68
|
+
-- @return list of path components
|
69
|
+
function splitdir (path)
|
70
|
+
return string.split (path, package.dirsep)
|
71
|
+
end
|
72
|
+
|
73
|
+
--- Concatenate one or more directories and a filename into a path.
|
74
|
+
-- @param ... path components
|
75
|
+
-- @return path
|
76
|
+
function catfile (...)
|
77
|
+
return table.concat ({...}, package.dirsep)
|
78
|
+
end
|
79
|
+
|
80
|
+
--- Concatenate two or more directories into a path, removing the trailing slash.
|
81
|
+
-- @param ... path components
|
82
|
+
-- @return path
|
83
|
+
function catdir (...)
|
84
|
+
return (string.gsub (catfile (...), "^$", package.dirsep))
|
85
|
+
end
|
86
|
+
|
87
|
+
--- Perform a shell command and return its output.
|
88
|
+
-- @param c command
|
89
|
+
-- @return output, or nil if error
|
90
|
+
function shell (c)
|
91
|
+
return io.slurp (io.popen (c))
|
92
|
+
end
|
93
|
+
|
94
|
+
--- Process files specified on the command-line.
|
95
|
+
-- If no files given, process <code>io.stdin</code>; in list of files,
|
96
|
+
-- <code>-</code> means <code>io.stdin</code>.
|
97
|
+
-- <br>FIXME: Make the file list an argument to the function.
|
98
|
+
-- @param f function to process files with, which is passed
|
99
|
+
-- <code>(name, arg_no)</code>
|
100
|
+
function processFiles (f)
|
101
|
+
-- N.B. "arg" below refers to the global array of command-line args
|
102
|
+
if #arg == 0 then
|
103
|
+
table.insert (arg, "-")
|
104
|
+
end
|
105
|
+
for i, v in ipairs (arg) do
|
106
|
+
if v == "-" then
|
107
|
+
io.input (io.stdin)
|
108
|
+
else
|
109
|
+
io.input (v)
|
110
|
+
end
|
111
|
+
prog.file = v
|
112
|
+
f (v, i)
|
113
|
+
end
|
114
|
+
prog.file = nil
|
115
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,302 @@
|
|
1
|
+
--
|
2
|
+
-- KEEPER.LUA
|
3
|
+
--
|
4
|
+
-- Keeper state logic
|
5
|
+
--
|
6
|
+
-- This code is read in for each "keeper state", which are the hidden, inter-
|
7
|
+
-- mediate data stores used by Lanes inter-state communication objects.
|
8
|
+
--
|
9
|
+
-- Author: Asko Kauppi <akauppi@gmail.com>
|
10
|
+
--
|
11
|
+
--[[
|
12
|
+
===============================================================================
|
13
|
+
|
14
|
+
Copyright (C) 2008-10 Asko Kauppi <akauppi@gmail.com>
|
15
|
+
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
18
|
+
in the Software without restriction, including without limitation the rights
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
21
|
+
furnished to do so, subject to the following conditions:
|
22
|
+
|
23
|
+
The above copyright notice and this permission notice shall be included in
|
24
|
+
all copies or substantial portions of the Software.
|
25
|
+
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
32
|
+
THE SOFTWARE.
|
33
|
+
|
34
|
+
===============================================================================
|
35
|
+
]]--
|
36
|
+
|
37
|
+
-- We only need to have base and table libraries (and io for debugging)
|
38
|
+
--
|
39
|
+
local table_concat = assert( table.concat)
|
40
|
+
local table_insert = assert( table.insert)
|
41
|
+
local table_remove = assert( table.remove)
|
42
|
+
local select, unpack = assert( select), assert( unpack)
|
43
|
+
|
44
|
+
--[[
|
45
|
+
local function WR(...)
|
46
|
+
if io then
|
47
|
+
io.stderr:write( table_concat({...},'\t').."\n" )
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
local function DEBUG(title,ud,key)
|
52
|
+
assert( title and ud and key )
|
53
|
+
|
54
|
+
local data,_= tables(ud)
|
55
|
+
|
56
|
+
local s= tostring(data[key])
|
57
|
+
for _,v in ipairs( data[key] or {} ) do
|
58
|
+
s= s..", "..tostring(v)
|
59
|
+
end
|
60
|
+
WR( "*** "..title.." ("..tostring(key).."): ", s )
|
61
|
+
end
|
62
|
+
--]]
|
63
|
+
|
64
|
+
-----
|
65
|
+
-- FIFO for a key
|
66
|
+
--
|
67
|
+
|
68
|
+
local fifo_new = function()
|
69
|
+
return { first = 1, count = 0}
|
70
|
+
end
|
71
|
+
|
72
|
+
local fifo_push = function( fifo, ...)
|
73
|
+
local first, count, added = fifo.first, fifo.count, select( '#', ...)
|
74
|
+
local start = first + count - 1
|
75
|
+
for i = 1, added do
|
76
|
+
fifo[start + i] = select( i, ...)
|
77
|
+
end
|
78
|
+
fifo.count = count + added
|
79
|
+
end
|
80
|
+
|
81
|
+
local fifo_peek = function( fifo, count)
|
82
|
+
if count <= fifo.count then
|
83
|
+
local first = fifo.first
|
84
|
+
local last = first + count - 1
|
85
|
+
return unpack( fifo, first, last)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
local fifo_pop = function( fifo, count)
|
90
|
+
local first = fifo.first
|
91
|
+
local last = first + count - 1
|
92
|
+
local out = { unpack( fifo, first, last)}
|
93
|
+
for i = first, last do
|
94
|
+
fifo[i] = nil
|
95
|
+
end
|
96
|
+
fifo.first = first + count
|
97
|
+
fifo.count = fifo.count - count
|
98
|
+
return unpack( out)
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
-----
|
103
|
+
-- Actual data store
|
104
|
+
--
|
105
|
+
-- { [linda_deep_ud]= { key= { val [, ... ] } [, ...] }
|
106
|
+
-- ...
|
107
|
+
-- }
|
108
|
+
--
|
109
|
+
local _data= {}
|
110
|
+
|
111
|
+
-----
|
112
|
+
-- Length limits (if any) for queues
|
113
|
+
--
|
114
|
+
-- 0: don't queue values at all; ':send()' waits if the slot is not vacant
|
115
|
+
-- N: allow N values to be queued (slot itself + N-1); wait if full
|
116
|
+
-- nil: no limits, '_data' may grow endlessly
|
117
|
+
--
|
118
|
+
local _limits= {}
|
119
|
+
|
120
|
+
-----
|
121
|
+
-- data_tbl, limits_tbl = tables( linda_deep_ud )
|
122
|
+
--
|
123
|
+
-- Gives appropriate tables for a certain Linda (creates them if needed)
|
124
|
+
--
|
125
|
+
local function tables( ud )
|
126
|
+
-- tables are created either all or nothing
|
127
|
+
--
|
128
|
+
if not _data[ud] then
|
129
|
+
_data[ud]= {}
|
130
|
+
_limits[ud]= {}
|
131
|
+
end
|
132
|
+
return _data[ud], _limits[ud]
|
133
|
+
end
|
134
|
+
|
135
|
+
-----
|
136
|
+
-- bool= send( linda_deep_ud, key, ...)
|
137
|
+
--
|
138
|
+
-- Send new data (1..N) to 'key' slot. This send is atomic; all the values
|
139
|
+
-- end up one after each other (this is why having possibility for sending
|
140
|
+
-- multiple values in one call is deemed important).
|
141
|
+
--
|
142
|
+
-- If the queue has a limit, values are sent only if all of them fit in.
|
143
|
+
--
|
144
|
+
-- Returns: 'true' if all the values were placed
|
145
|
+
-- 'false' if sending would exceed the queue limit (wait & retry)
|
146
|
+
--
|
147
|
+
function send( ud, key, ...)
|
148
|
+
|
149
|
+
local data, limits = tables( ud)
|
150
|
+
|
151
|
+
local n = select( '#', ...)
|
152
|
+
|
153
|
+
-- Initialize queue for all keys that have been used with ':send()'
|
154
|
+
--
|
155
|
+
if data[key] == nil then
|
156
|
+
data[key] = fifo_new()
|
157
|
+
end
|
158
|
+
local fifo = data[key]
|
159
|
+
|
160
|
+
local len = fifo.count
|
161
|
+
local m = limits[key]
|
162
|
+
|
163
|
+
if m and len+n > m then
|
164
|
+
return false -- would exceed the limit; try again later
|
165
|
+
end
|
166
|
+
|
167
|
+
fifo_push( fifo, ...)
|
168
|
+
return true
|
169
|
+
end
|
170
|
+
|
171
|
+
|
172
|
+
-----
|
173
|
+
-- [val, key]= receive( linda_deep_ud, key [, ...] )
|
174
|
+
--
|
175
|
+
-- Read any of the given keys, consuming the data found. Keys are read in
|
176
|
+
-- order.
|
177
|
+
--
|
178
|
+
function receive( ud, ...)
|
179
|
+
|
180
|
+
local data = tables( ud)
|
181
|
+
|
182
|
+
for i = 1, select( '#', ...) do
|
183
|
+
local key = select( i, ...)
|
184
|
+
local fifo = data[key]
|
185
|
+
if fifo and fifo.count > 0 then
|
186
|
+
local val = fifo_pop( fifo, 1)
|
187
|
+
if val ~= nil then
|
188
|
+
return val, key
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
|
195
|
+
-----
|
196
|
+
-- [val1, ... valCOUNT]= receive_batched( linda_deep_ud, key , min_COUNT, max_COUNT)
|
197
|
+
--
|
198
|
+
-- Read a single key, consuming the data found.
|
199
|
+
--
|
200
|
+
receive_batched = function( ud, key, min_count, max_count)
|
201
|
+
if min_count > 0 then
|
202
|
+
local fifo = tables( ud)[key]
|
203
|
+
if fifo then
|
204
|
+
local fifo_count = fifo.count
|
205
|
+
if fifo_count >= min_count then
|
206
|
+
max_count = max_count or min_count
|
207
|
+
max_count = (max_count > fifo_count) and fifo_count or max_count
|
208
|
+
return fifo_pop( fifo, max_count)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
|
215
|
+
-----
|
216
|
+
-- = limit( linda_deep_ud, key, uint )
|
217
|
+
--
|
218
|
+
function limit( ud, key, n)
|
219
|
+
|
220
|
+
local _, limits = tables( ud)
|
221
|
+
|
222
|
+
limits[key] = n
|
223
|
+
end
|
224
|
+
|
225
|
+
|
226
|
+
-----
|
227
|
+
-- void= set( linda_deep_ud, key, [val] )
|
228
|
+
--
|
229
|
+
function set( ud, key, val)
|
230
|
+
|
231
|
+
local data, _ = tables( ud)
|
232
|
+
|
233
|
+
-- Setting a key to 'nil' really clears it; only queing uses sentinels.
|
234
|
+
--
|
235
|
+
if val ~= nil then
|
236
|
+
local fifo = fifo_new()
|
237
|
+
fifo_push( fifo, val)
|
238
|
+
data[key] = fifo
|
239
|
+
else
|
240
|
+
data[key] = nil
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
|
245
|
+
-----
|
246
|
+
-- [val]= get( linda_deep_ud, key )
|
247
|
+
--
|
248
|
+
function get( ud, key)
|
249
|
+
local data, _ = tables( ud)
|
250
|
+
local fifo = data[key]
|
251
|
+
return fifo and fifo_peek( fifo, 1)
|
252
|
+
end
|
253
|
+
|
254
|
+
|
255
|
+
-----
|
256
|
+
-- [val]= count( linda_deep_ud, ...)
|
257
|
+
--
|
258
|
+
-- 3 modes of operation
|
259
|
+
-- linda:count() -> returns a table of key/count pairs
|
260
|
+
-- linda:count(key) returns the number of items waiting in the key
|
261
|
+
-- linda:count(key,...) -> returns a table telling, for each key, the number of items
|
262
|
+
function count( ud, ...)
|
263
|
+
local data, _ = tables( ud)
|
264
|
+
local n = select( '#', ...)
|
265
|
+
if n == 0 then
|
266
|
+
local out
|
267
|
+
for key, _ in pairs( data) do
|
268
|
+
local fifo = data[key]
|
269
|
+
local count = fifo and fifo.count or 0
|
270
|
+
out = out or {}
|
271
|
+
out[key] = count
|
272
|
+
found = true
|
273
|
+
end
|
274
|
+
return out
|
275
|
+
elseif n == 1 then
|
276
|
+
local key = ...
|
277
|
+
local fifo = data[key]
|
278
|
+
return fifo and fifo.count or nil
|
279
|
+
else -- more than 1 key
|
280
|
+
local out
|
281
|
+
for i = 1, n do
|
282
|
+
local key = select( i, ...)
|
283
|
+
local fifo = data[key]
|
284
|
+
local count = fifo and fifo.count or nil
|
285
|
+
out = out or {}
|
286
|
+
out[key] = count
|
287
|
+
end
|
288
|
+
return out
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
|
293
|
+
-----
|
294
|
+
-- void= clear( linda_deep_ud)
|
295
|
+
--
|
296
|
+
-- Clear the data structures used for a Linda (at its destructor)
|
297
|
+
--
|
298
|
+
function clear( ud)
|
299
|
+
|
300
|
+
_data[ud]= nil
|
301
|
+
_limits[ud]= nil
|
302
|
+
end
|