From 1efecaef1f867cb218366e2b4ab4b901fdd2835f Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 4 Jul 2026 14:54:45 +0900 Subject: 途中経過コミット MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mcp/tools/common/memory_index.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/mcp/tools/common/memory_index.h (limited to 'src/mcp/tools/common/memory_index.h') diff --git a/src/mcp/tools/common/memory_index.h b/src/mcp/tools/common/memory_index.h new file mode 100644 index 0000000..fbe43a7 --- /dev/null +++ b/src/mcp/tools/common/memory_index.h @@ -0,0 +1,24 @@ +#ifndef TINY_CONVMEM_MCP_TOOLS_MEMORY_INDEX_H +#define TINY_CONVMEM_MCP_TOOLS_MEMORY_INDEX_H + +#include "storage/store.h" + +typedef struct tiny_relation_reference +{ + size_t source_index; + tiny_relation_type_t type; +} tiny_relation_reference_t; + +typedef struct tiny_memory_index tiny_memory_index_t; + +tiny_memory_index_t *tiny_memory_index_build(const tiny_store_t *store); +void tiny_memory_index_free(tiny_memory_index_t *index); +bool tiny_memory_index_find(const tiny_memory_index_t *index, + const char *message_id, + size_t *entry_index); +bool tiny_memory_index_incoming(const tiny_memory_index_t *index, + const char *message_id, + const tiny_relation_reference_t **references, + size_t *count); + +#endif -- cgit v1.2.3