1 | #ifndef MAD_ELEM_H |
---|
2 | #define MAD_ELEM_H |
---|
3 | |
---|
4 | // types |
---|
5 | |
---|
6 | struct node; |
---|
7 | struct name_list; |
---|
8 | struct command; |
---|
9 | struct command_parameter; |
---|
10 | |
---|
11 | struct element /* each element is unique */ |
---|
12 | { |
---|
13 | char name[NAME_L]; |
---|
14 | int def_type; /* 0 if defined separately, |
---|
15 | 1 if inside sequence */ |
---|
16 | int bv; /* bv: 0 false, 1 true (invert angle for |
---|
17 | sequence bv = -1) */ |
---|
18 | double length; |
---|
19 | struct command* def; /* pointer to defining command */ |
---|
20 | struct element* parent; /* pointer to parent of element */ |
---|
21 | /* *this for base_type elements (rbend etc.) */ |
---|
22 | int stamp; |
---|
23 | struct element* base_type; /* pointer to base_type of element */ |
---|
24 | /* *this for base_type elements (rbend etc.) */ |
---|
25 | }; |
---|
26 | |
---|
27 | struct el_list /* contains list of element pointers sorted by name */ |
---|
28 | { |
---|
29 | int stamp; |
---|
30 | char name[NAME_L]; |
---|
31 | int max, /* max. pointer array size */ |
---|
32 | curr; /* current occupation */ |
---|
33 | struct name_list* list; /* index list of names */ |
---|
34 | struct element** elem; /* element pointer list */ |
---|
35 | }; |
---|
36 | |
---|
37 | // interface |
---|
38 | |
---|
39 | struct element* make_element(char* name, char* parent, struct command*, int flag); |
---|
40 | struct element* clone_element(struct element*); |
---|
41 | struct element* delete_element(struct element*); |
---|
42 | void update_element(struct element*, struct command* update); |
---|
43 | void dump_element(struct element*); |
---|
44 | void export_el_def(struct element*, char* string); |
---|
45 | void export_el_def_8(struct element*, char* string); |
---|
46 | |
---|
47 | struct el_list* new_el_list(int length); |
---|
48 | struct el_list* delete_el_list(struct el_list*); |
---|
49 | struct element* find_element(char* name, struct el_list*); |
---|
50 | void write_elems(struct el_list*, struct command_list*, FILE*); |
---|
51 | void write_elems_8(struct el_list*, struct command_list*, FILE*); |
---|
52 | |
---|
53 | struct node* new_elem_node(struct element*, int occ_cnt); |
---|
54 | void make_elem_node(struct element*, int occ_cnt); |
---|
55 | char* compound(char* e_name, int occ_cnt); |
---|
56 | |
---|
57 | void enter_element(struct in_cmd*); |
---|
58 | void element_name(char* name, int* l); |
---|
59 | double element_value(struct node*, char* par); |
---|
60 | int element_vector(struct element*, char* par, double* vector); |
---|
61 | |
---|
62 | int belongs_to_class(struct element*, char* class); |
---|
63 | double get_refpos(struct sequence*); |
---|
64 | void get_node_vector(char* par, int* length, double* vector); |
---|
65 | int el_par_vector(int* total, double* vect); |
---|
66 | double el_par_value(char* par, struct element*); |
---|
67 | double el_par_value_recurse(char* par, struct element*); |
---|
68 | void fill_elem_var_list(struct element*, struct el_list*, struct var_list*); |
---|
69 | void add_to_el_list(struct element**, int inf, struct el_list*, int flag); |
---|
70 | |
---|
71 | // used by mad_mkthin.c |
---|
72 | struct command_parameter* return_param(char* par, struct element*); |
---|
73 | struct command_parameter* return_param_recurse(char* par, struct element*); |
---|
74 | |
---|
75 | #endif // MAD_ELEM_H |
---|
76 | |
---|