+ return true;
+}
+
+/*
+ * Get a selection list
+ * We get a command from the user, scan it, then
+ * return when OK
+ * Returns true if OK
+ * false if error
+ */
+bool get_selection_list(UAContext *ua, sellist &sl,
+ const char *prompt, bool subprompt)
+{
+ for ( ;; ) {
+ if (!get_cmd(ua, prompt, subprompt)) {
+ return false;
+ }
+ if (!sl.set_string(ua->cmd, true)) {
+ ua->send_msg("%s", sl.get_errmsg());
+ continue;
+ }
+ return true;
+ }
+}
+
+/*
+ * Get a positive integer
+ * Returns: false if failure
+ * true if success => value in ua->pint32_val
+ */
+bool get_pint(UAContext *ua, const char *prompt)
+{
+ double dval;
+ ua->pint32_val = 0;
+ ua->int64_val = 0;
+ for (;;) {
+ ua->cmd[0] = 0;
+ if (!get_cmd(ua, prompt)) {
+ return false;
+ }
+ /* Kludge for slots blank line => 0 */
+ if (ua->cmd[0] == 0 && strncmp(prompt, _("Enter slot"), strlen(_("Enter slot"))) == 0) {
+ return true;
+ }
+ if (!is_a_number(ua->cmd)) {
+ ua->warning_msg(_("Expected a positive integer, got: %s\n"), ua->cmd);
+ continue;
+ }
+ errno = 0;
+ dval = strtod(ua->cmd, NULL);
+ if (errno != 0 || dval < 0) {
+ ua->warning_msg(_("Expected a positive integer, got: %s\n"), ua->cmd);
+ continue;
+ }
+ ua->pint32_val = (uint32_t)dval;
+ ua->int64_val = (int64_t)dval;
+ return true;
+ }