<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 06/08/2013 04:13 AM, Lex Trotman
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKhWKDOkJD+BwLo=PPjXXZV+z_jcwb3xROaGr8ijseybMYUNCA@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On 8 June 2013 20:31, Roger Booth <span
              dir="ltr"><<a moz-do-not-send="true"
                href="mailto:rbooth@kabooth.com" target="_blank">rbooth@kabooth.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000">
                <div>
                  <div class="h5">
                    <div>On 06/08/2013 03:02 AM, Frank Lanitz wrote:<br>
                    </div>
                  </div>
                </div>
                <blockquote type="cite">
                  <div>
                    <div class="h5">
                      <pre>On Sat, 08 Jun 2013 02:54:38 -0700
Roger Booth <a moz-do-not-send="true" href="mailto:rbooth@kabooth.com" target="_blank"><rbooth@kabooth.com></a> wrote:

</pre>
                      <blockquote type="cite">
                        <pre>One thing I could ask for is a reference in the docs to where I can
find the correspondence between api and abi. Maybe thats the wrong
question, but anyway, how do i know which abi version I need? This is
in regards to PLUGIN_VERSION_CHECK(xxx)
</pre>
                      </blockquote>
                      <pre>A lot of functions have a note at Geany's API documentation, since
which version of Geany they are avaialble. E.g. Since: 0.16 at
utils_str_casecmp().
At <a moz-do-not-send="true" href="http://wiki.geany.org/plugins/development/api-versions" target="_blank">http://wiki.geany.org/plugins/development/api-versions</a> you can find
also the connection between API and ABI as well as the corresponding
Geany version.

Cheers, 
Frank
</pre>
                      <br>
                      <fieldset></fieldset>
                      <br>
                    </div>
                  </div>
                  <div class="im">
                    <pre>_______________________________________________
Devel mailing list
<a moz-do-not-send="true" href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a>
<a moz-do-not-send="true" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
                  </div>
                </blockquote>
                I guess what I was asking for was a note in the docs
                that talk about writing plugins, and especially in the
                docs about PLUGIN_VERSION_CHECK() that points to where
                the programmer can read up on the connection between api
                and abi. Or at least how the programmer can find out the
                number. <br>
                <br>
                Its great that you tell me here, and I know that
                somewhere in my mail history I have the info as well,
                but wouldn't it be better to put the info at the
                location where it helps the the programmer that is about
                to add a PLUGIN_VERSION_CHECK() to a plugin? That was an
                issue for me, and adding the references to the location
                where I was looking would have helped me.<br>
                <br>
                But beyond that, let me understand. What I do when
                writing a plugin is I keep track of the least value of
                x.yy in "Since: x.yy" for every function I use from the
                Geany API. Then I look at the URL you listed to find
                x.yy and cross reference it to an abi number. And that
                abi number is the number I plug in to the
                PLUGIN_VERSION_CHECK() macro. Is that how this works? If
                that is so, again, maybe it would be nice to document
                the manual procedure programmers should follow.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div style="">It might be just a typo on your part, but it
              is the biggest A*P*I number you get from the table that
              you plug into the version check.  You don't do anything
              with the ABI number, its automatic.</div>
            <div style=""><br>
            </div>
            <div style="">Or to be more realistic, plug in the API
              number of the geany you are developing your plugin
              against. If you are using a function that is too new for
              the Geany you are using you will get a compilation error.
              So simply use the oldest version of Geany you want the
              plugin to work for and sit back and let the compiler take
              the strain :)</div>
            <div><br>
            </div>
            <div style="">If you develop with a new version of Geany,
              then only when you are *sure* your plugin is finished
              should you consider looking for the oldest version of API
              that will work, therefore defining the oldest version of
              Geany that will work.  But due to the unfortunate changes
              of ABI that have happened every few versions, people will
              have to compile your plugin themselves to use older Geany
              versions, so your audience is narrowed significantly
              (those who use an older Geany but are willing to compile
              plugins).  It is not possible to use a precompiled plugin
              with a version of Geany that has a different ABI, even if
              the API is ok.</div>
            <div style=""><br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> <br>
                Your initial post in this thread asked
                <div class="im"><br>
                  <br>
                      Is there something that describes how to go about
                  adding a plugin to geany-plugins?<br>
                  <br>
                </div>
                It sounded to me like you wanted to know about issues
                folks had writing plugins. Well, I'm listing issues I
                have had writing Geany plugins.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div style="">Actually I wanted to know how to add them to
              the g-p build system, rather than just plugins in general,
              since I havn't done anything g-p before :) </div>
            <div style="">
              <br>
            </div>
            <div style="">Since various people claim its just copying
              the examples in the docs I'll see tomorrow :)</div>
            <div><br>
            </div>
            <div style="">But thanks for the feedback that it isn't
              clear how best to use the API/ABI versions, thats the sort
              of info the experts need if they are to be able to improve
              the docs.</div>
            <div style=""><br>
            </div>
            <div style="">Cheers</div>
            <div style="">Lex</div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> </div>
              <br>
              _______________________________________________<br>
              Devel mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
              <a moz-do-not-send="true"
                href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel"
                target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
              <br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
    <br>
    From the Geany plugin website at<br>
       
<a class="moz-txt-link-freetext" href="http://www.geany.org/manual/reference/plugindata_8h.html#a68c850fc7108c65909f4340da8c16df9">http://www.geany.org/manual/reference/plugindata_8h.html#a68c850fc7108c65909f4340da8c16df9</a><br>
    <br>
    ====================================================<br>
    <table class="memname">
      <tbody>
        <tr>
          <td class="memname">#define PLUGIN_VERSION_CHECK</td>
          <td>(</td>
          <td class="paramtype"> </td>
          <td class="paramname">api_required</td>
          <td> ) </td>
          <td><br>
          </td>
        </tr>
      </tbody>
    </table>
    <b>Value:</b>
    <div class="fragment">
      <pre class="fragment">gint <a class="code" href="http://www.geany.org/manual/reference/pluginsymbols_8c.html#a02238186945c26ea04e20410daf5b209" title="Use the PLUGIN_VERSION_CHECK() macro instead.">plugin_version_check</a>(gint abi_ver) \
    { \
        <span class="keywordflow">if</span> (abi_ver != <a class="code" href="http://www.geany.org/manual/reference/plugindata_8h.html#a81ace29a6d7fb7cce2b59100fe3f6d71" title="The Application Binary Interface (ABI) version, incremented whenever existing fields in the plugin da...">GEANY_ABI_VERSION</a>) \
            <span class="keywordflow">return</span> -1; \
        <span class="keywordflow">return</span> (api_required); \
    }
</pre>
    </div>
    <p>Defines a function to check the plugin is safe to load. </p>
    <p>This performs runtime checks that try to ensure:</p>
    <ul>
      <li>Geany ABI data types are compatible with this plugin.</li>
      <li>Geany sources provide the required API for this plugin.
        <dl>
          <dt><b>Parameters:</b></dt>
          <dd>
            <table border="0" cellpadding="0" cellspacing="2">
              <tbody>
                <tr>
                  <td valign="top"><br>
                  </td>
                  <td valign="top"><em>api_required</em> </td>
                  <td>The minimum API number your plugin requires. Look
                    at the source for the value of <code>GEANY_API_VERSION</code>
                    to use if you want your plugin to require the
                    current Geany version on your machine. You should
                    update this value when using any new API features. </td>
                </tr>
              </tbody>
            </table>
          </dd>
        </dl>
      </li>
    </ul>
    ======================================================<br>
    The above documentation is crap.<br>
    <br>
    First, note that the macro definition describes the parameter as 
    abi_ver. So, according to the documentation, where does the sole
    parameter - abi_ver - come from?<br>
    <br>
    So we can skip the test<br>
        if(abi_ver blah blah)<br>
    unless somebody can answer the above question.<br>
    <br>
    So that leads to the last line of code that generates stuff:<br>
        return api_required;<br>
    <br>
    I eliminated superfluous parens.<br>
    <br>
    As documented, this macro returns what it is passed.<br>
    <br>
    And you wonder why I'm confused?<br>
    <br>
    BTW, this one is<br>
    <dl class="since">
      <dt><b>Since:</b></dt>
      <dd>0.19 </dd>
    </dl>
    <br>
    <br>
    <br>
  </body>
</html>