in APR 0.9 and 1.x, this flag's behavior is undefined if the rootpath is NULL or empty. In APR 2.0 this should be changed to imply NOTABSOLUTE if the rootpath is NULL or empty.
#define APR_FILEPATH_NOTABSOLUTE 0x08
Fail apr_filepath_merge if the merged path is absolute
#define APR_FILEPATH_NOTRELATIVE 0x04
Fail apr_filepath_merge if the merged path is relative
#define APR_FILEPATH_SECUREROOT 0x03
Cause apr_filepath_merge to fail if addpath is above rootpath, even given a rootpath /foo/bar and an addpath ../bar/bash
#define APR_FILEPATH_SECUREROOTTEST 0x02
internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT
#define APR_FILEPATH_TRUENAME 0x20
Resolve the true case of existing directories and file elements of addpath, (resolving any aliases on Win32) and append a proper trailing slash if a directory
Merge additional file path onto the previously processed rootpath
Parameters:
newpath
the merged paths returned
rootpath
the root file path (NULL uses the current working path)
addpath
the path to add to the root path
flags
the desired APR_FILEPATH_ rules to apply when merging
p
the pool to allocate the new path string from
Remarks:
if the flag APR_FILEPATH_TRUENAME is given, and the addpath contains wildcard characters ('*', '?') on platforms that don't support such characters within filenames, the paths will be merged, but the result code will be APR_EPATHWILD, and all further segments will not reflect the true filenames including the wildcard and following segments.
the root file path returned with APR_SUCCESS or APR_EINCOMPLETE
filepath
the pathname to parse for its root component
flags
the desired rules to apply, from
APR_FILEPATH_NATIVE Use native path seperators (e.g. '\' on Win32)
APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper
p
the pool to allocate the new path string from
Remarks:
on return, filepath points to the first non-root character in the given filepath. In the simplest example, given a filepath of "/foo", returns the rootpath of "/" and filepath points at "foo". This is far more complex on other platforms, which will canonicalize the root form to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also test for the validity of that root (e.g., that a drive d:/ or network share //machine/foovol/). The function returns APR_ERELATIVE if filepath isn't rooted (an error), APR_EINCOMPLETE if the root path is ambigious (but potentially legitimate, e.g. "/" on Windows is incomplete because it doesn't specify the drive letter), or APR_EBADPATH if the root is simply invalid. APR_SUCCESS is returned if filepath is an absolute path.