title: Expose only required functions in C
body: <p>I am writing a small API library sort of module in C. I will compile this module and give it to my fellow developers and I will expose some required functions in header file of my module so developers who will use my module know which function to call for required functionality. Now I want to inquire one thing: Can I expose only desired functions in C. e.g.</p>
  
  <p>I have test.c having:</p>
  
  <pre><code>#include "test.h"
  void A()
  {
    if( some condition is true )
      B();
    else
     return;
  }
  
  void B()
  {
    //some code here
  }
  </code></pre>
  
  <p>and in test.h, I have only one function exposed i.e.</p>
  
  <pre><code>void A();
  </code></pre>
  
  <p>Now B() clearly is dependent on condition put in A() otherwise it can not be run and as only A() is exposed in test.h then user wont know that he/she can also directly call B(). Now my fear is that if user gets to know (or by guess) that there is some function in my module called B() which can be called directly by bypassing A(), then it can compromise my implementation.</p>
  
  <p>I know that C++ would be better in this case because of public and private methods and I also have an idea that I can prevent B() being called directly by using some flag check of A() in B() but I want to know if there is any other method so that user cant call my functions (like B()) which are not exposed in header file.</p>