dpkg (1.18.25) stretch; urgency=medium
[dpkg] / lib / dpkg / path.h
CommitLineData
1479465f
GJ
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
21#ifndef LIBDPKG_PATH_H
22#define LIBDPKG_PATH_H
23
24#include <sys/stat.h>
25
26#include <stddef.h>
27
28#include <dpkg/macros.h>
29
30DPKG_BEGIN_DECLS
31
32/**
33 * @defgroup path Path handling
34 * @ingroup dpkg-internal
35 * @{
36 */
37
38size_t path_trim_slash_slashdot(char *path);
39const char *path_skip_slash_dotslash(const char *path);
40const char *path_basename(const char *path);
41char *path_quote_filename(char *dst, const char *src, size_t size);
42
43char *path_make_temp_template(const char *suffix);
44
45int secure_unlink_statted(const char *pathname, const struct stat *stab);
46int secure_unlink(const char *pathname);
47int secure_remove(const char *pathname);
48
49void path_remove_tree(const char *pathname);
50
51/** @} */
52
53DPKG_END_DECLS
54
55#endif /* LIBDPKG_PATH_H */