libsysprof-analyze: add get_relative_path helper

This acts somewhat like g_file_get_relative_path() in that if it is not a
subdirectory of the parent, NULL is returned. Otherwise the relative path
is returned. We can just dive into the substring instead of copying which
is a bonus point.
This commit is contained in:
Christian Hergert
2023-05-19 10:02:20 -07:00
parent 7db4540f9a
commit 63168656a5
2 changed files with 31 additions and 1 deletions

View File

@ -27,7 +27,7 @@ G_BEGIN_DECLS
SysprofMount *_sysprof_mount_new_for_mountinfo (SysprofStrings *strings,
const char *mountinfo);
gboolean _sysprof_mount_contains_path (SysprofMount *self,
const char *_sysprof_mount_get_relative_path (SysprofMount *self,
const char *path);
G_END_DECLS