*** empty log message ***
[bpt/emacs.git] / oldXMenu / XDestAssoc.c
CommitLineData
e745ede7 1/* Copyright Massachusetts Institute of Technology 1985 */
5b0d63bc
TTN
2/* Copyright (C) 2002, 2003, 2004, 2005,
3 2006 Free Software Foundation, Inc. */
e745ede7
DL
4
5/*
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation, and that the name of M.I.T. not be used in advertising or
11publicity pertaining to distribution of the software without specific,
12written prior permission. M.I.T. makes no representations about the
13suitability of this software for any purpose. It is provided "as is"
14without express or implied warranty.
15*/
16
17#include <X11/Xlib.h>
18#include "X10.h"
19
20/*
21 * XDestroyAssocTable - Destroy (free the memory associated with)
177c0ea7 22 * an XAssocTable.
e745ede7
DL
23 */
24XDestroyAssocTable(table)
25 register XAssocTable *table;
26{
27 register int i;
28 register XAssoc *bucket;
29 register XAssoc *Entry, *entry_next;
30
31 /* Free the buckets. */
32 for (i = 0; i < table->size; i++) {
33 bucket = &table->buckets[i];
34 for (
35 Entry = bucket->next;
36 Entry != bucket;
37 Entry = entry_next
38 ) {
39 entry_next = Entry->next;
40 free((char *)Entry);
41 }
42 }
43
44 /* Free the bucket array. */
45 free((char *)table->buckets);
46
47 /* Free the table. */
48 free((char *)table);
49}
50
ab5796a9
MB
51/* arch-tag: a536bf02-8d63-45f2-8c1a-c7f9fd4da2cf
52 (do not change this comment) */