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