File: list.h

package info (click to toggle)
polyglot 2.0.1%2Bgit20140926-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,228 kB
  • ctags: 1,163
  • sloc: ansic: 10,416; sh: 994; makefile: 18
file content (54 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

// list.h

#ifndef LIST_H
#define LIST_H

// includes

#include "board.h"
#include "move.h"
#include "util.h"

// defines

#define ListSize 256

// types

typedef struct {
   sint16 size;
   move_t move[ListSize];
   sint16 value[ListSize];
} list_t;

// functions

extern bool list_is_ok    (const list_t * list);

extern void list_clear    (list_t * list);
extern void list_add      (list_t * list, int move);
extern void list_add_ex   (list_t * list, int move, int value);

extern void list_remove   (list_t * list, int index);

extern bool list_is_empty (const list_t * list);
extern int  list_size     (const list_t * list);

extern int  list_move     (const list_t * list, int index);
extern int  list_value    (const list_t * list, int index);

extern void list_copy     (list_t * dst, const list_t * src);

extern void list_note     (list_t * list);
extern void list_sort     (list_t * list);

extern bool list_contain  (const list_t * list, int move);
extern bool list_equal    (list_t * list_1, list_t * list_2);

extern void list_disp     (const list_t * list, const board_t * board);

#endif // !defined LIST_H

// end of list.h