Category : C Source Code
Archive   : DYNAM_S1.ZIP
Filename : YCOMD.C

 
Output of file : YCOMD.C contained in archive : DYNAM_S1.ZIP

/******************************** YCOMD.C **********************************/
/************************* DISK COMMANDS AND MENU ****************************/
/********************* (C) 1986,7,8 by JAMES A. YORKE ************************/


#include "yinclud.h"
/*#define DEBUG*/

int caseDs(CodeName)
char *CodeName;
{
/* for terminating a command without changing values by entering '\n' */
char name[80];
FILE *fff; /* for DD */

#ifdef DEBUG
fprintf(stderr, "caseDs(%s)\n", CodeName);
pause(0.5);
#endif
TEST("afd") {
fetchPic(YES); /* yes means add to what is already there */
return(1);
}
TEST("dd") {
NameDDfile();
fff = fopen(DDfile, "w");/* Opens file for reading input */
DumpData(fff);
fclose(fff);
if(level < PROCESS)
MainMenu();
erase_line();

PRINT
"\n DATA HAS BEEN STORED IN DISK FILE: %s \n\n", DDfile);
return(1);
}
TEST("dn") {
if(SCREEN) {
erase_line();
PRINT
"\nThe disk file Name for storing the picture + data is currently: %s \n",
DiskFileName);
erase_line();
PRINT "Enter new file name: ");
if (abortEnter() == YES)/* for terminating a command
without changing values by entering '\n' */
return(1);
}
#ifdef X11
if(input == StInput)
(void) strcpy(name, xwfgets());
else
(void) fscanf(input, "%s", name);
#else
fscanf(input, "%s", name);
#endif

if(name[0] != '\0' && name[0] != ' ' && name[0] != '\n') {
/* don't copy a trivial string into
DiskFileName */
(void) strcpy(DiskFileName, name);
picNameFlag = NO;
/* indicates name has been changed and this
file has not been accessed; */
}
if(SCREEN)
PRINT
"\nCurrent picture file name now is: %s \n\n"
,DiskFileName);
return(1);
}
TEST("fd") {
fetchPic(NO); /* fetch pic from disk, replace, NOt adding */
return(1);
}
TEST("td") {
td(); /* 4 color planes contains DumpData */
return(1);
}
TEST("td0") {
td0(); /* monochrome storage -- contains DumpData */
return(1);
}
TEST("tdfreq") {
if(SCREEN)
if(printer >= 1) {
erase_line();
PRINT
"This feature is turned off(set to 0) whenever the screen is cleared, as \n");
erase_line();
PRINT
"happens with command \"T\" but not with \"RT\".\n\n");
PRINT
"Enter the number of dots computed between disk stores of the picture \n");
PRINT
" (or for basin calculations the number of vertical lines)\n");
}
TDFreq = (long) Entervalue((double) TDFreq, CHECKSET);
return(1);
}
TEST("tdtime") { /* set minutes between saving picture to disk
*/
if(SCREEN)
if(printer >= 1) {
erase_line();
PRINT
"This feature is turned off(set to 0) whenever the screen is cleared, as \n");
erase_line();
PRINT
"happens with command \"T\" but not with \"RT\".\n\n");
PRINT
"Enter the seconds between disk stores of the picture while computing\n");
}
setTDTime(); /* in Y.C */
return(1);
}
TEST("tdwp") {
disk = 1 - disk;
return(1);
}
return(0);
}

diskMenu() {
NameDDfile();
if(level == SETPARAM)
scr_clr(); /* in desmets pcio.a */
scr_rowcol(2, 0);
PRINT
" MENU OF DISK FILE COMMANDS\n\n");
PRINT
"Current disk file name for sending or getting pictures and data: %s \n"
,DiskFileName);
PRINT
"DN: (Disk Name) to change this file name\n");
PRINT
" The following 5 commands use that file\n");
PRINT
"FD: to read picture From the Disk File into core; follow with RT,PS, etc\n");
PRINT
"AFD: Add picture From Disk file into core picture; follow with RT or PS, etc"
);
PRINT "\n");
PRINT
"TD: (To Disk) sends last picture with parameters To the Disk file now\n"
);
PRINT
"TDFREQ: TD is called automatically every %ld dots(=0 means not set)\n",
TDFreq);
PRINT
"TDTIME: disk save freq. (in minutes)=%lf(=0 means not set)\n\n", TDTime);
PRINT
"DD: Dumps Data only to Disk file %s(same as above name but ends in \n"
,DDfile);
PRINT
" .DD) This file is for storing Process name + values of \n");
PRINT
" most constants and vectors. Start program using DOS line \n");
PRINT
" DYNAMICS %s to reproduce this state\n\n", DDfile);
}


  3 Responses to “Category : C Source Code
Archive   : DYNAM_S1.ZIP
Filename : YCOMD.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/