Oh yeah, attached is the source code and compiled versions for linux and window. I do not have cvs access. Could someone please include it in the cvs and adapt the makefile accordingly? Also could someone compile it for OS X intel and PPC and send me the binary?
<br><br>Tom<br><br><div><span class="gmail_quote">On 8/29/07, <b class="gmail_sendername">Thomas O Fredericks</b> &lt;<a href="mailto:tof@danslchamp.org">tof@danslchamp.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
getdollarzero can get the dollar zero of any parent.<br>For example, lets say a patch called &quot;top&quot; contains the abstraction 1. <br>The abstraction 1 contains the abstraction 2. <br>The abstraction 2 contains the abstraction 3. 
<br>Well, with getdollarzero, abstraction 1 through 3 can know the dollar zero of the patch &quot;top&quot;. <br>The patch &quot;top&quot; becomes the &quot;root&quot; patch. <br>All the abstractions 1 through 3 have in common this &quot;root&quot; patch.
<br><br>This is what I needed it for: <br>1) I am currently developing a state saving system that does not require the &quot;$0&quot; arguments (of Memento for example). The state of all elements that have the same &quot;root&quot; patch are saved together.
<br>2) I am also creating a timing architecture for PD and I wanted all elements in the same &quot;root&quot; to be synchronized together.<br><br>Tom<div><span class="e" id="q_114b3afbbc7029a5_1"><br><br><br><br><div><span class="gmail_quote">
On 8/29/07, <b class="gmail_sendername">
Hans-Christoph Steiner</b> &lt;<a href="mailto:hans@eds.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hans@eds.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div><br></div><div>Hey,</div><div><br></div><div>I think Günter didn&#39;t want to depend on non-public headers like g_canvas.h, so included the glist struct from that header.&nbsp; Personally, I think makes more sense to include the g_canvas.h header.
</div><div><br></div><div>[parentdollarzero] like a useful object, I am not usre what [getdollarzero] does beyond [float $0] or [$0].&nbsp; Anyway, hopefully they make into Pd-extended.</div><div><br></div><div>.hc</div><div>
<br>
</div><br><div><div><span><div>On Aug 27, 2007, at 4:43 PM, Thomas O Fredericks wrote:</div><br></span></div><blockquote type="cite"><div><span>Thanks to Han&#39;s help page (
<a href="http://puredata.info/docs/developer/mingw" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://puredata.info/docs/developer/mingw</a>) I was able to compile a test external on windows with mingw. 
<br><br>I then started making a new external called getdollarzero based on getdir (from ggee) and parentdollarzero (from iemlib2). I compiled it and it works but I had to: <br>1) remove Guenter&#39;s hack from getdir&#39;s source code
<br>2) and therefore include g_canvas.h<br><br>My question is the following: why is there a hack in the first place? If I do not use it will my code crash PD in some way (I compiled against PD 0.4 and worked fine during testing)?
<br><br>As a reference, here is my code with the hack commented out :<br><br><br>--------- getdollarzero&nbsp; --------<br clear="all"><br>#include &quot;m_pd.h&quot;<br>#include &quot;g_canvas.h&quot; //needed to include g_canvas.h once the hack was commented out 
<br><br><br>/* HACK<br>struct _glist<br>{<br>&nbsp;&nbsp;&nbsp; t_object gl_obj;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // header in case we&#39;re a glist<br>&nbsp;&nbsp;&nbsp; t_gobj *gl_list;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the actual data<br>&nbsp;&nbsp;&nbsp; struct _gstub *gl_stub;&nbsp;&nbsp;&nbsp;&nbsp; // safe pointer handler 
<br>&nbsp;&nbsp;&nbsp; int gl_valid;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // incremented when pointers might be stale<br>&nbsp;&nbsp;&nbsp; struct _glist *gl_owner;&nbsp;&nbsp;&nbsp; // parent glist, supercanvas, or 0 if none<br>};<br><br>END HACK<br>*/<br><br>typedef struct getdollarzero 
<br>{<br>&nbsp;&nbsp;&nbsp; t_object x_ob;<br>&nbsp;&nbsp;&nbsp; t_canvas * x_canvas;<br>&nbsp;&nbsp;&nbsp; t_outlet* x_outlet;<br>&nbsp;&nbsp;&nbsp; int x_level;<br>} t_getdollarzero;<br><br><br><br><br>static void getdollarzero_bang(t_getdollarzero *x)<br>{<br>&nbsp;&nbsp;&nbsp; int i = x-&gt;x_level; 
<br>&nbsp;&nbsp;&nbsp; t_canvas* last = x-&gt;x_canvas;<br><br>&nbsp;&nbsp;&nbsp; while (i&gt;0) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i--;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (last-&gt;gl_owner) last = last-&gt;gl_owner;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; &nbsp; // code example taken from iemlib2&#39;s parentdollarzero:<br>

 &nbsp;&nbsp;&nbsp; // x-&gt;s_parent_unique = canvas_realizedollar((t_canvas *)this_canvas-&gt;gl_owner, gensym(&quot;$0&quot;)); <br>&nbsp;&nbsp;&nbsp; // original get dir function:<br>&nbsp;&nbsp;&nbsp; //outlet_symbol(x-&gt;x_outlet,canvas_getdir(last));<br><br>

&nbsp;&nbsp;&nbsp; outlet_symbol(x-&gt;x_outlet,canvas_realizedollar(last, gensym(&quot;$0&quot;))); <br>}<br><br>t_class *getdollarzero_class;<br><br>static void *getdollarzero_new(t_floatarg level)<br>{<br>&nbsp;&nbsp;&nbsp; t_getdollarzero *x = (t_getdollarzero *)pd_new(getdollarzero_class);
<br>&nbsp;&nbsp;&nbsp; x-&gt;x_canvas =&nbsp; canvas_getcurrent(); <br>&nbsp;&nbsp;&nbsp; x-&gt;x_outlet =&nbsp; outlet_new(&amp;x-&gt;x_ob, &amp;s_);<br>&nbsp;&nbsp;&nbsp; x-&gt;x_level&nbsp; =&nbsp; level;<br>&nbsp;&nbsp;&nbsp; return (void *)x;<br>}<br><br>void getdollarzero_setup(void)<br>{<br>&nbsp;&nbsp;&nbsp; getdollarzero_class = class_new(gensym(&quot;getdollarzero&quot;), (t_newmethod)getdollarzero_new, 0, 
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sizeof(t_getdollarzero), 0, A_DEFFLOAT,0);<br>&nbsp;&nbsp;&nbsp; class_addbang(getdollarzero_class, getdollarzero_bang);<br>}<br><br>--------- getdollarzero&nbsp; end --------<br clear="all"><br>-- <br>thomas ouellet fredericks, 
<a href="mailto:tof@danslchamp.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tof@danslchamp.org</a>, montreal, canada</span></div><div style="margin: 0px;">_______________________________________________
</div><div style="margin: 0px;"><a href="mailto:PD-list@iem.at" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">PD-list@iem.at</a> mailing list</div><div style="margin: 0px;">UNSUBSCRIBE and account-management -&gt; 
<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.puredata.info/listinfo/pd-list</a></div> </blockquote></div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">

<br><div><br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>Computer science is no more related to the computer than astronomy is related to the telescope.&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;-Edsger Dykstra
</div><br></span> </div><br></div></blockquote></div><br><br clear="all"><br>-- <br>thomas ouellet fredericks, <a href="mailto:tof@danslchamp.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tof@danslchamp.org
</a>, montreal, canada
</span></div></blockquote></div><br><br clear="all"><br>-- <br>thomas ouellet fredericks, <a href="mailto:tof@danslchamp.org">tof@danslchamp.org</a>, montreal, canada