8000 GitHub - shanfl/minilua: Single-file port of Lua, a powerful scripting language.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ minilua Public
forked from edubart/minilua

Single-file port of Lua, a powerful scripting language.

License

Notifications You must be signed in to change notification settings

shanfl/minilua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniLua

This is Lua contained in a single header to be bundled in C/C++ applications with ease. Lua is a powerful, efficient, lightweight, embeddable scripting language.

Example Usage

#define LUA_IMPL
#include "minilua.h"

int main() {
  lua_State *L = luaL_newstate();
  if(L == NULL)
    return -1;
  luaL_openlibs(L);
  luaL_loadstring(L, "print 'hello world'");
  lua_call(L, 0, 0);
  lua_close(L);
  return 0;
}

Usage

Copy minilua.h into your C or C++ project, include it anywhere you want to use Lua API. Then do the following in one C file to implement Lua:

#define LUA_IMPL
#include "minilua.h"

By default it detects the system platform to use, however you can explicitl 6258 y define one.

Note that almost no modification was made in the Lua implementation code, thus there are some C variable names that may collide with your code, therefore it is best to declare the Lua implementation in dedicated C file.

Optionally provide the following defines:

  • LUA_MAKE_LUA - implement the Lua command line REPL

Documentation

For documentation on how to use Lua read its official manual.

Updates

  • 25-Jul-2024: Updated to Lua 5.4.7.
  • 13-Nov-2023: Updated to Lua 5.4.6.
  • 28-Jan-2022: Updated to Lua 5.4.4.
  • 31-Mar-2021: Updated to Lua 5.4.3.
  • 03-Dec-2020: Updated to Lua 5.4.2.
  • 27-Nov-2020: Library created, using Lua 5.4.2-rc1.

Notes

This library tries to keep up with latest official Lua release. The header is generated using the bash script gen.sh all modifications done is there.

License

Same license as Lua, the MIT license, see LICENSE.txt for information.

About

Single-file port of Lua, a powerful scripting language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.3%
  • Other 0.7%
0