X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/e745ede7473e87b93d71858bc1c8447a1307de28..d048e1e6bd3f634ca8308003e67967f134098c6c:/oldXMenu/XMakeAssoc.c diff --git a/oldXMenu/XMakeAssoc.c b/oldXMenu/XMakeAssoc.c index d4682700ed..143b264111 100644 --- a/oldXMenu/XMakeAssoc.c +++ b/oldXMenu/XMakeAssoc.c @@ -1,53 +1,31 @@ -/* $XConsortium: XMakeAssoc.c,v 10.18 91/01/06 12:09:28 rws Exp $ */ /* Copyright Massachusetts Institute of Technology 1985 */ -/* -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the name of M.I.T. not be used in advertising or -publicity pertaining to distribution of the software without specific, -written prior permission. M.I.T. makes no representations about the -suitability of this software for any purpose. It is provided "as is" -without express or implied warranty. -*/ +#include "copyright.h" + #include -#include +#include "XMenuInt.h" #include -#include "X10.h" #include #ifndef NULL #define NULL 0 #endif -extern int errno; - -void emacs_insque(); -struct qelem { - struct qelem *q_forw; - struct qelem *q_back; - char q_data[1]; -}; /* * XMakeAssoc - Insert data into an XAssocTable keyed on an XId. * Data is inserted into the table only once. Redundant inserts are * meaningless (but cause no problems). The queue in each association * bucket is sorted (lowest XId to highest XId). */ -XMakeAssoc(dpy, table, x_id, data) - register Display *dpy; - register XAssocTable *table; - register XID x_id; - register caddr_t data; +void +XMakeAssoc(register Display *dpy, register XAssocTable *table, register XID x_id, register void *data) { int hash; register XAssoc *bucket; register XAssoc *Entry; register XAssoc *new_entry; - + /* Hash the XId to get the bucket number. */ hash = x_id & (table->size - 1); /* Look up the bucket to get the entries in that bucket. */ @@ -91,7 +69,7 @@ XMakeAssoc(dpy, table, x_id, data) /* If we are here then the new entry should be inserted just */ /* before the current value of "Entry". */ /* Create a new XAssoc and load it with new provided data. */ - new_entry = (XAssoc *) xmalloc(sizeof(XAssoc)); + new_entry = (XAssoc *) malloc(sizeof(XAssoc)); new_entry->display = dpy; new_entry->x_id = x_id; new_entry->data = data; @@ -99,4 +77,3 @@ XMakeAssoc(dpy, table, x_id, data) /* Insert the new entry. */ emacs_insque((struct qelem *)new_entry, (struct qelem *)Entry->prev); } -