Closed Duckwhale closed 1 year ago
Since automatic updates as part of the build process seem a bit tricky (with bootstrapping and luajit-only APIs), I'll leave it as a manual step for now. It's probably not worth spending time on automating as it only takes a few seconds to copy/paste the generated headers into the cdef
field. The update frequency would have to be fairly high for that investment to pay off.
Goals:
A quick prototype suggests the following approach may be viable:
llhttp.h
via https://github.com/facebookresearch/CParserlcpp
producesffi.cdef()
)Bindings/llhttp_ffi.h
This should work since the llhttp headers don't use any other fancy stuff that
lcpp
couldn't handle.I'm a bit worried since the entire thing relies on an experimental tool that may or may not continue to function in the future, but if nothing major changes it might still be worth the risk. Having the definitions auto-generated would save a lot of maintenance work, and avoid difficult-to-debug SEGFAULT errors in FFI code.