if (newdata[category]->usage_count != MAX_USAGE_COUNT) newdata[category]->usage_count = MAX_USAGE_COUNT;
if (newdata[category]->usage_count != UNDELETABLE) newdata[category]->usage_count = UNDELETABLE;
setlocale (int category, const char *locale){  char *locale_path;  size_t locale_path_len;  const char *locpath_var;  char *composite;  /* Sanity check for CATEGORY argument.  */  if (category < 0 || category > LC_ALL)    ERROR_RETURN;  /* Does user want name of current locale?  */  if (locale == NULL)    return (char *) _nl_current_names[category];  if (strcmp (locale, _nl_current_names[category]) == 0)    /* Changing to the same thing.  */    return (char *) _nl_current_names[category];  /* We perhaps really have to load some data.  So we determine the     path in which to look for the data now.  The environment variable     `LOCPATH' must only be used when the binary has no SUID or SGID     bit set.  */  locale_path = NULL;  locale_path_len = 0;  locpath_var = __secure_getenv ("LOCPATH");  if (locpath_var != NULL && locpath_var[0] != '\0')    if (__argz_create_sep (locpath_var, ':',			   &locale_path, &locale_path_len) != 0)      return NULL;  if (__argz_add_sep (&locale_path, &locale_path_len, LOCALE_PATH, ':') != 0)    return NULL;  if (category == LC_ALL)    {      /* The user wants to set all categories.  The desired locales	 for the individual categories can be selected by using a	 composite locale name.  This is a semi-colon separated list	 of entries of the form `CATEGORY=VALUE'.  */      const char *newnames[LC_ALL];      struct locale_data *newdata[LC_ALL];      /* Set all name pointers to the argument name.  */      for (category = 0; category < LC_ALL; ++category)	newnames[category] = (char *) locale;      if (strchr (locale, ';') != NULL)	{	  /* This is a composite name.  Make a copy and split it up.  */	  char *np = strdupa (locale);	  char *cp;	  int cnt;	  while ((cp = strchr (np, '=')) != NULL)	    {	      for (cnt = 0; cnt < LC_ALL; ++cnt)		if ((size_t) (cp - np) == _nl_category_name_sizes[cnt]		    && memcmp (np, _nl_category_names[cnt], cp - np) == 0)		  break;	      if (cnt == LC_ALL)		/* Bogus category name.  */		ERROR_RETURN;	      /* Found the category this clause sets.  */	      newnames[cnt] = ++cp;	      cp = strchr (cp, ';');	      if (cp != NULL)		{		  /* Examine the next clause.  */		  *cp = '\0';		  np = cp + 1;		}	      else		/* This was the last clause.  We are done.  */		break;	    }	  for (cnt = 0; cnt < LC_ALL; ++cnt)	    if (newnames[cnt] == locale)	      /* The composite name did not specify all categories.  */	      ERROR_RETURN;	}      /* Protect global data.  */      __libc_lock_lock (__libc_setlocale_lock);      /* Load the new data for each category.  */      while (category-- > 0)	{	  newdata[category] = _nl_find_locale (locale_path, locale_path_len,					       category,					       &newnames[category]);	  if (newdata[category] == NULL)	    break;	  /* We must not simply free a global locale since we have no	     control over the usage.  So we mark it as un-deletable.  */	  if (newdata[category]->usage_count != MAX_USAGE_COUNT)	    newdata[category]->usage_count = MAX_USAGE_COUNT;	}      /* Create new composite name.  */      if (category >= 0	  || (composite = new_composite_name (LC_ALL, newnames)) == NULL)	/* Loading this part of the locale failed.  Abort the	   composite load.  */	composite = NULL;      else	{	  /* Now we have loaded all the new data.  Put it in place.  */	  for (category = 0; category < LC_ALL; ++category)	    {	      setdata (category, newdata[category]);	      setname (category, newnames[category]);	    }	  setname (LC_ALL, composite);	}      /* Critical section left.  */      __libc_lock_unlock (__libc_setlocale_lock);      /* Free the resources (the locale path variable.  */      free (locale_path);      return composite;    }  else    {      struct locale_data *newdata = NULL;      const char *newname[1] = { locale };      /* Protect global data.  */      __libc_lock_lock (__libc_setlocale_lock);      if (_nl_current[category] != NULL)	{	  /* Only actually load the data if anything will use it.  */	  newdata = _nl_find_locale (locale_path, locale_path_len, category,				     &newname[0]);	  if (newdata == NULL)	    goto abort_single;	  /* We must not simply free a global locale since we have no	     control over the usage.  So we mark it as un-deletable.	     Note: do ont remove the `if', it's necessary to copy with	     the builtin locale data.  */	  if (newdata->usage_count != MAX_USAGE_COUNT)	    newdata->usage_count = MAX_USAGE_COUNT;	}      /* Create new composite name.  */      composite = new_composite_name (category, newname);      if (composite == NULL)	{	  /* Say that we don't have any data loaded.  */	abort_single:	  newname[0] = NULL;	}      else	{	  if (_nl_current[category] != NULL)	    setdata (category, newdata);	  setname (category, newname[0]);	  setname (LC_ALL, composite);	}      /* Critical section left.  */      __libc_lock_unlock (__libc_setlocale_lock);      /* Free the resources (the locale path variable.  */      free (locale_path);      return (char *) newname[0];    }}