Commit | Line | Data |
---|---|---|
e745ede7 DL |
1 | /* Copyright Massachusetts Institute of Technology 1985 */ |
2 | ||
0ff3f435 GM |
3 | #include "copyright.h" |
4 | ||
e745ede7 DL |
5 | |
6 | #include <X11/Xlib.h> | |
7 | #include "X10.h" | |
8 | ||
9 | /* | |
10 | * XDestroyAssocTable - Destroy (free the memory associated with) | |
177c0ea7 | 11 | * an XAssocTable. |
e745ede7 | 12 | */ |
b782e2d7 | 13 | XDestroyAssocTable(register XAssocTable *table) |
e745ede7 DL |
14 | { |
15 | register int i; | |
16 | register XAssoc *bucket; | |
17 | register XAssoc *Entry, *entry_next; | |
18 | ||
19 | /* Free the buckets. */ | |
20 | for (i = 0; i < table->size; i++) { | |
21 | bucket = &table->buckets[i]; | |
22 | for ( | |
23 | Entry = bucket->next; | |
24 | Entry != bucket; | |
25 | Entry = entry_next | |
26 | ) { | |
27 | entry_next = Entry->next; | |
28 | free((char *)Entry); | |
29 | } | |
30 | } | |
31 | ||
32 | /* Free the bucket array. */ | |
33 | free((char *)table->buckets); | |
34 | ||
35 | /* Free the table. */ | |
36 | free((char *)table); | |
37 | } | |
38 | ||
ab5796a9 MB |
39 | /* arch-tag: a536bf02-8d63-45f2-8c1a-c7f9fd4da2cf |
40 | (do not change this comment) */ |