static int asmrp_eval (asmrp_t *p, int *matches) { int rule_num, num_matches; #ifdef LOG printf ("eval\n"); #endif asmrp_get_sym (p); rule_num = 0; num_matches = 0; while (p->sym != ASMRP_SYM_EOF) { if (asmrp_rule (p)) { #ifdef LOG printf ("rule #%d is true\n", rule_num); #endif matches[num_matches] = rule_num; num_matches++; } rule_num++; } matches[num_matches] = -1; return num_matches; }
static int asmrp_eval (asmrp_t *p, int *matches) { int rule_num, num_matches; #ifdef LOG printf ("eval\n"); #endif asmrp_get_sym (p); rule_num = 0; num_matches = 0; while (p->sym != ASMRP_SYM_EOF) { if (asmrp_rule (p)) { #ifdef LOG printf ("rule #%d is true\n", rule_num); #endif if(num_matches < MAX_RULEMATCHES - 1) matches[num_matches++] = rule_num; else mp_msg(MSGT_STREAM, MSGL_ERR, "Ignoring matched asm rule %d, too many matched rules.\n", rule_num); } rule_num++; } matches[num_matches] = -1; return num_matches; }