<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks a lot for the info Christof, IOhannes and Miller. Everything is starting to make sense :)<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
Is there any kind of document containing development guidelines or an explanation of the inner workings of PD?
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The closest i could find is the ChangeLog.txt (which contained precious information that really helped me get started) in the
<a href="https://github.com/pure-data/pure-data/blob/master/src/CHANGELOG.txt#L135" title="https://github.com/pure-data/pure-data/blob/master/src/CHANGELOG.txt#L135">
"original source notes" section .<br>
</a></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>Cheers,</div>
<div><span>Henri.</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> Christof Ressi <christof.ressi@gmx.at><br>
<b>Enviado:</b> terça-feira, 20 de novembro de 2018 15:29<br>
<b>Para:</b> Henri Augusto Bisognini<br>
<b>Cc:</b> pd-dev@lists.iem.at<br>
<b>Assunto:</b> Aw: [PD-dev] why some structs are defined in m_obj.c? + what are vinlets and voutlets?</font>
<div> </div>
</div>
<div><font size="2"><span style="font-size:11pt">
<div>Hi, <br>
 <br>
you can actually use obj_starttraverseoutlet() to traverse the outlets like this:<br>
<br>
// x is your object<br>
t_outlet *outlet;<br>
int nout = obj_noutlets(x);<br>
for (int i = 0; i < nout; ++i){<br>
    obj_starttraverseoutlet(x, &outlet, i);<br>
    // do something with outlet<br>
}<br>
<br>
obj_starttraverseoutlet returns the connections from this outlet to other ojects (which you can traverse with obj_nexttraverseoutlet), but it also gives you the outlet via the second parameter (a t_outlet** so it can change your t_outlet* to point to the right
 outlet).<br>
<br>
note that those functions are not part of the public API, so use with caution.<br>
<br>
Christof<br>
<br>
<br>
Gesendet: Dienstag, 20. November 2018 um 17:37 Uhr<br>
Von: "Henri Augusto Bisognini" <msndohenri@hotmail.com><br>
An: "pd-dev@lists.iem.at" <pd-dev@lists.iem.at><br>
Betreff: [PD-dev] why some structs are defined in m_obj.c? + what are vinlets and voutlets?<br>
<br>
Hi.<br>
 <br>
I'm starting to dwelve into pd's C side of things. I'm having a really hard time figuring stuff out. (i have mainly experience with more high-level languages like Java, etc)<br>
 <br>
I'm trying to experiment with some editor features and i've been wandering: <br>
 <br>
why the _inlet and _outlet structures are defined in m_obj.c instead of m_pd.h ?<br>
 <br>
This way i can't access the structure members. I'm trying to traverse an t_object's t_outlets linked list but<br>
 <br>
t_outlet *o = selected_object->te_outlet;<br>
o = o->o_next;<br>
but this throws me an "dereferencing incomplete type" error since there is no definition for t_outlet inside m_pd.<br>
 <br>
 The same goes for accessing members of t_outconnect for example, but there are two methods that allows you to traverse the connections linked list<br>
obj_starttraverseoutlet()       (m_imp.h)(m_obj.c)<br>
obj_nexttraverseoutlet()       (m_imp.h)(m_obj.c)<br>
 <br>
<br>
But i couldn't find any method to traverse an t_object's linked list of t_outlets. The only three methods that seems to return t_outlets pointers are<br>
 <br>
t_outlet *outlet_new(t_object *owner, t_symbol *s)                                       (m_obj.c)<br>
t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *s)              (g_graph.c)<br>
and <br>
t_outlet *voutlet_getit(t_pd *x)        (g_io.c)<br>
which i currently do not understand but doesn't seem to be what i'm looking for.<br>
 <br>
How could i traverse from, lets say the g_editor.c file, all the t_inlets and t_outlets of an t_object?<br>
 <br>
Btw, on a second question, what exactly are vinlets and voutlets? <br>
 <br>
Cheers,<br>
Henri._______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at
<a href="https://lists.puredata.info/listinfo/pd-dev" title="CTRL+Clique para seguir o link
https://lists.puredata.info/listinfo/pd-dev">
https://lists.puredata.info/listinfo/pd-dev</a><br>
</div>
</span></font></div>
</body>
</html>