title: Equivalent of C++ set container in C
body: <p>I am required to convert some C++ codes to C and I am having some problems regarding the STL container. In the original C++ code, set container is used as in <code>set&lt; pair&lt;int, int&gt;, sortMapped&gt; mySet;</code> where sortMapped is a custom comparator to "sort" the entry by mapped value instead of the key value. And of course basic insertion, removal and iterator are included in the original C++ code as well.</p>
  
  <p>So my problem is, does anyone knows the C equivalent of such "always sorted" container where I can write my own comparator as well? Thank you.</p>