Sébastien Tandel wrote:
> I'm not sure it's really safe and cleaner since it's
> working only because proto_item = proto_tree =
proto_node
...
> On Mon, Mar 23, 2009 at 18:48, Luca Ceresoli
> <[email protected]> wrote:
> >  my_tree = ptvcursor_add_text_with_subtree(cursor,
..,"foo");
> >  my_item = proto_tree_get_parent(my_tree);
> >  /* ... */
> >  proto_item_set_text(my_item, "<%s>", my_string);

Not sure I got your point.
In proto.h, proto_tree_get_parent() is declared as taking a 
proto_tree* and returning a proto_item*, so I interpret it
this way:
  proto_tree* X -> proto_item* Y -> proto_tree* Z
  then proto_tree_get_parent(Z) returns Y.
Where am I wrong?

Of course I am speaking from the "theoretical" and
future-compatible POV.
In the current practice the implementation of
proto_tree_get_parent() is pretty eloquent.

Luca

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to