retval = _nl_find_msg (domain, binding, msgid1, &retlen);
retval = _nl_find_msg (domain, binding, msgid1, 1, &retlen);
DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)     const char *domainname;     const char *msgid1;     const char *msgid2;     int plural;     unsigned long int n;     int category;{#ifndef HAVE_ALLOCA  struct block_list *block_list = NULL;#endif  struct loaded_l10nfile *domain;  struct binding *binding;  const char *categoryname;  const char *categoryvalue;  char *dirname, *xdomainname;  char *single_locale;  char *retval;  size_t retlen;  int saved_errno;#if defined HAVE_TSEARCH || defined _LIBC  struct known_translation_t *search;  struct known_translation_t **foundp = NULL;  size_t msgid_len;#endif  size_t domainname_len;  /* If no real MSGID is given return NULL.  */  if (msgid1 == NULL)    return NULL;#ifdef _LIBC  if (category < 0 || category >= __LC_LAST || category == LC_ALL)    /* Bogus.  */    return (plural == 0	    ? (char *) msgid1	    /* Use the Germanic plural rule.  */	    : n == 1 ? (char *) msgid1 : (char *) msgid2);#endif  __libc_rwlock_rdlock (_nl_state_lock);  /* If DOMAINNAME is NULL, we are interested in the default domain.  If     CATEGORY is not LC_MESSAGES this might not make much sense but the     definition left this undefined.  */  if (domainname == NULL)    domainname = _nl_current_default_domain;#if defined HAVE_TSEARCH || defined _LIBC  msgid_len = strlen (msgid1) + 1;  /* Try to find the translation among those which we found at     some time.  */  search = (struct known_translation_t *)	   alloca (offsetof (struct known_translation_t, msgid) + msgid_len);  memcpy (search->msgid, msgid1, msgid_len);  search->domainname = domainname;  search->category = category;  /* Since tfind/tsearch manage a balanced tree, concurrent tfind and     tsearch calls can be fatal.  */  __libc_rwlock_define_initialized (static, tree_lock);  __libc_rwlock_rdlock (tree_lock);  foundp = (struct known_translation_t **) tfind (search, &root, transcmp);  __libc_rwlock_unlock (tree_lock);  freea (search);  if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)    {      /* Now deal with plural.  */      if (plural)	retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,				(*foundp)->translation_length);      else	retval = (char *) (*foundp)->translation;      __libc_rwlock_unlock (_nl_state_lock);      return retval;    }#endif  /* Preserve the `errno' value.  */  saved_errno = errno;  /* See whether this is a SUID binary or not.  */  DETERMINE_SECURE;  /* First find matching binding.  */  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)    {      int compare = strcmp (domainname, binding->domainname);      if (compare == 0)	/* We found it!  */	break;      if (compare < 0)	{	  /* It is not in the list.  */	  binding = NULL;	  break;	}    }  if (binding == NULL)    dirname = (char *) _nl_default_dirname;  else if (binding->dirname[0] == '/')    dirname = binding->dirname;  else    {      /* We have a relative path.  Make it absolute now.  */      size_t dirname_len = strlen (binding->dirname) + 1;      size_t path_max;      char *ret;      path_max = (unsigned int) PATH_MAX;      path_max += 2;		/* The getcwd docs say to do this.  */      for (;;)	{	  dirname = (char *) alloca (path_max + dirname_len);	  ADD_BLOCK (block_list, dirname);	  __set_errno (0);	  ret = getcwd (dirname, path_max);	  if (ret != NULL || errno != ERANGE)	    break;	  path_max += path_max / 2;	  path_max += PATH_INCR;	}      if (ret == NULL)	{	  /* We cannot get the current working directory.  Don't signal an	     error but simply return the default string.  */	  FREE_BLOCKS (block_list);	  __libc_rwlock_unlock (_nl_state_lock);	  __set_errno (saved_errno);	  return (plural == 0		  ? (char *) msgid1		  /* Use the Germanic plural rule.  */		  : n == 1 ? (char *) msgid1 : (char *) msgid2);	}      stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);    }  /* Now determine the symbolic name of CATEGORY and its value.  */  categoryname = category_to_name (category);  categoryvalue = guess_category_value (category, categoryname);  domainname_len = strlen (domainname);  xdomainname = (char *) alloca (strlen (categoryname)				 + domainname_len + 5);  ADD_BLOCK (block_list, xdomainname);  stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),		  domainname, domainname_len),	  ".mo");  /* Creating working area.  */  single_locale = (char *) alloca (strlen (categoryvalue) + 1);  ADD_BLOCK (block_list, single_locale);  /* Search for the given string.  This is a loop because we perhaps     got an ordered list of languages to consider for the translation.  */  while (1)    {      /* Make CATEGORYVALUE point to the next element of the list.  */      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')	++categoryvalue;      if (categoryvalue[0] == '\0')	{	  /* The whole contents of CATEGORYVALUE has been searched but	     no valid entry has been found.  We solve this situation	     by implicitly appending a "C" entry, i.e. no translation	     will take place.  */	  single_locale[0] = 'C';	  single_locale[1] = '\0';	}      else	{	  char *cp = single_locale;	  while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')	    *cp++ = *categoryvalue++;	  *cp = '\0';	  /* When this is a SUID binary we must not allow accessing files	     outside the dedicated directories.  */	  if (ENABLE_SECURE && strchr (single_locale, '/') != NULL)	    /* Ingore this entry.  */	    continue;	}      /* If the current locale value is C (or POSIX) we don't load a	 domain.  Return the MSGID.  */      if (strcmp (single_locale, "C") == 0	  || strcmp (single_locale, "POSIX") == 0)	{	  FREE_BLOCKS (block_list);	  __libc_rwlock_unlock (_nl_state_lock);	  __set_errno (saved_errno);	  return (plural == 0		  ? (char *) msgid1		  /* Use the Germanic plural rule.  */		  : n == 1 ? (char *) msgid1 : (char *) msgid2);	}      /* Find structure describing the message catalog matching the	 DOMAINNAME and CATEGORY.  */      domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);      if (domain != NULL)	{	  retval = _nl_find_msg (domain, binding, msgid1, &retlen);	  if (retval == NULL)	    {	      int cnt;	      for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)		{		  retval = _nl_find_msg (domain->successor[cnt], binding,					 msgid1, &retlen);		  if (retval != NULL)		    {		      domain = domain->successor[cnt];		      break;		    }		}	    }	  if (retval != NULL)	    {	      /* Found the translation of MSGID1 in domain DOMAIN:		 starting at RETVAL, RETLEN bytes.  */	      FREE_BLOCKS (block_list);#if defined HAVE_TSEARCH || defined _LIBC	      if (foundp == NULL)		{		  /* Create a new entry and add it to the search tree.  */		  struct known_translation_t *newp;		  newp = (struct known_translation_t *)		    malloc (offsetof (struct known_translation_t, msgid)			    + msgid_len + domainname_len + 1);		  if (newp != NULL)		    {		      char *new_domainname;		      new_domainname = mempcpy (newp->msgid, msgid1, msgid_len);		      memcpy (new_domainname, domainname, domainname_len + 1);		      newp->domainname = new_domainname;		      newp->category = category;		      newp->counter = _nl_msg_cat_cntr;		      newp->domain = domain;		      newp->translation = retval;		      newp->translation_length = retlen;		      __libc_rwlock_wrlock (tree_lock);		      /* Insert the entry in the search tree.  */		      foundp = (struct known_translation_t **)			tsearch (newp, &root, transcmp);		      __libc_rwlock_unlock (tree_lock);		      if (foundp == NULL			  || __builtin_expect (*foundp != newp, 0))			/* The insert failed.  */			free (newp);		    }		}	      else		{		  /* We can update the existing entry.  */		  (*foundp)->counter = _nl_msg_cat_cntr;		  (*foundp)->domain = domain;		  (*foundp)->translation = retval;		  (*foundp)->translation_length = retlen;		}#endif	      __set_errno (saved_errno);	      /* Now deal with plural.  */	      if (plural)		retval = plural_lookup (domain, n, retval, retlen);	      __libc_rwlock_unlock (_nl_state_lock);	      return retval;	    }	}    }  /* NOTREACHED */}