title: Understanding how to use typedef void function with pointers as params
body: <p>I'm trying to understand a firmware written in C that drives a chip for ultrawideband connections.</p>
  <p>The firmware does heavy use of <code>typedef</code> and pointers. I've understood most of the idea behind the firmware but there's a <code>typedef void</code> function I can't understand.</p>
  <p>Basically, the firmware creates a structure to hold the device data with</p>
  <pre><code>typedef struct
  {
     //some data
     dwt_cb_t    cbTxDone; // Callback for TX confirmation event
     //some other data
  } dwt_local_data_t ;
  </code></pre>
  <p>I've understood that the structure is named <strong>dwt_local_data_t</strong> and contains some variables including this strange <strong>dwt_cb_t</strong> type.</p>
  <p>On the .h file <strong>dwt_cb_t</strong> is named as</p>
  <pre><code>// Call-back type for all events    
  typedef void (*dwt_cb_t)(const dwt_cb_data_t *);
  </code></pre>
  <p>where <strong>dwt_cb_data_t</strong> is another structure in the form of</p>
  <pre><code>typedef struct
  {
      uint32 status;      //initial value of register as ISR is entered
      uint16 datalength;  //length of frame
      uint8  fctrl[2];    //frame control bytes
      uint8  rx_flags;    //RX frame flags, see above
  } dwt_cb_data_t;
  </code></pre>
  <p>Now, I'm trying to understand the meaning of <code>typedef void (*dwt_cb_t)(const dwt_cb_data_t *);</code></p>
  <p>From what I've understood, <code>typedef void</code> is a pointer-to-function type. It defines a variable <strong>dwt_cb_t</strong> that points to a function receiving as an input a constant struct <strong>dwt_cb_data_t</strong></p>
  <p>I don't know if my reasoning is correct because I can't understand why there's a <code>*</code> spaced at the end of  <strong>dwt_cb_data_t</strong>. Does it mean that the input of the function is the pointer of the structure? In this case, why don't write <code>typedef void (*dwt_cb_t)(const *dwt_cb_data_t);</code> instead?</p>