title: need to get the parent pointer value, whats the best way to do it
body: <pre><code>typedef struct node_ {
  
      avl_node node;
      some_struct *data;
  }node_t;
  </code></pre>
  
  <p>Now if a function(API) returns me the pointer to data is there a way, I can get the structure node_t pointer?</p>
  
  <p>For example:</p>
  
  <pre><code>node_t *a = malloc(sizeof(node_t));
  
  a-&gt;data = malloc(sizeof(some_struct));
  
  //some code
  
  //a-&gt;data-&gt;key = some_val;
  
  //avl_insert(a-&gt;data-&gt;key)
  
  
  /* API to get the data, which return pointer of type some_struct*/
  some_struct *temp;
  
  temp = get_data(key)
  </code></pre>
  
  <p>Is there a way for me to get the the pointer node_t of the "temp".</p>
  
  <p>Please, let me know what's the best way to get it.</p>