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

Function gpf_images

tests/test_grammar_probe_f.c:1929–1950  ·  view source on GitHub ↗

Every DEPENDS_ON edge into an Image as "@ -> (via)", * sorted, one per line. */

Source from the content-addressed store, hash-verified

1927/* Every DEPENDS_ON edge into an Image as "@<file> -> <repository> (via)",
1928 * sorted, one per line. */
1929static char *gpf_images(const GpfFile *files, int nfiles) {
1930 GpfProj lp;
1931 cbm_store_t *store = gpf_index_files(&lp, files, nfiles);
1932 char *out = NULL;
1933 if (store) {
1934 sqlite3_stmt *st = NULL;
1935 const char *sql =
1936 "SELECT coalesce(group_concat(x, char(10)), '') FROM (SELECT '@' || s.file_path "
1937 "|| ' -> ' || t.name || ' (' || json_extract(e.properties,'$.via') || ')' AS x "
1938 "FROM edges e JOIN nodes s ON s.id=e.source_id JOIN nodes t ON t.id=e.target_id "
1939 "WHERE e.project=?1 AND e.type='DEPENDS_ON' AND t.label='Image' ORDER BY x)";
1940 if (sqlite3_prepare_v2(cbm_store_get_db(store), sql, -1, &st, NULL) == SQLITE_OK) {
1941 sqlite3_bind_text(st, 1, lp.project, -1, SQLITE_STATIC);
1942 if (sqlite3_step(st) == SQLITE_ROW) {
1943 out = strdup((const char *)sqlite3_column_text(st, 0));
1944 }
1945 }
1946 sqlite3_finalize(st);
1947 }
1948 gpf_cleanup(&lp, store);
1949 return out;
1950}
1951
1952#define GPF_ASSERT_IMAGES(files, n, want) \
1953 do { \

Callers

nothing calls this directly

Calls 3

gpf_index_filesFunction · 0.85
cbm_store_get_dbFunction · 0.85
gpf_cleanupFunction · 0.85

Tested by

no test coverage detected