Lines Matching refs:id
50 * a resource is a 32 bit quantity. the upper 12 bits are client id.
51 * client provides a 19 bit resource id. this is "hashed" by me by
58 * purpose. By setting CLIENT_ID(id) to the client, the SERVER_BIT to
85 FSID id;
119 NoneDeleteFunc (void *ptr, FSID id)
159 hash(int client, FSID id)
161 id &= RESOURCE_ID_MASK;
164 return ((int) (0x03F & (id ^ (id >> 6) ^ (id >> 12))));
166 return ((int) (0x07F & (id ^ (id >> 7) ^ (id >> 13))));
168 return ((int) (0x0FF & (id ^ (id >> 8) ^ (id >> 16))));
170 return ((int) (0x1FF & (id ^ (id >> 9))));
172 return ((int) (0x3FF & (id ^ (id >> 10))));
174 return ((int) (0x7FF & (id ^ (id >> 11))));
183 register FSID id,
189 if ((goodid >= id) && (goodid <= maxid))
191 for (; id <= maxid; id++)
193 res = clientTable[client].resources[hash(client, id)];
194 while (res && (res->id != id))
197 return id;
213 register FSID id, maxid;
219 id = clientTable[client].fakeID++;
220 if (id != clientTable[client].endFakeID)
221 return id;
222 id = ((Mask)client << CLIENTOFFSET) | SERVER_BIT;
223 maxid = id | RESOURCE_ID_MASK;
230 if ((res->id < id) || (res->id > maxid))
232 if (((res->id - id) >= (maxid - res->id)) ?
233 (goodid = AvailableID(client, id, res->id - 1, goodid)) :
234 !(goodid = AvailableID(client, res->id + 1, maxid, goodid)))
235 maxid = res->id - 1;
237 id = res->id + 1;
240 if (id > maxid) {
244 id = ((Mask)client << CLIENTOFFSET) | (SERVER_BIT * 3);
245 maxid = id | RESOURCE_ID_MASK;
247 clientTable[client].fakeID = id + 1;
249 return id;
255 FSID id,
266 id, type, value, cid);
272 head = &rrec->resources[hash(cid, id)];
275 (*DeleteFuncs[type & TypeMask]) (value, id);
279 res->id = id;
284 if (!(id & SERVER_BIT) && (id >= rrec->expectID))
285 rrec->expectID = id + 1;
326 tptr = &tails[hash(client, res->id)];
340 FSID id,
351 head = &clientTable[cid].resources[hash(cid, id)];
356 if (res->id == id) {
362 (*DeleteFuncs[rtype & TypeMask]) (res->value, res->id);
372 FatalError("freeing resource id=%lX which isn't there\n", id);
397 * for one which do a LookupID on another resource id (a Colormap id
412 (*DeleteFuncs[rtype & TypeMask]) (this->value, this->id);
432 * lookup_id_by_type returns the object with the given id and type, else NULL.
437 FSID id,
443 res = clientTable[cid].resources[hash(cid, id)];
446 if ((res->id == id) && (res->type == rtype))