1 | #ifndef MAD_CONST_H |
---|
2 | #define MAD_CONST_H |
---|
3 | |
---|
4 | // types |
---|
5 | |
---|
6 | struct node; |
---|
7 | struct sequence; |
---|
8 | struct expression; |
---|
9 | struct command; |
---|
10 | |
---|
11 | struct constraint /* contains one constraint */ |
---|
12 | { |
---|
13 | char name[NAME_L]; |
---|
14 | int type; /* 1 minimum */ |
---|
15 | /* 2 maximum */ |
---|
16 | /* 3 both 1 + 2 */ |
---|
17 | /* 4 value */ |
---|
18 | int stamp; |
---|
19 | double value, c_min, c_max, weight; |
---|
20 | struct expression *ex_value, *ex_c_min, *ex_c_max; |
---|
21 | }; |
---|
22 | |
---|
23 | struct constraint_list /* contains list of constraints */ |
---|
24 | { |
---|
25 | int stamp; |
---|
26 | char name[NAME_L]; |
---|
27 | int max, /* max. pointer array size */ |
---|
28 | curr; /* current occupation */ |
---|
29 | struct constraint** constraints; /* command pointer list */ |
---|
30 | }; |
---|
31 | |
---|
32 | // interface |
---|
33 | |
---|
34 | struct constraint* delete_constraint(struct constraint*); // used by mad_match.c |
---|
35 | void dump_constraint(struct constraint*); // used by mad_node.c |
---|
36 | |
---|
37 | struct constraint_list* new_constraint_list(int length); |
---|
38 | struct constraint_list* delete_constraint_list(struct constraint_list*); |
---|
39 | //void dump_constraint_list(struct constraint_list*); |
---|
40 | |
---|
41 | void fill_constraint_list(int type, struct command*, struct constraint_list*); |
---|
42 | void update_sequ_constraints(struct sequence*, struct constraint_list*); |
---|
43 | void update_node_constraints(struct node*, struct constraint_list*); |
---|
44 | |
---|
45 | int constraint_name(char* name, int* name_l, int* index); |
---|
46 | int next_constr_namepos(char* name); |
---|
47 | int next_constraint(char* name, int* name_l, int* type, double* value, double* c_min, double* c_max, double* weight); |
---|
48 | int next_global(char* name, int* name_l, int* type, double* value, double* c_min, double* c_max, double* weight); |
---|
49 | |
---|
50 | #endif // MAD_CONST_H |
---|
51 | |
---|