cffi-lua
cffi-lua copied to clipboard
Allow cdef declarations to be scoped to a namespace
I have a use case where I provide a cffi interface to user scripts. Users can script in lua to access memory via struct definitions.
I am worried about name clashes as everything declared in cffi is global I think. I want my users' scripts to be able to use cdef independently of each other.
Possible solutions:
- Force users to use anonymous struct declarations. Does cffi-lua support this?
- Separate cdef namespaces for each user script. Does or can cffi-lua support this?
- Enforce a naming convention so user scripts use a prefix to avoid name clashes.