title: Including C header file with lots of global variables
body: <p>I have an include file with 100+ global variables. It's being used in a library, but some programs that I'm linking the lib to also need to access the globals.</p>
  
  <p>The way it was built:</p>
  
  <pre><code>// In one library .c file
  #define Extern
  
  // In the programs that use the globals
  #define Extern extern
  
  // In the .h file
  Extern int a,b,c;
  </code></pre>
  
  <p>I had a hard time understanding why the original programmer did that so I removed that define Extern stuff. Now I think I understand the thing about TU with the help of stackoverflow:
  <a href="https://stackoverflow.com/questions/1575766/including-header-file-with-global-variable">1</a>, 
  <a href="https://stackoverflow.com/questions/2649427/difference-between-putting-variables-in-header-vs-putting-variables-in-source">2</a>, 
  <a href="https://stackoverflow.com/questions/1578635/declaring-a-global-in-a-global-header-file">3</a>.</p>
  
  <p>Now I understand that I should define the global variables in one .c file in the library and use extern in the .h file. The problem is that I don't want to duplicate code.</p>
  
  <p>Should I go back to that #define Extern voodoo? </p>