/*@null@*/ static node_t list_get_node_by_value(list_t inst, void* val) { node_t n = inst->head; int ctr = 0; while ((n != NULL) && (inst->cmp(node_get_value(n), val))) { ctr++; n = n->next; } return n; }
int list_index_of(list_t inst, void* val) { node_t n = inst->head; int rval = 0; while ((n != NULL) && (inst->cmp(node_get_value(n), val))) { rval++; n = n->next; } if (n == NULL) { rval = -1; } return rval; }