modern syntax for inits. When ANSI cpp comes will need more work.
[unix-history] / usr / src / games / cribbage / io.c
index 945cfef..708dbd2 100644 (file)
@@ -1,6 +1,16 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)io.c       5.1 (Berkeley) %G%";
+#endif not lint
+
 # include      <curses.h>
 # include      <ctype.h>
 # include      <curses.h>
 # include      <ctype.h>
-# include      <unctrl.h>
+# include      <signal.h>
 # include      "deck.h"
 # include      "cribbage.h"
 # include      "cribcur.h"
 # include      "deck.h"
 # include      "cribbage.h"
 # include      "cribcur.h"
@@ -546,3 +556,17 @@ getline()
     stdscr = oscr;
     return linebuf;
 }
     stdscr = oscr;
     return linebuf;
 }
+
+/*
+ * bye:
+ *     Leave the program, cleaning things up as we go.
+ */
+bye()
+{
+       signal(SIGINT, SIG_IGN);
+       mvcur(0, COLS - 1, LINES - 1, 0);
+       fflush(stdout);
+       endwin();
+       putchar('\n');
+       exit(1);
+}