Lines Matching refs:f
499 struct filter *f; in should_process_file_prog() local
503 f = &env.deny_filters[i]; in should_process_file_prog()
504 if (f->kind != FILTER_NAME) in should_process_file_prog()
507 if (f->any_glob && glob_matches(filename, f->any_glob)) in should_process_file_prog()
509 if (f->any_glob && prog_name && glob_matches(prog_name, f->any_glob)) in should_process_file_prog()
511 if (f->file_glob && glob_matches(filename, f->file_glob)) in should_process_file_prog()
513 if (f->prog_glob && prog_name && glob_matches(prog_name, f->prog_glob)) in should_process_file_prog()
518 f = &env.allow_filters[i]; in should_process_file_prog()
519 if (f->kind != FILTER_NAME) in should_process_file_prog()
523 if (f->any_glob) { in should_process_file_prog()
524 if (glob_matches(filename, f->any_glob)) in should_process_file_prog()
532 if (!prog_name || glob_matches(prog_name, f->any_glob)) in should_process_file_prog()
535 if (f->file_glob && !glob_matches(filename, f->file_glob)) in should_process_file_prog()
537 if (f->prog_glob && prog_name && !glob_matches(prog_name, f->prog_glob)) in should_process_file_prog()
572 struct filter *f; in append_filter() local
582 f = &(*filters)[*cnt]; in append_filter()
583 memset(f, 0, sizeof(*f)); in append_filter()
643 f->kind = FILTER_STAT; in append_filter()
644 f->stat_id = id; in append_filter()
645 f->stat_var = var; in append_filter()
646 f->op = operators[i].op_kind; in append_filter()
647 f->abs = true; in append_filter()
648 f->value = val; in append_filter()
662 f->kind = FILTER_NAME; in append_filter()
665 f->any_glob = strdup(str); in append_filter()
666 if (!f->any_glob) in append_filter()
671 f->file_glob = strndup(str, p - str); in append_filter()
672 if (!f->file_glob) in append_filter()
677 f->prog_glob = strdup(p + 1); in append_filter()
678 if (!f->prog_glob) { in append_filter()
679 free(f->file_glob); in append_filter()
680 f->file_glob = NULL; in append_filter()
693 FILE *f; in append_filter_file() local
696 f = fopen(path, "r"); in append_filter_file()
697 if (!f) { in append_filter_file()
703 while (fscanf(f, " %1023[^\n]\n", buf) == 1) { in append_filter_file()
717 fclose(f); in append_filter_file()
748 FILE *f; in append_file_from_file() local
750 f = fopen(path, "r"); in append_file_from_file()
751 if (!f) { in append_file_from_file()
758 while (fscanf(f, " %1023[^\n]\n", buf) == 1) { in append_file_from_file()
768 fclose(f); in append_file_from_file()
1346 FILE *f; in write_one_line() local
1348 f = fopen(file, "w"); in write_one_line()
1349 if (!f) in write_one_line()
1354 err = vfprintf(f, fmt, ap); in write_one_line()
1357 fclose(f); in write_one_line()
1369 FILE *f; in scanf_one_line() local
1371 f = fopen(file, "r"); in scanf_one_line()
1372 if (!f) in scanf_one_line()
1376 while (getline(&line, &line_len, f) > 0) { in scanf_one_line()
1381 if (ferror(f)) { in scanf_one_line()
1389 fclose(f); in scanf_one_line()
1752 FILE *f; in append_var_preset_file() local
1755 f = fopen(filename, "rt"); in append_var_preset_file()
1756 if (!f) { in append_var_preset_file()
1762 while (fscanf(f, " %1023[^\n]\n", buf) == 1) { in append_var_preset_file()
1772 fclose(f); in append_var_preset_file()
2625 FILE *f; in parse_stats_csv() local
2629 f = fopen(filename, "r"); in parse_stats_csv()
2630 if (!f) { in parse_stats_csv()
2638 while (fgets(line, sizeof(line), f)) { in parse_stats_csv()
2711 if (!feof(f)) { in parse_stats_csv()
2717 fclose(f); in parse_stats_csv()
2909 static bool is_join_stat_filter_matched(struct filter *f, const struct verif_stats_join *stats) in is_join_stat_filter_matched() argument
2915 fetch_join_stat_value(stats, f->stat_id, f->stat_var, &str, &value); in is_join_stat_filter_matched()
2917 if (f->abs) in is_join_stat_filter_matched()
2920 switch (f->op) { in is_join_stat_filter_matched()
2921 case OP_EQ: return value > f->value - eps && value < f->value + eps; in is_join_stat_filter_matched()
2922 case OP_NEQ: return value < f->value - eps || value > f->value + eps; in is_join_stat_filter_matched()
2923 case OP_LT: return value < f->value - eps; in is_join_stat_filter_matched()
2924 case OP_LE: return value <= f->value + eps; in is_join_stat_filter_matched()
2925 case OP_GT: return value > f->value + eps; in is_join_stat_filter_matched()
2926 case OP_GE: return value >= f->value - eps; in is_join_stat_filter_matched()
2929 fprintf(stderr, "BUG: unknown filter op %d!\n", f->op); in is_join_stat_filter_matched()
2935 struct filter *f; in should_output_join_stats() local
2939 f = &env.deny_filters[i]; in should_output_join_stats()
2940 if (f->kind != FILTER_STAT) in should_output_join_stats()
2943 if (is_join_stat_filter_matched(f, stats)) in should_output_join_stats()
2948 f = &env.allow_filters[i]; in should_output_join_stats()
2949 if (f->kind != FILTER_STAT) in should_output_join_stats()
2953 if (is_join_stat_filter_matched(f, stats)) in should_output_join_stats()
3122 static bool is_stat_filter_matched(struct filter *f, const struct verif_stats *stats) in is_stat_filter_matched() argument
3124 long value = stats->stats[f->stat_id]; in is_stat_filter_matched()
3126 if (f->abs) in is_stat_filter_matched()
3129 switch (f->op) { in is_stat_filter_matched()
3130 case OP_EQ: return value == f->value; in is_stat_filter_matched()
3131 case OP_NEQ: return value != f->value; in is_stat_filter_matched()
3132 case OP_LT: return value < f->value; in is_stat_filter_matched()
3133 case OP_LE: return value <= f->value; in is_stat_filter_matched()
3134 case OP_GT: return value > f->value; in is_stat_filter_matched()
3135 case OP_GE: return value >= f->value; in is_stat_filter_matched()
3138 fprintf(stderr, "BUG: unknown filter op %d!\n", f->op); in is_stat_filter_matched()
3144 struct filter *f; in should_output_stats() local
3148 f = &env.deny_filters[i]; in should_output_stats()
3149 if (f->kind != FILTER_STAT) in should_output_stats()
3152 if (is_stat_filter_matched(f, stats)) in should_output_stats()
3157 f = &env.allow_filters[i]; in should_output_stats()
3158 if (f->kind != FILTER_STAT) in should_output_stats()
3162 if (is_stat_filter_matched(f, stats)) in should_output_stats()