Lines Matching defs:new
189 * Allocates a new, uninitialised, locale.
194 locale_t new = calloc(sizeof(struct _xlocale), 1);
196 new->header.destructor = destruct_locale;
197 new->monetary_locale_changed = 1;
198 new->numeric_locale_changed = 1;
199 return (new);
202 copyflags(locale_t new, locale_t old)
204 new->using_monetary_locale = old->using_monetary_locale;
205 new->using_numeric_locale = old->using_numeric_locale;
206 new->using_time_locale = old->using_time_locale;
207 new->using_messages_locale = old->using_messages_locale;
210 static int dupcomponent(int type, locale_t base, locale_t new)
217 new->components[type] = constructors[type](src->locale, new);
218 if (new->components[type]) {
219 strncpy(new->components[type]->locale, src->locale,
221 strncpy(new->components[type]->version, src->version,
225 new->components[type] = xlocale_retain(base->components[type]);
233 return (0 != new->components[type]);
251 locale_t new = alloc_locale();
252 if (NULL == new) {
258 copyflags(new, base);
271 new->components[type] =
272 constructors[type](realLocale, new);
273 if (new->components[type]) {
274 strncpy(new->components[type]->locale,
281 if (!dupcomponent(type, base, new)) {
289 xlocale_release(new);
290 new = NULL;
295 return (new);
300 locale_t new = alloc_locale();
305 if (NULL == new) {
310 copyflags(new, base);
313 dupcomponent(type, base, new);
316 return (new);