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

Function format_agg_value

src/cypher/cypher.c:5181–5197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5179}
5180
5181static void format_agg_value(const char *func, int count, double sum, double min_val,
5182 double max_val, char ***collect_lists, int *collect_counts, int ci,
5183 char *buf, size_t buf_sz) {
5184 if (strcmp(func, "SUM") == 0) {
5185 snprintf(buf, buf_sz, "%.10g", sum);
5186 } else if (strcmp(func, "AVG") == 0) {
5187 snprintf(buf, buf_sz, "%.10g", count > 0 ? sum / count : 0.0);
5188 } else if (strcmp(func, "MIN") == 0) {
5189 snprintf(buf, buf_sz, "%.10g", min_val);
5190 } else if (strcmp(func, "MAX") == 0) {
5191 snprintf(buf, buf_sz, "%.10g", max_val);
5192 } else if (strcmp(func, "COLLECT") == 0) {
5193 format_collect_list(collect_lists[ci], collect_counts[ci], buf, buf_sz);
5194 } else {
5195 snprintf(buf, buf_sz, "%d", count);
5196 }
5197}
5198
5199/* RETURN aggregation entry (ret_agg_entry_t, declared with ret_sink_t) */
5200struct ret_agg_entry {

Callers 1

ret_agg_emit_rowFunction · 0.85

Calls 1

format_collect_listFunction · 0.85

Tested by

no test coverage detected