home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume3 / xchess / patch1 < prev   
Encoding:
Internet Message Format  |  1988-01-25  |  4.7 KB

  1. Path: uunet!tektronix!tekgen!tekred!games-request
  2. From: games-request@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v03i079:  xchess - chess display program using X windows, Patch1
  5. Message-ID: <2124@tekred.TEK.COM>
  6. Date: 25 Jan 88 19:39:34 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 169
  9. Approved: billr@tekred.TEK.COM
  10.  
  11. Submitted by: Konstantinos Konstantinides <kk@hpl-opus.HP.COM>
  12. Comp.sources.games: Volume 3, Issue 79
  13. Archive-name: xchess/Patch1
  14.  
  15.     [The following patches allow xchess to understand the
  16.      new "level" option in gnuchess.  Include are diffs
  17.      for xchess.c, program.c and xchess.1.  Just run this
  18.      file through 'patch' to update your sources.  -br]
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of shell archive."
  27. # Contents:  Patches01
  28. # Wrapped by billr@tekred on Mon Jan 25 11:30:36 1988
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f Patches01 -a "${1}" != "-c" ; then 
  31.   echo shar: Will not over-write existing file \"Patches01\"
  32. else
  33. echo shar: Extracting \"Patches01\" \(3108 characters\)
  34. sed "s/^X//" >Patches01 <<'END_OF_Patches01'
  35. X*** xchess.c    Thu Dec 11 09:19:24 1986
  36. X--- new/xchess.c    Mon Jan 25 11:25:15 1988
  37. X***************
  38. X*** 28,34 ****
  39. X  
  40. X  #define USAGE    "xchess [ -d ] [ -f recordfile ] [ -r savedfile ] [ -i ]\n\
  41. X  \t[ -t moves/timeunit ] [ -c ] [ -p program ]  [ -b ] [ -bnw ] [ -s ]\n\
  42. X! \t[ -n ] [ -h host ] [ -v ] [ -R ] [ whitedisplay ] [ blackdisplay ]"
  43. X  
  44. X  #include "xchess.h"
  45. X  
  46. X--- 28,34 ----
  47. X  
  48. X  #define USAGE    "xchess [ -d ] [ -f recordfile ] [ -r savedfile ] [ -i ]\n\
  49. X  \t[ -t moves/timeunit ] [ -c ] [ -p program ]  [ -b ] [ -bnw ] [ -s ]\n\
  50. X! \t[ -n ] [ -h host ] [ -v ] [ -R ] [ whitedisplay ] [ blackdisplay ] [-l level]"
  51. X  
  52. X  #include "xchess.h"
  53. X  
  54. X***************
  55. X*** 40,45 ****
  56. X--- 40,46 ----
  57. X  bool quickflag = false;
  58. X  
  59. X  char *progname = DEF_PROGRAM;
  60. X+ char *level;
  61. X  char *proghost = NULL;
  62. X  char *piecenames[] = { "pawn", "rook", "knight", "bishop", "queen", "king" } ;
  63. X  char *colornames[] = { "white", "black", "none" } ;
  64. X***************
  65. X*** 110,115 ****
  66. X--- 111,123 ----
  67. X                  progname = *av;
  68. X              else
  69. X                  goto usage;
  70. X+ 
  71. X+         } else if (eq(*av, "-l")) {
  72. X+             av++; ac --;
  73. X+             if (*av)
  74. X+                 level = *av;
  75. X+             else
  76. X+                 goto usage;
  77. X          } else if (eq(*av, "-h")) {
  78. X              av++; ac--;
  79. X              if (*av)
  80. X***************
  81. X*** 209,215 ****
  82. X  
  83. X      /* Start the program if necessary. */
  84. X      if (progflag)
  85. X!         if (!program_init(progname))
  86. X              exit(1);
  87. X      
  88. X      XSync(0);
  89. X--- 217,223 ----
  90. X  
  91. X      /* Start the program if necessary. */
  92. X      if (progflag)
  93. X!         if (!program_init(progname,level))
  94. X              exit(1);
  95. X      
  96. X      XSync(0);
  97. X*** program.c    Thu Dec 11 09:19:17 1986
  98. X--- new/program.c    Mon Jan 25 11:25:16 1988
  99. X***************
  100. X*** 30,43 ****
  101. X  
  102. X  #include "xchess.h"
  103. X  #include <signal.h>
  104. X  #include <sys/time.h>
  105. X  
  106. X  static int pid;
  107. X  static FILE *from, *to;
  108. X  
  109. X  bool
  110. X! program_init(name)
  111. X!     char *name;
  112. X  {
  113. X      int toprog[2], fromprog[2];
  114. X      char buf[BSIZE];
  115. X--- 30,47 ----
  116. X  
  117. X  #include "xchess.h"
  118. X  #include <signal.h>
  119. X+ #ifdef  hpux
  120. X+ #include <time.h>
  121. X+ #else
  122. X  #include <sys/time.h>
  123. X+ #endif
  124. X  
  125. X  static int pid;
  126. X  static FILE *from, *to;
  127. X  
  128. X  bool
  129. X! program_init(name,level)
  130. X!     char *name, *level;
  131. X  {
  132. X      int toprog[2], fromprog[2];
  133. X      char buf[BSIZE];
  134. X***************
  135. X*** 54,63 ****
  136. X          close(fromprog[0]);
  137. X          close(fromprog[1]);
  138. X          if (proghost)
  139. X!             execl("/usr/ucb/rsh", "rsh", proghost, name,
  140. X                      (char *) NULL);
  141. X          else
  142. X!             execl(name, name, (char *) NULL);
  143. X          perror(name);
  144. X          exit(1);
  145. X      }
  146. X--- 58,67 ----
  147. X          close(fromprog[0]);
  148. X          close(fromprog[1]);
  149. X          if (proghost)
  150. X!             execl("/usr/ucb/rsh", "remsh", proghost, name,level,
  151. X                      (char *) NULL);
  152. X          else
  153. X!             execl(name, name,level, (char *) NULL);
  154. X          perror(name);
  155. X          exit(1);
  156. X      }
  157. X*** xchess.1    Sat Nov 29 17:44:27 1986
  158. X--- new/xchess.1    Mon Jan 25 11:25:18 1988
  159. X***************
  160. X*** 84,89 ****
  161. X--- 84,93 ----
  162. X  .B -R
  163. X  Randomly chose who plays white and who plays black, if two displays are
  164. X  given.
  165. X+ .TP 8
  166. X+ .B -l level
  167. X+ Selects the level of the game. Gnuchess will be forced to make a move
  168. X+ in "level" seconds.  The default is 30 seconds.
  169. X  .SH CONTROLS
  170. X  .PP
  171. X  The window is divided up into several sub-windows.  The pieces are moved by
  172. END_OF_Patches01
  173. if test 3108 -ne `wc -c <Patches01`; then
  174.     echo shar: \"Patches01\" unpacked with wrong size!
  175. fi
  176. # end of overwriting check
  177. fi
  178. echo shar: End of shell archive.
  179. exit 0
  180.