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
@@ -0,0 +1,117 @@
|
|
1
|
+
-- Extensions to the table module
|
2
|
+
module ("table", package.seeall)
|
3
|
+
|
4
|
+
--require "list" FIXME: allow require loops
|
5
|
+
|
6
|
+
|
7
|
+
local _sort = sort
|
8
|
+
--- Make table.sort return its result.
|
9
|
+
-- @param t table
|
10
|
+
-- @param c comparator function
|
11
|
+
-- @return sorted table
|
12
|
+
function sort (t, c)
|
13
|
+
_sort (t, c)
|
14
|
+
return t
|
15
|
+
end
|
16
|
+
|
17
|
+
--- Return whether table is empty.
|
18
|
+
-- @param t table
|
19
|
+
-- @return <code>true</code> if empty or <code>false</code> otherwise
|
20
|
+
function empty (t)
|
21
|
+
return not next (t)
|
22
|
+
end
|
23
|
+
|
24
|
+
--- Find the number of elements in a table.
|
25
|
+
-- @param t table
|
26
|
+
-- @return number of elements in t
|
27
|
+
function size (t)
|
28
|
+
local n = 0
|
29
|
+
for _ in pairs (t) do
|
30
|
+
n = n + 1
|
31
|
+
end
|
32
|
+
return n
|
33
|
+
end
|
34
|
+
|
35
|
+
--- Make the list of keys of a table.
|
36
|
+
-- @param t table
|
37
|
+
-- @return list of keys
|
38
|
+
function keys (t)
|
39
|
+
local u = {}
|
40
|
+
for i, v in pairs (t) do
|
41
|
+
insert (u, i)
|
42
|
+
end
|
43
|
+
return u
|
44
|
+
end
|
45
|
+
|
46
|
+
--- Make the list of values of a table.
|
47
|
+
-- @param t table
|
48
|
+
-- @return list of values
|
49
|
+
function values (t)
|
50
|
+
local u = {}
|
51
|
+
for i, v in pairs (t) do
|
52
|
+
insert (u, v)
|
53
|
+
end
|
54
|
+
return u
|
55
|
+
end
|
56
|
+
|
57
|
+
--- Invert a table.
|
58
|
+
-- @param t table <code>{i=v, ...}</code>
|
59
|
+
-- @return inverted table <code>{v=i, ...}</code>
|
60
|
+
function invert (t)
|
61
|
+
local u = {}
|
62
|
+
for i, v in pairs (t) do
|
63
|
+
u[v] = i
|
64
|
+
end
|
65
|
+
return u
|
66
|
+
end
|
67
|
+
|
68
|
+
--- Make a shallow copy of a table, including any metatable (for a
|
69
|
+
-- deep copy, use tree.clone).
|
70
|
+
-- @param t table
|
71
|
+
-- @param nometa if non-nil don't copy metatable
|
72
|
+
-- @return copy of table
|
73
|
+
function clone (t, nometa)
|
74
|
+
local u = {}
|
75
|
+
if not nometa then
|
76
|
+
setmetatable (u, getmetatable (t))
|
77
|
+
end
|
78
|
+
for i, v in pairs (t) do
|
79
|
+
u[i] = v
|
80
|
+
end
|
81
|
+
return u
|
82
|
+
end
|
83
|
+
|
84
|
+
--- Clone a table, renaming some keys.
|
85
|
+
-- @param map table <code>{old_key=new_key, ...}</code>
|
86
|
+
-- @param t table to copy
|
87
|
+
-- @return copy of table
|
88
|
+
function clone_rename (map, t)
|
89
|
+
local r = clone (t)
|
90
|
+
for i, v in pairs (map) do
|
91
|
+
r[v] = t[i]
|
92
|
+
r[i] = nil
|
93
|
+
end
|
94
|
+
return r
|
95
|
+
end
|
96
|
+
|
97
|
+
--- Merge one table into another. <code>u</code> is merged into <code>t</code>.
|
98
|
+
-- @param t first table
|
99
|
+
-- @param u second table
|
100
|
+
-- @return first table
|
101
|
+
function merge (t, u)
|
102
|
+
for i, v in pairs (u) do
|
103
|
+
t[i] = v
|
104
|
+
end
|
105
|
+
return t
|
106
|
+
end
|
107
|
+
|
108
|
+
--- Make a table with a default value for unset keys.
|
109
|
+
-- @param x default entry value (default: <code>nil</code>)
|
110
|
+
-- @param t initial table (default: <code>{}</code>)
|
111
|
+
-- @return table whose unset elements are x
|
112
|
+
function new (x, t)
|
113
|
+
return setmetatable (t or {},
|
114
|
+
{__index = function (t, i)
|
115
|
+
return x
|
116
|
+
end})
|
117
|
+
end
|
@@ -0,0 +1,262 @@
|
|
1
|
+
-----------------------------------------------------------------------------
|
2
|
+
-- tar - Lua Tape ARchive module
|
3
|
+
--
|
4
|
+
-- Code for managing tar files
|
5
|
+
--
|
6
|
+
-- Version 0.1 (21 AUG 2007)
|
7
|
+
--
|
8
|
+
-- Author: Judge Maygarden (jmaygarden@computer.org)
|
9
|
+
--
|
10
|
+
-- Copyright (c) 2007 Judge Maygarden
|
11
|
+
-----------------------------------------------------------------------------
|
12
|
+
|
13
|
+
local public = {}
|
14
|
+
local private = {}
|
15
|
+
local TarFile = {}
|
16
|
+
local TarInternalFile = {}
|
17
|
+
tar = public
|
18
|
+
TarFile.__index = TarFile
|
19
|
+
TarInternalFile.__index = TarInternalFile
|
20
|
+
|
21
|
+
-----------------------------------------------------------------------------
|
22
|
+
-- Closes file
|
23
|
+
-----------------------------------------------------------------------------
|
24
|
+
function TarInternalFile:close()
|
25
|
+
end
|
26
|
+
|
27
|
+
-----------------------------------------------------------------------------
|
28
|
+
-- UNSUPPORTED: Saves any written data to file
|
29
|
+
-----------------------------------------------------------------------------
|
30
|
+
function TarInternalFile:flush()
|
31
|
+
error('Tar file output flushing is unsupported.')
|
32
|
+
end
|
33
|
+
|
34
|
+
-----------------------------------------------------------------------------
|
35
|
+
-- Returns an iterator function that returns a new line from the file
|
36
|
+
-- @return String repressenting a line from the file without the newline
|
37
|
+
-----------------------------------------------------------------------------
|
38
|
+
function TarInternalFile:lines()
|
39
|
+
return function(s, var)
|
40
|
+
return self:read("*l")
|
41
|
+
end, self, nil
|
42
|
+
end
|
43
|
+
|
44
|
+
-----------------------------------------------------------------------------
|
45
|
+
-- Reads the file according to the given formats as follows:
|
46
|
+
-- "*n": reads a number
|
47
|
+
-- "*a": reads the whole file
|
48
|
+
-- "*l" reads the next line
|
49
|
+
-- number: reads a string with up to this number of characters
|
50
|
+
-- @param variadic list of formats (default "*l")
|
51
|
+
-- @return list of strings (or numbers) or nil if end of file or format error
|
52
|
+
-----------------------------------------------------------------------------
|
53
|
+
function TarInternalFile:read(...)
|
54
|
+
local eof = self.offset + self.size
|
55
|
+
if self.pointer >= eof then return nil end -- eof
|
56
|
+
local t = {}
|
57
|
+
self.archive.file:seek("set", self.pointer)
|
58
|
+
for i, v in ipairs{...} do
|
59
|
+
local s
|
60
|
+
if "*a" == v then
|
61
|
+
s = self.archive.file:read(eof - self.pointer)
|
62
|
+
elseif "*l" == v or "*n" == v or "number" == type(v) then
|
63
|
+
s = self.archive.file:read(v)
|
64
|
+
else
|
65
|
+
error('bad argument %d to %s (%s)', i
|
66
|
+
'TarInternalFile:read', 'invalid format')
|
67
|
+
return nil
|
68
|
+
end
|
69
|
+
local last = self.pointer
|
70
|
+
self.pointer = self.archive.file:seek()
|
71
|
+
if s and self.pointer < eof then
|
72
|
+
table.insert(t, s)
|
73
|
+
elseif s then
|
74
|
+
table.insert(t, string.sub(s, 1, eof - last - 1))
|
75
|
+
self.pointer = self.offset + self.size
|
76
|
+
break
|
77
|
+
else
|
78
|
+
break
|
79
|
+
end
|
80
|
+
end
|
81
|
+
return unpack(t)
|
82
|
+
end
|
83
|
+
|
84
|
+
-----------------------------------------------------------------------------
|
85
|
+
-- Sets and gets the file position measured from the given base as follows:
|
86
|
+
-- "set": base is position 0 (beginning of the file)
|
87
|
+
-- "cur": base is current position
|
88
|
+
-- "end": base is end of file
|
89
|
+
-- @param base position (default "cur")
|
90
|
+
-- @param offset in bytes (default 0)
|
91
|
+
-- @return final position
|
92
|
+
-----------------------------------------------------------------------------
|
93
|
+
function TarInternalFile:seek(whence, offset)
|
94
|
+
local whence = whence or "cur"
|
95
|
+
local offset = offset or 0
|
96
|
+
local eof = self.offset + self.size
|
97
|
+
local final
|
98
|
+
local err
|
99
|
+
|
100
|
+
if "cur" == whence then
|
101
|
+
final, err = self.archive.file:seek("set",
|
102
|
+
offset + self.pointer) - self.offset
|
103
|
+
|
104
|
+
elseif "set" == whence then
|
105
|
+
final, err = self.archive.file:seek("set",
|
106
|
+
offset + self.offset) - self.offset
|
107
|
+
|
108
|
+
elseif "end" == whence then
|
109
|
+
final, err = self.archive.file:seek("set",
|
110
|
+
offset + eof - 1) - self.offset
|
111
|
+
|
112
|
+
else
|
113
|
+
final, err = self.archive.file:seek(whence, offset)
|
114
|
+
end
|
115
|
+
|
116
|
+
if not final then
|
117
|
+
return nil, err
|
118
|
+
elseif final < 0 then
|
119
|
+
final = 0
|
120
|
+
elseif final > self.size then
|
121
|
+
final = self.size
|
122
|
+
end
|
123
|
+
self.pointer = final + self.offset
|
124
|
+
|
125
|
+
return final
|
126
|
+
end
|
127
|
+
|
128
|
+
-----------------------------------------------------------------------------
|
129
|
+
-- UNSUPPORTED: Sets the buffering mode for an output file
|
130
|
+
-- @param "no" - no buffering, "full" - full buffering, "line" - line buffering
|
131
|
+
-- @param size of the buffer for "full" and "line" modes
|
132
|
+
-----------------------------------------------------------------------------
|
133
|
+
function TarInternalFile:setvbuf(mode, size)
|
134
|
+
error('Tar file output buffering is unsupported.')
|
135
|
+
end
|
136
|
+
|
137
|
+
-----------------------------------------------------------------------------
|
138
|
+
-- UNSUPPORTED: Writes the value of each of its arguments to the file
|
139
|
+
-- @param string or numbers values only
|
140
|
+
-----------------------------------------------------------------------------
|
141
|
+
function TarInternalFile:write(...)
|
142
|
+
error('Tar file writes are unsupported.')
|
143
|
+
end
|
144
|
+
|
145
|
+
-----------------------------------------------------------------------------
|
146
|
+
-- Opens a file inside the tar file archive
|
147
|
+
-- @param pathname of a file inside the tar file
|
148
|
+
-- @return file handle or nil if the file is not found
|
149
|
+
-----------------------------------------------------------------------------
|
150
|
+
function TarFile:open(filename)
|
151
|
+
if not self.list[filename] then return nil end
|
152
|
+
local file = {}
|
153
|
+
file.archive = self
|
154
|
+
file.filename = filename
|
155
|
+
file.offset = self.list[filename].offset
|
156
|
+
file.pointer = file.offset
|
157
|
+
file.size = self.list[filename].size
|
158
|
+
setmetatable(file, TarInternalFile)
|
159
|
+
return file
|
160
|
+
end
|
161
|
+
|
162
|
+
-----------------------------------------------------------------------------
|
163
|
+
-- Returns an iterator over all files in the tar archive
|
164
|
+
-- @return interator function, tar file handle
|
165
|
+
-----------------------------------------------------------------------------
|
166
|
+
function TarFile:files()
|
167
|
+
return next, self.list, nil
|
168
|
+
end
|
169
|
+
|
170
|
+
-----------------------------------------------------------------------------
|
171
|
+
-- Data for parsing tar header fields
|
172
|
+
-----------------------------------------------------------------------------
|
173
|
+
private.HEADER_DATA = {
|
174
|
+
-- { field, offset, size, octal }
|
175
|
+
{ "name", 0, 100 },
|
176
|
+
{ "mode", 100, 8, true },
|
177
|
+
{ "uid", 108, 8, true },
|
178
|
+
{ "gid", 116, 8, true },
|
179
|
+
{ "size", 124, 12, true },
|
180
|
+
{ "mtime", 136, 12, true },
|
181
|
+
{ "chksum", 148, 8, true },
|
182
|
+
{ "typeflag", 156, 1, true },
|
183
|
+
{ "linkname", 157, 100 },
|
184
|
+
{ "magic", 257, 6 },
|
185
|
+
{ "version", 263, 2 },
|
186
|
+
{ "uname", 265, 32 },
|
187
|
+
{ "gname", 297, 32 },
|
188
|
+
{ "devmajor", 329, 8, true },
|
189
|
+
{ "devminor", 337, 8, true },
|
190
|
+
{ "prefix", 345, 155 },
|
191
|
+
}
|
192
|
+
|
193
|
+
-----------------------------------------------------------------------------
|
194
|
+
-- Converts an octal string into a number
|
195
|
+
-- @param string of octal digits
|
196
|
+
-- @return number or nil if an invalid string was passed
|
197
|
+
-----------------------------------------------------------------------------
|
198
|
+
private.octal = function(s)
|
199
|
+
if string.match(s, "[^0-7]") then return nil end
|
200
|
+
local n, m = 0, 0
|
201
|
+
for i = string.len(s), 1, -1 do
|
202
|
+
n = n + (string.byte(s, i) - 48) * 8 ^ m
|
203
|
+
m = m + 1
|
204
|
+
end
|
205
|
+
return n
|
206
|
+
end
|
207
|
+
|
208
|
+
-----------------------------------------------------------------------------
|
209
|
+
-- Decodes a tar file header
|
210
|
+
-- @param 512-byte string containing a tar file header block
|
211
|
+
-- @return table containg the header fields
|
212
|
+
-----------------------------------------------------------------------------
|
213
|
+
private.decode = function(header)
|
214
|
+
local t = {}
|
215
|
+
for _, field in ipairs(private.HEADER_DATA) do
|
216
|
+
local s = string.sub(header, field[2] + 1, field[2] + field[3])
|
217
|
+
local s = string.match(s, "[^%z]*")
|
218
|
+
if field[4] then
|
219
|
+
t[field[1]] = private.octal(s)
|
220
|
+
else
|
221
|
+
t[field[1]] = s
|
222
|
+
end
|
223
|
+
end
|
224
|
+
if 0 < string.len(t.prefix) then
|
225
|
+
t.pathname = t.prefix..'/'..t.name
|
226
|
+
else
|
227
|
+
t.pathname = t.name
|
228
|
+
end
|
229
|
+
return t
|
230
|
+
end
|
231
|
+
|
232
|
+
-----------------------------------------------------------------------------
|
233
|
+
-- Opens a tar archive by attaching to the provided Lua file handle.
|
234
|
+
-- Ownership of the file handle is transferred to the returned table and
|
235
|
+
-- should no longer be referenced by the user.
|
236
|
+
-- @param open file handle
|
237
|
+
-- @return tar file handle
|
238
|
+
-----------------------------------------------------------------------------
|
239
|
+
public.open = function(file)
|
240
|
+
assert(file, 'invalid file handle')
|
241
|
+
local archive = {}
|
242
|
+
archive.file = file
|
243
|
+
archive.list = {}
|
244
|
+
local p = file:seek("set")
|
245
|
+
while true do
|
246
|
+
local block = file:read(512)
|
247
|
+
if not block or not string.match(block, "[^%z]") then break end
|
248
|
+
local header = private.decode(block)
|
249
|
+
if 0 == header.typeflag then
|
250
|
+
archive.list[header.pathname] = {
|
251
|
+
["offset"] = file:seek(),
|
252
|
+
["size"] = header.size
|
253
|
+
}
|
254
|
+
end
|
255
|
+
local p = file:seek("cur", 512 * math.ceil(header.size / 512))
|
256
|
+
end
|
257
|
+
setmetatable(archive, TarFile)
|
258
|
+
return archive
|
259
|
+
end
|
260
|
+
|
261
|
+
return tar
|
262
|
+
|
Binary file
|
@@ -0,0 +1,81 @@
|
|
1
|
+
--- Tables as trees.
|
2
|
+
module ("tree", package.seeall)
|
3
|
+
|
4
|
+
require "list"
|
5
|
+
|
6
|
+
|
7
|
+
local metatable = {}
|
8
|
+
--- Make a table into a tree
|
9
|
+
-- @param t table
|
10
|
+
-- @return tree
|
11
|
+
function new (t)
|
12
|
+
return setmetatable (t or {}, metatable)
|
13
|
+
end
|
14
|
+
|
15
|
+
--- Tree <code>__index</code> metamethod.
|
16
|
+
-- @param tr tree
|
17
|
+
-- @param i non-table, or list of keys <code>{i<sub>1</sub> ...
|
18
|
+
-- i<sub>n</sub>}</code>
|
19
|
+
-- @return <code>tr[i]...[i<sub>n</sub>]</code> if i is a table, or
|
20
|
+
-- <code>tr[i]</code> otherwise
|
21
|
+
function metatable.__index (tr, i)
|
22
|
+
-- FIXME: the following doesn't treat list keys correctly
|
23
|
+
-- e.g. tr[{{1, 2}, {3, 4}}], maybe flatten first?
|
24
|
+
if type (i) == "table" and #i > 0 then
|
25
|
+
return list.foldl (op["[]"], tr, i)
|
26
|
+
else
|
27
|
+
return rawget (tr, i)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
--- Tree <code>__newindex</code> metamethod.
|
32
|
+
-- Sets <code>tr[i<sub>1</sub>]...[i<sub>n</sub>] = v</code> if i is a
|
33
|
+
-- table, or <code>tr[i] = v</code> otherwise
|
34
|
+
-- @param tr tree
|
35
|
+
-- @param i non-table, or list of keys <code>{i<sub>1</sub> ...
|
36
|
+
-- i<sub>n</sub>}</code>
|
37
|
+
-- @param v value
|
38
|
+
function metatable.__newindex (tr, i, v)
|
39
|
+
if type (i) == "table" then
|
40
|
+
for n = 1, #i - 1 do
|
41
|
+
if getmetatable (tr[i[n]]) ~= metatable then
|
42
|
+
rawset (tr, i[n], tree.new ())
|
43
|
+
end
|
44
|
+
tr = tr[i[n]]
|
45
|
+
end
|
46
|
+
rawset (tr, i[#i], v)
|
47
|
+
else
|
48
|
+
rawset (tr, i, v)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
--- Make a deep copy of a tree, including any metatables
|
53
|
+
-- @param t table
|
54
|
+
-- @param nometa if non-nil don't copy metatables
|
55
|
+
-- @return copy of table
|
56
|
+
function clone (t, nometa)
|
57
|
+
local r = {}
|
58
|
+
if not nometa then
|
59
|
+
setmetatable (r, getmetatable (t))
|
60
|
+
end
|
61
|
+
local d = {[t] = r}
|
62
|
+
local function copy (o, x)
|
63
|
+
for i, v in pairs (x) do
|
64
|
+
if type (v) == "table" then
|
65
|
+
if not d[v] then
|
66
|
+
d[v] = {}
|
67
|
+
if not nometa then
|
68
|
+
setmetatable (d[v], getmetatable (v))
|
69
|
+
end
|
70
|
+
o[i] = copy (d[v], v)
|
71
|
+
else
|
72
|
+
o[i] = d[v]
|
73
|
+
end
|
74
|
+
else
|
75
|
+
o[i] = v
|
76
|
+
end
|
77
|
+
end
|
78
|
+
return o
|
79
|
+
end
|
80
|
+
return copy (r, t)
|
81
|
+
end
|