Diff of /oputch.c [815a60] .. [710805] Maximize Restore

  Switch to side-by-side view

--- a/oputch.c
+++ b/oputch.c
@@ -21,7 +21,7 @@
 /* Puts a character into the buffer at the current cursor position, and sets
    the attributes of that character to be the defaults for the specified
    display. */
-int ioputch(char ch, iodisplay *display)
+int ioputch(char ch)
 {
     /* Check if the charaacter is an escape character. */
     switch(ch)
@@ -30,14 +30,14 @@
            and set it to the start of the line. */
         case '\n':
         {
-            display->cursorPos += display->bufferWidth;
-            display->cursorPos -= display->cursorPos % display->bufferWidth;
+            ioCurrentDisplay->cursorPos += ioCurrentDisplay->bufferWidth;
+            ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
             /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }
@@ -46,14 +46,14 @@
            and set it to the start of the line. */
         case '\r':
         {
-            display->cursorPos += display->bufferWidth;
-            display->cursorPos -= display->cursorPos % display->bufferWidth;
+            ioCurrentDisplay->cursorPos += ioCurrentDisplay->bufferWidth;
+            ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
              /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }
@@ -64,17 +64,17 @@
             int i;
             for(i = 0; i < 4; ++i)
             {
-                display->buffer[display->cursorPos].ch = ' ';
-                display->buffer[display->cursorPos].foreCol = display->defaultForeCol;
-                display->buffer[display->cursorPos].backCol = display->defaultBackCol;
-                ++display->cursorPos;
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].ch = ' ';
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].foreCol = ioCurrentDisplay->defaultForeCol;
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].backCol = ioCurrentDisplay->defaultBackCol;
+                ++ioCurrentDisplay->cursorPos;
                 /* If the cursor has moved out of the buffer, move it back up and
                    scroll the screen. */
-                if(display->cursorPos > display->bufferLength * display->bufferWidth)
+                if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
                 {
-                    display->cursorPos -= display->bufferWidth;
-                    display->cursorPos -= display->cursorPos % display->bufferWidth;
-                    ioscroll(1, -1, &*display);
+                    ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                    ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
+                    ioscroll(1, -1);
                 }
             }
             break;
@@ -84,17 +84,17 @@
            cursor position. */
         default:
         {
-            display->buffer[display->cursorPos].ch = ch;
-            display->buffer[display->cursorPos].foreCol = display->defaultForeCol;
-            display->buffer[display->cursorPos].backCol = display->defaultBackCol;
-            ++display->cursorPos;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].ch = ch;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].foreCol = ioCurrentDisplay->defaultForeCol;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].backCol = ioCurrentDisplay->defaultBackCol;
+            ++ioCurrentDisplay->cursorPos;
             /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                display->cursorPos -= display->cursorPos % display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }
@@ -105,7 +105,7 @@
 
 /* Puts a character into the buffer at the current cursor position and sets the
    attributes to those specified in the function parameters. */
-int ioputchattrib(char ch, int foreCol, int backCol, iodisplay *display)
+int ioputchattrib(char ch, int foreCol, int backCol)
 {
     /* Check if the charaacter is an escape character. */
     switch(ch)
@@ -114,14 +114,14 @@
            and set it to the start of the line. */
         case '\n':
         {
-            display->cursorPos += display->bufferWidth;
-            display->cursorPos -= display->cursorPos % display->bufferWidth;
+            ioCurrentDisplay->cursorPos += ioCurrentDisplay->bufferWidth;
+            ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
             /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }
@@ -130,14 +130,14 @@
            and set it to the start of the line. */
         case '\r':
         {
-            display->cursorPos += display->bufferWidth;
-            display->cursorPos -= display->cursorPos % display->bufferWidth;
+            ioCurrentDisplay->cursorPos += ioCurrentDisplay->bufferWidth;
+            ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
              /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }
@@ -148,17 +148,17 @@
             int i;
             for(i = 0; i < 4; ++i)
             {
-                display->buffer[display->cursorPos].ch = ' ';
-                display->buffer[display->cursorPos].foreCol = foreCol;
-                display->buffer[display->cursorPos].backCol = backCol;
-                ++display->cursorPos;
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].ch = ' ';
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].foreCol = foreCol;
+                ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].backCol = backCol;
+                ++ioCurrentDisplay->cursorPos;
                 /* If the cursor has moved out of the buffer, move it back up and
                    scroll the screen. */
-                if(display->cursorPos > display->bufferLength * display->bufferWidth)
+                if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
                 {
-                    display->cursorPos -= display->bufferWidth;
-                    display->cursorPos -= display->cursorPos % display->bufferWidth;
-                    ioscroll(1, -1, &*display);
+                    ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                    ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
+                    ioscroll(1, -1);
                 }
             }
             break;
@@ -168,17 +168,17 @@
            cursor position. */
         default:
         {
-            display->buffer[display->cursorPos].ch = ch;
-            display->buffer[display->cursorPos].foreCol = foreCol;
-            display->buffer[display->cursorPos].backCol = backCol;
-            ++display->cursorPos;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].ch = ch;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].foreCol = foreCol;
+            ioCurrentDisplay->buffer[ioCurrentDisplay->cursorPos].backCol = backCol;
+            ++ioCurrentDisplay->cursorPos;
             /* If the cursor has moved out of the buffer, move it back up and
                scroll the screen. */
-            if(display->cursorPos > display->bufferLength * display->bufferWidth)
+            if(ioCurrentDisplay->cursorPos > ioCurrentDisplay->bufferLength * ioCurrentDisplay->bufferWidth)
             {
-                display->cursorPos -= display->bufferWidth;
-                display->cursorPos -= display->cursorPos % display->bufferWidth;
-                ioscroll(1, -1, &*display);
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->bufferWidth;
+                ioCurrentDisplay->cursorPos -= ioCurrentDisplay->cursorPos % ioCurrentDisplay->bufferWidth;
+                ioscroll(1, -1);
             }
             break;
         }