summaryrefslogtreecommitdiff
path: root/src/mcp/tools/common/memory_index.h
blob: fbe43a7c710d5a1e0f81ad295fb2f259931f3fb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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