title: dlsym/dlopen with runtime arguments
body: <p>I am trying to do something like the following</p>
  
  <pre><code>  enum types {None, Bool, Short, Char, Integer, Double, Long, Ptr};
    int main(int argc, char ** args) {
       enum types params[10] = {0};
       void* triangle = dlopen("./foo.so", RTLD_LAZY);
       void * fun = dlsym(triangle, ars[1]);
  
       &lt;&lt;pseudo code&gt;&gt;
    }
  </code></pre>
  
  <p>Where pseudo code is something like</p>
  
  <pre><code>fun = {}
  for param in params:
        if param == None:
           fun += void
        if param == Bool:
            fun += Boolean
        if param == Integer:
            fun += int
        ...
   returnVal = fun.pop()
   funSignature = returnval + " " + funName + "(" + Riffle(fun, ",") + ")"
   exec funSignature
  </code></pre>
  
  <p>Thank you</p>