selection box_rep::find_check_selection (path lp, path rp) { bool lfound= false, rfound= false; path lbp= find_box_path (lp, lfound); path rbp= find_box_path (rp, rfound); selection sel= find_selection (lbp, rbp); sel->valid= lfound && rfound; return sel; }
static int set_selection(const char *val, struct option *p) { if (strchr(p->selections, ' ')) return p->selected = find_selection(val, p->selections); if (p->value) free(p->value); p->value = (char*)malloc(strlen(val) + 1); if (p->value) strcpy(p->value, val); return 0; }