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. */
| 72 | * same-named definitions in different scopes apart — exactly the case that |
| 73 | * attrpath qualification exists to separate. */ |
| 74 | static int has_def_qn(CBMFileResult *r, const char *qn) { |
| 75 | for (int i = 0; i < r->defs.count; i++) { |
| 76 | if (r->defs.items[i].qualified_name && strcmp(r->defs.items[i].qualified_name, qn) == 0) |
| 77 | return 1; |
| 78 | } |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | static int count_defs_with_label(CBMFileResult *r, const char *label) { |
| 83 | int count = 0; |