diff options
author | bpc2003 <wpesfriendnva@gmail.com> | 2025-04-21 18:01:57 -0400 |
---|---|---|
committer | bpc2003 <wpesfriendnva@gmail.com> | 2025-04-21 18:01:57 -0400 |
commit | dc83060f785031f1607dc4152e678472bff06b8a (patch) | |
tree | 93455eea782710ed38ff9cd6c31183597711295d /src/lib/mdb.h | |
parent | 6722eaf826a14b7f2c21a2cbfb24c21389a4818e (diff) |
Update documentation in mdb.h
Diffstat (limited to 'src/lib/mdb.h')
-rw-r--r-- | src/lib/mdb.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/mdb.h b/src/lib/mdb.h index f1284b7..cb0502d 100644 --- a/src/lib/mdb.h +++ b/src/lib/mdb.h @@ -18,17 +18,26 @@ typedef struct { tabidx_t tab[TABLEN]; } tablist_t; -// Table operations -// TODO: Make this private -tabidx_t getkey(tablist_t *list, int id, char *key); +/* getkeys: gets the provided keys from the provided id, + * if the id is set to -1, it will get the provided key from every document, + * if keys is NULL, it will get every key. */ +tablist_t *getkeys(tablist_t *list, int id, char **keys, int len); -// Batch Operations -tablist_t *getkeys(tablist_t *list, int id, char **keys, int len); // TODO: Reimplement getkeys +/* setkeys: sets the provided key-value pairs in the provided object, + * if the id is -1, it will set the provided pairs in every object. */ int setkeys(tablist_t **list, int id, char **pairs, int len); + +/* delkeys: deletes the provided keys from the provided id, + * if the id is -1, it will delete the provided key from every document, + * if keys is NULL it, will delete every key. */ int delkeys(tablist_t *list, int id, char **keys, int len); -// file operations +/* readdb: reads the provided db file, + * if the filename is NULL, it will return an empty table list, + * if the file format is invalid, it will return NULL. */ tablist_t *readdb(char *filename); + +/* writedb: writes a table list to a database file. */ void writedb(char *filename, tablist_t *list); #endif |