summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2012-03-04 04:05:16 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2012-03-04 04:05:16 +0000
commitea5319421a589ebd8583734a461346e1f0d91bec (patch)
treef5bd7462d5be00f2b6c3ea91c579bd03d2ef6dce /games
parentc90e6f8af6e01b6bd2b8ec8057571ae41b0ddb00 (diff)
In preparation for getline and getdelim additions to libc, rename getline()
occurrences to get_line(). Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
Diffstat (limited to 'games')
-rw-r--r--games/boggle/boggle/bog.c4
-rw-r--r--games/boggle/boggle/extern.h4
-rw-r--r--games/boggle/boggle/mach.c4
-rw-r--r--games/cribbage/crib.c6
-rw-r--r--games/cribbage/cribbage.h4
-rw-r--r--games/cribbage/io.c10
-rw-r--r--games/gomoku/bdisp.c4
-rw-r--r--games/gomoku/gomoku.h4
-rw-r--r--games/gomoku/main.c14
9 files changed, 27 insertions, 27 deletions
diff --git a/games/boggle/boggle/bog.c b/games/boggle/boggle/bog.c
index 86170628925..bfaf04afa61 100644
--- a/games/boggle/boggle/bog.c
+++ b/games/boggle/boggle/bog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bog.c,v 1.20 2009/10/27 23:59:24 deraadt Exp $ */
+/* $OpenBSD: bog.c,v 1.21 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: bog.c,v 1.5 1995/04/24 12:22:32 cgd Exp $ */
/*-
@@ -274,7 +274,7 @@ playgame(void)
}
while (1) {
- if (getline(buf) == NULL) {
+ if (get_line(buf) == NULL) {
if (feof(stdin))
clearerr(stdin);
break;
diff --git a/games/boggle/boggle/extern.h b/games/boggle/boggle/extern.h
index 0fc7b0d5bb8..868837ca984 100644
--- a/games/boggle/boggle/extern.h
+++ b/games/boggle/boggle/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.6 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: extern.h,v 1.7 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: extern.h,v 1.3 1995/04/24 12:22:37 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@ void delay(int);
long dictseek(FILE *, long, int);
void findword(void);
void flushin(FILE *);
-char *getline(char *);
+char *get_line(char *);
void getword(char *);
int help(void);
int inputch(void);
diff --git a/games/boggle/boggle/mach.c b/games/boggle/boggle/mach.c
index fb16b4b269c..2c9149675a1 100644
--- a/games/boggle/boggle/mach.c
+++ b/games/boggle/boggle/mach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mach.c,v 1.12 2009/10/27 23:59:24 deraadt Exp $ */
+/* $OpenBSD: mach.c,v 1.13 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: mach.c,v 1.5 1995/04/28 22:28:48 mycroft Exp $ */
/*-
@@ -194,7 +194,7 @@ prwidth(char **base, int indx)
* - doesn't accept words longer than MAXWORDLEN or containing caps
*/
char *
-getline(char *q)
+get_line(char *q)
{
int ch, done;
char *p;
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c
index efbd71d20dd..b6d9970d706 100644
--- a/games/cribbage/crib.c
+++ b/games/cribbage/crib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crib.c,v 1.15 2010/05/10 08:53:12 nicm Exp $ */
+/* $OpenBSD: crib.c,v 1.16 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */
/*-
@@ -207,7 +207,7 @@ game(void)
do {
msg(quiet ? "Cut for crib? " :
"Cut to see whose crib it is -- low card wins? ");
- foo = getline();
+ foo = get_line();
if (*foo != '\0' && ((i = atoi(foo)) < 4 || i > 48))
msg("Invalid cut");
else
@@ -389,7 +389,7 @@ cut(bool mycrib, int pos)
do {
msg(quiet ? "Cut the deck? " :
"How many cards down do you wish to cut the deck? ");
- foo = getline();
+ foo = get_line();
if (*foo != '\0' && ((i = atoi(foo)) < 4 || i > 36))
msg("Invalid cut");
else
diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h
index 08002905462..bcf33c04fb0 100644
--- a/games/cribbage/cribbage.h
+++ b/games/cribbage/cribbage.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cribbage.h,v 1.9 2010/05/10 08:53:12 nicm Exp $ */
+/* $OpenBSD: cribbage.h,v 1.10 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */
/*
@@ -78,7 +78,7 @@ int eq(CARD, CARD);
int fifteens(CARD [], int);
void game(void);
void gamescore(void);
-char *getline(void);
+char *get_line(void);
int getuchar(void);
int incard(CARD *);
int infrom(CARD [], int, char *);
diff --git a/games/cribbage/io.c b/games/cribbage/io.c
index b335f9707b2..c46b7d266e6 100644
--- a/games/cribbage/io.c
+++ b/games/cribbage/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.13 2010/05/10 08:53:12 nicm Exp $ */
+/* $OpenBSD: io.c,v 1.14 2012/03/04 04:05:15 fgsch Exp $ */
/* $NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $ */
/*-
@@ -216,7 +216,7 @@ incard(CARD *crd)
retval = FALSE;
rnk = sut = EMPTY;
- if (!(line = getline()))
+ if (!(line = get_line()))
goto gotit;
p = p1 = line;
while (*p1 != ' ' && *p1 != '\0')
@@ -315,7 +315,7 @@ number(int lo, int hi, char *prompt)
for (sum = 0;;) {
msg(prompt);
- if (!(p = getline()) || *p == '\0') {
+ if (!(p = get_line()) || *p == '\0') {
msg(quiet ? "Not a number" :
"That doesn't look like a number");
continue;
@@ -505,12 +505,12 @@ over:
}
/*
- * getline:
+ * get_line:
* Reads the next line up to '\n' or EOF. Multiple spaces are
* compressed to one space; a space is inserted before a ','
*/
char *
-getline(void)
+get_line(void)
{
char *sp;
int c, oy, ox;
diff --git a/games/gomoku/bdisp.c b/games/gomoku/bdisp.c
index d6fb0c6aead..0fe37506ed1 100644
--- a/games/gomoku/bdisp.c
+++ b/games/gomoku/bdisp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bdisp.c,v 1.10 2009/10/27 23:59:24 deraadt Exp $ */
+/* $OpenBSD: bdisp.c,v 1.11 2012/03/04 04:05:15 fgsch Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -248,7 +248,7 @@ ask(str)
}
int
-getline(buf, size)
+get_line(buf, size)
char *buf;
int size;
{
diff --git a/games/gomoku/gomoku.h b/games/gomoku/gomoku.h
index e5d6b5360e4..b9b58684161 100644
--- a/games/gomoku/gomoku.h
+++ b/games/gomoku/gomoku.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gomoku.h,v 1.9 2004/01/16 00:13:19 espie Exp $ */
+/* $OpenBSD: gomoku.h,v 1.10 2012/03/04 04:05:15 fgsch Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -285,7 +285,7 @@ void cursinit(void);
void dislog(char *);
void dlog(char *);
int getcoord(void);
-int getline(char *, int);
+int get_line(char *, int);
void init_overlap(void);
#ifdef DEBUG
int list_eq(struct combostr **, struct combostr **, int);
diff --git a/games/gomoku/main.c b/games/gomoku/main.c
index aeb8f56b0f8..c516fc58a48 100644
--- a/games/gomoku/main.c
+++ b/games/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.22 2009/10/27 23:59:24 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.23 2012/03/04 04:05:15 fgsch Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -162,7 +162,7 @@ again:
}
} else {
setbuf(stdout, 0);
- getline(buf, sizeof(buf));
+ get_line(buf, sizeof(buf));
if (strcmp(buf, "black") == 0)
color = BLACK;
else if (strcmp(buf, "white") == 0)
@@ -239,7 +239,7 @@ again:
FILE *fp;
ask("save file name? ");
- (void)getline(fname, sizeof(fname));
+ (void)get_line(fname, sizeof(fname));
if ((fp = fopen(fname, "w")) == NULL) {
logit("cannot create save file");
goto getinput;
@@ -257,7 +257,7 @@ again:
goto getinput;
}
} else {
- if (!getline(buf, sizeof(buf))) {
+ if (!get_line(buf, sizeof(buf))) {
curmove = RESIGN;
break;
}
@@ -307,14 +307,14 @@ again:
if (i != RESIGN) {
replay:
ask("replay? ");
- if (getline(buf, sizeof(buf)) &&
+ if (get_line(buf, sizeof(buf)) &&
(buf[0] == 'y' || buf[0] == 'Y'))
goto again;
if (strcmp(buf, "save") == 0) {
FILE *fp;
ask("save file name? ");
- (void)getline(buf, sizeof(buf));
+ (void)get_line(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
logit("cannot create save file");
goto replay;
@@ -364,7 +364,7 @@ whatsup(signum)
quit(0);
top:
ask("cmd? ");
- if (!getline(fmtbuf, sizeof(fmtbuf)))
+ if (!get_line(fmtbuf, sizeof(fmtbuf)))
quit(0);
switch (*fmtbuf) {
case '\0':