Lines Matching refs:item

152  * Dynamically allocate space for a struct item plus the key and data
187 /* Allocate space for struct item, struct passwd and the strings. */
233 struct cache_item *item = v;
235 if (--item->refcnt == 0)
236 efree(item);
253 struct cache_item key, *item;
258 item = (struct cache_item *) node->data;
268 item = make_pwitem(key.d.pw, NULL);
269 if (rbinsert(pwcache_byuid, item) != NULL)
271 (unsigned int) uid, item->d.pw->pw_name);
273 item = ecalloc(1, sizeof(*item));
274 item->refcnt = 1;
275 item->k.uid = uid;
276 /* item->d.pw = NULL; */
277 if (rbinsert(pwcache_byuid, item) != NULL)
285 item->refcnt++;
286 return item->d.pw;
296 struct cache_item key, *item;
302 item = (struct cache_item *) node->data;
312 item = make_pwitem(key.d.pw, name);
313 if (rbinsert(pwcache_byname, item) != NULL)
317 item = ecalloc(1, sizeof(*item) + len);
318 item->refcnt = 1;
319 item->k.name = (char *) item + sizeof(*item);
320 memcpy(item->k.name, name, len);
321 /* item->d.pw = NULL; */
322 if (rbinsert(pwcache_byname, item) != NULL)
329 item->refcnt++;
330 return item->d.pw;
460 * Dynamically allocate space for a struct item plus the key and data
536 struct cache_item *item = v;
538 if (--item->refcnt == 0)
539 efree(item);
556 struct cache_item key, *item;
561 item = (struct cache_item *) node->data;
568 item = make_gritem(key.d.gr, NULL);
569 if (rbinsert(grcache_bygid, item) != NULL)
573 item = ecalloc(1, sizeof(*item));
574 item->refcnt = 1;
575 item->k.gid = gid;
576 /* item->d.gr = NULL; */
577 if (rbinsert(grcache_bygid, item) != NULL)
582 item->refcnt++;
583 return item->d.gr;
593 struct cache_item key, *item;
599 item = (struct cache_item *) node->data;
606 item = make_gritem(key.d.gr, name);
607 if (rbinsert(grcache_byname, item) != NULL)
611 item = ecalloc(1, sizeof(*item) + len);
612 item->refcnt = 1;
613 item->k.name = (char *) item + sizeof(*item);
614 memcpy(item->k.name, name, len);
615 /* item->d.gr = NULL; */
616 if (rbinsert(grcache_byname, item) != NULL)
620 item->refcnt++;
621 return item->d.gr;