OpenVPN
|
#include "syshead.h"
#include "console.h"
#include "error.h"
#include "buffer.h"
#include "misc.h"
#include "win32.h"
Go to the source code of this file.
Functions | |
static bool | get_console_input_win32 (const char *prompt, const bool echo, char *input, const int capacity) |
Get input from a Windows console. More... | |
static bool | get_console_input (const char *prompt, const bool echo, char *input, const int capacity) |
Core function for getting input from console. More... | |
bool | query_user_exec_builtin (void) |
Wrapper function enabling query_user_exec() if no alternative methods have been enabled. More... | |
|
static |
Core function for getting input from console.
prompt The prompt to present to the user echo Should the user see what is being typed input Pointer to the buffer used to save the user input capacity Size of the input buffer
Definition at line 194 of file console_builtin.c.
References ASSERT, chomp(), get_console_input_win32(), M_FATAL, msg, secure_memzero(), and strncpynt().
Referenced by query_user_exec_builtin().
|
static |
Get input from a Windows console.
prompt | Prompt to display to the user |
echo | Should the user input be displayed in the console |
input | Pointer to the buffer the user input will be saved |
capacity | Size of the buffer for the user input |
Definition at line 59 of file console_builtin.c.
References ASSERT, chomp(), flags, free, get_orig_stderr(), malloc, status, string_null_terminate(), win32_service_interrupt(), and write.
Referenced by get_console_input().
bool query_user_exec_builtin | ( | void | ) |
Wrapper function enabling query_user_exec() if no alternative methods have been enabled.
Executes a configured setup, using the built-in method for querying the user.
Default method for querying user using default stdin/stdout on a console. This needs to be available as a backup interface for the alternative implementations in case they cannot query through their implementation specific methods.
If no alternative implementation is declared, a wrapper in console.h will ensure query_user_exec() will call this function instead.
Definition at line 270 of file console_builtin.c.
References _query_user::echo, get_console_input(), _query_user::prompt, query_user, QUERY_USER_NUMSLOTS, _query_user::response, and _query_user::response_len.
Referenced by query_user_exec().