| 3119 | } |
| 3120 | |
| 3121 | static bool php_vendor_kind(const cbm_php_vendor_names_t *value, const char *name, int kind) { |
| 3122 | if (!value || !value->targets || !value->imports || !name || name[0] == '\\') |
| 3123 | return false; |
| 3124 | size_t length = 0; |
| 3125 | while (php_ident_byte((unsigned char)name[length])) |
| 3126 | length++; |
| 3127 | if (length == 0) |
| 3128 | return false; |
| 3129 | for (int i = 0; i < value->imports->count; i++) { |
| 3130 | const CBMImport *imp = &value->imports->items[i]; |
| 3131 | if (!imp->local_name || !imp->module_path || value->targets[i] || |
| 3132 | (kind >= 0 && (int)imp->kind != kind)) |
| 3133 | continue; |
| 3134 | if (strlen(imp->local_name) == length && strncmp(imp->local_name, name, length) == 0) |
| 3135 | return true; |
| 3136 | } |
| 3137 | return false; |
| 3138 | } |
| 3139 | |
| 3140 | bool cbm_pipeline_php_vendor_bound(const cbm_php_vendor_names_t *value, const char *name) { |
| 3141 | return php_vendor_kind(value, name, CBM_IMPORT_KIND_DEFAULT); |
no test coverage detected