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

Function op_note_group

src/pipeline/pass_operator.c:673–697  ·  view source on GitHub ↗

group -> the package directories that declare it (owned keys and lists); * `seen` holds "group\x1fdir" (owned keys) so a repeat is one lookup. */

Source from the content-addressed store, hash-verified

671/* group -> the package directories that declare it (owned keys and lists);
672 * `seen` holds "group\x1fdir" (owned keys) so a repeat is one lookup. */
673static void op_note_group(CBMHashTable *groups, CBMHashTable *seen, const char *group,
674 const char *dir) {
675 char key[PAIR_LEN * CBM_SZ_1K];
676 op_key(key, sizeof(key), group, dir);
677 if (!group[0] || cbm_ht_get(seen, key)) {
678 return;
679 }
680 char *seen_key = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, key);
681 if (!seen_key) {
682 return;
683 }
684 cbm_ht_set(seen, seen_key, seen_key);
685 op_strs_t *dirs = cbm_ht_get(groups, group);
686 if (!dirs) {
687 dirs = cbm_calloc(CBM_MEM_CLASS_OTHER, sizeof(*dirs));
688 char *gkey = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, group);
689 if (!dirs || !gkey) {
690 cbm_free(CBM_MEM_CLASS_OTHER, dirs);
691 cbm_free(CBM_MEM_CLASS_OTHER, gkey);
692 return;
693 }
694 cbm_ht_set(groups, gkey, dirs);
695 }
696 op_strs_push(dirs, dir);
697}
698
699static void op_scan_groups(CBMHashTable *groups, CBMHashTable *seen, const char *file,
700 const char *text) {

Callers 1

op_scan_groupsFunction · 0.85

Calls 7

op_keyFunction · 0.85
cbm_ht_getFunction · 0.85
cbm_mem_strdupFunction · 0.85
cbm_ht_setFunction · 0.85
cbm_callocFunction · 0.85
cbm_freeFunction · 0.85
op_strs_pushFunction · 0.85

Tested by

no test coverage detected