BSD 4_3_Reno release
[unix-history] / usr / src / games / cribbage / io.c
index 3a7f9e3..4bb8061 100644 (file)
@@ -1,4 +1,25 @@
-static char    *sccsid = "@(#)io.c     1.13 (Berkeley) %G%";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that: (1) source distributions retain this entire copyright
+ * notice and comment, and (2) distributions including binaries display
+ * the following acknowledgement:  ``This product includes software
+ * developed by the University of California, Berkeley and its contributors''
+ * in the documentation or other materials provided with the distribution
+ * and in all advertising materials mentioning features or use of this
+ * software. Neither the name of the University nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)io.c       5.6 (Berkeley) 6/1/90";
+#endif /* not lint */
 
 # include      <curses.h>
 # include      <ctype.h>
 
 # include      <curses.h>
 # include      <ctype.h>
@@ -14,10 +35,10 @@ static char *sccsid = "@(#)io.c     1.13 (Berkeley) %G%";
 # endif
 # define       CTRL(X)                 ('X' - 'A' + 1)
 
 # endif
 # define       CTRL(X)                 ('X' - 'A' + 1)
 
-# ifndef       attron
+# ifdef        notdef                          /* defined in curses.h */
 #      define  erasechar()     _tty.sg_erase
 #      define  killchar()      _tty.sg_kill
 #      define  erasechar()     _tty.sg_erase
 #      define  killchar()      _tty.sg_kill
-# endif                attron
+# endif
 
 char           linebuf[ LINESIZE ];
 
 
 char           linebuf[ LINESIZE ];
 
@@ -483,8 +504,10 @@ readchar()
 over:
     cnt = 0;
     while (read(0, &c, 1) <= 0)
 over:
     cnt = 0;
     while (read(0, &c, 1) <= 0)
-       if (cnt++ > 100)        /* if we are getting infinite EOFs */
-           bye();              /* quit the game */
+       if (cnt++ > 100) {      /* if we are getting infinite EOFs */
+               bye();          /* quit the game */
+               exit(1);
+       }
     if (c == CTRL(L)) {
        wrefresh(curscr);
        goto over;
     if (c == CTRL(L)) {
        wrefresh(curscr);
        goto over;
@@ -549,6 +572,12 @@ getline()
     return linebuf;
 }
 
     return linebuf;
 }
 
+rint()
+{
+       bye();
+       exit(1);
+}
+
 /*
  * bye:
  *     Leave the program, cleaning things up as we go.
 /*
  * bye:
  *     Leave the program, cleaning things up as we go.
@@ -560,5 +589,4 @@ bye()
        fflush(stdout);
        endwin();
        putchar('\n');
        fflush(stdout);
        endwin();
        putchar('\n');
-       exit(1);
 }
 }