1
/* Handle list of needed message catalogs
2
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
1
/* Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3
2
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2, or (at your option)
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published
6
by the Free Software Foundation; either version 2, or (at your option)
10
9
This program is distributed in the hope that it will be useful,
11
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software Foundation,
17
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public
15
License along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19
/* Tell glibc's <string.h> to provide a prototype for stpcpy().
20
This must come before <config.h> because <config.h> may include
21
<features.h>, and once <features.h> has been included, it's too late. */
23
# define _GNU_SOURCE 1
19
26
#ifdef HAVE_CONFIG_H
20
27
# include <config.h>
24
#if defined HAVE_STRING_H || defined _LIBC
26
# define _GNU_SOURCE 1
32
# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
35
#if !HAVE_STRCHR && !defined _LIBC
41
32
#if defined _LIBC || defined HAVE_ARGZ_H
45
36
#include <sys/types.h>
47
#if defined STDC_HEADERS || defined _LIBC
51
39
#include "loadinfo.h"
98
86
# undef __argz_count
99
87
# define __argz_count(argz, len) argz_count__ (argz, len)
90
# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
100
92
#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
102
94
#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
122
114
# undef __argz_stringify
123
115
# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
118
# define __argz_stringify(argz, len, sep) \
119
INTUSE(__argz_stringify) (argz, len, sep)
124
121
#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
126
123
#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
225
222
/* Construct file name. */
226
223
memcpy (abs_filename, dirlist, dirlist_len);
227
__argz_stringify (abs_filename, dirlist_len, ':');
224
__argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
228
225
cp = abs_filename + (dirlist_len - 1);
230
227
cp = stpcpy (cp, language);
350
347
/* Normalize codeset name. There is no standard for the codeset
351
348
names. Normalization allows the user to use any of the common
349
names. The return value is dynamically allocated and has to be
350
freed by the caller. */
354
352
_nl_normalize_codeset (codeset, name_len)
355
const unsigned char *codeset;
382
380
for (cnt = 0; cnt < name_len; ++cnt)
383
if (isalpha (codeset[cnt]))
384
*wp++ = tolower (codeset[cnt]);
385
else if (isdigit (codeset[cnt]))
381
if (isalpha ((unsigned char) codeset[cnt]))
382
*wp++ = tolower ((unsigned char) codeset[cnt]);
383
else if (isdigit ((unsigned char) codeset[cnt]))
386
384
*wp++ = codeset[cnt];