MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / dm_row

Function dm_row

tests/test_doc_mentions_helpers.h:148–173  ·  view source on GitHub ↗

Reason (and, when `syntax` is not NULL, the family name) of the unresolved * row with this raw text in this file; "" when there is none. */

Source from the content-addressed store, hash-verified

146/* Reason (and, when `syntax` is not NULL, the family name) of the unresolved
147 * row with this raw text in this file; "" when there is none. */
148static inline void dm_row(const char *db, const char *rel, const char *raw, char *reason,
149 size_t cap, char *syntax, size_t scap) {
150 reason[0] = '\0';
151 if (syntax) {
152 syntax[0] = '\0';
153 }
154 sqlite3 *h = NULL;
155 if (sqlite3_open_v2(db, &h, SQLITE_OPEN_READONLY, NULL) == SQLITE_OK) {
156 sqlite3_stmt *st = NULL;
157 if (sqlite3_prepare_v2(h,
158 "SELECT reason, syntax FROM doc_link_unresolved WHERE rel_path = ?1 "
159 "AND raw = ?2",
160 -1, &st, NULL) == SQLITE_OK) {
161 sqlite3_bind_text(st, 1, rel, -1, SQLITE_TRANSIENT);
162 sqlite3_bind_text(st, 2, raw, -1, SQLITE_TRANSIENT);
163 if (sqlite3_step(st) == SQLITE_ROW) {
164 snprintf(reason, cap, "%s", (const char *)sqlite3_column_text(st, 0));
165 if (syntax) {
166 snprintf(syntax, scap, "%s", (const char *)sqlite3_column_text(st, 1));
167 }
168 }
169 }
170 sqlite3_finalize(st);
171 }
172 sqlite3_close(h);
173}
174
175/* Canonical text of every MENTIONS edge and unresolved row: what two indexes
176 * of the same tree (full and incremental, one worker and several) must agree

Callers 15

c_rowFunction · 0.85
pl_rowFunction · 0.85
jt_reasonFunction · 0.85
go_reasonFunction · 0.85
ts_rowFunction · 0.85
dm_namespace_publishedFunction · 0.85
dm_control_publishedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected