diff options
author | dzwdz | 2021-08-04 12:27:02 +0200 |
---|---|---|
committer | dzwdz | 2021-08-04 12:27:02 +0200 |
commit | 6e5a5a3b27257f212fcd10a3580cfca3ea224fab (patch) | |
tree | cb9dc8962b9c6bb46ef7b05ffaa2d01652f24c46 /src/kernel/vfs/path.h | |
parent | 0a695a33e4e23fb5a0d70c7a3500224cce931ccf (diff) |
partial path_simplify implementation
it currently only checks if the path is valid, it's the bare minimum
needed to write tests
Diffstat (limited to 'src/kernel/vfs/path.h')
-rw-r--r-- | src/kernel/vfs/path.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kernel/vfs/path.h b/src/kernel/vfs/path.h new file mode 100644 index 0000000..22dc754 --- /dev/null +++ b/src/kernel/vfs/path.h @@ -0,0 +1,11 @@ +#pragma once +#include <stdbool.h> +#include <stddef.h> + +/** Reduce a path to its simplest form. + * *in and *out can't overlap unless they're equal. Then, the path is modified + * in-place. + * + * @return Was the path valid? If this is false, *out is undefined + */ +bool path_simplify(const char *in, char *out, size_t len); |