~ubuntu-branches/ubuntu/trusty/dds/trusty-proposed

« back to all changes in this revision

Viewing changes to dll.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2008-10-30 23:19:27 UTC
  • mfrom: (1.1.3 upstream) (7.2.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081030231927-yvf4f2tmezkl45av
Update watch file with correct dversionmangling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* portability-macros header prefix */
2
2
 
 
3
#if !defined(_MSC_VER)
 
4
#define LONGLONG long long
 
5
#endif
 
6
 
3
7
/* Windows requires a __declspec(dllexport) tag, etc */
4
8
#if defined(_WIN32)
5
9
#    define DLLEXPORT __declspec(dllexport)
67
71
#define Max(x, y) (((x) >= (y)) ? (x) : (y))
68
72
#define Min(x, y) (((x) <= (y)) ? (x) : (y))
69
73
 
 
74
/* "hand" is leading hand, "relative" is hand relative leading
 
75
hand.
 
76
The handId macro implementation follows a solution 
 
77
by Thomas Andrews. 
 
78
All hand identities are given as
 
79
0=NORTH, 1=EAST, 2=SOUTH, 3=WEST. */
 
80
 
 
81
#define handId(hand, relative) (hand + relative) & 3
 
82
 
70
83
struct gameInfo  {          /* All info of a particular deal */
71
 
  int vulnerable;
 
84
  /*int vulnerable;*/
72
85
  int declarer;
73
 
  int contract;
 
86
  /*int contract;*/
74
87
  int leadHand;
75
88
  int leadSuit;
76
89
  int leadRank;
190
203
  int winMask[4];
191
204
};
192
205
 
 
206
struct adaptWinRanksType {
 
207
  unsigned short int winRanks[14];
 
208
};
 
209
 
193
210
 
194
211
struct ttStoreType {
195
212
  struct nodeCardsType * cardsP;
203
220
 
204
221
 
205
222
extern struct gameInfo game;
 
223
extern int newDeal;
206
224
extern struct gameInfo * gameStore;
207
225
extern struct ttStoreType * ttStore;
208
226
extern struct nodeCardsType * nodeCards;
222
240
extern struct nodeCardsType **pn;
223
241
extern struct posSearchType **pl;
224
242
 
225
 
 
226
 
extern int handStore[4][4];             /* All hand identities are given as
227
 
                                        0=NORTH, 1=EAST, 2=SOUTH, 3=WEST.
228
 
                                        Player is the hand whose move is to be
229
 
                                        optimized.
230
 
                                        1st index is first hand, 2nd index
231
 
                                        is hand relative first. The value is
232
 
                                        the absolute value, NORTH, EAST,
233
 
                                        SOUTH, WEST of the hand pointed to
234
 
                                        by handRelFirst */
 
243
extern int * highestRank;
 
244
extern int * counttable;
 
245
extern struct adaptWinRanksType * adaptWins;                                       
235
246
extern unsigned short int bitMapRank[16];
236
247
extern unsigned short int iniRemovedRanks[4];
237
248
extern unsigned short int relRankInSuit[4][4];
297
308
void UpdateWinner(struct pos * posPoint, int suit);
298
309
void UpdateSecondBest(struct pos * posPoint, int suit);
299
310
int WinningMove(struct moveType * mvp1, struct moveType * mvp2);
300
 
unsigned short int CountOnes(unsigned short int b);
301
311
int AdjustMoveList(void);
302
312
int QuickTricks(struct pos * posPoint, int hand, 
303
313
        int depth, int target, int *result);
311
321
  struct winCardType * nodeP, int firstHand, 
312
322
        int target, int tricks, int * valp);  
313
323
struct cardType NextCard(struct cardType card);
314
 
struct nodeCardsType * BuildPath(struct pos * posPoint, int firstHand,
315
 
  int tricks, struct posSearchType *nodep, int * result);
 
324
struct nodeCardsType * BuildPath(struct pos * posPoint, 
 
325
  struct posSearchType *nodep, int * result);
316
326
void BuildSOP(struct pos * posPoint, int tricks, int firstHand, int target,
317
327
  int depth, int scoreFlag, int score);
318
328
struct posSearchType * SearchLenAndInsert(struct posSearchType
319
329
        * rootp, LONGLONG key, int insertNode, int *result);  
320
330
void Undo(struct pos * posPoint, int depth);
321
331
int CheckDeal(struct moveType * cardp);
322
 
void WinAdapt(struct pos * posPoint, int depth, struct nodeCardsType * cp,
323
 
   unsigned short int aggr[]);
324
332
int InvBitMapRank(unsigned short bitMap);
325
333
int InvWinMask(int mask);
326
334
void ReceiveTTstore(struct pos *posPoint, struct nodeCardsType * cardsP, int target, int depth);
327
 
int DismissX(struct pos *posPoint, int depth); 
 
335
int NextMove(struct pos *posPoint, int depth); 
328
336
int DumpInput(int errCode, struct deal dl, int target, int solutions, int mode); 
329
337
void Wipe(void);
330
338
void AddNodeSet(void);