Fri, 09 Nov 2018 17:11:12 +0100
fixes document switching with textareas (Motif)
0 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * | |
152
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
4 | * Copyright 2016 Olaf Wintermann. All rights reserved. |
0 | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | |
15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | |
28 | ||
29 | #include "list.h" | |
30 | ||
31 | UcxList *ucx_list_clone(UcxList *l, copy_func fnc, void *data) { | |
32 | return ucx_list_clone_a(ucx_default_allocator(), l, fnc, data); | |
33 | } | |
34 | ||
35 | UcxList *ucx_list_clone_a(UcxAllocator *alloc, UcxList *l, | |
36 | copy_func fnc, void *data) { | |
37 | UcxList *ret = NULL; | |
38 | while (l) { | |
39 | if (fnc) { | |
40 | ret = ucx_list_append_a(alloc, ret, fnc(l->data, data)); | |
41 | } else { | |
42 | ret = ucx_list_append_a(alloc, ret, l->data); | |
43 | } | |
44 | l = l->next; | |
45 | } | |
46 | return ret; | |
47 | } | |
48 | ||
49 | int ucx_list_equals(const UcxList *l1, const UcxList *l2, | |
50 | cmp_func fnc, void* data) { | |
51 | if (l1 == l2) return 1; | |
52 | ||
53 | while (l1 != NULL && l2 != NULL) { | |
54 | if (fnc == NULL) { | |
55 | if (l1->data != l2->data) return 0; | |
56 | } else { | |
57 | if (fnc(l1->data, l2->data, data) != 0) return 0; | |
58 | } | |
59 | l1 = l1->next; | |
60 | l2 = l2->next; | |
61 | } | |
62 | ||
63 | return (l1 == NULL && l2 == NULL); | |
64 | } | |
65 | ||
66 | void ucx_list_free(UcxList *l) { | |
67 | ucx_list_free_a(ucx_default_allocator(), l); | |
68 | } | |
69 | ||
70 | void ucx_list_free_a(UcxAllocator *alloc, UcxList *l) { | |
71 | UcxList *e = l, *f; | |
72 | while (e != NULL) { | |
73 | f = e; | |
74 | e = e->next; | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
75 | alfree(alloc, f); |
0 | 76 | } |
77 | } | |
78 | ||
152
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
79 | void ucx_list_free_content(UcxList* list, ucx_destructor destr) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
80 | while (list != NULL) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
81 | destr(list->data); |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
82 | list = list->next; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
83 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
84 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
85 | |
0 | 86 | UcxList *ucx_list_append(UcxList *l, void *data) { |
87 | return ucx_list_append_a(ucx_default_allocator(), l, data); | |
88 | } | |
89 | ||
90 | UcxList *ucx_list_append_a(UcxAllocator *alloc, UcxList *l, void *data) { | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
91 | UcxList *nl = (UcxList*) almalloc(alloc, sizeof(UcxList)); |
0 | 92 | if (!nl) { |
93 | return NULL; | |
94 | } | |
95 | ||
96 | nl->data = data; | |
97 | nl->next = NULL; | |
98 | if (l) { | |
99 | UcxList *t = ucx_list_last(l); | |
100 | t->next = nl; | |
101 | nl->prev = t; | |
102 | return l; | |
103 | } else { | |
104 | nl->prev = NULL; | |
105 | return nl; | |
106 | } | |
107 | } | |
108 | ||
152
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
109 | UcxList *ucx_list_append_once(UcxList *l, void *data, |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
110 | cmp_func cmpfnc, void *cmpdata) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
111 | return ucx_list_append_once_a(ucx_default_allocator(), l, |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
112 | data, cmpfnc, cmpdata); |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
113 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
114 | |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
115 | UcxList *ucx_list_append_once_a(UcxAllocator *alloc, UcxList *l, void *data, |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
116 | cmp_func cmpfnc, void *cmpdata) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
117 | |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
118 | UcxList *last = NULL; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
119 | { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
120 | UcxList *e = l; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
121 | while (e) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
122 | if (cmpfnc(e->data, data, cmpdata) == 0) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
123 | return l; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
124 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
125 | last = e; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
126 | e = e->next; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
127 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
128 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
129 | |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
130 | UcxList *nl = ucx_list_append_a(alloc, NULL, data); |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
131 | if (!nl) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
132 | return NULL; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
133 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
134 | |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
135 | if (last == NULL) { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
136 | return nl; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
137 | } else { |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
138 | nl->prev = last; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
139 | last->next = nl; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
140 | return l; |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
141 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
142 | } |
62921b370c60
fixes use after free when a GtkTreeView was destroyed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
143 | |
0 | 144 | UcxList *ucx_list_prepend(UcxList *l, void *data) { |
145 | return ucx_list_prepend_a(ucx_default_allocator(), l, data); | |
146 | } | |
147 | ||
148 | UcxList *ucx_list_prepend_a(UcxAllocator *alloc, UcxList *l, void *data) { | |
149 | UcxList *nl = ucx_list_append_a(alloc, NULL, data); | |
150 | if (!nl) { | |
151 | return NULL; | |
152 | } | |
153 | l = ucx_list_first(l); | |
154 | ||
155 | if (l) { | |
156 | nl->next = l; | |
157 | l->prev = nl; | |
158 | } | |
159 | return nl; | |
160 | } | |
161 | ||
162 | UcxList *ucx_list_concat(UcxList *l1, UcxList *l2) { | |
163 | if (l1) { | |
164 | UcxList *last = ucx_list_last(l1); | |
165 | last->next = l2; | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
166 | if (l2) { |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
167 | l2->prev = last; |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
168 | } |
0 | 169 | return l1; |
170 | } else { | |
171 | return l2; | |
172 | } | |
173 | } | |
174 | ||
175 | UcxList *ucx_list_last(const UcxList *l) { | |
176 | if (l == NULL) return NULL; | |
177 | ||
178 | const UcxList *e = l; | |
179 | while (e->next != NULL) { | |
180 | e = e->next; | |
181 | } | |
182 | return (UcxList*)e; | |
183 | } | |
184 | ||
185 | ssize_t ucx_list_indexof(const UcxList *list, const UcxList *elem) { | |
186 | ssize_t index = 0; | |
187 | while (list) { | |
188 | if (list == elem) { | |
189 | return index; | |
190 | } | |
191 | list = list->next; | |
192 | index++; | |
193 | } | |
194 | return -1; | |
195 | } | |
196 | ||
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
197 | UcxList *ucx_list_get(const UcxList *l, size_t index) { |
0 | 198 | if (l == NULL) return NULL; |
199 | ||
200 | const UcxList *e = l; | |
201 | while (e->next && index > 0) { | |
202 | e = e->next; | |
203 | index--; | |
204 | } | |
205 | ||
206 | return (UcxList*)(index == 0 ? e : NULL); | |
207 | } | |
208 | ||
209 | ssize_t ucx_list_find(UcxList *l, void *elem, cmp_func fnc, void *cmpdata) { | |
210 | ssize_t index = 0; | |
211 | UCX_FOREACH(e, l) { | |
212 | if (fnc) { | |
213 | if (fnc(elem, e->data, cmpdata) == 0) { | |
214 | return index; | |
215 | } | |
216 | } else { | |
217 | if (elem == e->data) { | |
218 | return index; | |
219 | } | |
220 | } | |
221 | index++; | |
222 | } | |
223 | return -1; | |
224 | } | |
225 | ||
226 | int ucx_list_contains(UcxList *l, void *elem, cmp_func fnc, void *cmpdata) { | |
227 | return ucx_list_find(l, elem, fnc, cmpdata) > -1; | |
228 | } | |
229 | ||
230 | size_t ucx_list_size(const UcxList *l) { | |
231 | if (l == NULL) return 0; | |
232 | ||
233 | const UcxList *e = l; | |
234 | size_t s = 1; | |
235 | while (e->next != NULL) { | |
236 | e = e->next; | |
237 | s++; | |
238 | } | |
239 | ||
240 | return s; | |
241 | } | |
242 | ||
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
243 | static UcxList *ucx_list_sort_merge(int length, |
0 | 244 | UcxList* restrict ls, UcxList* restrict le, UcxList* restrict re, |
245 | cmp_func fnc, void* data) { | |
246 | ||
247 | UcxList** sorted = (UcxList**) malloc(sizeof(UcxList*)*length); | |
248 | UcxList *rc, *lc; | |
249 | ||
250 | lc = ls; rc = le; | |
251 | int n = 0; | |
252 | while (lc && lc != le && rc != re) { | |
253 | if (fnc(lc->data, rc->data, data) <= 0) { | |
254 | sorted[n] = lc; | |
255 | lc = lc->next; | |
256 | } else { | |
257 | sorted[n] = rc; | |
258 | rc = rc->next; | |
259 | } | |
260 | n++; | |
261 | } | |
262 | while (lc && lc != le) { | |
263 | sorted[n] = lc; | |
264 | lc = lc->next; | |
265 | n++; | |
266 | } | |
267 | while (rc && rc != re) { | |
268 | sorted[n] = rc; | |
269 | rc = rc->next; | |
270 | n++; | |
271 | } | |
272 | ||
273 | // Update pointer | |
274 | sorted[0]->prev = NULL; | |
275 | for (int i = 0 ; i < length-1 ; i++) { | |
276 | sorted[i]->next = sorted[i+1]; | |
277 | sorted[i+1]->prev = sorted[i]; | |
278 | } | |
279 | sorted[length-1]->next = NULL; | |
280 | ||
281 | UcxList *ret = sorted[0]; | |
282 | free(sorted); | |
283 | return ret; | |
284 | } | |
285 | ||
286 | UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data) { | |
287 | if (l == NULL) { | |
288 | return NULL; | |
289 | } | |
290 | ||
291 | UcxList *lc; | |
292 | int ln = 1; | |
293 | ||
294 | UcxList *restrict ls = l, *restrict le, *restrict re; | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
295 | |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
296 | // check how many elements are already sorted |
0 | 297 | lc = ls; |
298 | while (lc->next != NULL && fnc(lc->next->data, lc->data, data) > 0) { | |
299 | lc = lc->next; | |
300 | ln++; | |
301 | } | |
302 | le = lc->next; | |
303 | ||
304 | if (le == NULL) { | |
305 | return l; // this list is already sorted :) | |
306 | } else { | |
307 | UcxList *rc; | |
308 | int rn = 1; | |
309 | rc = le; | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
310 | // skip already sorted elements |
0 | 311 | while (rc->next != NULL && fnc(rc->next->data, rc->data, data) > 0) { |
312 | rc = rc->next; | |
313 | rn++; | |
314 | } | |
315 | re = rc->next; | |
316 | ||
317 | // {ls,...,le->prev} and {rs,...,re->prev} are sorted - merge them | |
318 | UcxList *sorted = ucx_list_sort_merge(ln+rn, | |
319 | ls, le, re, | |
320 | fnc, data); | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
321 | |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
322 | // Something left? Sort it! |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
323 | size_t remainder_length = ucx_list_size(re); |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
324 | if (remainder_length > 0) { |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
325 | UcxList *remainder = ucx_list_sort(re, fnc, data); |
0 | 326 | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
327 | // merge sorted list with (also sorted) remainder |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
328 | l = ucx_list_sort_merge(ln+rn+remainder_length, |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
329 | sorted, remainder, NULL, fnc, data); |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
330 | } else { |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
331 | // no remainder - we've got our sorted list |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
332 | l = sorted; |
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
333 | } |
0 | 334 | |
335 | return l; | |
336 | } | |
337 | } | |
338 | ||
339 | UcxList *ucx_list_first(const UcxList *l) { | |
340 | if (!l) { | |
341 | return NULL; | |
342 | } | |
343 | ||
344 | const UcxList *e = l; | |
345 | while (e->prev) { | |
346 | e = e->prev; | |
347 | } | |
348 | return (UcxList *)e; | |
349 | } | |
350 | ||
351 | UcxList *ucx_list_remove(UcxList *l, UcxList *e) { | |
352 | return ucx_list_remove_a(ucx_default_allocator(), l, e); | |
353 | } | |
354 | ||
355 | UcxList *ucx_list_remove_a(UcxAllocator *alloc, UcxList *l, UcxList *e) { | |
29
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
356 | if (l == e) { |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
357 | l = e->next; |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
358 | } |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
359 | |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
360 | if (e->next) { |
0 | 361 | e->next->prev = e->prev; |
362 | } | |
29
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
363 | |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
364 | if (e->prev) { |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
365 | e->prev->next = e->next; |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
366 | } |
c96169444d88
added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
367 | |
124
80609f9675f1
added support for icons for the table widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
368 | alfree(alloc, e); |
0 | 369 | return l; |
370 | } |