title: Wrapping C code with SWIG that uses static global variables
body: <p>I'm wrapping some C code from an embedded system for experimenting, using SWIG and targeting Python. It's simple code, and I've stubbed out the hardware and everything is compiling fine. </p>
  
  <p>The issue I've run into is that the functions I'm interested in operate on a static global 'context' variable defined at the top of the C file. I can't figure out how to have this variable instantiated by the module and be operated on by the wrapped functions. </p>
  
  <p>I made some simple test files to play with, and if I declare the global variable in the module it appears in cvar, but a function which is supposed to modify this variable in its body has no effect on the cvar instance. </p>
  
  <p>Is there any way to make this work, without modifying the C source files I am wrapping?</p>