Show_Owner

Functions

HC_KEY Show_Owner (const char *segment, char *owner)
 Returns the segment which contains a given segment or which contains an item with a given key. More...
 
HC_KEY Show_Owner_By_Key (HC_KEY key, char *owner)
 Similar to Show_Owner(), but operates on an object referenced by an HC_KEY. More...
 
HC_KEY Show_Owner_Original_Key (HC_KEY key)
 Similar to Show_Owner() but returns the non-renumber key of the owning segment. More...
 

Detailed Description

Function Documentation

◆ Show_Owner()

HC_KEY Show_Owner ( const char *  segment,
char *  owner 
)

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

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.

DETAILS

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.

NOTES

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 "^").

RESTRICTIONS

See also
Show_Key_Type, Show_Pathname_Expansion, Show_Segment, Get_Selection, Begin_Contents_Search.

◆ Show_Owner_By_Key()

HC_KEY Show_Owner_By_Key ( HC_KEY  key,
char *  owner 
)

Similar to Show_Owner(), but operates on an object referenced by an HC_KEY.

Parameters
key- The unique numeric identifier pointing to an object in the database.
owner- The segment which owns segment. Returned to user. Passed by reference always.
Returns
The key of the owning segment.

DETAILS

No additional details. See Show_Owner()

◆ Show_Owner_Original_Key()

HC_KEY Show_Owner_Original_Key ( HC_KEY  key)

Similar to Show_Owner() but returns the non-renumber key of the owning segment.

Parameters
key- The unique numeric identifier pointing to an object in the database.
Returns
Returns the non-renumbered key of the owning segment of the passed key.

DETAILS

No additional details. See Show_Owner().