WMPATHMAKE(3W)
NAME
wmpathmake − build a path name using an environment variable
SYNOPSIS
int wmpathmake(environ,suffix,target);
char *environ, *suffix, *target;
DESCRIPTION
environ
is a pointer to a null terminated character string with the name of an environment variable containing a directory path.
suffix
is a pointer to a null terminated character string with a path name in it.
target
is a pointer to sufficient space, minimum of 40 chars, to return the resulting path name.
DISCUSSION
Wmpathmake expands the given suffix and environment variable to an absolute path name. Rules of processing are: unless the suffix begins with "/", "./", or "../", the suffix is appended to the value of the named environment variable. In all cases the path name is expanded to an absolute path name. Note the following:
∗ The space pointed at by target, must be a minimum of 40 characters.
∗ If the value of the environment variable duplicates the leading portion of the suffix, then no appending is done. For example, "x/y/z" cannot be appended to "x/y".
∗ wmpathmake requires stdin and stdout to be open in order to expand "./" or "../", see getcwd(3C).
Typically wmpathmake is used to attach the value of the $WMDIR environment variable to "wm" or some window name. Care should be taken when $WMDIR is "./" or "../", in that $WMDIR must be the same for both the window system and the user, otherwise unexpected results will occur.
SEE ALSO
DIAGNOSTICS
A return value of -1 indicates that the resulting path name was truncated at 40 characters; otherwise a return value of 0 indicates no error occurred.
Hewlett-Packard Company — May 11, 2021