aboutsummaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-24 21:13:47 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-24 21:17:05 +0100
commitf3756dac8a49f3b5599fd50f4c631da4168e9eb0 (patch)
treea84d95e30269d4b368b741ffd1a781b7cfbb1988 /src/storage
parent97b35ce73fab8a84d4d3e6807618a252efcf4cd9 (diff)
add jump-to month
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/user.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/storage/user.zig b/src/storage/user.zig
index b817f84..c2cc82a 100644
--- a/src/storage/user.zig
+++ b/src/storage/user.zig
@@ -214,3 +214,21 @@ pub fn set_image(
try file_writer.interface.flush();
}
+
+pub fn list(
+ storage: *Storage,
+ allocator: std.mem.Allocator,
+) ![][]const u8 {
+ var user = try storage.dir.openDir("user", .{ .iterate = true });
+ defer user.close();
+
+ var ids: std.ArrayList([]const u8) = .empty;
+
+ var iterator = user.iterate();
+
+ while (try iterator.next()) |entry| {
+ try ids.append(allocator, try allocator.dupe(u8, entry.name));
+ }
+
+ return ids.toOwnedSlice(allocator);
+}