24 |
|
{ |
25 |
|
LIST *l; |
26 |
|
|
27 |
– |
|
28 |
– |
|
27 |
|
/* check free list for available edges */ |
28 |
|
if( free_lists ) |
29 |
|
{ |
50 |
|
{ |
51 |
|
LIST * l; |
52 |
|
|
55 |
– |
if(!a) |
56 |
– |
return(b); |
57 |
– |
|
53 |
|
if(!b) |
54 |
|
return(a); |
55 |
|
|
62 |
|
return(b); |
63 |
|
} |
64 |
|
|
65 |
+ |
/* attaches list a at the end of list b */ |
66 |
+ |
LIST |
67 |
+ |
*add_data(l,d,end) |
68 |
+ |
LIST *l; |
69 |
+ |
int d; |
70 |
+ |
LIST **end; |
71 |
+ |
|
72 |
+ |
{ |
73 |
+ |
LIST *list,*lptr; |
74 |
+ |
|
75 |
+ |
list = new_list(); |
76 |
+ |
SET_LIST_DATA(list,d); |
77 |
+ |
|
78 |
+ |
if(!l) |
79 |
+ |
{ |
80 |
+ |
if(end) |
81 |
+ |
*end = list; |
82 |
+ |
return(list); |
83 |
+ |
} |
84 |
+ |
if(end) |
85 |
+ |
lptr = *end; |
86 |
+ |
else |
87 |
+ |
{ |
88 |
+ |
lptr = l; |
89 |
+ |
while(LIST_NEXT(lptr)) |
90 |
+ |
lptr = LIST_NEXT(lptr); |
91 |
+ |
} |
92 |
+ |
LIST_NEXT(lptr) = list; |
93 |
+ |
if(end) |
94 |
+ |
*end = list; |
95 |
+ |
|
96 |
+ |
return(l); |
97 |
+ |
} |
98 |
+ |
|
99 |
|
/* Adds data to the end of a circular list. If set, "end" |
100 |
|
* is a pointer to the last element in the list |
101 |
|
*/ |
147 |
|
{ |
148 |
|
if(!l) |
149 |
|
return(NULL); |
150 |
+ |
|
151 |
|
free_lists = append_list(free_lists,l); |
152 |
|
|
153 |
|
return(NULL); |
161 |
|
LIST **l; |
162 |
|
{ |
163 |
|
LIST *p; |
164 |
< |
void *d; |
164 |
> |
int d; |
165 |
|
|
166 |
|
if(!l) |
167 |
|
return(NULL); |