title: Lua/C binding, binding from lua
body: <p>I'm currently building a lua event system (in lua), however I want to be able to fire events from C too, I was wanting to bind a C function to a lua function, such that the C function could fire events in lua, I was planning to use the:</p>
  
  <pre><code>lua_register
  </code></pre>
  
  <p>function; however I can't seem to find a way to bind my lua function like this, it would seem I'm in need of a lua function that does the same, but from the lua side, I was thinking about making some hack, by binding a C function into lua, that simply calls 'lua_register', but this seems a bit unsafe to me.</p>
  
  <p>So what should I do instead?</p>