************
File DKB0:[EVERHART.XFR]BOSS.C;266
  182   
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  182   Version 4.3 - 6/1992, Glenn C. Everhart. Added command mode processing
  183   	started by ^\+ (plus char after the control char). The mode is
  184   	to accept ONE command line which will be structured as
  185   	verb args
  186   	which will let the verb determine what will be done with the
  187   	args. The command line is terminated by return. The command
  188   	processing is intended for setup purposes mainly, as it will
  189   	not strive to keep ASTs going and may cause some I/O to
  190   	overrun if there's a lot going on or the user is too slow.
  191   	However the state machine is getting VERY complex! Initial commands
  192   	understood are S<chars>, which sets switch chars to the string
  193   	"chars" (no brackets in cmd, mind). These are set at each
  194   	context switch after stuff_chars. E.g. S^W where ^W is control-W
  195   	would cause BOSS to emit control-W every time it switched to
  196   	this process. G<chars> does the same for all processes (Global
  197   	set). There may be up to 7 characters preloaded in this way.
  198   	Also understood are commands Pnumber and Anumber. Pnumber limits
  199   	playback of saved information in ^I^J mode to "number" characters,
  200   	forced between 100 and BUFSIZE limits, for the current process.
  201   	Anumber limits this playback for all processes to number. Note
  202   	that normal buffered mode output is unaffected by this and will
  203   	allow dump of the whole saved buffer; this is intended to handle
  204   	the case where everything is being saved past where it would
  205   	normally be and limit the amount of that which gets played back
  206   	at every context change.
  207   
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  188     C-a append to log file?
  189     Add support for VT420 terminals, where the display buffer can be larger
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  213     C-a append to log file? (somewhat obsolete; also conflicts with kermit)
  214     Add support for VT420 terminals, where the display buffer can be larger
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  195   #define VERSION		"4.2a"
  196   
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  220   #define VERSION		"4.3"
  221   
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  341   static unsigned char input_char;
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  366   /* Add a command buffer for a command mode to let us joggle more stuff w/o
  367      a super complex state machine. Just handle with normal reads/writes and
  368      accept possible lossage of ast speed etc. if we take too long. */
  369   static char emitchr[NPROCMAX][8];
  370   int emitlen[NPROCMAX];
  371   /* echlen is length of buffer to dump out in ^I ^J mode */
  372   int echlen[NPROCMAX],echnew[NPROCMAX];
  373   static char cmdlin[128];
  374   static unsigned char input_char;
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  810   	 * stuff */
  811   	if (bufmod[n] == 0) {
  812   	    to_term(buffer[n], buflen[n], n);
  813   	    if (bufmod2[n] == 0)
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  843   	 * stuff. Thus only print it all if bufmod == 0. */
  844   	if (bufmod[n] == 0) {
  845   /* Where this process is not in ^i^j mode and it was buffering data,
  846      echnew will come in as 0, so dump the whole buffer. Limit the size
  847      of what we dump however if we've been keeping history of the buffer
  848      using ^i^j mode. In that case the echlen number is the number of
  849      chars we dump. */
  850   	    if (echnew[n] != 1){
  851   	      to_term(buffer[n], buflen[n], n);
  852   	    }
  853   	    if (echnew[n] == 1){
  854   /* send only last 'echlen' bytes to terminal if not in full-buffer mode */
  855   /* If buflen[n] < echlen[n], normal send. */
  856   	      if (buflen[n] <= echlen[n]){
  857   	        to_term(buffer[n], buflen[n], n);
  858   	      }
  859   	      if (buflen[n] > echlen[n]){
  860   	        to_term(buffer[n]+buflen[n]-echlen[n], echlen[n], n);
  861   	      }
  862   	      echnew[n] = 0;
  863   	    }
  864   	    if (bufmod2[n] == 0)
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  817   	} else
  818   	    to_term(tpptr, count[n], n);
******
File DKB0:[EVERHART.XFR]BOSS.C;267
  868   	} else /* emit the buffer we currently have to terminal */
  869   	    to_term(tpptr, count[n], n);
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
  966   	bufmod[cur] = 0;
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 1017   	echnew[cur] = 0;
 1018   	if(bufmod[cur] != 0) echnew[cur] = 1;
 1019   	bufmod[cur] = 0;
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
 1041       return (j);
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 1094   /* Handle emitchr string */
 1095       if ((emitchr[cur][0] != '\0') && (emitlen[cur] > 0)){
 1096   #ifndef USE_PTD
 1097        for (i = 0; i < emitlen[cur]; i++) {
 1098   	 check(SYS$QIOW(0, py_chn[cur], IO$_WRITEVBLK, &tiosb, 0, 0,
 1099   		        emitchr[cur][0] + i, 1, 0, 0, 0, 0));
 1100   	 if (tiosb.stats != SS$_DATAOVERUN)
 1101   	     check(tiosb.stats);
 1102        }
 1103   #else
 1104        if ( emitlen[ncur] ) {
 1105          strncpy(otpline[ncur],emitchr[ncur],emitlen[ncur]);
 1106          check(PTD$WRITE(py_chn[ncur], 0, 0, otpline[ncur]-4, emitlen[ncur], 0, 0));
 1107         }
 1108   #endif
 1109       }
 1110   /*  */
 1111       return (j);
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
 1094       sprintf(buf, "\r    C-g     Get n lines of cur proc -> next%s", ceoln);
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 1164       sprintf(buf, "\r    +       Enter cmd mode for 1 cmd", ceoln);
 1165       term_msg(buf);
 1166       sprintf(buf, "\r    C-g     Get n lines of cur proc -> next%s", ceoln);
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
 1284   		    case '\016':	/* C-n */
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 1356   		    case '+':	/* Plus sign */
 1357   /* Fire up command mode */
 1358   /* Command mode is responsible for its' own prompting, etc. */
 1359   			cmdmode(cur);
 1360   			input_state = NORMAL;
 1361   			break;
 1362   		    case '\016':	/* C-n */
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
 1687   get_tt_info()
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 1765   /* cmdmode(cur); */
 1766   /* Handle commands too intricate for normal work. Can use global cmdlin
 1767      to read data into. */
 1768   cmdmode(curprc)
 1769      int curprc;
 1770   {
 1771     int j,k,n;
 1772     term_msg("\r\nCmd>");
 1773   /* zero the command line initially */
 1774     for (j=0; j < 128; j++){
 1775       cmdlin[j] = '\0';}
 1776     check(SYS$QIOW(4,tt_chn,IO$_READVBLK, &tiosb,0,0,&cmdlin,126,0,0,0,0));
 1777     term_msg(cmdlin); /* echo the line */
 1778   /* got command line in now...go process it and return */
 1779   /* Sstart-chars - set start chars in current process; ctrl-W a good choice */
 1780     if (toupper(cmdlin[0]) == 'S'){
 1781   /* start charstring is rest of line */
 1782       if(curprc >= 0){
 1783         emitlen[curprc] = 0;
 1784         for (j = 0; j <= 7 ; j++){ emitchr[curprc][j] = '\0';}
 1785         for (j = 1; j < 7; j++){
 1786         if (cmdlin[j] == '\0')break;
 1787         if (cmdlin[j] == '\r')break;
 1788         emitchr[curprc][j-1] = cmdlin[j];
 1789         emitlen[curprc]++;
 1790         }
 1791       }
 1792     }
 1793   /* Gstart-chars - set start chars for all processes */
 1794     if (toupper(cmdlin[0]) == 'G'){
 1795   /* start charstring is rest of line */
 1796       for (k=0;k < NPROCMAX; k++){
 1797         for (j = 0; j <= 7 ; j++){ emitchr[k][j] = '\0';}
 1798         emitlen[k] = 0;
 1799         for (j = 1; j < 7; j++){
 1800         if (cmdlin[j] == '\0')break;
 1801         if (cmdlin[j] == '\r')break;
 1802         emitchr[k][j-1] = cmdlin[j];
 1803         emitlen[k]++;
 1804         }
 1805       }
 1806     }
 1807   /* Pnumber plays back only "number" chars for the buffer, not
 1808      the entire buffer size. "Number" must be between 100 and
 1809      BUFSIZE, the 100 chosen to allow current output by. */
 1810     if(toupper(cmdlin[0]) == 'P'){
 1811       sscanf(&cmdlin[1],"%d",&n);
 1812   	printf("[Setting save print to (%d)\n",
 1813   	       n);
 1814       if(curprc >= 0){
 1815         if ((n >= 100) && ( n <= BUFSIZE)){
 1816           k = n;
 1817         }else{
 1818           k = BUFSIZE;}
 1819         echlen[curprc] = k;
 1820       }
 1821     }
 1822   /* Anumber plays back only "number" chars for the buffer, not
 1823      the entire buffer size. "Number" must be between 100 and
 1824      BUFSIZE, the 100 chosen to allow current output by. */
 1825   /* Unlike Pnumber, Anumber operates on all processes. */
 1826     if(toupper(cmdlin[0]) == 'A'){
 1827       sscanf(&cmdlin[1],"%d",&n);
 1828   	printf("[Setting save prints to (%d)\n",
 1829   	       n);
 1830       for (j=0; j < NPROCMAX ; j++){
 1831         if ((n >= 100) && ( n <= BUFSIZE)){
 1832           k = n;
 1833         }else{
 1834           k = BUFSIZE;}
 1835         echlen[j] = k;
 1836       }
 1837     }
 1838   }
 1839   
 1840   get_tt_info()
************
************
File DKB0:[EVERHART.XFR]BOSS.C;266
 1909       /* Save old value of BOSS$ID */
******
File DKB0:[EVERHART.XFR]BOSS.C;267
 2062       for (j = 0; j < nalph; j++){
 2063   	emitchr[j][0] = '\0';
 2064   	emitlen[j] = 0;
 2065   	echlen[j] = BUFSIZE;
 2066           echnew[j] = 0;
 2067       }
 2068       /* Save old value of BOSS$ID */
************

Number of difference sections found: 12
Number of difference records found: 165

DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=DKB0:[EVERHART.XFR]BOSS_C_DIFF.SRC;1-
    DKB0:[EVERHART.XFR]BOSS.C;266-
    DKB0:[EVERHART.XFR]BOSS.C;267
