ckitem.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * Copyright (c) 1989, 2011, Oracle and/or its affiliates. All rights reserved. 2N/Astatic int getstr(
char *,
char *,
char *,
char *,
char *);
2N/A#
define MESG0 "Entry does not match available menu selection. " 2N/A#
define MESG1 "the number of the menu item you wish to select, or " 2N/A#
define MESG2 "the token which is associated with the menu item,\ 2N/A or a partial string which uniquely identifies the \ 2N/A token for the menu item. Enter ?? to reprint the menu." 2N/A#
define TOOMANY "Too many items selected from menu" 2N/A#
define NOTUNIQ "The entered text does not uniquely identify a menu choice." 2N/A#
define BADNUM "Bad numeric choice specification" 2N/A return (
4);
/* nothing to choose from */ 2N/A return (
1);
/* wasn't a number, or an invalid one */ 2N/A /* request to clear memory usage */ 2N/A /* should come before this one */ 2N/A /* there is text associated with the token */ 2N/A /* page the choices */ 2N/A "\n... %d more menu choices to follow;",
2N/A "\n<RETURN> for more choices, <CTRL-D> to stop \ 2N/A /* ignore other chars */ 2N/A break;
/* stop printing menu */ 2N/A /* (void) strcpy(strval, input); */ 2N/A continue;
/* lower than the last one we found */ 2N/A /* first or subsequent call */ 2N/A if (p ==
NULL)
/* return if no tokens remaining */ 2N/A if (*q ==
'\0')
/* return if no tokens remaining */ 2N/A savept = 0;
/* indicate this is last token */