~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to dttools/src/console_login.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
6
*/
 
7
 
 
8
#ifndef CONSOLE_LOGIN_H
 
9
#define CONSOLE_LOGIN_H
 
10
 
 
11
/** @file console_login.h
 
12
Read a name and password from the console.
 
13
*/
 
14
 
 
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.
 
24
*/
 
25
int console_login( const char *service, char *name, int namelen, char *pass, int passlen );
 
26
 
 
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.
 
34
*/
 
35
int console_input( const char *prompt, char *buf, int buflen );
 
36
 
 
37
#endif