Skip to main content

svn_path_split

Function svn_path_split 

Source
pub unsafe extern "C" fn svn_path_split(
    path: *const c_char,
    dirpath: *mut *const c_char,
    base_name: *mut *const c_char,
    pool: *mut apr_pool_t,
)
Expand description

Divide the canonicalized @a path into @a *dirpath and @a *base_name, allocated in @a pool.

If @a dirpath or @a base_name is NULL, then don’t set that one.

Either @a dirpath or @a base_name may be @a path’s own address, but they may not both be the same address, or the results are undefined.

If @a path has two or more components, the separator between @a dirpath and @a base_name is not included in either of the new names.

examples: -

“/foo/bar/baz”  ==>  “/foo/bar” and “baz”
-
“/bar”          ==>  “/”  and “bar”
-
“/”             ==>  “/”  and “/”
-
“X:/”           ==>  “X:/” and “X:/”
-
“bar”           ==>  “”   and “bar”
-
“”              ==>  “”   and “”

@deprecated Provided for backward compatibility with the 1.6 API. New code should use svn_dirent_split(), svn_uri_split(), svn_relpath_split() or svn_fspath__split().