Un-ignored: the dev drive is the ground truth the restoration and emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio content). Kept in-repo for the pod-owner community. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
82 lines
3.1 KiB
Plaintext
82 lines
3.1 KiB
Plaintext
/****************************************************************************
|
|
** PROJECT ** SAFEDOS **
|
|
*****************************************************************************
|
|
** FUNCTION ** REPLACEMENT FOR "dos" MACRO. IF THERE ARE ANY MODIFIED **
|
|
** ** BUFFERS IN MEMORY, THE USER IS INFORMED AND GIVEN THE USUAL **
|
|
** ** OPTIONS OF CONTINUING ANYWAY, ABORTING, OR WRITING THEM TO **
|
|
** ** DISK BEFORE CONTINUING! **
|
|
*****************************************************************************
|
|
** AUTHOR ** WARREN D HUMPHREYS **
|
|
*****************************************************************************
|
|
** DATE ** WEDNESDAY 23RD OCTOBER 1991 **
|
|
*****************************************************************************
|
|
** COMMENTS ** **
|
|
*****************************************************************************
|
|
** MODIFICATION HISTORY **
|
|
*****************************************************************************
|
|
** DATE ** WHO ** CHANGED WHAT **
|
|
*****************************************************************************
|
|
** ** ** **
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
** FUNCTION PROTOTYPES **
|
|
****************************************************************************/
|
|
|
|
replacement int dos();
|
|
|
|
/****************************************************************************
|
|
** GLOBAL VARIABLES **
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
** ACTUAL FUNCTIONS **
|
|
****************************************************************************/
|
|
|
|
replacement int dos()
|
|
{
|
|
int Modified,
|
|
NewBuffID,
|
|
ReturnCode,
|
|
ThisBuffID;
|
|
|
|
string Message,
|
|
Prompt,
|
|
Reply;
|
|
|
|
Modified=0;
|
|
Reply="Y";
|
|
ReturnCode=0;
|
|
ThisBuffID=inq_buffer(NULL);
|
|
do
|
|
{
|
|
set_buffer(NewBuffID=next_buffer(0));
|
|
if (inq_modified(NULL))
|
|
Modified+=1;
|
|
}
|
|
while (NewBuffID!=ThisBuffID);
|
|
if (Modified)
|
|
{
|
|
sprintf(Prompt,"%d buffer%s not been saved. Shell [ynw]? ",Modified,
|
|
Modified==1 ? " has" : "s have");
|
|
get_parm(NULL,Reply,Prompt,1,"");
|
|
if (upper(Reply)=="W")
|
|
{
|
|
sprintf(Message,"Writing modified buffer%s",Modified==1 ? "" : "s");
|
|
message(Message);
|
|
do
|
|
{
|
|
set_buffer(NewBuffID=next_buffer(0));
|
|
if (inq_modified(NULL))
|
|
write_buffer();
|
|
}
|
|
while (NewBuffID!=ThisBuffID);
|
|
}
|
|
}
|
|
if (upper(Reply)=="N")
|
|
ReturnCode=0;
|
|
else
|
|
ReturnCode=dos();
|
|
return(ReturnCode);
|
|
}
|