Mail Archives: geda-user/2015/09/05/23:35:57
Hello Vladimir,
On Sat, 5 Sep 2015, Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
>
> Hi, Igor.
>
> All objects have the same type OBJECT (struct st_object) defined in
> libgeda/include/libgeda/struct.h. It has pointers to "substructures".
> The substructure for components is COMPLEX, for pins it is LINE in
> essence. The struct COMPLEX (st_complex) has a member named prim_objs
> which is a list of component primitives. Text objects are attributes if
> their text is in the form 'name=value'. If an object is an attribute,
> the st_object member attached_to shows the object where the attribute is
> attached (if it is attached). The lowlevel logic of working with
> attributes is in libgeda/src/o_attrib.c.
>
Great, thank you. This is the answer to the question I was going to post
this morning. Now this is fast, I get the answer before I even post the
question :)
About the original question from yesterday: I was more interested in
whether there is a hash of refdes -> OBJECT, or anything like that, being
constantly maintained by gschem. Or whenever gshcem is looking for
something, does it do linear searches on the lists of pages and objects?
Yesterday my impression was that the latter happens. It'd make my algo
O(n*m) - n is the number of object, m is the number of patch requests on
the back annotation list. So I probably build a temporary hash before the
action and discard it after the action. This'd cost c*n+m (c is the
overhead of creating/discarding string->pointer hash entries).
Regards,
Igor2
- Raw text -