/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
*/
/*LINTLIBRARY*/
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
#include "valtools.h"
#include <stdlib.h>
#include <strings.h>
#include "libadm.h"
static char *strtoki(char *, char *);
static int getstr(char *, char *, char *, char *, char *);
static int getnum(char *, int, int *, int *);
static char *deferr;
static char *errmsg;
static char *defhlp;
or a partial string which uniquely identifies the \
token for the menu item. Enter ?? to reprint the menu."
static char *
{
int n;
char *msg;
n = (int)(6 + sizeof (MESG2));
if (flag)
n += (int)(sizeof (MESG0));
if (flag)
else
msg[0] = '\0';
} else {
if (flag)
else
msg[0] = '\0';
}
return (msg);
}
CKMENU *
{
}
return (pt);
}
void
{
}
void
{
}
int
{
int n, i;
char **list;
return (4); /* nothing to choose from */
n++;
}
if (n <= 1) {
return (0);
}
}
if (max < 1)
if (!prompt)
return (n);
}
goto reprint;
}
} else {
if (!list) {
goto start;
}
for (i = 0; (i < max); i++)
}
return (0);
}
static int
{
int n;
char *pt;
for (;;) {
if (*pt == '$') {
n = max;
pt++;
} else {
if ((n <= 0) || (n > max))
return (1);
}
pt++;
*begin = n;
pt++;
pt++;
continue;
} else if (*pt) {
return (1); /* wasn't a number, or an invalid one */
} else if (*begin) {
*end = n;
break;
} else {
*begin = n;
break;
}
}
if (!*end)
}
static char **
{
char **choice;
nchoice = 0;
do {
do {
*pt++ = '\0';
}
return (NULL);
}
&end)) {
return (NULL);
}
for (i = 1; chp; i++) {
return (NULL);
}
}
}
continue;
}
for (i = 0; chp; i++) {
break;
} else if (found) {
return (NULL); /* not unique */
}
}
}
#if _3b2
#else
#endif
break;
} else if (found) {
return (NULL);
}
}
}
}
if (found) {
continue;
}
return (NULL);
return (choice);
}
int
{
int n;
char *pt;
/* request to clear memory usage */
while (chp) {
}
return (1);
}
return (1);
return (1);
}
return (2);
}
}
else
return (0);
}
int
{
int index;
index = 0;
return (0);
return (0);
}
else {
index++; /* count invisible choices */
(index+2)* sizeof (char *));
}
return (-1);
return (0);
}
static int
{
int n;
while (base) {
return (0);
}
if (last)
else
return (1);
}
while (base) {
return (0);
if (n > 0) {
/* should come before this one */
break;
}
}
if (last) {
} else {
}
return (1);
}
void
{
int i;
char *pt;
int c;
}
for (i = 1; chp; ++i) {
/* LINTED E_SEC_PRINTF_VAR_FMT */
/* there is text associated with the token */
while (*pt) {
if (*pt++ == '\n') {
"%5s", "");
/* LINTED E_SEC_PRINTF_VAR_FMT */
++pt;
}
}
}
if (chp && ((i % 10) == 0)) {
/* page the choices */
"\n... %d more menu choices to follow;",
/* CSTYLED */
"\n<RETURN> for more choices, <CTRL-D> to stop \
display:");
/* ignore other chars */
;
if (c == EOF)
break; /* stop printing menu */
}
}
}
static int
{
*end = '\0';
if (defstr) {
}
if (ckquit) {
} else {
}
return (1);
if (defstr) {
return (0);
}
goto start;
goto start;
/* (void) strcpy(strval, input); */
return (3);
}
return (0);
}
static struct _choice_ *
{
static char *last;
static char *first;
if (!chp) {
return (NULL);
}
continue; /* lower than the last one we found */
}
}
return (found);
}
static char *
{
char *p, *q, *r;
static char *savept;
/* first or subsequent call */
if (p == NULL) /* return if no tokens remaining */
return (NULL);
if (*q == '\0') /* return if no tokens remaining */
return (NULL);
savept = 0; /* indicate this is last token */
else {
*r = '\0';
savept = ++r;
}
return (q);
}