d always be accessed using the special typemap
variable <tt>$1_descriptor</tt>.  For example:
</p>

<div class="indent">
<pre>
%typemap(in) Foo * {
  if (!SWIG_IsOK(SWIG_ConvertPtr($input, (void **) &amp;$1, $1_descriptor, 0))) {
    SWIG_exception_fail(SWIG_TypeError, "in method '$symname', expecting type Foo");
  }
}
</pre>
</div>

<p>
If necessary, the descriptor for any type can be obtained using the <tt>$descriptor()</tt> macro in a typemap.
For example:
</p>

<div class="indent">
<pre>
%typemap(in) Fo