From 63634407d4d20e2ab26616e78c9d498da2db3242 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Tue, 28 Feb 2023 18:44:02 +0000 Subject: [PATCH] Update TODO.txt, add stub functions in Db. --- TODO.txt | 4 +++- src/Db.c | 19 +++++++++++++++++++ src/include/Db.h | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/TODO.txt b/TODO.txt index 44a0020..d5f2d97 100644 --- a/TODO.txt +++ b/TODO.txt @@ -16,6 +16,7 @@ Milestone: v0.2.0 [~] Db API [x] If object is in cache, but doesn't exist on disk, delete from cache [ ] Allow cache to be totally disabled (no MIN_CACHE_SIZE) + [ ] List keys under a path (DbList() using POSIX opendir()) [~] User login [x] User manipulation functions (so we don't use the DB directly) [x] Refresh tokens @@ -23,9 +24,10 @@ Milestone: v0.2.0 [x] Delete refresh token if present [ ] Logout all [~] Login fallback (static HTML page) -[x] User Interactive +[~] User Interactive [x] Passwords [x] Caller builds flows + [ ] Clean up old sessions [ ] Document new User functions [ ] Document new JSON functions diff --git a/src/Db.c b/src/Db.c index 0c2d35a..aa393df 100644 --- a/src/Db.c +++ b/src/Db.c @@ -794,6 +794,25 @@ DbExists(Db * db, size_t nArgs,...) return ret; } +Array * +DbList(Db *db, size_t nArgs, ...) +{ + Array *result; + + if (!db || !nArgs) + { + return NULL; + } + + result = ArrayCreate(); + if (!result) + { + return NULL; + } + + return result; +} + HashMap * DbJson(DbRef * ref) { diff --git a/src/include/Db.h b/src/include/Db.h index f08e992..a94be03 100644 --- a/src/include/Db.h +++ b/src/include/Db.h @@ -56,6 +56,9 @@ extern int extern int DbExists(Db *, size_t,...); +extern Array * + DbList(Db *, size_t, ...); + extern HashMap * DbJson(DbRef *);