1999-10-03 19:36:13 +00:00
|
|
|
/* Copyright Massachusetts Institute of Technology 1985 */
|
|
|
|
|
2007-02-25 00:10:18 +00:00
|
|
|
#include "copyright.h"
|
|
|
|
|
1999-10-03 19:36:13 +00:00
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include "X10.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XDestroyAssocTable - Destroy (free the memory associated with)
|
2003-02-04 14:56:31 +00:00
|
|
|
* an XAssocTable.
|
1999-10-03 19:36:13 +00:00
|
|
|
*/
|
|
|
|
XDestroyAssocTable(table)
|
|
|
|
register XAssocTable *table;
|
|
|
|
{
|
|
|
|
register int i;
|
|
|
|
register XAssoc *bucket;
|
|
|
|
register XAssoc *Entry, *entry_next;
|
|
|
|
|
|
|
|
/* Free the buckets. */
|
|
|
|
for (i = 0; i < table->size; i++) {
|
|
|
|
bucket = &table->buckets[i];
|
|
|
|
for (
|
|
|
|
Entry = bucket->next;
|
|
|
|
Entry != bucket;
|
|
|
|
Entry = entry_next
|
|
|
|
) {
|
|
|
|
entry_next = Entry->next;
|
|
|
|
free((char *)Entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free the bucket array. */
|
|
|
|
free((char *)table->buckets);
|
|
|
|
|
|
|
|
/* Free the table. */
|
|
|
|
free((char *)table);
|
|
|
|
}
|
|
|
|
|
2003-09-01 15:45:59 +00:00
|
|
|
/* arch-tag: a536bf02-8d63-45f2-8c1a-c7f9fd4da2cf
|
|
|
|
(do not change this comment) */
|