Skip to content

thenumbernine/include-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Donate via Stripe

lua-include

If you want to use LuaJIT FFI with typical C #include statements.

Depends on:

Uses the environment variable $LUAJIT_INCLUDE_CACHE_PATH for storing, otherwise uses $HOME/.luajit.include.

Example:

local ffi = require 'ffi'
local include = require 'include'
local stdio = include '<stdio.h>'
stdio.printf("testing %d\n", ffi.cast('int64_t', 42))

TODO:

  • The cache stores by searched filename, but it would be nice if it could also first store by included filename, so that subsequent include's could get the correct file without doing a search (in case it's on a system where the C includes/compile is missing)

About

#include functionality for ffi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages