Wed Apr 22 23:36:26 2020 UTC ()
buffnum is shared between subs.c and fancy.c


(joerg)
diff -r1.20 -r1.21 src/games/backgammon/common_source/back.h
diff -r1.14 -r1.15 src/games/backgammon/common_source/fancy.c

cvs diff -r1.20 -r1.21 src/games/backgammon/common_source/back.h (expand / switch to unified diff)

--- src/games/backgammon/common_source/back.h 2012/10/13 19:19:39 1.20
+++ src/games/backgammon/common_source/back.h 2020/04/22 23:36:26 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: back.h,v 1.20 2012/10/13 19:19:39 dholland Exp $ */ 1/* $NetBSD: back.h,v 1.21 2020/04/22 23:36:26 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1993 4 * Copyright (c) 1980, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -114,26 +114,28 @@ extern int *inptr; /* pointer to in for @@ -114,26 +114,28 @@ extern int *inptr; /* pointer to in for
114extern int *inopp; /* pointer to in for opponent */ 114extern int *inopp; /* pointer to in for opponent */
115 115
116extern int ncin; /* number of characters in cin */ 116extern int ncin; /* number of characters in cin */
117extern char cin[100]; /* input line of current move 117extern char cin[100]; /* input line of current move
118 (used for reconstructing input after 118 (used for reconstructing input after
119 a backspace) */ 119 a backspace) */
120 120
121extern const char *const color[]; 121extern const char *const color[];
122 /* colors as strings */ 122 /* colors as strings */
123extern const char *const *colorptr; /* color of current player */ 123extern const char *const *colorptr; /* color of current player */
124extern const char *const *Colorptr; /* color of current player, capitalized */ 124extern const char *const *Colorptr; /* color of current player, capitalized */
125extern int colen; /* length of color of current player */ 125extern int colen; /* length of color of current player */
126 126
 127extern int buffnum;
 128
127extern struct termios old, noech, raw;/* original tty status */ 129extern struct termios old, noech, raw;/* original tty status */
128 130
129extern int curr; /* row position of cursor */ 131extern int curr; /* row position of cursor */
130extern int curc; /* column position of cursor */ 132extern int curc; /* column position of cursor */
131extern int begscr; /* 'beginning' of screen 133extern int begscr; /* 'beginning' of screen
132 (not including board) */ 134 (not including board) */
133 135
134int addbuf(int); 136int addbuf(int);
135void backone(struct move *, int); 137void backone(struct move *, int);
136void buflush(void); 138void buflush(void);
137int canhit(int, int); 139int canhit(int, int);
138int checkmove(struct move *, int); 140int checkmove(struct move *, int);
139void clear(void); 141void clear(void);

cvs diff -r1.14 -r1.15 src/games/backgammon/common_source/fancy.c (expand / switch to unified diff)

--- src/games/backgammon/common_source/fancy.c 2009/08/12 05:17:57 1.14
+++ src/games/backgammon/common_source/fancy.c 2020/04/22 23:36:26 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $ */ 1/* $NetBSD: fancy.c,v 1.15 2020/04/22 23:36:26 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1993 4 * Copyright (c) 1980, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34#if 0 34#if 0
35static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93"; 35static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
36#else 36#else
37__RCSID("$NetBSD: fancy.c,v 1.14 2009/08/12 05:17:57 dholland Exp $"); 37__RCSID("$NetBSD: fancy.c,v 1.15 2020/04/22 23:36:26 joerg Exp $");
38#endif 38#endif
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#include "back.h" 41#include "back.h"
42 42
43static void bsect(int, int, int, int); 43static void bsect(int, int, int, int);
44static void fixpos(int, int, int, int, int); 44static void fixpos(int, int, int, int, int);
45static void fixcol(int, int, int, int, int); 45static void fixcol(int, int, int, int, int);
46static void newline(void); 46static void newline(void);
47 47
48/* 48/*
49 * These need to be declared so they come out as commons, because 49 * These need to be declared so they come out as commons, because
50 * termcap might or might not define some of them. Our termcap defines 50 * termcap might or might not define some of them. Our termcap defines
@@ -68,28 +68,26 @@ static int lHO; /* length of HO */ @@ -68,28 +68,26 @@ static int lHO; /* length of HO */
68static int lBC; /* length of BC */ 68static int lBC; /* length of BC */
69static int lND; /* length of ND */ 69static int lND; /* length of ND */
70static int lUP; /* length of UP */ 70static int lUP; /* length of UP */
71static int CO; /* number of columns */ 71static int CO; /* number of columns */
72static int LI; /* number of lines */ 72static int LI; /* number of lines */
73static int *linect; /* array of lengths of lines on screen (the 73static int *linect; /* array of lengths of lines on screen (the
74 * actual screen is not stored) */ 74 * actual screen is not stored) */
75 75
76 /* two letter codes */ 76 /* two letter codes */
77static char tcap[] = "bccdceclcmhomcmlndup"; 77static char tcap[] = "bccdceclcmhomcmlndup";
78 /* corresponding strings */ 78 /* corresponding strings */
79static char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP}; 79static char **tstr[] = {&BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP};
80 80
81int buffnum; /* pointer to output buffer */ 
82 
83static char tbuf[1024]; /* buffer for decoded termcap entries */ 81static char tbuf[1024]; /* buffer for decoded termcap entries */
84 82
85static int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  83static int oldb[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0, 0, 0, 0}; 84 0, 0, 0, 0, 0, 0};
87 85
88static int oldr; 86static int oldr;
89static int oldw; 87static int oldw;
90 /* "real" cursor positions, so it knows when to reposition. These are -1 if 88 /* "real" cursor positions, so it knows when to reposition. These are -1 if
91 * curr and curc are accurate */ 89 * curr and curc are accurate */
92static int realr; 90static int realr;
93static int realc; 91static int realc;
94 92
95void 93void