]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
c0de361f | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003. |
28bf4b0b | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | /* | |
7 | ** stateCombinationTable.h | |
8 | */ | |
9 | ||
10 | # ifndef STATECOMBINATIONTABLE_H | |
11 | # define STATECOMBINATIONTABLE_H | |
12 | ||
13 | /* | |
14 | ** stateCombinationTable is a mapping: int x int -> int x cstring | |
15 | ** The int values must be in a fixed (pre-defined) range, 0, ..., max. | |
16 | */ | |
17 | ||
18 | typedef struct { | |
19 | int value; | |
20 | cstring msg; | |
21 | } *stateEntry; | |
22 | ||
b73d1009 | 23 | typedef /*@only@*/ stateEntry o_stateEntry; |
28bf4b0b | 24 | |
25 | typedef struct | |
26 | { | |
27 | int size; | |
b73d1009 | 28 | /*@only@*/ o_stateEntry *entries; |
28bf4b0b | 29 | } *stateRow; |
30 | ||
b73d1009 | 31 | typedef /*@only@*/ stateRow o_stateRow; |
28bf4b0b | 32 | |
33 | abst_typedef struct | |
34 | { | |
b73d1009 | 35 | int size; |
36 | /*@only@*/ o_stateRow *rows; | |
28bf4b0b | 37 | } *stateCombinationTable; |
38 | ||
39 | extern /*@only@*/ stateCombinationTable stateCombinationTable_create (int p_size); | |
40 | ||
41 | extern void stateCombinationTable_set (stateCombinationTable p_h, | |
42 | int p_from, int p_to, | |
43 | int p_value, | |
44 | /*@only@*/ cstring p_msg); | |
45 | ||
46 | extern void stateCombinationTable_update (stateCombinationTable p_h, | |
47 | int p_from, int p_to, | |
48 | int p_value, | |
49 | /*@only@*/ cstring p_msg); | |
50 | ||
51 | extern int stateCombinationTable_lookup | |
52 | (stateCombinationTable p_h, int p_from, | |
b73d1009 | 53 | int p_to, /*@out@*/ ob_cstring *p_msg); |
28bf4b0b | 54 | |
55 | extern int stateCombinationTable_lookupLoseReference | |
56 | (stateCombinationTable p_h, int p_from, | |
57 | /*@out@*/ /*@observer@*/ cstring *p_msg); | |
58 | ||
59 | extern void stateCombinationTable_free (/*@only@*/ stateCombinationTable p_t); | |
60 | ||
61 | extern int stateCombinationTable_size (stateCombinationTable p_h) /*@*/ ; | |
62 | # define stateCombinationTable_size(h) ((h)->size) | |
63 | ||
64 | extern cstring stateCombinationTable_unparse (stateCombinationTable) /*@*/ ; | |
65 | ||
66 | # else | |
67 | # error "Multiple include" | |
68 | # endif | |
69 | ||
70 | ||
71 | ||
72 | ||
73 | ||
74 | ||
75 | ||
76 | ||
77 | ||
78 | ||
79 | ||
80 | ||
81 |