In file input.h:

int get_userid

(char* uid, int msg, int err, int def, char* defval,
int online)

Get and validate a user ID.

Documentation

Get and validate a user ID.

Prompts msg asking for a user ID. If the user does not exist (as checked by uidxref()), err is prompted (with a %s format specifier containing the invalid user ID. If def!=0, prompt def is displayed along with a default user ID of defval.

The user can enter the first few characters of a user ID (three at least), and uidxref() will complete the user ID will when Enter is pressed. If there are more than one user IDs matching what the user entered, a short menu will be shown and the user can choose which one they meant.

Parameters:
uid - pointer to a char *. This is written to if a valid (or default) answer is provided. The variable will be set to the canonical form of the user ID, i.e. in full, and capitalised properly.
msg - is the short prompt number to display. This should give the user a brief idea of what is expected of them. This prompt should belong to the current message block. It will not be displayed if the value is zero, but please don't do this as it makes things look inelegant.
err - the error prompt to display. Specify zero to disable error printing.
def - is the user prompt used when defaults are used (which must belong to the current prompt block). This is usually a short string added to the short menu prompt, and looks like `(Enter=%c)' or ` [%d]'. The format specifier gets either `Y' or `N', depending on the value of defval. Use a zero to disable printing of defval where, for instance, the default value is printed by msg.
defval - is the default value for when the user presses Enter. Non-zero values stand for yes; zero is no.
online - if this is non-zero, the entered user ID must belong to a user who is currently on-line.
Returns:
a value of one is returned if input is valid, in which case the selected user ID can be found in uid. Zero is returned if the user bailed out with X. A value of -1 implies that INF_HELP was set and the user entered `?'.

Alphabetic index



This page was generated with the help of DOC++.