Remove a bunch of usages of gdb_suppress_tests in 'runto_main'.
[deliverable/binutils-gdb.git] / gdb / common / pathstuff.h
CommitLineData
b4987c95
SDJ
1/* Path manipulation routines for GDB and gdbserver.
2
3 Copyright (C) 1986-2018 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program 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 3 of the License, or
10 (at your option) any later version.
11
12 This program 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 <http://www.gnu.org/licenses/>. */
19
20#ifndef PATHSTUFF_H
21#define PATHSTUFF_H
22
23/* Path utilities. */
24
25/* Return the real path of FILENAME, expanding all the symbolic links.
26
27 Contrary to "gdb_abspath", this function does not use
28 CURRENT_DIRECTORY for path expansion. Instead, it relies on the
29 current working directory (CWD) of GDB or gdbserver. */
30
31extern gdb::unique_xmalloc_ptr<char> gdb_realpath (const char *filename);
32
33/* Return a copy of FILENAME, with its directory prefix canonicalized
34 by gdb_realpath. */
35
36extern gdb::unique_xmalloc_ptr<char>
37 gdb_realpath_keepfile (const char *filename);
38
39/* Return PATH in absolute form, performing tilde-expansion if necessary.
40 PATH cannot be NULL or the empty string.
41 This does not resolve symlinks however, use gdb_realpath for that.
42
43 Contrary to "gdb_realpath", this function uses CURRENT_DIRECTORY
44 for the path expansion. This may lead to scenarios the current
45 working directory (CWD) is different than CURRENT_DIRECTORY. */
46
47extern gdb::unique_xmalloc_ptr<char> gdb_abspath (const char *path);
48
25e3c82c
SDJ
49/* Return whether PATH contains a directory separator character. */
50
51extern bool contains_dir_separator (const char *path);
52
87d6a7aa
SM
53/* Get the usual user cache directory for the current platform.
54
55 On Linux, it follows the XDG Base Directory specification: use
e6cd1dc1
TT
56 $XDG_CACHE_HOME/gdb if the XDG_CACHE_HOME environment variable is
57 defined, otherwise $HOME/.cache.
87d6a7aa 58
e6cd1dc1
TT
59 On macOS, it follows the local convention and uses
60 ~/Library/Caches/gdb.
61
62 The return value is absolute and tilde-expanded. Return an empty
63 string if neither XDG_CACHE_HOME (on Linux) or HOME are defined. */
87d6a7aa
SM
64
65extern std::string get_standard_cache_dir ();
66
b4987c95 67#endif /* PATHSTUFF_H */
This page took 0.083647 seconds and 4 git commands to generate.