Get edge property by name. Uses rotating thread-local buffers to allow * multiple concurrent calls (e.g. projecting r.url_path, r.confidence * in the same row). */
| 2487 | * multiple concurrent calls (e.g. projecting r.url_path, r.confidence |
| 2488 | * in the same row). */ |
| 2489 | static const char *edge_prop(const cbm_edge_t *e, const char *prop) { |
| 2490 | if (!e || !prop) { |
| 2491 | return ""; |
| 2492 | } |
| 2493 | if (strcmp(prop, "type") == 0) { |
| 2494 | return e->type ? e->type : ""; |
| 2495 | } |
| 2496 | /* Rotate through 8 thread-local buffers so multiple props can be accessed per row. */ |
| 2497 | static CBM_TLS char ebufs[CYP_BUF_8][CBM_SZ_512]; |
| 2498 | static CBM_TLS int ebuf_idx = 0; |
| 2499 | char *buf = ebufs[ebuf_idx++ & CYP_EBUF_MASK]; |
| 2500 | json_extract_prop(e->properties_json, prop, buf, CBM_SZ_512); |
| 2501 | return buf; |
| 2502 | } |
| 2503 | |
| 2504 | /* Find an edge variable in a binding */ |
| 2505 | static cbm_edge_t *binding_get_edge(binding_t *b, const char *var) { |
no test coverage detected