r11859: Canonicalize whitespace
[ctsim.git] / libctsupport / consoleio.cpp
index 763a8b1312b3b76718cde2a027cb5b4ecc59a1e7..29a7ce9a837f61ce6b13087cc19d32625f839f75 100644 (file)
 
 
 /* NAME
- *   cio_put_c                         Put a character on screen
+ *   cio_put_c                          Put a character on screen
  *
  * SYNOPSIS
  *   cio_put_c (c)
- *   char c                            Character to write
+ *   char c                             Character to write
  *
  * NOTES
  *   Color of character is determined by the global variable, crtv.text_attr.
@@ -38,7 +38,7 @@
  *   and maybe the screen will scroll
  */
 
-void 
+void
 cio_put_c (int c)
 {
     fputc(c, stdout);
@@ -47,23 +47,23 @@ cio_put_c (int c)
 
 
 /* NAME
- *    cio_put_cc                       Put a char on screen count times
+ *    cio_put_cc                        Put a char on screen count times
  *
  * SYNOPSIS
  *    cio_put_cc (c, count)
- *    char c                           Character to write
- *    int count                                Number of characters to write
+ *    char c                            Character to write
+ *    int count                         Number of characters to write
  */
 
-void 
+void
 cio_put_cc (int c, int count)
 {
     for (int i = 0; i < count; i++)
-       cio_put_c (c);
+        cio_put_c (c);
 }
 
 
-void 
+void
 cio_put_str (const char *str)
 {
     fputs (str, stdout);
@@ -72,17 +72,17 @@ cio_put_str (const char *str)
 
 
 /* NAME
- *   kb_getc                   Get a character from the keyboard
+ *   kb_getc                    Get a character from the keyboard
  *
  * SYNOPSIS
  *   key = kb_getc()
  *
  * DESCRIPTION
- *     1. This routine returns an EXTENTED ASCII code,
- *        the extended codes have a low byte of 0 and a distinctive
- *        high byte, such as 0x2D00 and 0x3200
- *     2. This routine waits until a key has been typed
- *     2. The keystroke will not be echoed.
+ *      1. This routine returns an EXTENTED ASCII code,
+ *         the extended codes have a low byte of 0 and a distinctive
+ *         high byte, such as 0x2D00 and 0x3200
+ *      2. This routine waits until a key has been typed
+ *      2. The keystroke will not be echoed.
  */
 
 unsigned int cio_kb_getc(void)
@@ -90,24 +90,24 @@ unsigned int cio_kb_getc(void)
     return fgetc(stdin);
 }
 
-void 
+void
 cio_kb_ungetc (unsigned int c)
 {
     ungetc(c, stdin);
 }
 
 /* NAME
- *    kb_gets                          Get a string from the keyboard
+ *    kb_gets                           Get a string from the keyboard
  *
  * SYNOPSIS
  *    str = kb_gets (str, maxlen)
- *    char *str                                Space to store input string
- *    int maxlen                       Maximum number of characters to read
- *                                     (Not including EOS)
+ *    char *str                         Space to store input string
+ *    int maxlen                        Maximum number of characters to read
+ *                                      (Not including EOS)
  * NOTES
- *    Backspace        - erases character to the right
- *    Escape   - erases to beginning of line
- *    Return   - ends string (no not cause a linefeed)
+ *    Backspace - erases character to the right
+ *    Escape    - erases to beginning of line
+ *    Return    - ends string (no not cause a linefeed)
  */
 
 char *
@@ -117,13 +117,13 @@ cio_kb_gets (char *str, int maxlen)
 }
 
 /* NAME
- *   kb_waitc                  Wait for a character from the keyboard
+ *   kb_waitc                   Wait for a character from the keyboard
  *
  * SYNOPSIS
  *   key = kb_waitc (astr, estr, beep)
- *   int key                   Keystroke entered
- *   char *astr                        String of valid ascii characters
- *   bool beep                 If TRUE, beep when user hits invalid key
+ *   int key                    Keystroke entered
+ *   char *astr                 String of valid ascii characters
+ *   bool beep                  If TRUE, beep when user hits invalid key
  *
  */
 
@@ -135,17 +135,17 @@ cio_kb_waitc (const char *astr, int beep_on_error)
   do {
     c = cio_kb_getc ();
     if (strchr (astr, c) != NULL)
-       break;
+        break;
     if (beep_on_error)
       cio_beep();
   } while (1);
-  
+
   return (c);
 }
 
 
 /* NAME
- *    beep                             sound a beep to user
+ *    beep                              sound a beep to user
  *
  * SYNOPSIS
  *    beep()
@@ -153,27 +153,27 @@ cio_kb_waitc (const char *astr, int beep_on_error)
 
 void cio_beep (void)
 {
-       cio_tone (2000.0, 0.3);
+        cio_tone (2000.0, 0.3);
 }
 
 /* NAME
- *    tone             play a frequency sound for some duration
+ *    tone              play a frequency sound for some duration
  *
  * SYNOPSIS
  *    tone (freq, length)
- *    double freq      frequency to play in Hertz
- *    double length    duration to play note in seconds
+ *    double freq       frequency to play in Hertz
+ *    double length     duration to play note in seconds
  */
 
-void 
+void
 cio_tone (double freq, double length)
 {
 #if 1
   fprintf(stdout, "\007");
 #else
-  cio_spkr_freq (freq);                /* Set frequency of tone */
-  cio_spkr_on ();                      /* Turn on speaker */
-  pause (length);                      /* Pause for length seconds */
-  cio_spkr_off ();                     /* Turn off speaker */
+  cio_spkr_freq (freq);         /* Set frequency of tone */
+  cio_spkr_on ();                       /* Turn on speaker */
+  pause (length);                       /* Pause for length seconds */
+  cio_spkr_off ();                      /* Turn off speaker */
 #endif
 }