public final class OsLib extends Object
os.| Modifier and Type | Method and Description |
|---|---|
static org.classdump.luna.runtime.LuaFunction |
clock(RuntimeEnvironment runtimeEnvironment)
Returns a function
os.clock that uses the runtime environment
runtimeEnvironment. |
static org.classdump.luna.runtime.LuaFunction |
getenv(RuntimeEnvironment runtimeEnvironment)
Returns a function
os.getenv that uses the runtime environment
runtimeEnvironment. |
static void |
installInto(org.classdump.luna.StateContext context,
org.classdump.luna.Table env,
RuntimeEnvironment runtimeEnvironment)
Installs the coroutine library to the global environment
env in the state
context context. |
public static org.classdump.luna.runtime.LuaFunction clock(RuntimeEnvironment runtimeEnvironment)
os.clock that uses the runtime environment
runtimeEnvironment.
The following is the corresponding entry from the Lua Reference Manual:
os.clock ()Returns an approximation of the amount in seconds of CPU time used by the program.
runtimeEnvironment - the runtime environment, must not be nullos.clock functionNullPointerException - if runtimeEnvironment is nullos.clockpublic static org.classdump.luna.runtime.LuaFunction getenv(RuntimeEnvironment runtimeEnvironment)
os.getenv that uses the runtime environment
runtimeEnvironment.
The following is the corresponding entry from the Lua Reference Manual:
os.getenv (varname)Returns the value of the process environment variable
varname, or nil if the variable is not defined.
runtimeEnvironment - the runtime environment, must not be nullos.getenv functionNullPointerException - if runtimeEnvironment is nullos.getenvpublic static void installInto(org.classdump.luna.StateContext context,
org.classdump.luna.Table env,
RuntimeEnvironment runtimeEnvironment)
env in the state
context context. The library will use the runtime environment
runtimeEnvironment.
If runtimeEnvironment is null, then no functions will be installed
by this method (i.e., the global table os will be empty).
If env.package.loaded is a table, adds the library table
to it with the key "os", using raw access.
context - the state context, must not be nullenv - the global environment, must not be nullruntimeEnvironment - the runtime environment, may be nullNullPointerException - if context or env is nullCopyright © 2016–2017. All rights reserved.