Lines Matching defs:np
81 np = malloc(sizeof(struct catentry)); \
82 if (np != NULL) { \
83 np->name = strdup(n); \
84 np->path = NULL; \
85 np->catd = NLERR; \
86 np->lang = (l == NULL) ? NULL : \
88 np->caterrno = e; \
89 SLIST_INSERT_HEAD(&cache, np, list); \
116 struct catentry *np;
144 SLIST_FOREACH(np, &cache, list) {
145 if ((strcmp(np->name, name) == 0) &&
146 ((lang != NULL && np->lang != NULL &&
147 strcmp(np->lang, lang) == 0) || (np->lang == lang))) {
148 if (np->caterrno != 0) {
151 NLRETERR(np->caterrno);
154 np->refcount++;
156 return (np->catd);
330 struct catentry *np;
340 SLIST_FOREACH(np, &cache, list) {
341 if (catd == np->catd) {
342 np->refcount--;
343 if (np->refcount == 0) {
346 SLIST_REMOVE(&cache, np, catentry, list);
347 free(np->name);
348 free(np->path);
349 free(np->lang);
350 free(np);
368 struct catentry *np;
379 SLIST_FOREACH(np, &cache, list) {
380 if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
381 np->refcount++;
383 return (np->catd);
437 if ((np = malloc(sizeof(struct catentry))) != NULL) {
438 np->name = strdup(name);
439 np->path = strdup(path);
440 np->catd = catd;
441 np->lang = (lang == NULL) ? NULL : strdup(lang);
442 np->refcount = 1;
443 np->caterrno = 0;
444 SLIST_INSERT_HEAD(&cache, np, list);