diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-07-04 14:54:45 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-07-04 14:54:45 +0900 |
| commit | 1efecaef1f867cb218366e2b4ab4b901fdd2835f (patch) | |
| tree | 3080a3d80a1a0671e8e82819d3f785465aace162 /src/mcp/tools/common/history.c | |
| parent | 34e00404e9561dcaf8d2d99df7470757a4fee915 (diff) | |
途中経過コミット
Diffstat (limited to 'src/mcp/tools/common/history.c')
| -rw-r--r-- | src/mcp/tools/common/history.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mcp/tools/common/history.c b/src/mcp/tools/common/history.c index 6254d8c..9f08e84 100644 --- a/src/mcp/tools/common/history.c +++ b/src/mcp/tools/common/history.c @@ -284,3 +284,26 @@ tiny_history_index_session(const tiny_history_index_t *index, } return index && session_id; } + +size_t +tiny_history_index_session_count(const tiny_history_index_t *index) +{ + return index ? index->count : 0; +} + +bool +tiny_history_index_session_at(const tiny_history_index_t *index, + size_t position, + const char **session_id, + const size_t **entries, + size_t *count) +{ + if (!index || position >= index->count || !session_id || !entries || !count) + { + return false; + } + *session_id = index->buckets[position].session_id; + *entries = index->buckets[position].entries; + *count = index->buckets[position].count; + return true; +} |
