HC_Show_Owner

Key HC_Show_Owner(char const *segment, char *owner)
Key HC_Show_Owner(char const segment, char owner)

Returns the segment which contains a given segment or which contains an item with a given key.

Given a key pointing to a geometrical primitive (e.g. point, line, marker), a style, an include, or a subsegment, Show_Owner_By_Key returns its parent segment. For example, given the key for a line this might be used to reveal the color of the line, by determining its owning segment and then doing a Show_Net_Color() on that segment.

If the key corresponds to a text cursor, then in that special case the owner is the text, not a segment. The key of the text can be returned, but obviously no segment name can be.

If the key or the segment refers to the root segment (“/”), then there is no owner: owner will be returned as blank or null, and ownerkey will be returned as zero. This is not considered an error - no message is generated.

Show_Owner is nearly the same as:

Open_Segment (*segment*)
Show_Pathname_Expansion ("^", *owner*)
Close_Segment ()

(The differences are that Open_Segment() will create segment if it didn’t exist, while Show_Owner would just complain, and that the root segment would give indigestion to Show_Pathname_Expansion() of “^”).

HC_Show_Key_Type, HC_Show_Pathname_Expansion, HC_Show_Segment, HC_Get_Selection, HC_Begin_Contents_Search.

Parameters

segment: The name of a segment whose owning segment you wish to find.

owner: The segment which owns segment. Returned to user. Passed by reference always.

Returns

The key of the owning segment.