The node at `qn`, when it belongs to file f (any file when f is NULL). */
| 417 | |
| 418 | /* The node at `qn`, when it belongs to file f (any file when f is NULL). */ |
| 419 | static const cbm_gbuf_node_t *tr_node(const tr_ctx_t *c, const char *qn, const tr_file_t *f) { |
| 420 | const cbm_gbuf_node_t *n = cbm_gbuf_find_by_qn(c->g, qn); |
| 421 | if (!n || !n->label) { |
| 422 | return NULL; |
| 423 | } |
| 424 | if (f && (!n->file_path || strcmp(n->file_path, f->path) != 0)) { |
| 425 | return NULL; |
| 426 | } |
| 427 | return n; |
| 428 | } |
| 429 | |
| 430 | static bool tr_join(char *out, size_t cap, const char *a, const char *b, const char *c) { |
| 431 | int n = c ? snprintf(out, cap, "%s.%s.%s", a, b, c) : snprintf(out, cap, "%s.%s", a, b); |
no test coverage detected