Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7759 | leency | 1 | enum {DT=1, OL, UL}; |
2 | struct LIST |
||
3 | { |
||
4 | int level; |
||
5 | int ordered[5]; |
||
6 | int counter[5]; |
||
7 | void reset(); |
||
8 | void upd_level(); |
||
9 | int inc_counter(); |
||
10 | int get_order_type(); |
||
11 | }; |
||
12 | |||
13 | void LIST::reset() |
||
14 | { |
||
15 | level = 0; |
||
16 | } |
||
17 | |||
18 | void LIST::upd_level(int direction, type) |
||
19 | { |
||
20 | if (direction == 1) && (level<5) { |
||
21 | level++; |
||
22 | counter[level]=0; |
||
23 | ordered[level]=type; |
||
24 | } |
||
25 | if (direction == 0) && (level>0) { |
||
26 | level--; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | int LIST::inc_counter() |
||
31 | { |
||
32 | counter[level]++; |
||
33 | return counter[level]; |
||
34 | } |
||
35 | |||
36 | int LIST::get_order_type() |
||
37 | { |
||
38 | return ordered[level]; |
||
39 | }5)> |