cffi-lua icon indicating copy to clipboard operation
cffi-lua copied to clipboard

Allow cdef declarations to be scoped to a namespace

Open gynt opened this issue 10 months ago • 0 comments

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.

gynt avatar Mar 06 '25 10:03 gynt