/* Handle list of needed message catalogs Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdefined _LIBC || defined HAVE_ARGZ_H # include <argz.h> #endif #include <ctype.h> #include <sys/types.h>
#ifdefined STDC_HEADERS || defined _LIBC # include <stdlib.h> #endif
#include"loadinfo.h"
/* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # ifdefined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif
/* @@ end of prolog @@ */
#ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object
file and the name space must not be polluted. */ # define stpcpy(dest, src) __stpcpy(dest, src) #else # ifndef HAVE_STPCPY staticchar *stpcpy PARAMS ((char *dest, constchar *src)); # endif #endif
/* Define function which are usually not available. */
#if !defined _LIBC && !defined HAVE___ARGZ_COUNT /* Returns the number of strings in ARGZ. */ static size_t argz_count__ PARAMS ((constchar *argz, size_t len));
#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
except the last into the character SEP. */ staticvoid argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
/* Return number of bits set in X. */ staticint pop PARAMS ((int x));
staticinlineint
pop (x) int x;
{ /* We assume that no more than 16 bits are used. */
x = ((x & ~0x5555) >> 1) + (x & 0x5555);
x = ((x & ~0x3333) >> 2) + (x & 0x3333);
x = ((x >> 4) + x) & 0x0f0f;
x = ((x >> 8) + x) & 0xff;
if ((mask & TERRITORY) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, territory);
} if ((mask & XPG_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, codeset);
} if ((mask & XPG_NORM_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, normalized_codeset);
} if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{ /* This component can be part of both syntaces but has different
leading characters. For CEN we use `+', else `@'. */
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
cp = stpcpy (cp, modifier);
} if ((mask & CEN_SPECIAL) != 0)
{
*cp++ = '+';
cp = stpcpy (cp, special);
} if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
{
*cp++ = ','; if ((mask & CEN_SPONSOR) != 0)
cp = stpcpy (cp, sponsor); if ((mask & CEN_REVISION) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, revision);
}
}
*cp++ = '/';
stpcpy (cp, filename);
/* Look in list of already loaded domains whether it is already
available. */
last = NULL; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL)
{ int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0)
{ /* It's not in the list. */
retval = NULL; break;
}
entries = 0; /* If the DIRLIST is a real list the RETVAL entry corresponds not to a real file. So we have to use the DIRLIST separation mechanism
of the inner loop. */
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask; for (; cnt >= 0; --cnt) if ((cnt & ~mask) == 0
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
{ /* Iterate over all elements of the DIRLIST. */ char *dir = NULL;
/* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common
names. */ constchar *
_nl_normalize_codeset (codeset, name_len) constchar *codeset;
size_t name_len;
{ int len = 0; int only_digit = 1; char *retval; char *wp;
size_t cnt;
for (cnt = 0; cnt < name_len; ++cnt) if (isalnum (codeset[cnt]))
{
++len;
/* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY
to be defined. */ #if !_LIBC && !HAVE_STPCPY staticchar *
stpcpy (dest, src) char *dest; constchar *src;
{ while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1;
} #endif
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.