void main( void ) { char line[256]; long val; GRP *g; fin=stdin; while(fgets(line,256,fin)) { sscanf(line,"%ld",&val); g=grouper(val); } pgrouper(g); }
static void *branch_start(void *arg) { struct branch_info *binfo = (struct branch_info *)arg; struct group **groups; struct group **filtered_groups; char **filtered_records; size_t num_filtered_records; size_t num_groups; size_t num_filtered_groups; /* * FILTER */ filtered_records = filter(binfo->data, binfo->filter_rules, binfo->num_filter_rules, &num_filtered_records); printf("\rnumber of filtered records: %zd\n", num_filtered_records); /* * GROUPER */ groups = grouper(filtered_records, num_filtered_records, binfo->group_modules, binfo->num_group_modules, binfo->aggr, binfo->num_aggr, &num_groups); free(filtered_records); printf("\rnumber of groups: %zd\n", num_groups); /* * GROUPFILTER */ filtered_groups = group_filter(groups, num_groups, binfo->gfilter_rules, binfo->num_gfilter_rules, &num_filtered_groups); free(groups); printf("\rnumber of filtered groups: %zd\n", num_filtered_groups); pthread_exit(filtered_groups); }