The scope blob stored for `rel_path` (the surface row's `dl`), into out; * "" when there is none. */
| 10303 | /* The scope blob stored for `rel_path` (the surface row's `dl`), into out; |
| 10304 | * "" when there is none. */ |
| 10305 | static void dm_stored_scope(const char *db, const char *rel_path, char *out, size_t cap) { |
| 10306 | out[0] = '\0'; |
| 10307 | sqlite3 *h = NULL; |
| 10308 | if (sqlite3_open_v2(db, &h, SQLITE_OPEN_READONLY, NULL) == SQLITE_OK) { |
| 10309 | sqlite3_stmt *st = NULL; |
| 10310 | if (sqlite3_prepare_v2(h, |
| 10311 | "SELECT json_extract(defs_json, '$.dl') FROM lsp_surface " |
| 10312 | "WHERE rel_path = ?1", |
| 10313 | -1, &st, NULL) == SQLITE_OK) { |
| 10314 | sqlite3_bind_text(st, 1, rel_path, -1, SQLITE_TRANSIENT); |
| 10315 | if (sqlite3_step(st) == SQLITE_ROW && sqlite3_column_text(st, 0)) { |
| 10316 | snprintf(out, cap, "%s", (const char *)sqlite3_column_text(st, 0)); |
| 10317 | } |
| 10318 | } |
| 10319 | sqlite3_finalize(st); |
| 10320 | } |
| 10321 | sqlite3_close(h); |
| 10322 | } |
| 10323 | |
| 10324 | /* S8 across runs: the scope its own run refused is stored as the rejected |
| 10325 | * marker, so a later incremental run that reads it back treats the file as |