static int match_term(ErlNifEnv* env, ERL_NIF_TERM term, State *st){ if (match_binary(env, term, st)){ return 1; }else if(match_atom(env, term, st)){ return 1; }else if(match_int(env, term, st)){ return 1; }else if(match_empty_list(env, term, st)){ return 1; }else if(match_list(env, term, st)){ return 1; }else if(match_proplist(env, term, st)){ return 1; }else if(match_tuple(env, term, st)){ return 1; }else if(match_double(env, term, st)){ return 1; }else if(match_int64(env, term, st)){ return 1; } if(!st->no_match){ st->no_match = term; } return 0; }
void match_float(t_match *x, double f) { t_atom a; atom_setfloat(&a, f); if (x->m_size) match_atom(x,&a); }
void match_int(t_match *x, long n) { t_atom a; atom_setlong(&a, n); if (x->m_size) match_atom(x,&a); }
void match_list(t_match *x, t_symbol *s, short argc, t_atom *argv) { long i; if (!x->m_size) return; for (i = 0; i < argc; i++) match_atom(x,argv+i); }
void match_anything(t_match *x, t_symbol *s, short argc, t_atom *argv) { t_atom a; if (!x->m_size) return; atom_setsym(&a, s); match_atom(x,&a); match_list(x,s,argc,argv); }