title: Lua C API - Getting metatable from a table on stack
body: <p>Let's say we have a table that was passed to a function and it's now on top of the stack like so:</p>
  
  <pre><code>// -1 = table
  </code></pre>
  
  <p>Is it possible to get the metatable from that table on stack? I can simply get it with a known-name identifier like so:</p>
  
  <pre><code>luaL_getmetatable(L, "Foo");
  </code></pre>
  
  <p>But I want to re-use the function and get the metatable from the table that's in the stack.</p>
  
  <p>There is probably an easy way to do this, but I can't seem to find a function for this.</p>