title: Passing primitive pointers to C function from Cython
body: <p>I am writing a Cython wrapper around a C library we are maintaining.  I am getting the following error message:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>analog.pyx:6:66: Cannot convert 'unsigned short (*)' to Python object
  </code></pre>
  
  <p>Here's the code I am trying to write:
  </p>
  
  <pre class="lang-python prettyprint-override"><code>cimport company as lib
  
  def get_value(device, channel, index):
      cdef unsigned short aValue
  
      err = library_get_data_val(device, channel, index, &amp;aValue) # line 6
  
      # Ignore the err return value for StackOverflow.
  
      return aValue
  </code></pre>
  
  <p>The prototype of the C function I am trying to use is:</p>
  
  <pre class="lang-python prettyprint-override"><code>unsigned long library_get_data_val(unsigned long device, int channel,
      int index, unsigned short *pValue);
  </code></pre>
  
  <p>The library function returns the requested value in the <code>aValue</code> parameter.  It's just an <code>unsigned short</code> primitive.  What's the expected way of returning primitives (i.e. not <code>struct</code>) from these type of functions?  I am new to Cython so the answer may be quite simple but I didn't see anything obvious through Google.</p>