The hook runner itself should just be in lua. Instead of scripts, you write lua modules. If a lua module has a function with the correct names (ie, same as hooks) it uses that:
Ie in my module foo function fixups( r ) .... Would get called at fixups, etc. No need for a state per file, etc. Just have one state per thread. -- Brian Akins