Functions | |
void | Show_Pathname_Expansion (const char *pathname, char *expansion) |
Identifies the full absolute pathname corresponding to a relative pathname. More... | |
void Show_Pathname_Expansion | ( | const char * | pathname, |
char * | expansion | ||
) |
Identifies the full absolute pathname corresponding to a relative pathname.
pathname | - A relative pathname with no wildcards. |
expansion | - The absolute segment name corresponding to pathname. Passed by reference always. Returned to user. |
Translates a relative pathname to its absolute pathname in the context of the currently open segment. For example, if the currently open segment is "?picture/a one/and a two", the relative pathname "^/and a three" translates to "?picture/a one/and a three".
As a shortcut to determine the currently open segment, use "." as pathname. (An "open segment search" also can find the currently open segment, but it's more work.)
This routine is most often used when you want to "put your thumb" on a spot in the segment tree—since the expanded name includes the complete specification, you can come back later without worrying about the currently open segment, changes in alias names, etc.
This routine takes a simple or partially qualified segment name, and returns a fully qualified name. Show_Segment() , for comparison, takes a key and returns the fully qualified name.
Pathname is expanded whether or not the referenced segments exist at the time of the call, i.e. in the above example, the segment "and a three" need not exist. Use Find_Segment ( Begin_Segment_Search() ) to see if a segment exists.
Any aliases in pathname are replaced by their definitions such that expansion contains no explicit aliases. Use Show_Alias() to see the actual definition of an alias.
Wildcards in a pathname ("*", "%") and anything inside parentheses are returned "as is".
The Show_Pathname_Expansion routine works fine for simple input segment names, but complicated input path names can confuse it.