aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/paths.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-07 21:42:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-07 21:42:45 -0500
commit544b1fb6a70d55bf368b827136cf0f37a26e8288 (patch)
tree52886c54934fed676263611bdb401dbeb80aac63 /src/stdlib/paths.h
parentefbdf7b13e4b559958ed5b1b9ca9d772ae77d702 (diff)
Change Paths to be an enum of their different types.
Diffstat (limited to 'src/stdlib/paths.h')
-rw-r--r--src/stdlib/paths.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/stdlib/paths.h b/src/stdlib/paths.h
index 677631b2..7a175099 100644
--- a/src/stdlib/paths.h
+++ b/src/stdlib/paths.h
@@ -12,6 +12,9 @@
Path_t Path$from_str(const char *str);
Path_t Path$from_text(Text_t text);
// int Path$print(FILE *f, Path_t path);
+// UNSAFE: this works because each type of path has a .components in the same place
+#define Path$components(path) ((path).components)
+// END UNSAFE
const char *Path$as_c_string(Path_t path);
#define Path(str) Path$from_str(str)
Path_t Path$_concat(int n, Path_t items[n]);
@@ -69,5 +72,7 @@ bool Path$is_none(const void *obj, const TypeInfo_t *type);
void Path$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *type);
void Path$deserialize(FILE *in, void *obj, List_t *pointers, const TypeInfo_t *type);
+extern const TypeInfo_t Path$AbsolutePath$$info;
+extern const TypeInfo_t Path$RelativePath$$info;
+extern const TypeInfo_t Path$HomePath$$info;
extern const TypeInfo_t Path$info;
-extern const TypeInfo_t PathType$info;