<blockquote>
<p>The separate API allows to do the registration in the plugin's init(), and have the file extensions deppend on plugin configuration. Also a API-wise separattion to geany_plugin_register() is needed to allow for nested proxies.</p>
</blockquote>

<p>I get that, my point was that I would find the API less odd if one filled a specific structure, rather than one already used for something else.</p>

<p>e.g.</p>

<div class="highlight highlight-source-c"><pre>Proxy proxy = {
  .<span class="pl-smi">extensions</span> = { <span class="pl-s"><span class="pl-pds">"</span>so<span class="pl-pds">"</span></span>, <span class="pl-c1">NULL</span> },
  .<span class="pl-smi">load</span> = my_load,
  .<span class="pl-smi">probe</span> = my_probe,
  .<span class="pl-smi">unload</span> = my_unload
};
<span class="pl-en">geany_plugin_register_proxy</span>(plugin, &proxy);</pre></div>

<p>or alike.  But I know it has drawbacks, like binary incompatibility if the struct expands (solvable by  versioning the struct, but a bit annoying), etc.</p>

<p>I don't really mind though, as it does has a few advantages (at least being simple and easy to expand), and that API won't be used by everyone so any oddness won't affect too many people.</p>

<blockquote>
<p>A proxy can be a proxy for many types. the only limitation is that only one set of ProxyFuncs is supported per proxy. But this limitation is not a problem, since the proxies can do their own dispatching. For geany it simplifies storing the pointers (avoids introducing a list of vtables, etc)</p>
</blockquote>

<p>Okay, so maybe that part is not really relevant indeed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/629#issuecomment-143058333">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ9hcUyOlqUolRiCmzR5uBZwiw8pYks5o1GW_gaJpZM4Fy7fG.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/629#issuecomment-143058333"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>