2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3
Copyright (C) 2005- The University of Notre Dame
4
This software is distributed under the GNU General Public License.
5
See the file COPYING for details.
8
#ifndef CONSOLE_LOGIN_H
9
#define CONSOLE_LOGIN_H
11
/** @file console_login.h
12
Read a name and password from the console.
15
/** Read a name and password from the console.
16
This routine will set the console to no-echo mode,
17
carefully read a name and password, and then set the mode back.
18
@param service The name of the service to which the user is authenticating, such as a hostname.
19
@param name A pointer to a buffer to hold the user's name.
20
@param namelen The size of the name buffer in bytes.
21
@param pass A pointer to a buffer to hold the user's password.
22
@param passlen The size of the name buffer in bytes.
23
@return True if the name and password were successfully read, false otherwise.
25
int console_login( const char *service, char *name, int namelen, char *pass, int passlen );
27
/** Read a string from the console.
28
This routine will set the console to no-echo mode,
29
carefully read a generic string, and then set the mode back.
30
@param prompt The prompt to be displayed on the command line.
31
@param buf A pointer to a buffer to hold the string.
32
@param buflen The size of the buffer in bytes.
33
@return True if the string was successfully read, false otherwise.
35
int console_input( const char *prompt, char *buf, int buflen );