title: Linked list library
body: <p>I have to implement a linked list library, where every node has the type of the list. For example, the create function looks "normal" :</p>
  
  <pre><code>int LstCreate(LIST_ENTRY **List);
  </code></pre>
  
  <p>but GetNodeValue presents the Node as a list:</p>
  
  <pre><code>int LstGetNodeValue(LIST_ENTRY *Node, int *Value);
  
  int LstGetNthNode(LIST_ENTRY *List, int Index, LIST_ENTRY **Node);
  </code></pre>
  
  <p>How can I implement such a list ?
  My first idea was that the list is a structure that has only the head node in it like this:</p>
  
  <pre><code>struct LIST_ENTRY
  {
     int Value;
     LIST_ENTRY *Next;
  };
  </code></pre>
  
  <p>but then the list would have to be the head of the list every time.</p>
  
  <p>The structure can't look like this:</p>
  
  <pre><code>struct Node
  {
     int Value;
     Node *Next;
  }
  
  struct LIST_ENTRY
  {
     struct Node *Head;
     struct Node *CurrentNode;
     struct Node *Tail;
     ...
  }
  </code></pre>
  
  <p>because the Node has to have the SAME TYPE as the List.</p>