Add a new function child_path.
[deliverable/binutils-gdb.git] / gdb / common / pathstuff.h
index d43f337550fa41472a4684ab71ce01868cf57a20..67072a40e733700f369c1284718dee37dbf9cc7d 100644 (file)
@@ -17,8 +17,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef PATHSTUFF_H
-#define PATHSTUFF_H
+#ifndef COMMON_PATHSTUFF_H
+#define COMMON_PATHSTUFF_H
 
 #include "common/byte-vector.h"
 
@@ -48,6 +48,12 @@ extern gdb::unique_xmalloc_ptr<char>
 
 extern gdb::unique_xmalloc_ptr<char> gdb_abspath (const char *path);
 
+/* If the path in CHILD is a child of the path in PARENT, return a
+   pointer to the first component in the CHILD's pathname below the
+   PARENT.  Otherwise, return NULL.  */
+
+extern const char *child_path (const char *parent, const char *child);
+
 /* Return whether PATH contains a directory separator character.  */
 
 extern bool contains_dir_separator (const char *path);
@@ -86,4 +92,4 @@ extern const char *get_shell ();
 
 extern gdb::char_vector make_temp_filename (const std::string &f);
 
-#endif /* PATHSTUFF_H */
+#endif /* COMMON_PATHSTUFF_H */
This page took 0.025462 seconds and 4 git commands to generate.