#ifndef PW_PATH_H #define PW_PATH_H #include /** * Returns the basename of `path` or `NULL` if `path` is `NULL`. */ char const *pw_basename(char const *path); /** * Strips the extension from `path` into `name`. Returns the `false` if `name` * is not large enough. * * `name` must not overlap with `path`. */ bool pw_stripext(char *name, size_t sz, char const *path, char const *ext); /** * Returns whether or not `path` has `ext`. */ bool pw_hasext(char const *path, char const *ext); /** * Joins multiple components into `path`. returns `false` if `path` is not * large enough to fit all of the components. * * `path` must not overap with any of the segments, a final `NULL` segment must * be passed to signal end of arguments. */ bool pw_pathjoin(char *path, size_t sz, ...); #endif