debugging flag -D
authorBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 21 May 1983 08:56:22 +0000 (00:56 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 21 May 1983 08:56:22 +0000 (00:56 -0800)
SCCS-vsn: games/sail/pl_1.c 1.6
SCCS-vsn: games/sail/machdep.h 1.7

usr/src/games/sail/machdep.h
usr/src/games/sail/pl_1.c

index 6989f79..f9d41b0 100644 (file)
@@ -1,8 +1,9 @@
 /*
 /*
- * sccsid = "@(#)machdep.h     1.6 %G%";
+ * sccsid = "@(#)machdep.h     1.7 %G%";
  */
 #define LOGFILE "/usr/games/lib/shipslog"
 #define DRIVER "/usr/games/.driver"
  */
 #define LOGFILE "/usr/games/lib/shipslog"
 #define DRIVER "/usr/games/.driver"
+#define DEBUGDRIVER "driver"
 #define DRIVERNAME ".driver"
 #define UCBCORY
 #define SAILLOGDEF 0           /* don't look up usernames */
 #define DRIVERNAME ".driver"
 #define UCBCORY
 #define SAILLOGDEF 0           /* don't look up usernames */
index 51ca771..abb10aa 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)pl_1.c      1.5 83/05/20";
+static char *sccsid = "@(#)pl_1.c      1.6 83/05/20";
 #endif
 
 #include "player.h"
 #endif
 
 #include "player.h"
@@ -327,8 +327,8 @@ unfoulplayer()
        }
 }
 
        }
 }
 
-initialize(nodriver, randomize)
-char randomize, nodriver;
+initialize(nodriver, randomize, debug)
+char randomize, nodriver, debug;
 {
        char comm[80], file[25], capn;
        char message[60];
 {
        char comm[80], file[25], capn;
        char message[60];
@@ -499,7 +499,10 @@ reprint:
                char num[10];
                sprintf(num, "%d", game);
                if (!fork()) {
                char num[10];
                sprintf(num, "%d", game);
                if (!fork()) {
-                       execl(DRIVER, DRIVERNAME, num, 0);
+                       if (debug)
+                               execl(DEBUGDRIVER, DRIVERNAME, num, 0);
+                       else
+                               execl(DRIVER, DRIVERNAME, num, 0);
                        perror(DRIVER);
                        kill(pid, SIGKILL);
                        exit(1);
                        perror(DRIVER);
                        kill(pid, SIGKILL);
                        exit(1);
@@ -561,7 +564,8 @@ char ** argv;
        int ta;
        char message[60], ch;
        int uid;
        int ta;
        char message[60], ch;
        int uid;
-       char nodrive = 0, randomize = 0, *badstring();
+       char nodrive = 0, randomize = 0, debug = 0;
+       char *badstring();
        extern char _sobuf[];
 
        setbuf(stdout, _sobuf);
        extern char _sobuf[];
 
        setbuf(stdout, _sobuf);
@@ -577,6 +581,9 @@ char ** argv;
                case 'd':
                        nodrive = 1;
                        break;
                case 'd':
                        nodrive = 1;
                        break;
+               case 'D':
+                       debug++;
+                       break;
                case 'x':
                        randomize = 1;
                        break;
                case 'x':
                        randomize = 1;
                        break;
@@ -588,7 +595,7 @@ char ** argv;
                game = atoi(*argv);
        else
                game = -1;
                game = atoi(*argv);
        else
                game = -1;
-       initialize(nodrive, randomize);
+       initialize(nodrive, randomize, debug);
        Signal("Aye aye, Sir", 0, 0);
        for(;;) {
                move(scroll++,0);
        Signal("Aye aye, Sir", 0, 0);
        for(;;) {
                move(scroll++,0);