Skip to main content

svn_dirent_split

Function svn_dirent_split 

Source
pub unsafe extern "C" fn svn_dirent_split(
    dirpath: *mut *const c_char,
    base_name: *mut *const c_char,
    dirent: *const c_char,
    result_pool: *mut apr_pool_t,
)
Expand description

Divide the canonicalized @a dirent into @a *dirpath and @a *base_name.

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 dirent’s own address, but they may not both be the same address, or the results are undefined.

If @a dirent 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 “”
-
“bar”           ==>  “”   and “bar”
-
“”              ==>  “”   and “”
Windows: -
“X:/”           ==>  “X:/” and “”
-
“X:/foo”        ==>  “X:/” and “foo”
-
“X:foo”         ==>  “X:” and “foo”
Posix: -
“X:foo”         ==>  “”   and “X:foo”

Allocate the results in @a result_pool.

@since New in 1.7.