-/* $NetBSD: crib.c,v 1.12 1999/09/12 09:02:21 jsm Exp $ */
+/* $NetBSD: crib.c,v 1.20 2005/07/02 08:32:32 jmc Exp $ */
/*-
* Copyright (c) 1980, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: crib.c,v 1.12 1999/09/12 09:02:21 jsm Exp $");
+__RCSID("$NetBSD: crib.c,v 1.20 2005/07/02 08:32:32 jmc Exp $");
#endif
#endif /* not lint */
#include "cribcur.h"
#include "pathnames.h"
-int main __P((int, char *[]));
-
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
BOOLEAN playing;
FILE *f;
exit(1);
/* Revoke setgid privileges */
- setregid(getgid(), getgid());
+ setgid(getgid());
/* Set close-on-exec flag on log file */
if (f != NULL) {
}
initscr();
- (void)signal(SIGINT, rint);
- crmode();
+ (void)signal(SIGINT, receive_intr);
+ cbreak();
noecho();
Playwin = subwin(stdscr, PLAY_Y, PLAY_X, 0, 0);
mvcur(0, COLS - 1, LINES - 1, 0);
fflush(stdout);
instructions();
- crmode();
+ cbreak();
noecho();
clear();
refresh();
* Print out the initial board on the screen
*/
void
-makeboard()
+makeboard(void)
{
mvaddstr(SCORE_Y + 0, SCORE_X,
"+---------------------------------------+");
* Print out the current game score
*/
void
-gamescore()
+gamescore(void)
{
- extern int Lastscore[];
-
if (pgames || cgames) {
mvprintw(SCORE_Y + 1, SCORE_X + 28, "Games: %3d", pgames);
mvprintw(SCORE_Y + 7, SCORE_X + 28, "Games: %3d", cgames);
* player what card to turn. We do a random one, anyway.
*/
void
-game()
+game(void)
{
int i, j;
BOOLEAN flag;
* Do up one hand of the game
*/
int
-playhand(mycrib)
- BOOLEAN mycrib;
+playhand(BOOLEAN mycrib)
{
int deckpos;
* deal cards to both players from deck
*/
int
-deal(mycrib)
- BOOLEAN mycrib;
+deal(BOOLEAN mycrib)
{
int i, j;
* Note: we call cdiscard() after prining first message so player doesn't wait
*/
void
-discard(mycrib)
- BOOLEAN mycrib;
+discard(BOOLEAN mycrib)
{
const char *prompt;
CARD crd;
* player what card to turn. We do a random one, anyway.
*/
int
-cut(mycrib, pos)
- BOOLEAN mycrib;
- int pos;
+cut(BOOLEAN mycrib, int pos)
{
int i;
BOOLEAN win;
* Print out the turnover card with crib indicator
*/
void
-prcrib(mycrib, blank)
- BOOLEAN mycrib, blank;
+prcrib(BOOLEAN mycrib, BOOLEAN blank)
{
int y, cardx;
static int Tcnt;
int
-peg(mycrib)
- BOOLEAN mycrib;
+peg(BOOLEAN mycrib)
{
static CARD ch[CINHAND], ph[CINHAND];
int i, j, k;
* Print out the table with the current score
*/
void
-prtable(score)
- int score;
+prtable(int curscore)
{
prhand(Table, Tcnt, Tablewin, FALSE);
- mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score);
+ mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", curscore);
wrefresh(Tablewin);
}
* Handle the scoring of the hands
*/
int
-score(mycrib)
- BOOLEAN mycrib;
+score(BOOLEAN mycrib)
{
sorthand(crib, CINHAND);
if (mycrib) {