Accumulate a cross-package boundary into parallel arrays. */
| 3931 | |
| 3932 | /* Accumulate a cross-package boundary into parallel arrays. */ |
| 3933 | static void accum_boundary(const char *src_pkg, const char *tgt_pkg, char **bfroms, char **btos, |
| 3934 | int *bcounts, int *bn, int bcap) { |
| 3935 | int found = ST_FOUND; |
| 3936 | for (int i = 0; i < *bn; i++) { |
| 3937 | if (strcmp(bfroms[i], src_pkg) == 0 && strcmp(btos[i], tgt_pkg) == 0) { |
| 3938 | found = i; |
| 3939 | break; |
| 3940 | } |
| 3941 | } |
| 3942 | if (found >= 0) { |
| 3943 | bcounts[found]++; |
| 3944 | } else if (*bn < bcap) { |
| 3945 | bfroms[*bn] = heap_strdup(src_pkg); |
| 3946 | btos[*bn] = heap_strdup(tgt_pkg); |
| 3947 | bcounts[*bn] = SKIP_ONE; |
| 3948 | (*bn)++; |
| 3949 | } |
| 3950 | } |
| 3951 | |
| 3952 | static int arch_boundaries(cbm_store_t *s, const char *project, const char *path, |
| 3953 | cbm_cross_pkg_boundary_t **out_arr, int *out_count) { |
no test coverage detected