An open API service indexing awesome lists of open source software.

https://github.com/miqueas/lua-c-api-examples

Some C code I wrote while learning the Lua C API
https://github.com/miqueas/lua-c-api-examples

api c lua lua51 lua52 lua53

Last synced: 5 months ago
JSON representation

Some C code I wrote while learning the Lua C API

Awesome Lists containing this project

README

          

# Lua-C-API

A personal repo where I push things while I'm learning the Lua C API! Feel free to contribute :)

> **NOTE**: I really think that the Lua C API and this examples can be highly self-explained, BUT I recommend you to always check the Reference Manual to see in detail how every thing works

## Building

If you want to build this, you'll need Meson and Lua 5.1 development files and then:

```
meson . _BUILD
ninja -C _BUILD
```

And in the `_BUILD` folder you'll see the compiled files

## Running tests

Just:

```
meson test -C _BUILD
```

## References

I mainly readed the [Official Reference Manual][LuaManual] but I also saw this:

* [Veinin/lua-c-api-tutorial][lua-c-api-tutorial] – _First steps_
* [Stack (Wikipedia)][StackWikipedia] – _The simple illustration with numbers was really helpful_
* [Understanding the lua stack][UnderstandingStack] – _A set of articles I found about the stack_
* [tylerneylon/lua_api_demo][api_demo_repo] – _Here I learned how to use the `lua_newuserdata` function_
* [hertogp/lua-capi-examples][lua-capi-examples] – _Stack dump example_

And finally, thanks to the members of the [Telegram Group][TelegramGroup]!

## Why Lua 5.1?

Yes :heavy_check_mark:

[StackWikipedia]: https://en.wikipedia.org/wiki/Stack_(abstract_data_type)
[UnderstandingStack]: https://szpg1108.wordpress.com/2013/08/07/understanding-the-lua-stack-pt-1-the-basics/
[LuaManual]: https://www.lua.org/manual/5.1/manual.html#3
[api_demo_repo]: https://github.com/tylerneylon/lua_api_demo
[lua-c-api-tutorial]: https://github.com/Veinin/lua-c-api-tutorials
[lua-capi-examples]: https://github.com/hertogp/lua-capi-examples
[TelegramGroup]: https://t.me/LuaLang