Skip to content

Commit fcd3ade

Browse files
apply FSON logic to myshell
1 parent 86a8850 commit fcd3ade

File tree

2 files changed

+439
-111
lines changed

2 files changed

+439
-111
lines changed

code/logic/fossil/crabdb/myshell.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ void fossil_myshell_close(fossil_bluecrab_myshell_t *db);
215215
* Time Complexity: O(1) for append, O(n) for update (n = number of records).
216216
* @param db Database handle.
217217
* @param key Key string.
218+
* @param type Type string (FSON type).
218219
* @param value Value string.
219220
* @return Error code.
220221
*/
221-
fossil_bluecrab_myshell_error_t fossil_myshell_put(fossil_bluecrab_myshell_t *db, const char *key, const char *value);
222+
fossil_bluecrab_myshell_error_t fossil_myshell_put(fossil_bluecrab_myshell_t *db, const char *key, const char *type, const char *value);
222223

223224
/**
224225
* o-Record CRUD (key/value, git-like chain)
@@ -299,10 +300,11 @@ fossil_bluecrab_myshell_error_t fossil_myshell_revert(fossil_bluecrab_myshell_t
299300
* Time Complexity: O(1) for append, O(n) for update (n = number of staged records).
300301
* @param db Database handle.
301302
* @param key Key string.
303+
* @param type Type string (FSON type).
302304
* @param value Value string.
303305
* @return Error code.
304306
*/
305-
fossil_bluecrab_myshell_error_t fossil_myshell_stage(fossil_bluecrab_myshell_t *db, const char *key, const char *value);
307+
fossil_bluecrab_myshell_error_t fossil_myshell_stage(fossil_bluecrab_myshell_t *db, const char *key, const char *type, const char *value);
306308

307309
/**
308310
* o-Staging area
@@ -449,8 +451,8 @@ namespace fossil {
449451
}
450452

451453
// Record CRUD (put)
452-
fossil_bluecrab_myshell_error_t put(const std::string& key, const std::string& value) {
453-
return fossil_myshell_put(db_, key.c_str(), value.c_str());
454+
fossil_bluecrab_myshell_error_t put(const std::string& key, const std::string& type, const std::string& value) {
455+
return fossil_myshell_put(db_, key.c_str(), type.c_str(), value.c_str());
454456
}
455457

456458
// Record CRUD (get)
@@ -494,8 +496,8 @@ namespace fossil {
494496
}
495497

496498
// Staging (stage)
497-
fossil_bluecrab_myshell_error_t stage(const std::string& key, const std::string& value) {
498-
return fossil_myshell_stage(db_, key.c_str(), value.c_str());
499+
fossil_bluecrab_myshell_error_t stage(const std::string& key, const std::string& type, const std::string& value) {
500+
return fossil_myshell_stage(db_, key.c_str(), type.c_str(), value.c_str());
499501
}
500502

501503
// Staging (unstage)

0 commit comments

Comments
 (0)