console_login.h File Reference

Read a name and password from the console. More...

Go to the source code of this file.

## Functions

int | console_login (const char *service, char *name, int namelen, char *pass, int passlen)
| Read a name and password from the console.
int | console_input (const char *prompt, char *buf, int buflen)
| Read a string from the console.

## Detailed Description

Read a name and password from the console.

## Function Documentation

## console_login()

int console_login | ( | const char * | service,
|  | char * | name,
|  | int | namelen,
|  | char * | pass,
|  | int | passlen )

Read a name and password from the console.

This routine will set the console to no-echo mode, carefully read a name and password, and then set the mode back.

Parameters

  service | The name of the service to which the user is authenticating, such as a hostname.
  name | A pointer to a buffer to hold the user's name.
  namelen | The size of the name buffer in bytes.
  pass | A pointer to a buffer to hold the user's password.
  passlen | The size of the name buffer in bytes.

Returns
  True if the name and password were successfully read, false otherwise.

## console_input()

int console_input | ( | const char * | prompt,
|  | char * | buf,
|  | int | buflen )

Read a string from the console.

This routine will set the console to no-echo mode, carefully read a generic string, and then set the mode back.

Parameters

  prompt | The prompt to be displayed on the command line.
  buf | A pointer to a buffer to hold the string.
  buflen | The size of the buffer in bytes.

Returns
  True if the string was successfully read, false otherwise.