@scriptc/runtime 0.0.22 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ #ifndef SCR_WIN_STATS_H
2
+ #define SCR_WIN_STATS_H
3
+
4
+ #include <stdbool.h>
5
+ #include <stddef.h>
6
+ #include <stdint.h>
7
+
8
+ /* IO_REPARSE_TAG_MOUNT_POINT covers both directory junctions and mounted
9
+ * volumes. Node/libuv only presents drive-letter junction targets as links;
10
+ * a volume target (\\??\\Volume{...}) is followed even by lstat(). Keep this
11
+ * predicate platform-neutral so its payload classification can be unit-tested
12
+ * without requiring a spare Windows volume. */
13
+ static inline bool scr_win_stats_mount_target_is_junction(
14
+ const uint16_t *target, size_t len) {
15
+ return len >= 6 &&
16
+ target[0] == '\\' && target[1] == '?' && target[2] == '?' &&
17
+ target[3] == '\\' &&
18
+ ((target[4] >= 'A' && target[4] <= 'Z') ||
19
+ (target[4] >= 'a' && target[4] <= 'z')) &&
20
+ target[5] == ':' && (len == 6 || target[6] == '\\');
21
+ }
22
+
23
+ #endif /* SCR_WIN_STATS_H */