path.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * libdpkg - Debian packaging suite library routines
  3. * path.h - path handling routines
  4. *
  5. * Copyright © 2008-2012, 2015 Guillem Jover <guillem@debian.org>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. #ifndef LIBDPKG_PATH_H
  21. #define LIBDPKG_PATH_H
  22. #include <sys/stat.h>
  23. #include <stddef.h>
  24. #include <dpkg/macros.h>
  25. DPKG_BEGIN_DECLS
  26. /**
  27. * @defgroup path Path handling
  28. * @ingroup dpkg-internal
  29. * @{
  30. */
  31. size_t path_trim_slash_slashdot(char *path);
  32. const char *path_skip_slash_dotslash(const char *path);
  33. const char *path_basename(const char *path);
  34. char *path_quote_filename(char *dst, const char *src, size_t size);
  35. char *path_make_temp_template(const char *suffix);
  36. int secure_unlink_statted(const char *pathname, const struct stat *stab);
  37. int secure_unlink(const char *pathname);
  38. int secure_remove(const char *pathname);
  39. void path_remove_tree(const char *pathname);
  40. /** @} */
  41. DPKG_END_DECLS
  42. #endif /* LIBDPKG_PATH_H */