1 /********************************************************************
3 type_list.c - function for handling type lists
5 Niksa Orlic, 2004-04-28
7 ********************************************************************/
11 //#include "../util/message.h"
21 #include <stdlib.h>
23 /*
24 Create a new empty list
25 */
27 {
37 }
40 /*
41 Delete the list with all associated data
42 */
44 {
49 {
58 }
60 }
62 /*
63 Creates a copy of the list, the data
64 values are also copied
65 */
67 {
78 do
79 {
85 }
88 /*
89 Add an element into the list, the data is
90 copied.
91 */
93 {
98 else
99 {
108 /* move to the end of the list */
113 }
114 }
117 /*
118 Returns the number of elements in the list
119 */
121 {
127 do
128 {
130 counter ++;
134 }
137 /*
138 Returns the index (starting with one) of the first
139 item in the list1 different than the parameetr in the list2,
140 0 if the lists are equal, or -1 if the list1 is shorter than
141 the list2 and all elements in the list1 correspond to the first
142 n elements in the list2.
143 */
145 {
149 {
154 {
161 }
163 counter ++;
166 }
172 }
174 /*
175 Same as the previous function, except that if the list1 element
176 can be casted into list2 element, it is OK !!!
177 */
179 {
183 {
189 {
196 }
198 counter ++;
201 }
207 }
209 /*
210 Same as the above, but compares interval base types against the types;
211 this is used when checking array dimensions
212 */
214 {
218 {
223 {
225 }
227 counter ++;
230 }
236 }