Add forgotten files 1.4.70b
[polyglot.git] / list.h
1
2 // list.h
3
4 #ifndef LIST_H
5 #define LIST_H
6
7 // includes
8
9 #include "board.h"
10 #include "move.h"
11 #include "util.h"
12
13 // defines
14
15 #define ListSize 256
16
17 // types
18
19 typedef struct {
20    sint16 size;
21    move_t move[ListSize];
22    sint16 value[ListSize];
23 } list_t;
24
25 // functions
26
27 extern bool list_is_ok    (const list_t * list);
28
29 extern void list_clear    (list_t * list);
30 extern void list_add      (list_t * list, int move);
31 extern void list_add_ex   (list_t * list, int move, int value);
32
33 extern void list_remove   (list_t * list, int index);
34
35 extern bool list_is_empty (const list_t * list);
36 extern int  list_size     (const list_t * list);
37
38 extern int  list_move     (const list_t * list, int index);
39 extern int  list_value    (const list_t * list, int index);
40
41 extern void list_copy     (list_t * dst, const list_t * src);
42
43 extern void list_note     (list_t * list);
44 extern void list_sort     (list_t * list);
45
46 extern bool list_contain  (const list_t * list, int move);
47 extern bool list_equal    (list_t * list_1, list_t * list_2);
48
49 extern void list_disp     (const list_t * list, const board_t * board);
50
51 #endif // !defined LIST_H
52
53 // end of list.h
54