mirror of
https://git.zap.org.au/git/trader.git
synced 2025-09-21 19:44:39 -04:00
Rename the function getanswer() to get_yn_answer()
This commit is contained in:
42
src/intf.c
42
src/intf.c
@@ -390,26 +390,7 @@ int attrpr (WINDOW *win, int attr, const char *format, ...)
|
||||
************************************************************************/
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Function: gettxchar - Read a keyboard character
|
||||
Arguments: win - Window to use
|
||||
Returns: int - Keyboard character
|
||||
|
||||
This function reads a single character from the keyboard. The key is
|
||||
NOT echoed to the screen and the cursor visibility is NOT affected.
|
||||
*/
|
||||
|
||||
int gettxchar (WINDOW *win)
|
||||
{
|
||||
keypad(win, true);
|
||||
meta(win, true);
|
||||
wtimeout(win, -1);
|
||||
|
||||
return wgetch(win);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Function: getanswer - Read a Yes/No answer and return true/false
|
||||
Function: get_yn_answer - Read a Yes/No answer and return true/false
|
||||
Arguments: win - Window to use
|
||||
Returns: bool - true if Yes ("Y") was selected, else false
|
||||
|
||||
@@ -419,7 +400,7 @@ int gettxchar (WINDOW *win)
|
||||
the cursor becomes invisible after this function.
|
||||
*/
|
||||
|
||||
bool getanswer (WINDOW *win)
|
||||
bool get_yn_answer (WINDOW *win)
|
||||
{
|
||||
int key;
|
||||
bool ok;
|
||||
@@ -453,6 +434,25 @@ bool getanswer (WINDOW *win)
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Function: gettxchar - Read a keyboard character
|
||||
Arguments: win - Window to use
|
||||
Returns: int - Keyboard character
|
||||
|
||||
This function reads a single character from the keyboard. The key is
|
||||
NOT echoed to the screen and the cursor visibility is NOT affected.
|
||||
*/
|
||||
|
||||
int gettxchar (WINDOW *win)
|
||||
{
|
||||
keypad(win, true);
|
||||
meta(win, true);
|
||||
wtimeout(win, -1);
|
||||
|
||||
return wgetch(win);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Function: gettxline - Read a line from the keyboard (generic)
|
||||
Arguments: win - Window to use
|
||||
|
@@ -157,8 +157,8 @@ extern int attrpr (WINDOW *win, int attr, const char *format, ...)
|
||||
|
||||
// Input routines
|
||||
|
||||
extern bool get_yn_answer (WINDOW *win);
|
||||
extern int gettxchar (WINDOW *win);
|
||||
extern bool getanswer (WINDOW *win);
|
||||
extern int gettxline (WINDOW *win, char *buf, int bufsize, bool multifield,
|
||||
int maxlen, const char *emptyval, const char *defaultval,
|
||||
const char *allowed, bool stripspc, int y, int x,
|
||||
|
Reference in New Issue
Block a user