<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Externals in C: How to access the array]]></title><description><![CDATA[<p>Task: I need to write an external library in C. A list with the name of the array comes to the object's inlet. How to get a pointer to this array inside an external library in C language?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12488/externals-in-c-how-to-access-the-array</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 01:36:27 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/12488.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Dec 2019 03:01:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Externals in C: How to access the array on Sat, 21 Dec 2019 03:01:29 GMT]]></title><description><![CDATA[<p>Task: I need to write an external library in C. A list with the name of the array comes to the object's inlet. How to get a pointer to this array inside an external library in C language?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12488/externals-in-c-how-to-access-the-array</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12488/externals-in-c-how-to-access-the-array</guid><dc:creator><![CDATA[Alexandr Tarasov]]></dc:creator><pubDate>Sat, 21 Dec 2019 03:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to Externals in C: How to access the array on Sat, 21 Dec 2019 09:04:09 GMT]]></title><description><![CDATA[<p>see d_array.c in the sources as an example: seems like the way to do this is use <code>pd_findbyclass(t_symbol, garray_class)</code><br />
here's a section from tabread:</p>
<pre><code>if (!(a = (t_garray *)pd_findbyclass(x-&gt;x_arrayname, garray_class)))
        pd_error(x, &quot;%s: no such array&quot;, x-&gt;x_arrayname-&gt;s_name);
    else if (!garray_getfloatwords(a, &amp;npoints, &amp;vec))
        pd_error(x, &quot;%s: bad template for tabread&quot;, x-&gt;x_arrayname-&gt;s_name);
    else
    {
        int n = f;
        if (n &lt; 0) n = 0;
        else if (n &gt;= npoints) n = npoints - 1;
        outlet_float(x-&gt;x_obj.ob_outlet, (npoints ? vec[n].w_float : 0));
    }
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/12488/externals-in-c-how-to-access-the-array/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12488/externals-in-c-how-to-access-the-array/2</guid><dc:creator><![CDATA[seb-harmonik.ar]]></dc:creator><pubDate>Sat, 21 Dec 2019 09:04:09 GMT</pubDate></item></channel></rss>