ok, my bad. I haven't read proto_tree_get_parent() documentation and was guessing - erroneously - that it was returning a tree ... because a parent of a tree should be a tree and not an item (in the case, one day someone would like to have an API which differentiates proto_item from proto_tree).
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
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
In the current practice the implementation of
proto_tree_get_parent() is pretty eloquent.