gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / bsd-games-getline.patch
CommitLineData
95024494
VS
1diff -Naur bsd-games-2.17/boggle/boggle/bog.c bsd-games-2.17.1/boggle/boggle/bog.c
2--- bsd-games-2.17/boggle/boggle/bog.c 2004-12-07 07:34:21.000000000 -0600
3+++ bsd-games-2.17.1/boggle/boggle/bog.c 2010-05-22 10:51:23.000000000 -0500
4@@ -336,7 +336,7 @@
5 }
6
7 while (1) {
8- if (getline(buf) == NULL) {
9+ if (boggle_getline(buf) == NULL) {
10 if (feof(stdin))
11 clearerr(stdin);
12 break;
13diff -Naur bsd-games-2.17/boggle/boggle/extern.h bsd-games-2.17.1/boggle/boggle/extern.h
14--- bsd-games-2.17/boggle/boggle/extern.h 2004-01-27 14:52:07.000000000 -0600
15+++ bsd-games-2.17.1/boggle/boggle/extern.h 2010-05-22 10:51:23.000000000 -0500
16@@ -43,7 +43,7 @@
17 long dictseek(FILE *, long, int);
18 void findword(void);
19 void flushin(FILE *);
20-char *getline(char *);
21+char *boggle_getline(char *);
22 void getword(char *);
23 int help(void);
24 int inputch(void);
25diff -Naur bsd-games-2.17/boggle/boggle/mach.c bsd-games-2.17.1/boggle/boggle/mach.c
26--- bsd-games-2.17/boggle/boggle/mach.c 2004-12-07 07:34:21.000000000 -0600
27+++ bsd-games-2.17.1/boggle/boggle/mach.c 2010-05-22 10:51:23.000000000 -0500
28@@ -168,7 +168,7 @@
29 * - doesn't accept words longer than MAXWORDLEN or containing caps
30 */
31 char *
32-getline(q)
33+boggle_getline(q)
34 char *q;
35 {
36 int ch, done;
37diff -Naur bsd-games-2.17/cribbage/cribbage.h bsd-games-2.17.1/cribbage/cribbage.h
38--- bsd-games-2.17/cribbage/cribbage.h 2004-02-08 16:29:14.000000000 -0600
39+++ bsd-games-2.17.1/cribbage/cribbage.h 2010-05-22 10:51:23.000000000 -0500
40@@ -77,7 +77,7 @@
41 int fifteens(const CARD [], int);
42 void game(void);
43 void gamescore(void);
44-char *getline(void);
45+char *cribbage_getline(void);
46 int getuchar(void);
47 int incard(CARD *);
48 int infrom(const CARD [], int, const char *);
49diff -Naur bsd-games-2.17/cribbage/crib.c bsd-games-2.17.1/cribbage/crib.c
50--- bsd-games-2.17/cribbage/crib.c 2004-01-27 14:52:07.000000000 -0600
51+++ bsd-games-2.17.1/cribbage/crib.c 2010-05-22 10:51:23.000000000 -0500
52@@ -221,7 +221,7 @@
53 if (!rflag) { /* player cuts deck */
54 msg(quiet ? "Cut for crib? " :
55 "Cut to see whose crib it is -- low card wins? ");
56- getline();
57+ cribbage_getline();
58 }
59 i = (rand() >> 4) % CARDS; /* random cut */
60 do { /* comp cuts deck */
61@@ -397,7 +397,7 @@
62 if (!rflag) { /* random cut */
63 msg(quiet ? "Cut the deck? " :
64 "How many cards down do you wish to cut the deck? ");
65- getline();
66+ cribbage_getline();
67 }
68 i = (rand() >> 4) % (CARDS - pos);
69 turnover = deck[i + pos];
70diff -Naur bsd-games-2.17/cribbage/io.c bsd-games-2.17.1/cribbage/io.c
71--- bsd-games-2.17/cribbage/io.c 2004-12-07 07:34:21.000000000 -0600
72+++ bsd-games-2.17.1/cribbage/io.c 2010-05-22 10:51:23.000000000 -0500
73@@ -245,7 +245,7 @@
74
75 retval = FALSE;
76 rnk = sut = EMPTY;
77- if (!(line = getline()))
78+ if (!(line = cribbage_getline()))
79 goto gotit;
80 p = p1 = line;
81 while (*p1 != ' ' && *p1 != '\0')
82@@ -346,7 +346,7 @@
83
84 for (sum = 0;;) {
85 msg(prompt);
86- if (!(p = getline()) || *p == '\0') {
87+ if (!(p = cribbage_getline()) || *p == '\0') {
88 msg(quiet ? "Not a number" :
89 "That doesn't look like a number");
90 continue;
91@@ -528,12 +528,12 @@
92 }
93
94 /*
95- * getline:
96+ * cribbage_getline:
97 * Reads the next line up to '\n' or EOF. Multiple spaces are
98 * compressed to one space; a space is inserted before a ','
99 */
100 char *
101-getline()
102+cribbage_getline()
103 {
104 char *sp;
105 int c, oy, ox;
106diff -Naur bsd-games-2.17/gomoku/bdisp.c bsd-games-2.17.1/gomoku/bdisp.c
107--- bsd-games-2.17/gomoku/bdisp.c 2003-12-16 20:47:37.000000000 -0600
108+++ bsd-games-2.17.1/gomoku/bdisp.c 2010-05-22 10:51:23.000000000 -0500
109@@ -241,7 +241,7 @@
110 }
111
112 int
113-getline(buf, size)
114+gomoku_getline(buf, size)
115 char *buf;
116 int size;
117 {
118diff -Naur bsd-games-2.17/gomoku/gomoku.h bsd-games-2.17.1/gomoku/gomoku.h
119--- bsd-games-2.17/gomoku/gomoku.h 2004-01-27 14:52:07.000000000 -0600
120+++ bsd-games-2.17.1/gomoku/gomoku.h 2010-05-22 10:51:23.000000000 -0500
121@@ -263,7 +263,7 @@
122
123 void bdinit(struct spotstr *);
124 void init_overlap(void);
125-int getline(char *, int);
126+int gomoku_getline(char *, int);
127 void ask(const char *);
128 void dislog(const char *);
129 void bdump(FILE *);
130diff -Naur bsd-games-2.17/gomoku/main.c bsd-games-2.17.1/gomoku/main.c
131--- bsd-games-2.17/gomoku/main.c 2004-01-27 14:52:07.000000000 -0600
132+++ bsd-games-2.17.1/gomoku/main.c 2010-05-22 10:51:23.000000000 -0500
133@@ -155,7 +155,7 @@
134 if (inputfp == NULL && test == 0) {
135 for (;;) {
136 ask("black or white? ");
137- getline(buf, sizeof(buf));
138+ gomoku_getline(buf, sizeof(buf));
139 if (buf[0] == 'b' || buf[0] == 'B') {
140 color = BLACK;
141 break;
142@@ -172,7 +172,7 @@
143 }
144 } else {
145 setbuf(stdout, 0);
146- getline(buf, sizeof(buf));
147+ gomoku_getline(buf, sizeof(buf));
148 if (strcmp(buf, "black") == 0)
149 color = BLACK;
150 else if (strcmp(buf, "white") == 0)
151@@ -244,7 +244,7 @@
152 getinput:
153 if (interactive)
154 ask("move? ");
155- if (!getline(buf, sizeof(buf))) {
156+ if (!gomoku_getline(buf, sizeof(buf))) {
157 curmove = RESIGN;
158 break;
159 }
160@@ -256,7 +256,7 @@
161 FILE *fp;
162
163 ask("save file name? ");
164- (void)getline(buf, sizeof(buf));
165+ (void)gomoku_getline(buf, sizeof(buf));
166 if ((fp = fopen(buf, "w")) == NULL) {
167 glog("cannot create save file");
168 goto getinput;
169@@ -309,14 +309,14 @@
170 if (i != RESIGN) {
171 replay:
172 ask("replay? ");
173- if (getline(buf, sizeof(buf)) &&
174+ if (gomoku_getline(buf, sizeof(buf)) &&
175 (buf[0] == 'y' || buf[0] == 'Y'))
176 goto again;
177 if (strcmp(buf, "save") == 0) {
178 FILE *fp;
179
180 ask("save file name? ");
181- (void)getline(buf, sizeof(buf));
182+ (void)gomoku_getline(buf, sizeof(buf));
183 if ((fp = fopen(buf, "w")) == NULL) {
184 glog("cannot create save file");
185 goto replay;
186@@ -367,7 +367,7 @@
187 quit();
188 top:
189 ask("cmd? ");
190- if (!getline(fmtbuf, sizeof(fmtbuf)))
191+ if (!gomoku_getline(fmtbuf, sizeof(fmtbuf)))
192 quit();
193 switch (*fmtbuf) {
194 case '\0':