logo

utils-std

Collection of commonly available Unix tools

path.h (531B)


  1. // utils-std: Collection of commonly available Unix tools
  2. // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. // SPDX-License-Identifier: MPL-2.0
  4. #include <stdbool.h>
  5. #include <stddef.h> // size_t
  6. // barebones basename, returns what's after the rightmost slash
  7. char *static_basename(char *path);
  8. // Modifies a path in-place to given a parent (dirname-like) and a child (basename-like)
  9. // optionally trims the tailing slashes prior to splitting
  10. char *path_split_static(char *path, bool trim);