Lua.Constants

lua-2.3.3: Lua, an embeddable scripting language

Copyright | © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan; © 2017-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Stability | beta
Portability | ForeignFunctionInterface
Safe Haskell | None
Language | Haskell2010

Lua.Constants

Contents

- Version and copyright information
- Special values
- Pseudo-indices
- Basic types
- Status codes
- Relational operator codes
- Codes for arithmetic operations
- Garbage-collection options
- Predefined references
- Predefined values in the registry
- Boolean

Description

Lua constants

Synopsis

- pattern LUA_VERSION :: String
- pattern LUA_RELEASE :: String
- pattern LUA_COPYRIGHT :: String
- pattern LUA_MULTRET :: NumResults
- pattern LUA_REGISTRYINDEX :: StackIndex
- pattern LUA_TNONE :: TypeCode
- pattern LUA_TNIL :: TypeCode
- pattern LUA_TBOOLEAN :: TypeCode
- pattern LUA_TLIGHTUSERDATA :: TypeCode
- pattern LUA_TNUMBER :: TypeCode
- pattern LUA_TSTRING :: TypeCode
- pattern LUA_TTABLE :: TypeCode
- pattern LUA_TFUNCTION :: TypeCode
- pattern LUA_TUSERDATA :: TypeCode
- pattern LUA_TTHREAD :: TypeCode
- pattern LUA_OK :: StatusCode
- pattern LUA_YIELD :: StatusCode
- pattern LUA_ERRRUN :: StatusCode
- pattern LUA_ERRSYNTAX :: StatusCode
- pattern LUA_ERRMEM :: StatusCode
- pattern LUA_ERRERR :: StatusCode
- pattern LUA_ERRFILE :: StatusCode
- pattern LUA_OPEQ :: OPCode
- pattern LUA_OPLT :: OPCode
- pattern LUA_OPLE :: OPCode
- pattern LUA_OPADD :: ArithOPCode
- pattern LUA_OPSUB :: ArithOPCode
- pattern LUA_OPMUL :: ArithOPCode
- pattern LUA_OPDIV :: ArithOPCode
- pattern LUA_OPIDIV :: ArithOPCode
- pattern LUA_OPMOD :: ArithOPCode
- pattern LUA_OPPOW :: ArithOPCode
- pattern LUA_OPUNM :: ArithOPCode
- pattern LUA_OPBNOT :: ArithOPCode
- pattern LUA_OPBAND :: ArithOPCode
- pattern LUA_OPBOR :: ArithOPCode
- pattern LUA_OPBXOR :: ArithOPCode
- pattern LUA_OPSHL :: ArithOPCode
- pattern LUA_OPSHR :: ArithOPCode
- pattern LUA_GCSTOP :: GCCode
- pattern LUA_GCRESTART :: GCCode
- pattern LUA_GCCOLLECT :: GCCode
- pattern LUA_GCCOUNT :: GCCode
- pattern LUA_GCCOUNTB :: GCCode
- pattern LUA_GCSTEP :: GCCode
- pattern LUA_GCSETPAUSE :: GCCode
- pattern LUA_GCSETSTEPMUL :: GCCode
- pattern LUA_GCISRUNNING :: GCCode
- pattern LUA_GCGEN :: GCCode
- pattern LUA_GCINC :: GCCode
- pattern LUA_REFNIL :: CInt
- pattern LUA_NOREF :: CInt
- pattern LUA_RIDX_GLOBALS :: Integer
- pattern TRUE :: LuaBool
- pattern FALSE :: LuaBool

# Version and copyright information

pattern LUA_VERSION :: String #

Lua version information in the form "`Lua MAJOR.MINOR`".

pattern LUA_RELEASE :: String #

Lua version information in the form "`Lua MAJOR.MINOR.RELEASE`".

pattern LUA_COPYRIGHT :: String #

Lua copyright information; includes the Lua release

# Special values

pattern LUA_MULTRET :: NumResults #

Option for multiple returns in ``lua_pcall``.

# Pseudo-indices

pattern LUA_REGISTRYINDEX :: StackIndex #

Stack index of the Lua registry.

# Basic types

pattern LUA_TNONE :: TypeCode #

Non-valid stack index

pattern LUA_TNIL :: TypeCode #

Type of Lua's `nil` value

pattern LUA_TBOOLEAN :: TypeCode #

Type of Lua booleans

pattern LUA_TLIGHTUSERDATA :: TypeCode #

Type of light userdata

pattern LUA_TNUMBER :: TypeCode #

Type of Lua numbers. See ``Number``

pattern LUA_TSTRING :: TypeCode #

Type of Lua string values

pattern LUA_TTABLE :: TypeCode #

Type of Lua tables

pattern LUA_TFUNCTION :: TypeCode #

Type of functions, either normal or ``CFunction``

pattern LUA_TUSERDATA :: TypeCode #

Type of full user data

pattern LUA_TTHREAD :: TypeCode #

Type of Lua threads

# Status codes

pattern LUA_OK :: StatusCode #

Success.

pattern LUA_YIELD :: StatusCode #

Yielding / suspended coroutine.

pattern LUA_ERRRUN :: StatusCode #

A runtime error.

pattern LUA_ERRSYNTAX :: StatusCode #

A syntax error.

pattern LUA_ERRMEM :: StatusCode #

Memory allocation error. For such errors, Lua does not call the message handler.

pattern LUA_ERRERR :: StatusCode #

Error while running the message handler.

pattern LUA_ERRFILE :: StatusCode #

File related error (e.g., the file cannot be opened or read).

# Relational operator codes

pattern LUA_OPEQ :: OPCode #

Compares for equality (==)

pattern LUA_OPLT :: OPCode #

Compares for less than (<)

pattern LUA_OPLE :: OPCode #

Compares for less or equal (<=)

# Codes for arithmetic operations

pattern LUA_OPADD :: ArithOPCode #

Performs addition (`+`).

pattern LUA_OPSUB :: ArithOPCode #

Performs subtraction (`-`)

pattern LUA_OPMUL :: ArithOPCode #

Performs multiplication (`*`)

pattern LUA_OPDIV :: ArithOPCode #

Performs float division (`/`)

pattern LUA_OPIDIV :: ArithOPCode #

Performs floor division (`//`)

pattern LUA_OPMOD :: ArithOPCode #

Performs modulo (`%`)

pattern LUA_OPPOW :: ArithOPCode #

Performs exponentiation (`^`)

pattern LUA_OPUNM :: ArithOPCode #

Performs mathematical negation (unary `-`)

pattern LUA_OPBNOT :: ArithOPCode #

Performs bitwise NOT (`~`)

pattern LUA_OPBAND :: ArithOPCode #

Performs bitwise AND (`&`)

pattern LUA_OPBOR :: ArithOPCode #

Performs bitwise OR (`|`)

pattern LUA_OPBXOR :: ArithOPCode #

Performs bitwise exclusive OR (`~`)

pattern LUA_OPSHL :: ArithOPCode #

Performs left shift (`<<`)

pattern LUA_OPSHR :: ArithOPCode #

Performs right shift (`>>`)

# Garbage-collection options

pattern LUA_GCSTOP :: GCCode #

Stops the garbage collector.

pattern LUA_GCRESTART :: GCCode #

Restarts the garbage collector.

pattern LUA_GCCOLLECT :: GCCode #

Performs a full garbage-collection cycle.

pattern LUA_GCCOUNT :: GCCode #

Returns the current amount of memory (in Kbytes) in use by Lua.

pattern LUA_GCCOUNTB :: GCCode #

Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024.

pattern LUA_GCSTEP :: GCCode #

Performs an incremental step of garbage collection.

pattern LUA_GCSETPAUSE :: GCCode #

Sets data as the new value for the pause of the collector (see §2.5) and returns the previous value of the pause.

pattern LUA_GCSETSTEPMUL :: GCCode #

Sets data as the new value for the step multiplier of the collector (see §2.5) and returns the previous value of the step multiplier.

pattern LUA_GCISRUNNING :: GCCode #

Returns a boolean that tells whether the collector is running (i.e., not stopped).

pattern LUA_GCGEN :: GCCode #

Changes the collector to generational mode.

pattern LUA_GCINC :: GCCode #

Changes the collector to incremental mode.

# Predefined references

pattern LUA_REFNIL :: CInt #

Value signaling that no reference was created.

pattern LUA_NOREF :: CInt #

Value signaling that no reference was found.

# Predefined values in the registry

pattern LUA_RIDX_GLOBALS :: Integer #

The registry index that holds the global environment.

# Boolean

pattern TRUE :: LuaBool #

Value which Lua usually uses as `True`.

pattern FALSE :: LuaBool #

Value which Lua usually uses as `False`.