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