#include <uif.h>
#include <terrno.h>
int prmstr (param, help, deflag, def, maxlen, value, nreply)
char *param, *help;
int deflag;
char *def;
int maxlen;
char *value;
int *nreply;
int enumstr (param, help, deflag, def, ngood, goodval,
value, nreply)
char *param, *help;
int deflag;
char *def;
int ngood;
char *goodval[];
int *value;
int *nreply;
int prmenum (param, help, deflag, def, ngood, goodval,
value, nreply)
char *param, *help;
int deflag;
char *def;
int ngood;
char *goodval[];
int *value;
int *nreply;
int prmenumv (param, help, deflag, def, least, most,
ngood, goodval, uniq, value, nreply)
char *param;
char *help;
int deflag;
char *def;
int least;
int most;
int ngood;
char *goodval[];
int uniq;
int value[];
int *nreply;
int prmname(param, help, deflag, def, maxlen, value, nreply)
char *param, *help;
int deflag;
char *def;
int maxlen;
char *value;
int *nreply;
int prmnames(param, help, deflag, def, maxlen, least, most,
namestr, nreply)
char *param, *help;
int deflag;
char *def;
int maxlen, least, moset;
char *value;
int *nreply;
int prmfile(param, help, deflag, def, maxlen, value, nreply)
char *param, *help;
int deflag;
char *def;
int maxlen;
char *value;
int *nreply;
The functions described here process string-valued parameters. The following arguments have the same meaning for all functions:
param - parameter name, length no greater than MAX_PARAM_NAME.
help - obsolete, use NULL
deflag - default flag, either NO_DEFAULT, HAS_DEFAULT or OPTIONAL. OPTIONAL parameters also have defaults.
def - default response string
prmstr is the most basic routine, making no restrictions on the input string other than maximum characters maxlen. Leading and trailing blanks and tabs are ignored. The response is returned in value. nreply is set to 0 if the user accepted the default response, 1 otherwise.
prmname is similar to prmstr, except that blanks and tabs are not allowed. Leading blanks and tabs are ignored.
prmfile is similar to prmname, except that standard UNIX wildcard characters are expanded before testing the length.
prmnames is similar to prmname, except that multiple names are allowed. Names are separated by one or space characters, either blanks or tabs. least and most indicate the number of names expected by the application. The names are returned in value, separated by single \ characters. nreply is set to the number of names returned.
enumstr expects the user's response to be in the list goodval, which has ngood entries. The user is required to enter enough characters to ensure a unique leading match. value is set to the 0-relative index into goodval of the user's response. nreply is set to 0 if the user accepted the default, 1 otherwise.
prmenum is the same as enumstr, and should be used instead of enumstr in the future.
prmenumv works the same as enumstr, except that one or more input names can be accepted. As with enumstr, user input names are expected to be in the list goodval, which has ngood entries. least and most indicate the number of names expected by the application. If uniq is true, the user cannot enter the same name more than once. On output, value[i] is set to the 0-relative index into goodval corresponding to the i-\th input name. nreply is set to the number of values returned.
All of the above functions return 0 if successful. Otherwise they return -1 and set terrno to the appropriate error code.
The following error codes are defined in include/uif.h:
EUIF_SIGNAL - Signal occurred during input
EUIF_EOF - Unexpected end of input
include/uif.h, include/terrno.h, lib/libuif.a
None.
Last Update: $Date: 1999/05/10 20:57:02 $