Lines Matching refs:loc
222 struct locdata *loc; in locdata_get_cache() local
229 loc = cache_data[category]; in locdata_get_cache()
231 if ((loc != NULL) && (strcmp(loc->l_lname, locname) == 0)) { in locdata_get_cache()
233 return (loc); in locdata_get_cache()
241 for (loc = cat_data[category]; loc != NULL; loc = loc->l_next) { in locdata_get_cache()
242 if (strcmp(locname, loc->l_lname) == 0) { in locdata_get_cache()
264 if (loc == NULL) { in locdata_get_cache()
266 loc = (*loaders[category])(locname); in locdata_get_cache()
268 if (loc != NULL) in locdata_get_cache()
269 (void) strlcpy(loc->l_lname, locname, in locdata_get_cache()
270 sizeof (loc->l_lname)); in locdata_get_cache()
278 if (loc != NULL) { in locdata_get_cache()
279 cache_data[category] = loc; in locdata_get_cache()
280 if (!loc->l_cached) { in locdata_get_cache()
281 loc->l_cached = 1; in locdata_get_cache()
282 loc->l_next = cat_data[category]; in locdata_get_cache()
283 cat_data[category] = loc; in locdata_get_cache()
288 return (loc); in locdata_get_cache()
407 __mb_cur_max_l(locale_t loc) in __mb_cur_max_l() argument
409 return (loc->ctype->lc_max_mblen); in __mb_cur_max_l()
425 locale_t loc; in duplocale() local
428 loc = lmalloc(sizeof (*loc)); in duplocale()
429 if (loc == NULL) { in duplocale()
437 loc->locdata[i] = src->locdata[i]; in duplocale()
438 loc->loaded[i] = 0; in duplocale()
440 loc->collate = loc->locdata[LC_COLLATE]->l_data[0]; in duplocale()
441 loc->ctype = loc->locdata[LC_CTYPE]->l_data[0]; in duplocale()
442 loc->runelocale = loc->locdata[LC_CTYPE]->l_data[1]; in duplocale()
443 loc->messages = loc->locdata[LC_MESSAGES]->l_data[0]; in duplocale()
444 loc->monetary = loc->locdata[LC_MONETARY]->l_data[0]; in duplocale()
445 loc->numeric = loc->locdata[LC_NUMERIC]->l_data[0]; in duplocale()
446 loc->time = loc->locdata[LC_TIME]->l_data[0]; in duplocale()
447 return (loc); in duplocale()
451 freelocale(locale_t loc) in freelocale() argument
458 if ((loc != NULL) && (loc != &posix_locale) && (!loc->on_list)) in freelocale()
459 lfree(loc, sizeof (*loc)); in freelocale()
465 locale_t loc; in newlocale() local
478 loc = duplocale(___global_locale); in newlocale()
480 loc = duplocale(base); in newlocale()
482 if (loc == NULL) { in newlocale()
488 loc->loaded[i] = 0; in newlocale()
496 freelocale(loc); in newlocale()
500 loc->locdata[i] = ldata; in newlocale()
502 loc->collate = loc->locdata[LC_COLLATE]->l_data[0]; in newlocale()
503 loc->ctype = loc->locdata[LC_CTYPE]->l_data[0]; in newlocale()
504 loc->runelocale = loc->locdata[LC_CTYPE]->l_data[1]; in newlocale()
505 loc->messages = loc->locdata[LC_MESSAGES]->l_data[0]; in newlocale()
506 loc->monetary = loc->locdata[LC_MONETARY]->l_data[0]; in newlocale()
507 loc->numeric = loc->locdata[LC_NUMERIC]->l_data[0]; in newlocale()
508 loc->time = loc->locdata[LC_TIME]->l_data[0]; in newlocale()
511 return (mklocname(loc)); in newlocale()
515 uselocale(locale_t loc) in uselocale() argument
531 if (loc != NULL) { in uselocale()
536 if (loc == ___global_locale) { in uselocale()
540 *locptr = loc; in uselocale()
553 mklocname(locale_t loc) in mklocname() argument
559 if (strcmp(loc->locdata[0]->l_lname, in mklocname()
560 loc->locdata[i]->l_lname) != 0) { in mklocname()
572 (void) snprintf(loc->locname, sizeof (loc->locname), in mklocname()
574 loc->locdata[LC_CTYPE]->l_lname, in mklocname()
575 loc->locdata[LC_NUMERIC]->l_lname, in mklocname()
576 loc->locdata[LC_TIME]->l_lname, in mklocname()
577 loc->locdata[LC_COLLATE]->l_lname, in mklocname()
578 loc->locdata[LC_MONETARY]->l_lname, in mklocname()
579 loc->locdata[LC_MESSAGES]->l_lname); in mklocname()
581 (void) strlcpy(loc->locname, loc->locdata[LC_CTYPE]->l_lname, in mklocname()
582 sizeof (loc->locname)); in mklocname()
584 return (loc); in mklocname()