Count definitions with a given label. */ Check for a definition with the given qualified name. Distinct from * find_def_by_name, which returns the first match by NAME and so cannot tell two * same-named definitions in different scopes apart — exactly the case that * attrpath qualification exists to separate. */
| 58 | * same-named definitions in different scopes apart — exactly the case that |
| 59 | * attrpath qualification exists to separate. */ |
| 60 | static int has_def_qn(CBMFileResult *r, const char *qn) { |
| 61 | for (int i = 0; i < r->defs.count; i++) { |
| 62 | if (r->defs.items[i].qualified_name && strcmp(r->defs.items[i].qualified_name, qn) == 0) |
| 63 | return 1; |
| 64 | } |
| 65 | return 0; |
| 66 | } |
| 67 | |
| 68 | static int count_defs_with_label(CBMFileResult *r, const char *label) { |
| 69 | int count = 0; |