title: Wrapping a foreign pointer into a SWIG data structure
body: <p>I'm using Lua with two C libraries, one of which is using SWIG and one is wrapped manually. </p>
  
  <p>The library which is wrapped manually is an interface to Freetype; it creates <code>FT_Face</code> pointers in C which it returns as lightuserdata.</p>
  
  <p>Now I need to pass this <code>FT_Face</code> as a parameter to one of the functions which is wrapped by SWIG. However, SWIG of course does not take ordinary userdata as parameters, but expects that every C pointer is created by SWIG - even though I have a <code>FT_Face</code> pointer, SWIG  wants to see a <code>SWIGTYPE_p_FT_Face</code>, which is <code>swig_lua_userdata</code> underneath.</p>
  
  <p>Is there a way to turn Lua userdata into <code>swig_lua_userdata</code>? How does I get SWIG to 'recognise' my <code>FT_Face</code> userdata as a valid parameter to a function?</p>