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

Function cli_clients_spec_contains

src/cli/cli.c:10749–10766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10747}
10748
10749static bool cli_clients_spec_contains(const char *spec, const char *wanted_token) {
10750 char buf[CLI_BUF_1K];
10751 snprintf(buf, sizeof(buf), "%s", spec ? spec : "");
10752 char *save = NULL;
10753 for (char *tok = strtok_r(buf, ",", &save); tok; tok = strtok_r(NULL, ",", &save)) {
10754 while (*tok == ' ') {
10755 tok++;
10756 }
10757 size_t len = strlen(tok);
10758 while (len > 0 && tok[len - 1] == ' ') {
10759 tok[--len] = '\0';
10760 }
10761 if (strcmp(tok, wanted_token) == 0) {
10762 return true;
10763 }
10764 }
10765 return false;
10766}
10767
10768static bool cli_clients_selects_registry_client(const char *spec, cbm_agent_client_id_t client_id) {
10769 const cbm_agent_client_profile_t *profile = cbm_agent_client_by_id(client_id);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected