title: How to add an own struct_info.json? (emscripten)
body: <p>I would like to port a C library. There is a really short tutorial about it here: <a href="https://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#implement-c-in-javascript" rel="noreferrer" title="tutorial">Interacting with code</a></p>
  
  <p>I need to create a struct using javascript, and return a pointer to it. I looked into the libraries, which are already ported. My code looks like this:</p>
  
  <pre><code>var ptr = _malloc({{{ C_STRUCTS.MyStruct.__size__ }}});
  
  {{{ makeSetValue('ptr', C_STRUCTS.MyStruct.attr, '0', 'i8') }}};
  </code></pre>
  
  <p>It does not work, because emscripten does not know about <code>MyStruct</code>.</p>
  
  <p>My library definition is added to the project using <code>--js-library</code>
  But I don't know, how to add a struct definition (<code>struct_info.json</code>)</p>
  
  <p>In the C code, I have:</p>
  
  <pre><code>struct MyStruct {
      int8_t attr;
      //...
  }
  </code></pre>