Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Schneider <oliver@assarbad.net>2018-10-08 23:48:52 +0300
committerOliver Schneider <oliver@assarbad.net>2018-10-08 23:48:52 +0300
commit3008e91efac446fc21d607485cb787c457401a8b (patch)
tree1bba3159c29b56fa63a1fe3e5d5720b9e4ddfab3 /3rdparty/embedded-lua
parentf045e0d70bc3c17933ce61302f3e0bfb30c2ec2f (diff)
Using EOL extension now, including a .hgeol file to make certain line ending specifications explicit
Added missing test case for lua-winreg A number of warnings addressed Adding some helpers to deal with user privileges Some improvements regarding the inclusion of a basic set of Lua scripts in the resource section New version of setvcvars.cmd
Diffstat (limited to '3rdparty/embedded-lua')
-rw-r--r--3rdparty/embedded-lua/globals.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/3rdparty/embedded-lua/globals.lua b/3rdparty/embedded-lua/globals.lua
new file mode 100644
index 0000000..ec8e367
--- /dev/null
+++ b/3rdparty/embedded-lua/globals.lua
@@ -0,0 +1,30 @@
+-- Portions Copyright (c) 2002-2009 Jason Perkins and the Premake project
+
+_G.iif = function(expr, trueval, falseval)
+ if (expr) then
+ return trueval
+ else
+ return falseval
+ end
+end
+
+_G.printf = function(msg, ...)
+ _G.print(string.format(msg, unpack(arg)))
+end
+
+_G.dbgprintf = function(msg, ...)
+ os.dbgprint(string.format(msg, unpack(arg)))
+end
+
+-- An extension to type() to identify project object types by reading the
+-- "__type" field from the metatable.
+local builtin_type = _G.type
+_G.type = function(t)
+ local mt = getmetatable(t)
+ if (mt) then
+ if (mt.__type) then
+ return mt.__type
+ end
+ end
+ return builtin_type(t)
+end