mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
780 B
58 lines
780 B
/*++
|
|
|
|
Copyright (c) 1997 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
confirm.c
|
|
|
|
Abstract:
|
|
|
|
Routine to allow the user to confirm an operation
|
|
with a y/n response.
|
|
|
|
Author:
|
|
|
|
Ted Miller (tedm) 29-May-1997
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
#include <mytypes.h>
|
|
#include <misclib.h>
|
|
|
|
#include <stdio.h>
|
|
#include <conio.h>
|
|
#include <ctype.h>
|
|
|
|
|
|
BOOL
|
|
_far
|
|
ConfirmOperation(
|
|
IN FPCHAR ConfirmationText,
|
|
IN char textYesChar,
|
|
IN char textNoChar
|
|
)
|
|
{
|
|
char c;
|
|
|
|
printf(ConfirmationText);
|
|
printf(" ");
|
|
|
|
prompt:
|
|
|
|
c = (char)getch();
|
|
|
|
if(toupper(c) == toupper(textYesChar)) {
|
|
printf("%c\n\n",c);
|
|
return(TRUE);
|
|
}
|
|
|
|
if(toupper(c) == toupper(textNoChar)) {
|
|
printf("%c\n\n",c);
|
|
return(FALSE);
|
|
}
|
|
|
|
goto prompt;
|
|
}
|