Lines Matching full:np
81 #define SAVEFAIL(n, l, e) { np = calloc(1, sizeof(struct catentry)); \
82 if (np != NULL) { \
83 np->name = strdup(n); \
84 np->catd = NLERR; \
85 np->lang = (l == NULL) ? NULL : \
87 np->caterrno = e; \
88 if (np->name == NULL || \
89 (l != NULL && np->lang == NULL)) { \
90 free(np->name); \
91 free(np->lang); \
92 free(np); \
95 SLIST_INSERT_HEAD(&cache, np, \
130 struct catentry *np; in __catopen_l() local
159 SLIST_FOREACH(np, &cache, list) { in __catopen_l()
160 if ((strcmp(np->name, name) == 0) && in __catopen_l()
161 ((lang != NULL && np->lang != NULL && in __catopen_l()
162 strcmp(np->lang, lang) == 0) || (np->lang == lang))) { in __catopen_l()
163 if (np->caterrno != 0) { in __catopen_l()
166 NLRETERR(np->caterrno); in __catopen_l()
169 atomic_add_int(&np->refcount, 1); in __catopen_l()
171 return (np->catd); in __catopen_l()
343 catfree(struct catentry *np) in catfree() argument
346 if (np->catd != NULL && np->catd != NLERR) { in catfree()
347 munmap(np->catd->__data, (size_t)np->catd->__size); in catfree()
348 free(np->catd); in catfree()
350 SLIST_REMOVE(&cache, np, catentry, list); in catfree()
351 free(np->name); in catfree()
352 free(np->path); in catfree()
353 free(np->lang); in catfree()
354 free(np); in catfree()
360 struct catentry *np; in catclose() local
370 SLIST_FOREACH(np, &cache, list) { in catclose()
371 if (catd == np->catd) { in catclose()
372 if (atomic_fetchadd_int(&np->refcount, -1) == 1) in catclose()
373 catfree(np); in catclose()
390 struct catentry *np; in load_msgcat() local
402 SLIST_FOREACH(np, &cache, list) { in load_msgcat()
403 if ((np->path != NULL) && (strcmp(np->path, path) == 0)) { in load_msgcat()
404 atomic_add_int(&np->refcount, 1); in load_msgcat()
406 return (np->catd); in load_msgcat()
461 np = calloc(1, sizeof(struct catentry)); in load_msgcat()
465 catd == NULL || np == NULL) { in load_msgcat()
470 free(np); in load_msgcat()
480 np->name = copy_name; in load_msgcat()
481 np->path = copy_path; in load_msgcat()
482 np->catd = catd; in load_msgcat()
483 np->lang = copy_lang; in load_msgcat()
484 atomic_store_int(&np->refcount, 1); in load_msgcat()
486 SLIST_INSERT_HEAD(&cache, np, list); in load_msgcat()