]> code.delx.au - gnu-emacs/blob - oldXMenu/XDestAssoc.c
Merge from emacs--devo--0
[gnu-emacs] / oldXMenu / XDestAssoc.c
1 /* Copyright Massachusetts Institute of Technology 1985 */
2 /* Copyright (C) 2001, 2002, 2003, 2004, 2005,
3 2006, 2007 Free Software Foundation, Inc. */
4
5 #include "copyright.h"
6
7
8 #include <X11/Xlib.h>
9 #include "X10.h"
10
11 /*
12 * XDestroyAssocTable - Destroy (free the memory associated with)
13 * an XAssocTable.
14 */
15 XDestroyAssocTable(table)
16 register XAssocTable *table;
17 {
18 register int i;
19 register XAssoc *bucket;
20 register XAssoc *Entry, *entry_next;
21
22 /* Free the buckets. */
23 for (i = 0; i < table->size; i++) {
24 bucket = &table->buckets[i];
25 for (
26 Entry = bucket->next;
27 Entry != bucket;
28 Entry = entry_next
29 ) {
30 entry_next = Entry->next;
31 free((char *)Entry);
32 }
33 }
34
35 /* Free the bucket array. */
36 free((char *)table->buckets);
37
38 /* Free the table. */
39 free((char *)table);
40 }
41
42 /* arch-tag: a536bf02-8d63-45f2-8c1a-c7f9fd4da2cf
43 (do not change this comment) */