//compare the two parameters int param_list_compare(struct param_list *a, struct param_list *b){ if(!a && !b) return 1; if(!a || !b) return 0; if(a->name && b->name) return (strcmp(a->name, b->name) == 0 && type_compare(a->type, b->type) /*&& symbol_compare(a->symbol, b->symbol)*/ && param_list_compare(a->next, b->next)); else if(!a->name && !b->name) return (type_compare(a->type, b->type) /*&& symbol_compare(a->symbol, b->symbol)*/ && param_list_compare(a->next, b->next)); else return 0; }
// LIST INPUT void return_list(t_return *x, t_symbol *msg, long argc, t_atom *argv) { short i; if (!x->attrEnable) return; if (x->common.attr_repetitions == 0) { if (param_list_compare(x->output+1, x->input_len, argv, argc)) return; // nothing to do } for (i=1; i<=argc; i++) { jcom_core_atom_copy(&x->output[i], argv++); x->output_len++; } x->input_len = x->output_len-1; outlet_anything(x->outlets[k_outlet_thru], msg, x->output_len-1, &x->output[1]); return_send_feedback(x); }
// compare two types int type_compare( struct type *a, struct type *b ){ if(!a && !b) return 1; if(!a || !b) return 0; return (a->kind == b->kind && param_list_compare(a->params, b->params) && type_compare(a->subtype, b->subtype) && expr_compare(a->opt_expr, b->opt_expr)); }