Created
April 6, 2020 11:43
-
-
Save InukVT/41649b6f73fcdfcb3ad394ab268344b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** $Id: luaconf.h,v 1.259.1.1 2017/04/19 17:29:57 roberto Exp $ | |
** Configuration file for Lua | |
** See Copyright Notice in lua.h | |
*/ | |
/* | |
** =================================================================== | |
** Search for "@@" to find all configurable definitions. | |
** =================================================================== | |
*/ | |
/* | |
** {==================================================================== | |
** System Configuration: macros to adapt (if needed) Lua to some | |
** particular platform, for instance compiling it with 32-bit numbers or | |
** restricting it to C89. | |
** ===================================================================== | |
*/ | |
/* | |
@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You | |
** can also define LUA_32BITS in the make file, but changing here you | |
** ensure that all software connected to Lua will be compiled with the | |
** same configuration. | |
*/ | |
/* #define LUA_32BITS */ | |
/* | |
@@ LUA_USE_C89 controls the use of non-ISO-C89 features. | |
** Define it if you want Lua to avoid the use of a few C99 features | |
** or Windows-specific features on Windows. | |
*/ | |
/* #define LUA_USE_C89 */ | |
/* | |
** By default, Lua on Windows use (some) specific Windows features | |
*/ | |
/* enable goodies for regular Windows */ | |
/* enable support for DLL */ | |
/* broadly, Windows is C89 */ | |
/* needs an extra library: -ldl */ | |
/* needs some extra libraries */ | |
/* MacOS does not need -ldl */ | |
/* needs an extra library: -lreadline */ | |
/* | |
@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for | |
** C89 ('long' and 'double'); Windows always has '__int64', so it does | |
** not need to use this case. | |
*/ | |
/* | |
@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. | |
*/ | |
/* avoid undefined shifts */ | |
public var LUAI_BITSINT: Int32 { get } | |
/* 'int' always must have at least 16 bits */ | |
/* | |
@@ LUA_INT_TYPE defines the type for Lua integers. | |
@@ LUA_FLOAT_TYPE defines the type for Lua floats. | |
** Lua should work fine with any mix of these options (if supported | |
** by your C compiler). The usual configurations are 64-bit integers | |
** and 'double' (the default), 32-bit integers and 'float' (for | |
** restricted platforms), and 'long'/'double' (for C compilers not | |
** compliant with C99, which may not have support for 'long long'). | |
*/ | |
/* predefined options for LUA_INT_TYPE */ | |
public var LUA_INT_INT: Int32 { get } | |
public var LUA_INT_LONG: Int32 { get } | |
public var LUA_INT_LONGLONG: Int32 { get } | |
/* predefined options for LUA_FLOAT_TYPE */ | |
public var LUA_FLOAT_FLOAT: Int32 { get } | |
public var LUA_FLOAT_DOUBLE: Int32 { get } | |
public var LUA_FLOAT_LONGDOUBLE: Int32 { get } | |
/* { */ | |
/* | |
** 32-bit integers and 'float' | |
*/ | |
/* use 'int' if big enough */ | |
/* otherwise use 'long' */ | |
/* }{ */ | |
/* | |
** largest types available for C89 ('long' and 'double') | |
*/ | |
/* } */ | |
/* | |
** default configuration for 64-bit Lua ('long long' and 'double') | |
*/ | |
public var LUA_INT_TYPE: Int32 { get } | |
public var LUA_FLOAT_TYPE: Int32 { get } | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Configuration for Paths. | |
** =================================================================== | |
*/ | |
/* | |
** LUA_PATH_SEP is the character that separates templates in a path. | |
** LUA_PATH_MARK is the string that marks the substitution points in a | |
** template. | |
** LUA_EXEC_DIR in a Windows path is replaced by the executable's | |
** directory. | |
*/ | |
public var LUA_PATH_SEP: String { get } | |
public var LUA_PATH_MARK: String { get } | |
public var LUA_EXEC_DIR: String { get } | |
/* | |
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for | |
** Lua libraries. | |
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for | |
** C libraries. | |
** CHANGE them if your machine has a non-conventional directory | |
** hierarchy or if you want to install your libraries in | |
** non-conventional directories. | |
*/ | |
/* { */ | |
/* | |
** In Windows, any exclamation mark ('!') in the path is replaced by the | |
** path of the directory of the executable file of the current process. | |
*/ | |
/* }{ */ | |
public var LUA_ROOT: String { get } | |
/* } */ | |
/* | |
@@ LUA_DIRSEP is the directory separator (for submodules). | |
** CHANGE it if your machine does not use "/" as the directory separator | |
** and is not Windows. (On Windows Lua automatically uses "\".) | |
*/ | |
public var LUA_DIRSEP: String { get } | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Marks for exported symbols in the C code | |
** =================================================================== | |
*/ | |
/* | |
@@ LUA_API is a mark for all core API functions. | |
@@ LUALIB_API is a mark for all auxiliary library functions. | |
@@ LUAMOD_API is a mark for all standard library opening functions. | |
** CHANGE them if you need to define those functions in some special way. | |
** For instance, if you want to create one Windows DLL with the core and | |
** the libraries, you may want to use the following definition (define | |
** LUA_BUILD_AS_DLL to get it). | |
*/ | |
/* { */ | |
/* { */ | |
/* }{ */ | |
/* } */ | |
/* }{ */ | |
/* } */ | |
/* more often than not the libs go together with the core */ | |
/* | |
@@ LUAI_FUNC is a mark for all extern functions that are not to be | |
** exported to outside modules. | |
@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables | |
** that are not to be exported to outside modules (LUAI_DDEF for | |
** definitions and LUAI_DDEC for declarations). | |
** CHANGE them if you need to mark them in some special way. Elf/gcc | |
** (versions 3.2 and later) mark them as "hidden" to optimize access | |
** when Lua is compiled as a shared library. Not all elf targets support | |
** this attribute. Unfortunately, gcc does not offer a way to check | |
** whether the target offers that support, and those without support | |
** give a warning about it. To avoid these warnings, change to the | |
** default definition. | |
*/ | |
/* { */ | |
/* }{ */ | |
/* } */ | |
/* empty */ | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Compatibility with previous versions | |
** =================================================================== | |
*/ | |
/* | |
@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. | |
@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. | |
** You can define it to get all options, or change specific options | |
** to fit your specific needs. | |
*/ | |
/* { */ | |
/* | |
@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated | |
** functions in the mathematical library. | |
*/ | |
/* | |
@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. | |
*/ | |
/* | |
@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. | |
*/ | |
/* | |
@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for | |
** manipulating other integer types (lua_pushunsigned, lua_tounsigned, | |
** luaL_checkint, luaL_checklong, etc.) | |
*/ | |
/* } */ | |
/* { */ | |
/* Incompatibilities from 5.2 -> 5.3 */ | |
/* | |
@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. | |
** You can replace it with 'table.unpack'. | |
*/ | |
/* | |
@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. | |
** You can replace it with 'package.searchers'. | |
*/ | |
/* | |
@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. | |
** You can call your C function directly (with light C functions). | |
*/ | |
/* | |
@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. | |
** You can rewrite 'log10(x)' as 'log(x, 10)'. | |
*/ | |
/* | |
@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base | |
** library. You can rewrite 'loadstring(s)' as 'load(s)'. | |
*/ | |
/* | |
@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. | |
*/ | |
/* | |
@@ The following macros supply trivial compatibility for some | |
** changes in the API. The macros themselves document how to | |
** change your code to avoid using them. | |
*/ | |
/* | |
@@ LUA_COMPAT_MODULE controls compatibility with previous | |
** module functions 'module' (Lua) and 'luaL_register' (C). | |
*/ | |
/* } */ | |
/* | |
@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a | |
@@ a float mark ('.0'). | |
** This macro is not on by default even in compatibility mode, | |
** because this is not really an incompatibility. | |
*/ | |
/* #define LUA_COMPAT_FLOATSTRING */ | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Configuration for Numbers. | |
** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* | |
** satisfy your needs. | |
** =================================================================== | |
*/ | |
/* | |
@@ LUA_NUMBER is the floating-point type used by Lua. | |
@@ LUAI_UACNUMBER is the result of a 'default argument promotion' | |
@@ over a floating number. | |
@@ l_mathlim(x) corrects limit name 'x' to the proper float type | |
** by prefixing it with one of FLT/DBL/LDBL. | |
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. | |
@@ LUA_NUMBER_FMT is the format for writing floats. | |
@@ lua_number2str converts a float to a string. | |
@@ l_mathop allows the addition of an 'l' or 'f' to all math operations. | |
@@ l_floor takes the floor of a float. | |
@@ lua_str2number converts a decimal numeric string to a number. | |
*/ | |
/* The following definitions are good for most cases here */ | |
/* | |
@@ lua_numbertointeger converts a float number to an integer, or | |
** returns 0 if float is not within the range of a lua_Integer. | |
** (The range comparisons are tricky because of rounding. The tests | |
** here assume a two-complement representation, where MININTEGER always | |
** has an exact representation as a float; MAXINTEGER may not have one, | |
** and therefore its conversion to float may have an ill-defined value.) | |
*/ | |
/* now the variable definitions */ | |
/* { single float */ | |
/* }{ long double */ | |
/* }{ double */ | |
public var LUA_NUMBER_FRMLEN: String { get } | |
public var LUA_NUMBER_FMT: String { get } | |
/* }{ */ | |
/* } */ | |
/* | |
@@ LUA_INTEGER is the integer type used by Lua. | |
** | |
@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. | |
** | |
@@ LUAI_UACINT is the result of a 'default argument promotion' | |
@@ over a lUA_INTEGER. | |
@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. | |
@@ LUA_INTEGER_FMT is the format for writing integers. | |
@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. | |
@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. | |
@@ lua_integer2str converts an integer to a string. | |
*/ | |
/* The following definitions are good for most cases here */ | |
/* | |
** use LUAI_UACINT here to avoid problems with promotions (which | |
** can turn a comparison between unsigneds into a signed comparison) | |
*/ | |
/* now the variable definitions */ | |
/* { int */ | |
/* }{ long */ | |
/* }{ long long */ | |
/* use presence of macro LLONG_MAX as proxy for C99 compliance */ | |
/* { */ | |
/* use ISO C99 stuff */ | |
public var LUA_INTEGER_FRMLEN: String { get } | |
public var LUA_MAXINTEGER: Int64 { get } | |
/* }{ */ | |
/* in Windows, can use specific Windows types */ | |
/* }{ */ | |
/* } */ | |
/* }{ */ | |
/* } */ | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Dependencies with C99 and other C details | |
** =================================================================== | |
*/ | |
/* | |
@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89. | |
** (All uses in Lua have only one format item.) | |
*/ | |
/* | |
@@ lua_strx2number converts an hexadecimal numeric string to a number. | |
** In C99, 'strtod' does that conversion. Otherwise, you can | |
** leave 'lua_strx2number' undefined and Lua will provide its own | |
** implementation. | |
*/ | |
/* | |
@@ lua_pointer2str converts a pointer to a readable string in a | |
** non-specified way. | |
*/ | |
/* | |
@@ lua_number2strx converts a float to an hexadecimal numeric string. | |
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. | |
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will | |
** provide its own implementation. | |
*/ | |
/* | |
** 'strtof' and 'opf' variants for math functions are not valid in | |
** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the | |
** availability of these variants. ('math.h' is already included in | |
** all files that use these macros.) | |
*/ | |
/* variants not available */ | |
/* no variant */ | |
/* | |
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation | |
** functions. It must be a numerical type; Lua will use 'intptr_t' if | |
** available, otherwise it will use 'ptrdiff_t' (the nearest thing to | |
** 'intptr_t' in C89) | |
*/ | |
/* even in C99 this type is optional */ | |
/* | |
@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point). | |
** Change that if you do not want to use C locales. (Code using this | |
** macro must include header 'locale.h'.) | |
*/ | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Language Variations | |
** ===================================================================== | |
*/ | |
/* | |
@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some | |
** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from | |
** numbers to strings. Define LUA_NOCVTS2N to turn off automatic | |
** coercion from strings to numbers. | |
*/ | |
/* #define LUA_NOCVTN2S */ | |
/* #define LUA_NOCVTS2N */ | |
/* | |
@@ LUA_USE_APICHECK turns on several consistency checks on the C API. | |
** Define it as a help when debugging C code. | |
*/ | |
/* }================================================================== */ | |
/* | |
** {================================================================== | |
** Macros that affect the API and must be stable (that is, must be the | |
** same when you compile Lua and when you compile code that links to | |
** Lua). You probably do not want/need to change them. | |
** ===================================================================== | |
*/ | |
/* | |
@@ LUAI_MAXSTACK limits the size of the Lua stack. | |
** CHANGE it if you need a different limit. This limit is arbitrary; | |
** its only purpose is to stop Lua from consuming unlimited stack | |
** space (and to reserve some numbers for pseudo-indices). | |
*/ | |
public var LUAI_MAXSTACK: Int32 { get } | |
/* | |
@@ LUA_EXTRASPACE defines the size of a raw memory area associated with | |
** a Lua state with very fast access. | |
** CHANGE it if you need a different size. | |
*/ | |
/* | |
@@ LUA_IDSIZE gives the maximum size for the description of the source | |
@@ of a function in debug information. | |
** CHANGE it if you want a different size. | |
*/ | |
public var LUA_IDSIZE: Int32 { get } | |
/* | |
** $Id: lua.h,v 1.332.1.2 2018/06/13 16:58:17 roberto Exp $ | |
** Lua - A Scripting Language | |
** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | |
** See Copyright Notice at the end of this file | |
*/ | |
public var LUA_VERSION_MAJOR: String { get } | |
public var LUA_VERSION_MINOR: String { get } | |
public var LUA_VERSION_NUM: Int32 { get } | |
public var LUA_VERSION_RELEASE: String { get } | |
public var LUA_AUTHORS: String { get } | |
/* mark for precompiled code ('<esc>Lua') */ | |
public var LUA_SIGNATURE: String { get } | |
/* option for multiple returns in 'lua_pcall' and 'lua_call' */ | |
public var LUA_MULTRET: Int32 { get } | |
/* | |
** Pseudo-indices | |
** (-LUAI_MAXSTACK is the minimum valid index; we keep some free empty | |
** space after that to help overflow detection) | |
*/ | |
/* thread status */ | |
public var LUA_OK: Int32 { get } | |
public var LUA_YIELD: Int32 { get } | |
public var LUA_ERRRUN: Int32 { get } | |
public var LUA_ERRSYNTAX: Int32 { get } | |
public var LUA_ERRMEM: Int32 { get } | |
public var LUA_ERRGCMM: Int32 { get } | |
public var LUA_ERRERR: Int32 { get } | |
/* | |
** basic types | |
*/ | |
public var LUA_TNONE: Int32 { get } | |
public var LUA_TNIL: Int32 { get } | |
public var LUA_TBOOLEAN: Int32 { get } | |
public var LUA_TLIGHTUSERDATA: Int32 { get } | |
public var LUA_TNUMBER: Int32 { get } | |
public var LUA_TSTRING: Int32 { get } | |
public var LUA_TTABLE: Int32 { get } | |
public var LUA_TFUNCTION: Int32 { get } | |
public var LUA_TUSERDATA: Int32 { get } | |
public var LUA_TTHREAD: Int32 { get } | |
public var LUA_NUMTAGS: Int32 { get } | |
/* minimum Lua stack available to a C function */ | |
public var LUA_MINSTACK: Int32 { get } | |
/* predefined values in the registry */ | |
public var LUA_RIDX_MAINTHREAD: Int32 { get } | |
public var LUA_RIDX_GLOBALS: Int32 { get } | |
public var LUA_RIDX_LAST: Int32 { get } | |
/* type of numbers in Lua */ | |
public typealias lua_Number = Double | |
/* type for integer functions */ | |
public typealias lua_Integer = Int64 | |
/* unsigned integer type */ | |
public typealias lua_Unsigned = UInt64 | |
/* type for continuation-function contexts */ | |
public typealias lua_KContext = Int | |
/* | |
** Type for C functions registered with Lua | |
*/ | |
public typealias lua_CFunction = @convention(c) (OpaquePointer?) -> Int32 | |
/* | |
** Type for continuation functions | |
*/ | |
public typealias lua_KFunction = @convention(c) (OpaquePointer?, Int32, lua_KContext) -> Int32 | |
/* | |
** Type for functions that read/write blocks when loading/dumping Lua chunks | |
*/ | |
public typealias lua_Reader = @convention(c) (OpaquePointer?, UnsafeMutableRawPointer?, UnsafeMutablePointer<Int>?) -> UnsafePointer<Int8>? | |
public typealias lua_Writer = @convention(c) (OpaquePointer?, UnsafeRawPointer?, Int, UnsafeMutableRawPointer?) -> Int32 | |
/* | |
** Type for memory-allocation functions | |
*/ | |
public typealias lua_Alloc = @convention(c) (UnsafeMutableRawPointer?, UnsafeMutableRawPointer?, Int, Int) -> UnsafeMutableRawPointer? | |
/* | |
** generic extra include file | |
*/ | |
/* | |
** RCS ident string | |
*/ | |
/* | |
** state manipulation | |
*/ | |
public func lua_newstate(_ f: lua_Alloc!, _ ud: UnsafeMutableRawPointer!) -> OpaquePointer! | |
public func lua_close(_ L: OpaquePointer!) | |
public func lua_newthread(_ L: OpaquePointer!) -> OpaquePointer! | |
public func lua_atpanic(_ L: OpaquePointer!, _ panicf: lua_CFunction!) -> lua_CFunction! | |
public func lua_version(_ L: OpaquePointer!) -> UnsafePointer<lua_Number>! | |
/* | |
** basic stack manipulation | |
*/ | |
public func lua_absindex(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_gettop(_ L: OpaquePointer!) -> Int32 | |
public func lua_settop(_ L: OpaquePointer!, _ idx: Int32) | |
public func lua_pushvalue(_ L: OpaquePointer!, _ idx: Int32) | |
public func lua_rotate(_ L: OpaquePointer!, _ idx: Int32, _ n: Int32) | |
public func lua_copy(_ L: OpaquePointer!, _ fromidx: Int32, _ toidx: Int32) | |
public func lua_checkstack(_ L: OpaquePointer!, _ n: Int32) -> Int32 | |
public func lua_xmove(_ from: OpaquePointer!, _ to: OpaquePointer!, _ n: Int32) | |
/* | |
** access functions (stack -> C) | |
*/ | |
public func lua_isnumber(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_isstring(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_iscfunction(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_isinteger(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_isuserdata(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_type(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_typename(_ L: OpaquePointer!, _ tp: Int32) -> UnsafePointer<Int8>! | |
public func lua_tonumberx(_ L: OpaquePointer!, _ idx: Int32, _ isnum: UnsafeMutablePointer<Int32>!) -> lua_Number | |
public func lua_tointegerx(_ L: OpaquePointer!, _ idx: Int32, _ isnum: UnsafeMutablePointer<Int32>!) -> lua_Integer | |
public func lua_toboolean(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_tolstring(_ L: OpaquePointer!, _ idx: Int32, _ len: UnsafeMutablePointer<Int>!) -> UnsafePointer<Int8>! | |
public func lua_rawlen(_ L: OpaquePointer!, _ idx: Int32) -> Int | |
public func lua_tocfunction(_ L: OpaquePointer!, _ idx: Int32) -> lua_CFunction! | |
public func lua_touserdata(_ L: OpaquePointer!, _ idx: Int32) -> UnsafeMutableRawPointer! | |
public func lua_tothread(_ L: OpaquePointer!, _ idx: Int32) -> OpaquePointer! | |
public func lua_topointer(_ L: OpaquePointer!, _ idx: Int32) -> UnsafeRawPointer! | |
/* | |
** Comparison and arithmetic functions | |
*/ | |
public var LUA_OPADD: Int32 { get } /* ORDER TM, ORDER OP */ | |
public var LUA_OPSUB: Int32 { get } | |
public var LUA_OPMUL: Int32 { get } | |
public var LUA_OPMOD: Int32 { get } | |
public var LUA_OPPOW: Int32 { get } | |
public var LUA_OPDIV: Int32 { get } | |
public var LUA_OPIDIV: Int32 { get } | |
public var LUA_OPBAND: Int32 { get } | |
public var LUA_OPBOR: Int32 { get } | |
public var LUA_OPBXOR: Int32 { get } | |
public var LUA_OPSHL: Int32 { get } | |
public var LUA_OPSHR: Int32 { get } | |
public var LUA_OPUNM: Int32 { get } | |
public var LUA_OPBNOT: Int32 { get } | |
public func lua_arith(_ L: OpaquePointer!, _ op: Int32) | |
public var LUA_OPEQ: Int32 { get } | |
public var LUA_OPLT: Int32 { get } | |
public var LUA_OPLE: Int32 { get } | |
public func lua_rawequal(_ L: OpaquePointer!, _ idx1: Int32, _ idx2: Int32) -> Int32 | |
public func lua_compare(_ L: OpaquePointer!, _ idx1: Int32, _ idx2: Int32, _ op: Int32) -> Int32 | |
/* | |
** push functions (C -> stack) | |
*/ | |
public func lua_pushnil(_ L: OpaquePointer!) | |
public func lua_pushnumber(_ L: OpaquePointer!, _ n: lua_Number) | |
public func lua_pushinteger(_ L: OpaquePointer!, _ n: lua_Integer) | |
public func lua_pushlstring(_ L: OpaquePointer!, _ s: UnsafePointer<Int8>!, _ len: Int) -> UnsafePointer<Int8>! | |
public func lua_pushstring(_ L: OpaquePointer!, _ s: UnsafePointer<Int8>!) -> UnsafePointer<Int8>! | |
public func lua_pushvfstring(_ L: OpaquePointer!, _ fmt: UnsafePointer<Int8>!, _ argp: CVaListPointer) -> UnsafePointer<Int8>! | |
public func lua_pushcclosure(_ L: OpaquePointer!, _ fn: lua_CFunction!, _ n: Int32) | |
public func lua_pushboolean(_ L: OpaquePointer!, _ b: Int32) | |
public func lua_pushlightuserdata(_ L: OpaquePointer!, _ p: UnsafeMutableRawPointer!) | |
public func lua_pushthread(_ L: OpaquePointer!) -> Int32 | |
/* | |
** get functions (Lua -> stack) | |
*/ | |
public func lua_getglobal(_ L: OpaquePointer!, _ name: UnsafePointer<Int8>!) -> Int32 | |
public func lua_gettable(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_getfield(_ L: OpaquePointer!, _ idx: Int32, _ k: UnsafePointer<Int8>!) -> Int32 | |
public func lua_geti(_ L: OpaquePointer!, _ idx: Int32, _ n: lua_Integer) -> Int32 | |
public func lua_rawget(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_rawgeti(_ L: OpaquePointer!, _ idx: Int32, _ n: lua_Integer) -> Int32 | |
public func lua_rawgetp(_ L: OpaquePointer!, _ idx: Int32, _ p: UnsafeRawPointer!) -> Int32 | |
public func lua_createtable(_ L: OpaquePointer!, _ narr: Int32, _ nrec: Int32) | |
public func lua_newuserdata(_ L: OpaquePointer!, _ sz: Int) -> UnsafeMutableRawPointer! | |
public func lua_getmetatable(_ L: OpaquePointer!, _ objindex: Int32) -> Int32 | |
public func lua_getuservalue(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
/* | |
** set functions (stack -> Lua) | |
*/ | |
public func lua_setglobal(_ L: OpaquePointer!, _ name: UnsafePointer<Int8>!) | |
public func lua_settable(_ L: OpaquePointer!, _ idx: Int32) | |
public func lua_setfield(_ L: OpaquePointer!, _ idx: Int32, _ k: UnsafePointer<Int8>!) | |
public func lua_seti(_ L: OpaquePointer!, _ idx: Int32, _ n: lua_Integer) | |
public func lua_rawset(_ L: OpaquePointer!, _ idx: Int32) | |
public func lua_rawseti(_ L: OpaquePointer!, _ idx: Int32, _ n: lua_Integer) | |
public func lua_rawsetp(_ L: OpaquePointer!, _ idx: Int32, _ p: UnsafeRawPointer!) | |
public func lua_setmetatable(_ L: OpaquePointer!, _ objindex: Int32) -> Int32 | |
public func lua_setuservalue(_ L: OpaquePointer!, _ idx: Int32) | |
/* | |
** 'load' and 'call' functions (load and run Lua code) | |
*/ | |
public func lua_callk(_ L: OpaquePointer!, _ nargs: Int32, _ nresults: Int32, _ ctx: lua_KContext, _ k: lua_KFunction!) | |
public func lua_pcallk(_ L: OpaquePointer!, _ nargs: Int32, _ nresults: Int32, _ errfunc: Int32, _ ctx: lua_KContext, _ k: lua_KFunction!) -> Int32 | |
public func lua_load(_ L: OpaquePointer!, _ reader: lua_Reader!, _ dt: UnsafeMutableRawPointer!, _ chunkname: UnsafePointer<Int8>!, _ mode: UnsafePointer<Int8>!) -> Int32 | |
public func lua_dump(_ L: OpaquePointer!, _ writer: lua_Writer!, _ data: UnsafeMutableRawPointer!, _ strip: Int32) -> Int32 | |
/* | |
** coroutine functions | |
*/ | |
public func lua_yieldk(_ L: OpaquePointer!, _ nresults: Int32, _ ctx: lua_KContext, _ k: lua_KFunction!) -> Int32 | |
public func lua_resume(_ L: OpaquePointer!, _ from: OpaquePointer!, _ narg: Int32) -> Int32 | |
public func lua_status(_ L: OpaquePointer!) -> Int32 | |
public func lua_isyieldable(_ L: OpaquePointer!) -> Int32 | |
/* | |
** garbage-collection function and options | |
*/ | |
public var LUA_GCSTOP: Int32 { get } | |
public var LUA_GCRESTART: Int32 { get } | |
public var LUA_GCCOLLECT: Int32 { get } | |
public var LUA_GCCOUNT: Int32 { get } | |
public var LUA_GCCOUNTB: Int32 { get } | |
public var LUA_GCSTEP: Int32 { get } | |
public var LUA_GCSETPAUSE: Int32 { get } | |
public var LUA_GCSETSTEPMUL: Int32 { get } | |
public var LUA_GCISRUNNING: Int32 { get } | |
public func lua_gc(_ L: OpaquePointer!, _ what: Int32, _ data: Int32) -> Int32 | |
/* | |
** miscellaneous functions | |
*/ | |
public func lua_error(_ L: OpaquePointer!) -> Int32 | |
public func lua_next(_ L: OpaquePointer!, _ idx: Int32) -> Int32 | |
public func lua_concat(_ L: OpaquePointer!, _ n: Int32) | |
public func lua_len(_ L: OpaquePointer!, _ idx: Int32) | |
public func lua_stringtonumber(_ L: OpaquePointer!, _ s: UnsafePointer<Int8>!) -> Int | |
public func lua_getallocf(_ L: OpaquePointer!, _ ud: UnsafeMutablePointer<UnsafeMutableRawPointer?>!) -> lua_Alloc! | |
public func lua_setallocf(_ L: OpaquePointer!, _ f: lua_Alloc!, _ ud: UnsafeMutableRawPointer!) | |
/* | |
** {============================================================== | |
** some useful macros | |
** =============================================================== | |
*/ | |
/* }============================================================== */ | |
/* | |
** {============================================================== | |
** compatibility macros for unsigned conversions | |
** =============================================================== | |
*/ | |
/* }============================================================== */ | |
/* | |
** {====================================================================== | |
** Debug API | |
** ======================================================================= | |
*/ | |
/* | |
** Event codes | |
*/ | |
public var LUA_HOOKCALL: Int32 { get } | |
public var LUA_HOOKRET: Int32 { get } | |
public var LUA_HOOKLINE: Int32 { get } | |
public var LUA_HOOKCOUNT: Int32 { get } | |
public var LUA_HOOKTAILCALL: Int32 { get } | |
/* | |
** Event masks | |
*/ | |
public var LUA_MASKCALL: Int32 { get } | |
public var LUA_MASKRET: Int32 { get } | |
public var LUA_MASKLINE: Int32 { get } | |
public var LUA_MASKCOUNT: Int32 { get } | |
/* activation record */ | |
/* Functions to be called by the debugger in specific events */ | |
public typealias lua_Hook = @convention(c) (OpaquePointer?, UnsafeMutablePointer<lua_Debug>?) -> Void | |
public func lua_getstack(_ L: OpaquePointer!, _ level: Int32, _ ar: UnsafeMutablePointer<lua_Debug>!) -> Int32 | |
public func lua_getinfo(_ L: OpaquePointer!, _ what: UnsafePointer<Int8>!, _ ar: UnsafeMutablePointer<lua_Debug>!) -> Int32 | |
public func lua_getlocal(_ L: OpaquePointer!, _ ar: UnsafePointer<lua_Debug>!, _ n: Int32) -> UnsafePointer<Int8>! | |
public func lua_setlocal(_ L: OpaquePointer!, _ ar: UnsafePointer<lua_Debug>!, _ n: Int32) -> UnsafePointer<Int8>! | |
public func lua_getupvalue(_ L: OpaquePointer!, _ funcindex: Int32, _ n: Int32) -> UnsafePointer<Int8>! | |
public func lua_setupvalue(_ L: OpaquePointer!, _ funcindex: Int32, _ n: Int32) -> UnsafePointer<Int8>! | |
public func lua_upvalueid(_ L: OpaquePointer!, _ fidx: Int32, _ n: Int32) -> UnsafeMutableRawPointer! | |
public func lua_upvaluejoin(_ L: OpaquePointer!, _ fidx1: Int32, _ n1: Int32, _ fidx2: Int32, _ n2: Int32) | |
public func lua_sethook(_ L: OpaquePointer!, _ func: lua_Hook!, _ mask: Int32, _ count: Int32) | |
public func lua_gethook(_ L: OpaquePointer!) -> lua_Hook! | |
public func lua_gethookmask(_ L: OpaquePointer!) -> Int32 | |
public func lua_gethookcount(_ L: OpaquePointer!) -> Int32 | |
public struct lua_Debug { | |
public var event: Int32 | |
public var name: UnsafePointer<Int8>! /* (n) */ | |
public var namewhat: UnsafePointer<Int8>! /* (n) 'global', 'local', 'field', 'method' */ | |
public var what: UnsafePointer<Int8>! /* (S) 'Lua', 'C', 'main', 'tail' */ | |
public var source: UnsafePointer<Int8>! /* (S) */ | |
public var currentline: Int32 /* (l) */ | |
public var linedefined: Int32 /* (S) */ | |
public var lastlinedefined: Int32 /* (S) */ | |
public var nups: UInt8 /* (u) number of upvalues */ | |
public var nparams: UInt8 /* (u) number of parameters */ | |
public var isvararg: Int8 /* (u) */ | |
public var istailcall: Int8 /* (t) */ | |
public var short_src: (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8) /* (S) */ | |
/* private part */ | |
public var i_ci: OpaquePointer! /* active function */ | |
public init() | |
public init(event: Int32, name: UnsafePointer<Int8>!, namewhat: UnsafePointer<Int8>!, what: UnsafePointer<Int8>!, source: UnsafePointer<Int8>!, currentline: Int32, linedefined: Int32, lastlinedefined: Int32, nups: UInt8, nparams: UInt8, isvararg: Int8, istailcall: Int8, short_src: (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8), i_ci: OpaquePointer!) | |
} | |
/* | |
** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $ | |
** Auxiliary functions for building Lua libraries | |
** See Copyright Notice in lua.h | |
*/ | |
/* extra error code for 'luaL_loadfilex' */ | |
public var LUA_ERRFILE: Int32 { get } | |
/* key, in the registry, for table of loaded modules */ | |
public var LUA_LOADED_TABLE: String { get } | |
/* key, in the registry, for table of preloaded loaders */ | |
public var LUA_PRELOAD_TABLE: String { get } | |
public struct luaL_Reg { | |
public var name: UnsafePointer<Int8>! | |
public var `func`: lua_CFunction! | |
public init() | |
public init(name: UnsafePointer<Int8>!, func: lua_CFunction!) | |
} | |
public func luaL_checkversion_(_ L: OpaquePointer!, _ ver: lua_Number, _ sz: Int) | |
public func luaL_getmetafield(_ L: OpaquePointer!, _ obj: Int32, _ e: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_callmeta(_ L: OpaquePointer!, _ obj: Int32, _ e: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_tolstring(_ L: OpaquePointer!, _ idx: Int32, _ len: UnsafeMutablePointer<Int>!) -> UnsafePointer<Int8>! | |
public func luaL_argerror(_ L: OpaquePointer!, _ arg: Int32, _ extramsg: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_checklstring(_ L: OpaquePointer!, _ arg: Int32, _ l: UnsafeMutablePointer<Int>!) -> UnsafePointer<Int8>! | |
public func luaL_optlstring(_ L: OpaquePointer!, _ arg: Int32, _ def: UnsafePointer<Int8>!, _ l: UnsafeMutablePointer<Int>!) -> UnsafePointer<Int8>! | |
public func luaL_checknumber(_ L: OpaquePointer!, _ arg: Int32) -> lua_Number | |
public func luaL_optnumber(_ L: OpaquePointer!, _ arg: Int32, _ def: lua_Number) -> lua_Number | |
public func luaL_checkinteger(_ L: OpaquePointer!, _ arg: Int32) -> lua_Integer | |
public func luaL_optinteger(_ L: OpaquePointer!, _ arg: Int32, _ def: lua_Integer) -> lua_Integer | |
public func luaL_checkstack(_ L: OpaquePointer!, _ sz: Int32, _ msg: UnsafePointer<Int8>!) | |
public func luaL_checktype(_ L: OpaquePointer!, _ arg: Int32, _ t: Int32) | |
public func luaL_checkany(_ L: OpaquePointer!, _ arg: Int32) | |
public func luaL_newmetatable(_ L: OpaquePointer!, _ tname: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_setmetatable(_ L: OpaquePointer!, _ tname: UnsafePointer<Int8>!) | |
public func luaL_testudata(_ L: OpaquePointer!, _ ud: Int32, _ tname: UnsafePointer<Int8>!) -> UnsafeMutableRawPointer! | |
public func luaL_checkudata(_ L: OpaquePointer!, _ ud: Int32, _ tname: UnsafePointer<Int8>!) -> UnsafeMutableRawPointer! | |
public func luaL_where(_ L: OpaquePointer!, _ lvl: Int32) | |
public func luaL_checkoption(_ L: OpaquePointer!, _ arg: Int32, _ def: UnsafePointer<Int8>!, _ lst: UnsafePointer<UnsafePointer<Int8>?>!) -> Int32 | |
public func luaL_fileresult(_ L: OpaquePointer!, _ stat: Int32, _ fname: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_execresult(_ L: OpaquePointer!, _ stat: Int32) -> Int32 | |
/* predefined references */ | |
public var LUA_NOREF: Int32 { get } | |
public var LUA_REFNIL: Int32 { get } | |
public func luaL_ref(_ L: OpaquePointer!, _ t: Int32) -> Int32 | |
public func luaL_unref(_ L: OpaquePointer!, _ t: Int32, _ ref: Int32) | |
public func luaL_loadfilex(_ L: OpaquePointer!, _ filename: UnsafePointer<Int8>!, _ mode: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_loadbufferx(_ L: OpaquePointer!, _ buff: UnsafePointer<Int8>!, _ sz: Int, _ name: UnsafePointer<Int8>!, _ mode: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_loadstring(_ L: OpaquePointer!, _ s: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_newstate() -> OpaquePointer! | |
public func luaL_len(_ L: OpaquePointer!, _ idx: Int32) -> lua_Integer | |
public func luaL_gsub(_ L: OpaquePointer!, _ s: UnsafePointer<Int8>!, _ p: UnsafePointer<Int8>!, _ r: UnsafePointer<Int8>!) -> UnsafePointer<Int8>! | |
public func luaL_setfuncs(_ L: OpaquePointer!, _ l: UnsafePointer<luaL_Reg>!, _ nup: Int32) | |
public func luaL_getsubtable(_ L: OpaquePointer!, _ idx: Int32, _ fname: UnsafePointer<Int8>!) -> Int32 | |
public func luaL_traceback(_ L: OpaquePointer!, _ L1: OpaquePointer!, _ msg: UnsafePointer<Int8>!, _ level: Int32) | |
public func luaL_requiref(_ L: OpaquePointer!, _ modname: UnsafePointer<Int8>!, _ openf: lua_CFunction!, _ glb: Int32) | |
/* | |
** =============================================================== | |
** some useful macros | |
** =============================================================== | |
*/ | |
/* | |
** {====================================================== | |
** Generic Buffer manipulation | |
** ======================================================= | |
*/ | |
public struct luaL_Buffer { | |
public var b: UnsafeMutablePointer<Int8>! /* buffer address */ | |
public var size: Int /* buffer size */ | |
public var n: Int /* number of characters in buffer */ | |
public var L: OpaquePointer! | |
public init() | |
} | |
/* initial buffer */ | |
public func luaL_buffinit(_ L: OpaquePointer!, _ B: UnsafeMutablePointer<luaL_Buffer>!) | |
public func luaL_prepbuffsize(_ B: UnsafeMutablePointer<luaL_Buffer>!, _ sz: Int) -> UnsafeMutablePointer<Int8>! | |
public func luaL_addlstring(_ B: UnsafeMutablePointer<luaL_Buffer>!, _ s: UnsafePointer<Int8>!, _ l: Int) | |
public func luaL_addstring(_ B: UnsafeMutablePointer<luaL_Buffer>!, _ s: UnsafePointer<Int8>!) | |
public func luaL_addvalue(_ B: UnsafeMutablePointer<luaL_Buffer>!) | |
public func luaL_pushresult(_ B: UnsafeMutablePointer<luaL_Buffer>!) | |
public func luaL_pushresultsize(_ B: UnsafeMutablePointer<luaL_Buffer>!, _ sz: Int) | |
public func luaL_buffinitsize(_ L: OpaquePointer!, _ B: UnsafeMutablePointer<luaL_Buffer>!, _ sz: Int) -> UnsafeMutablePointer<Int8>! | |
/* }====================================================== */ | |
/* | |
** {====================================================== | |
** File handles for IO library | |
** ======================================================= | |
*/ | |
/* | |
** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and | |
** initial structure 'luaL_Stream' (it may contain other fields | |
** after that initial structure). | |
*/ | |
public var LUA_FILEHANDLE: String { get } | |
public struct luaL_Stream { | |
public var f: UnsafeMutablePointer<FILE>! /* stream (NULL for incompletely created streams) */ | |
public var closef: lua_CFunction! /* to close stream (NULL for closed streams) */ | |
public init() | |
public init(f: UnsafeMutablePointer<FILE>!, closef: lua_CFunction!) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment