mirror of
https://git.zap.org.au/git/trader.git
synced 2025-02-02 15:08:13 -05:00
Rename the function getanswer() to get_yn_answer()
This commit is contained in:
parent
36a3811cd1
commit
019734c8aa
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
|
Function: get_yn_answer - Read a Yes/No answer and return true/false
|
||||||
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
|
|
||||||
Arguments: win - Window to use
|
Arguments: win - Window to use
|
||||||
Returns: bool - true if Yes ("Y") was selected, else false
|
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.
|
the cursor becomes invisible after this function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool getanswer (WINDOW *win)
|
bool get_yn_answer (WINDOW *win)
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
bool ok;
|
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)
|
Function: gettxline - Read a line from the keyboard (generic)
|
||||||
Arguments: win - Window to use
|
Arguments: win - Window to use
|
||||||
|
@ -157,8 +157,8 @@ extern int attrpr (WINDOW *win, int attr, const char *format, ...)
|
|||||||
|
|
||||||
// Input routines
|
// Input routines
|
||||||
|
|
||||||
|
extern bool get_yn_answer (WINDOW *win);
|
||||||
extern int gettxchar (WINDOW *win);
|
extern int gettxchar (WINDOW *win);
|
||||||
extern bool getanswer (WINDOW *win);
|
|
||||||
extern int gettxline (WINDOW *win, char *buf, int bufsize, bool multifield,
|
extern int gettxline (WINDOW *win, char *buf, int bufsize, bool multifield,
|
||||||
int maxlen, const char *emptyval, const char *defaultval,
|
int maxlen, const char *emptyval, const char *defaultval,
|
||||||
const char *allowed, bool stripspc, int y, int x,
|
const char *allowed, bool stripspc, int y, int x,
|
||||||
|
Loading…
Reference in New Issue
Block a user