Lines Matching defs:ls
835 register Lc_scan_t* ls;
837 if (!(ls = (Lc_scan_t*)lc))
839 if (!(ls = newof(0, Lc_scan_t, 1, 0)))
841 ls->lc.code = ls->lc.name = ls->buf;
842 ls->territory = -1;
843 ls->language = elementsof(ls->lc.territory->languages);
844 ls->attribute = elementsof(ls->lc.language->attributes);
846 if (++ls->attribute >= elementsof(ls->lc.language->attributes) || !(ls->list.attribute = ls->lc.language->attributes[ls->attribute]))
848 if (++ls->language >= elementsof(ls->lc.territory->languages) || !(ls->lc.language = ls->lc.territory->languages[ls->language]))
850 if (!lc_territories[++ls->territory].code)
852 free(ls);
855 ls->lc.territory = &lc_territories[ls->territory];
856 ls->lc.language = ls->lc.territory->languages[ls->language = 0];
858 if (ls->lc.language)
860 ls->lc.charset = ls->lc.language->charset ? ls->lc.language->charset : &lc_charsets[0];
861 ls->list.attribute = ls->lc.language->attributes[ls->attribute = 0];
865 ls->lc.charset = &lc_charsets[0];
866 ls->list.attribute = 0;
869 ls->lc.attributes = ls->list.attribute ? &ls->list : (Lc_attribute_list_t*)0;
871 if (!ls->lc.language || !ls->lc.language->index)
872 ls->lc.index = 0;
875 if ((!ls->list.attribute || !(ls->lc.index = ls->list.attribute->index)) &&
876 (!ls->lc.territory || !(ls->lc.index = ls->lc.territory->indices[ls->language])))
877 ls->lc.index = SUBLANG_DEFAULT;
878 ls->lc.index = MAKELCID(MAKELANGID(ls->lc.language->index, ls->lc.index), SORT_DEFAULT);
881 canonical(ls->lc.language, ls->lc.territory, ls->lc.charset, ls->lc.attributes, 0, ls->buf, sizeof(ls->buf));
882 return (Lc_t*)ls;