|
|
1.1 ! root 1: #include <X/mit-copyright.h> ! 2: ! 3: /* $Header: XDestAssoc.c,v 10.4 86/02/01 15:32:05 tony Rel $ */ ! 4: /* Copyright Massachusetts Institute of Technology 1985 */ ! 5: ! 6: #include "XlibInternal.h" ! 7: ! 8: /* ! 9: * XDestroyAssocTable - Destroy (free the memory associated with) ! 10: * an XAssocTable. ! 11: */ ! 12: XDestroyAssocTable(table) ! 13: register XAssocTable *table; ! 14: { ! 15: register int i; ! 16: register XAssoc *bucket; ! 17: register XAssoc *entry; ! 18: ! 19: /* Free the buckets. */ ! 20: for (i = 0; i < table->size; i++) { ! 21: bucket = &(*table->table)[i]; ! 22: for ( ! 23: entry = bucket->next; ! 24: entry != bucket; ! 25: entry = entry->next ! 26: ) { ! 27: free(entry); ! 28: } ! 29: } ! 30: ! 31: /* Free the bucket headers. */ ! 32: free(table->table); ! 33: ! 34: /* Free the table. */ ! 35: free(table); ! 36: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.