Lines Matching refs:items
292 unsigned int *nitems, struct bsddialog_menuitem **items, int *focusitem,
307 exit_error(true, "%s bad arguments items number", opt->name);
310 *items = calloc(*nitems, sizeof(struct bsddialog_menuitem));
311 if (items == NULL)
312 exit_error(false, "%s cannot allocate items", opt->name);
316 (*items)[i].prefix = setprefix ? argv[j++] : "";
317 (*items)[i].depth = setdepth ?
319 (*items)[i].name = setname ? argv[j++] : "";
320 (*items)[i].desc = setdesc ? argv[j++] : "";
323 (*items)[i].on = true;
325 (*items)[i].on = false;
329 (*items)[i].name, i+1, argv[j]);
332 (*items)[i].on = false;
333 (*items)[i].bottomdesc = sethelp ? argv[j++] : "";
336 if (strcmp((*items)[i].name, opt->item_default) == 0)
342 print_menu_items(int output, int nitems, struct bsddialog_menuitem *items,
362 focusname = items[focusitem].name;
365 focusname = items[focusitem].bottomdesc;
405 if (items[i].on == false)
415 if (strchr(items[i].name, ' ') != NULL) {
422 quotech, items[i].name, quotech);
424 dprintf(opt->output_fd, "%s", items[i].name);
435 struct bsddialog_menuitem *items;
442 true, true, opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
445 items, &focusitem);
447 print_menu_items(output, nitems, items, focusitem, opt);
448 free(items);
460 struct bsddialog_menuitem *items;
467 true, false, opt->item_bottomdesc, &nitems, &items, &focusitem,
471 items, &focusitem);
473 print_menu_items(output, nitems, items, focusitem, opt);
474 free(items);
486 struct bsddialog_menuitem *items;
493 true, true, opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
496 items, &focusitem);
498 print_menu_items(output, nitems, items, focusitem, opt);
499 free(items);
511 struct bsddialog_menuitem *items;
518 opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
524 items, &focusitem);
526 print_menu_items(output, nitems, items, focusitem, opt);
527 free(items);
560 print_form_items(int output, int nitems, struct bsddialog_formitem *items,
572 helpname = items[focusitem].label;
575 helpname = items[focusitem].bottomdesc;
584 if (!(items[i].flags & BSDDIALOG_FIELDREADONLY))
585 dprintf(opt->output_fd, "%s\n", items[i].value);
586 free(items[i].value);
594 struct bsddialog_formitem *items;
604 exit_error(true, "--form bad number of arguments items");
607 if ((items = calloc(nitems, sizeof(struct bsddialog_formitem))) == NULL)
608 exit_error(false, "cannot allocate memory for form items");
611 items[i].label = argv[j++];
612 items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
613 items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
614 items[i].init = argv[j++];
615 items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
616 items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
620 items[i].fieldlen = strcols(items[i].init);
622 items[i].fieldlen = abs(fieldlen);
624 items[i].maxvaluelen = (u_int)strtoul(argv[j++], NULL, 10);
625 if (items[i].maxvaluelen == 0)
626 items[i].maxvaluelen = items[i].fieldlen;
629 items[i].flags = flags;
631 items[i].bottomdesc = opt->item_bottomdesc ? argv[j++] : "";
636 items, &focusitem);
637 print_form_items(output, nitems, items, focusitem, opt);
638 free(items);
677 struct bsddialog_formitem *items;
687 exit_error(true, "--mixedform bad number of arguments items");
690 if ((items = calloc(nitems, sizeof(struct bsddialog_formitem))) == NULL)
691 exit_error(false, "cannot allocate memory for form items");
694 items[i].label = argv[j++];
695 items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
696 items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
697 items[i].init = argv[j++];
698 items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
699 items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
702 items[i].fieldlen = strcols(items[i].init);
704 items[i].fieldlen = abs(fieldlen);
705 items[i].maxvaluelen = (u_int)strtoul(argv[j++], NULL, 10);
706 if (items[i].maxvaluelen == 0)
707 items[i].maxvaluelen = items[i].fieldlen;
709 items[i].flags = (u_int)strtoul(argv[j++], NULL, 10);
711 items[i].flags |= BSDDIALOG_FIELDREADONLY;
713 items[i].bottomdesc = opt->item_bottomdesc ? argv[j++] : "";
718 items, &focusitem);
721 items[i].flags &= ~ BSDDIALOG_FIELDREADONLY;
723 print_form_items(output, nitems, items, focusitem, opt);
724 free(items);
764 struct bsddialog_formitem *items;
774 exit_error(true, "--passwordform bad arguments items number");
778 if ((items = calloc(nitems, sizeof(struct bsddialog_formitem))) == NULL)
779 exit_error(false, "cannot allocate memory for form items");
782 items[i].label = argv[j++];
783 items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
784 items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
785 items[i].init = argv[j++];
786 items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
787 items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
790 items[i].fieldlen = abs(fieldlen);
793 items[i].maxvaluelen = valuelen == 0 ? abs(fieldlen) : valuelen;
796 items[i].flags = flags;
798 items[i].bottomdesc = opt->item_bottomdesc ? argv[j++] : "";
803 items, &focusitem);
804 print_form_items(output, nitems, items, focusitem, opt);
805 free(items);