https://github.com/vulcan-dev/cslw
C99-C23 Simple Lua Wrapper
https://github.com/vulcan-dev/cslw
c11 c23 c99 lua wrapper
Last synced: 10 months ago
JSON representation
C99-C23 Simple Lua Wrapper
- Host: GitHub
- URL: https://github.com/vulcan-dev/cslw
- Owner: vulcan-dev
- License: gpl-3.0
- Created: 2023-08-14T21:08:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-19T02:18:19.000Z (over 2 years ago)
- Last Synced: 2025-02-26T19:06:09.608Z (10 months ago)
- Topics: c11, c23, c99, lua, wrapper
- Language: C
- Homepage:
- Size: 58.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cslw
C Simple Lua Wrapper (WIP)
## Building
```
gcc src/main.c src/cslw.h -Iyour/dir -Lyour/dir -llua
```
To enable LuaJIT support, add `-DSLW_USE_LUAJIT`
## Examples
- [tables.c](examples/example_table.c)
- More to come... for now, take a peek at [cslw.h](include/cslw/cslw.h).
## Supported C Versions:
- C99
- C11
- C17
- C18
- C2X
\>= C11 has [Generic](https://en.cppreference.com/w/c/language/generic) Support
## Notes
LuaJIT and Lua5.4 have been tested, on Windows and on Linux w/ WSL
This is still work-in-progress, I need to:
- Check more Lua versions on both OS's
- Add more safety
- Possibly add a `slwState_return(slw, slwt_string("retval1"), slwt_tnumber(42));` function of some sort, that way you don't manually have to push each return value.
- Cleanup functions that use variadic args
- Add more stack functions
- Improve performance (checking the generated ASM w/ IDA for Clang & GCC, + timing execution time)
- Move to CMake to make life easier with automatically finding Lua and handling cross-platform situations (Will to tomorrow?)