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). */
| 2407 | * multiple concurrent calls (e.g. projecting r.url_path, r.confidence |
| 2408 | * in the same row). */ |
| 2409 | static const char *edge_prop(const cbm_edge_t *e, const char *prop) { |
| 2410 | if (!e || !prop) { |
| 2411 | return ""; |
| 2412 | } |
| 2413 | if (strcmp(prop, "type") == 0) { |
| 2414 | return e->type ? e->type : ""; |
| 2415 | } |
| 2416 | /* Rotate through 8 thread-local buffers so multiple props can be accessed per row. */ |
| 2417 | static CBM_TLS char ebufs[CYP_BUF_8][CBM_SZ_512]; |
| 2418 | static CBM_TLS int ebuf_idx = 0; |
| 2419 | char *buf = ebufs[ebuf_idx++ & CYP_EBUF_MASK]; |
| 2420 | json_extract_prop(e->properties_json, prop, buf, CBM_SZ_512); |
| 2421 | return buf; |
| 2422 | } |
| 2423 | |
| 2424 | /* Find an edge variable in a binding */ |
| 2425 | static cbm_edge_t *binding_get_edge(binding_t *b, const char *var) { |
no test coverage detected