summaryrefslogtreecommitdiff
path: root/src/shared/include
diff options
context:
space:
mode:
authordzwdz2022-08-05 14:01:42 +0200
committerdzwdz2022-08-05 14:01:42 +0200
commit27124aab29d54ba9f228dee18a48e903e222812a (patch)
tree7e4848516eca5ad581cd2d5282d28797eae0472b /src/shared/include
parent749a150e37fbfdaf33a8d6738e95306e6d95e8b5 (diff)
move path_simplify to shared code, move its tests to userland
Diffstat (limited to 'src/shared/include')
-rw-r--r--src/shared/include/camellia/path.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/include/camellia/path.h b/src/shared/include/camellia/path.h
index ba6bccf..8efa0d4 100644
--- a/src/shared/include/camellia/path.h
+++ b/src/shared/include/camellia/path.h
@@ -1,3 +1,10 @@
#pragma once
+#include <stddef.h>
#define PATH_MAX 512
+
+/** Reduce a path to its simplest form.
+ *
+ * @return length of the string in *out, always less than len. Negative if the path was invalid.
+ */
+int path_simplify(const char *in, char *out, size_t len);