BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
kchoose - prompt the user to select from a list of items
LIBRARY CALL
char *kchoose(
int notify_type,
char **list_of_options,
int num_options,
int default_index,
char *return_string,
int *return_index,
char *format,
kvalist)
INPUT
- notify_type - the notify level specified by the programmer
KFORCE, KSTANDARD, KVERBOSSE
- list_of_options - an array of strings containing the items
to select from.
- num_options - The number of items in the list_of_options.
- default_index - The index number to the default item,
must start at 1.
- format - grammatically correct, clear explanation of
the error that occurred. This can be formatted
like a (void) printf statement.
OUTPUT
- return_string - string that holds the selected item.
If it's NULL, it kmallocs the space necessary,
and returns the string.
- return_index - This is the index of the item selected.
RETURN VALUE
return_string if it is not NULL, or a pointer to the
resulting kmalloc'ed string if it is NULL.
NULL is returned upon error.
DESCRIPTION
kchoose will call the specified choose handler to request
the user to make a selection from a list of items.
This utility can operate in several different modes.
If the notify_type variable is set to KFORCE, then the
prompt will always appear regardless of the setting
of the environment variable KHOROS_NOTIFY.
If the notify_type variable is set to KSTANDARD and the
user has the environment variable KHOROS_NOTIFY set to
either KSTANDARD or KVERBOSE the prompt will appear.
And finally, if the notify_type variable is set to KVERBOSE
and the environment variable KHOROS_NOTIFY set to KVERBOSE,
the prompt will appear.
Here is a summary table:
notify_type = FORCE always prompt, ignore the setting of
the environment variable KHOROS_NOTIFY
notify_type = STANDARD only prompt when the environment
variable KHOROS_NOTIFY is set to
STANDARD or VERBOSE.
notify_type = VERBOSE only prompt when the environment
variable KHOROS_NOTIFY is set to
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/notify.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.