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. */
| 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. */ |
| 148 | static 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 |
no outgoing calls
no test coverage detected