]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - mille/move.c
defined(attron) does not mean there is a <term.h>
[bsdgames-darwin.git] / mille / move.c
index a6b8fd270c088ea4614f411d2fbe65bbb5489dbf..a9fe2130bb721ec1655df28e4f4bf0baa95546ba 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: move.c,v 1.8 1999/03/29 05:12:39 mrg Exp $     */
+
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-/*static char sccsid[] = "from: @(#)move.c     5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: move.c,v 1.2 1993/08/01 18:53:58 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)move.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: move.c,v 1.8 1999/03/29 05:12:39 mrg Exp $");
+#endif
 #endif /* not lint */
 
+#include <termios.h>
+
 #include       "mille.h"
 #ifndef        unctrl
 #include       "unctrl.h"
 #endif
 
-# ifdef        attron
-#      include <term.h>
-#      define  _tty    cur_term->Nttyb
-# endif        attron
-
 /*
  * @(#)move.c  1.2 (Berkeley) 3/28/83
  */
@@ -57,11 +60,12 @@ char        *Movenames[] = {
                "M_DISCARD", "M_DRAW", "M_PLAY", "M_ORDER"
        };
 
+void
 domove()
 {
-       reg PLAY        *pp;
-       reg int         i, j;
-       reg bool        goodplay;
+       PLAY    *pp;
+       int     i, j;
+       bool    goodplay;
 
        pp = &Player[Play];
        if (Play == PLAYER)
@@ -160,11 +164,12 @@ acc:
  *     Check and see if either side can go.  If they cannot,
  * the game is over
  */
-check_go() {
-
-       reg CARD        card;
-       reg PLAY        *pp, *op;
-       reg int         i;
+void
+check_go()
+{
+       CARD    card;
+       PLAY    *pp, *op;
+       int     i;
 
        for (pp = Player; pp < &Player[2]; pp++) {
                op = (pp == &Player[COMP] ? &Player[PLAYER] : &Player[COMP]);
@@ -190,11 +195,12 @@ check_go() {
        Finished = TRUE;
 }
 
+int
 playcard(pp)
-reg PLAY       *pp;
+       PLAY    *pp;
 {
-       reg int         v;
-       reg CARD        card;
+       int     v;
+       CARD    card;
 
        /*
         * check and see if player has picked
@@ -335,13 +341,14 @@ protected:
        if (pp == &Player[PLAYER])
                account(card);
        pp->hand[Card_no] = C_INIT;
-       Next = (Next == -1 ? FALSE : TRUE);
+       Next = (Next == (bool)-1 ? FALSE : TRUE);
        return TRUE;
 }
 
+void
 getmove()
 {
-       reg char        c, *sp;
+       char    c;
 #ifdef EXTRAP
        static bool     last_ex = FALSE;        /* set if last command was E */
 
@@ -387,7 +394,7 @@ getmove()
                        Movetype = M_ORDER;
                        goto ret;
                  case 'Q':             /* Quit */
-                       rub();          /* Same as a rubout */
+                       rub(0);         /* Same as a rubout */
                        break;
                  case 'W':             /* Window toggle */
                        Window = nextwin(Window);
@@ -452,7 +459,7 @@ getmove()
                                *sp = '\0';
                                leaveok(Board, TRUE);
                                if ((outf = fopen(buf, "w")) == NULL)
-                                       perror(buf);
+                                       warn("%s", buf);
                                setbuf(outf, (char *)NULL);
                        }
                        Debug = !Debug;
@@ -466,13 +473,15 @@ getmove()
 ret:
        leaveok(Board, TRUE);
 }
+
 /*
  * return whether or not the player has picked
  */
+int
 haspicked(pp)
-reg PLAY       *pp; {
-
-       reg int card;
+       PLAY    *pp;
+{
+       int     card;
 
        if (Topcard <= Deck)
                return TRUE;
@@ -488,10 +497,11 @@ reg PLAY  *pp; {
        return (pp->hand[card] != C_INIT);
 }
 
+void
 account(card)
-reg CARD       card; {
-
-       reg CARD        oppos;
+       CARD    card; 
+{
+       CARD    oppos;
 
        if (card == C_INIT)
                return;
@@ -513,8 +523,9 @@ reg CARD    card; {
                }
 }
 
+void
 prompt(promptno)
-int    promptno;
+       int     promptno;
 {
        static char     *names[] = {
                                ">>:Move:",
@@ -544,11 +555,12 @@ int       promptno;
        clrtoeol();
 }
 
+void
 sort(hand)
-reg CARD       *hand;
+       CARD    *hand;
 {
-       reg CARD        *cp, *tp;
-       reg CARD        temp;
+       CARD    *cp, *tp;
+       CARD    temp;
 
        cp = hand;
        hand += HAND_SZ;
@@ -560,4 +572,3 @@ reg CARD    *hand;
                                *tp = temp;
                        }
 }
-