title: Calling a function pointer with Emscripten
body: <p>With Emscripten, is it possible to call a function pointer (thus, a number) from JavaScript?<br>
  The signature of the function is variable, so I can't write a helper and be done.</p>
  
  <p>To illustrate an example, I've got a function like this:</p>
  
  <pre><code>// Returns a function pointer to call, with the appropiate
  // arguments, to initialize the demanded feature.
  void* get_feature_activator(feature_t feat);
  </code></pre>
  
  <p>You're supposed to use it as follows:</p>
  
  <pre><code>// Initialize the speaker
  void* activator = get_feature_activator(FEATURE_SPEAKER);
  // We know this function needs one float, so we cast and call it
  ((void(*)(float))activator) (3.0);
  </code></pre>
  
  <p>To do the same with JavaScript:</p>
  
  <pre><code>var activator = _get_feature_activator(constants.FEATURE_SPEAKER);
  // TODO: Need to call this pointer with one float
  </code></pre>