Merge branch 'vendor/OPENSSL'
[dragonfly.git] / games / cribbage / cribbage.h
CommitLineData
6693db17 1/*-
984263bc
MD
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
6693db17 13 * 3. Neither the name of the University nor the names of its contributors
984263bc
MD
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)cribbage.h 8.1 (Berkeley) 5/31/93
413c6806 30 * $DragonFly: src/games/cribbage/cribbage.h,v 1.3 2005/08/03 13:31:00 eirikn Exp $
984263bc
MD
31 */
32
413c6806 33
984263bc
MD
34extern CARD deck[ CARDS ]; /* a deck */
35extern CARD phand[ FULLHAND ]; /* player's hand */
36extern CARD chand[ FULLHAND ]; /* computer's hand */
37extern CARD crib[ CINHAND ]; /* the crib */
38extern CARD turnover; /* the starter */
39
40extern CARD known[ CARDS ]; /* cards we have seen */
41extern int knownum; /* # of cards we know */
42
43extern int pscore; /* player's score */
44extern int cscore; /* comp's score */
45extern int glimit; /* points to win game */
46
47extern int pgames; /* player's games won */
48extern int cgames; /* comp's games won */
49extern int gamecount; /* # games played */
50extern int Lastscore[2]; /* previous score for each */
51
413c6806
EN
52extern bool iwon; /* if comp won last */
53extern bool explain; /* player mistakes explained */
54extern bool rflag; /* if all cuts random */
55extern bool quiet; /* if suppress random mess */
984263bc 56
413c6806 57extern char explstr[]; /* string for explanation */
984263bc 58
b58f1e66 59void addmsg(const char *, ...) __printflike(1, 2);
6693db17
SW
60int adjust(CARD []);
61bool anymove(CARD [], int, int);
62void bye(void);
63int cchose(CARD [], int, int);
64void cdiscard(bool);
65bool chkscr(int *, int);
66bool comphand(CARD [], const char *);
67void cremove(CARD, CARD [], int);
68void do_wait(void);
69void endmsg(void);
70char *getline(void);
71int getuchar(void);
72int infrom(CARD [], int, const char *);
73void instructions(void);
74void intr(int);
75bool isone(CARD, CARD [], int);
76void makedeck(CARD []);
77void makeknown(CARD [], int);
b58f1e66 78void msg(const char *, ...) __printflike(1, 2);
6693db17
SW
79bool msgcard(CARD, bool);
80int number(int, int, const char *);
81int pegscore(CARD, CARD [], int, int);
82bool plyrhand(CARD [], const char *);
83void prcard(WINDOW *, int, int, CARD, bool);
84void prhand(CARD [], int, WINDOW *, bool);
85int scorehand(CARD [], CARD, int, bool, bool);
86void shuffle(CARD []);
87void sorthand(CARD [], int);