Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2001-08-14  Jakub Jelinek  <jakub@redhat.com>

	* resolv/nss_dns/dns-host.c (RESOLVSORT): Define.
	(addrsort): New function.
	* resolv/gethnamaddr.c (RESOLVSORT): Define.

2001-08-14  Jakub Jelinek  <jakub@redhat.com>

	* string/strsignal.c (free_mem): Remove.

2001-08-14  Andreas Jaeger  <aj@suse.de>

	* inet/inet_ntoa.c (free_mem): Remove, it's not used anymore.
	Closes PR libc/2477, reported by Dylan Alex Simon
	<dylan@dylex.caltech.edu>.

2001-08-14  Ulrich Drepper  <drepper@redhat.com>

	* locale/Makefile (aux): Add xlocale.
	* locale/xlocale.c: New file.
	* include/locale.c (_nl_C_locobj): Declare.
	* iconv/gconv_charset.h: Use __tolower_l, __isdigit_l, __isspace_l
	with _nl_C_locobj instead of tolower, isdigit, isspace.
	* iconv/gconv_conf.c: Likewise.
	* iconv/gconv_int.h: Likewise.
	* iconv/gconv_open.c: Likewise.

	* locale/newlocale.c: Minor cleanups.
  • Loading branch information
Ulrich Drepper committed Aug 14, 2001
1 parent ecad39f commit 5db9157
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 52 deletions.
29 changes: 29 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
2001-08-14 Jakub Jelinek <jakub@redhat.com>

* resolv/nss_dns/dns-host.c (RESOLVSORT): Define.
(addrsort): New function.
* resolv/gethnamaddr.c (RESOLVSORT): Define.

2001-08-14 Jakub Jelinek <jakub@redhat.com>

* string/strsignal.c (free_mem): Remove.

2001-08-14 Andreas Jaeger <aj@suse.de>

* inet/inet_ntoa.c (free_mem): Remove, it's not used anymore.
Closes PR libc/2477, reported by Dylan Alex Simon
<dylan@dylex.caltech.edu>.

2001-08-14 Ulrich Drepper <drepper@redhat.com>

* locale/Makefile (aux): Add xlocale.
* locale/xlocale.c: New file.
* include/locale.c (_nl_C_locobj): Declare.
* iconv/gconv_charset.h: Use __tolower_l, __isdigit_l, __isspace_l
with _nl_C_locobj instead of tolower, isdigit, isspace.
* iconv/gconv_conf.c: Likewise.
* iconv/gconv_int.h: Likewise.
* iconv/gconv_open.c: Likewise.

* locale/newlocale.c: Minor cleanups.

2001-08-14 Andreas Jaeger <aj@suse.de>

* sysdeps/ieee754/ldbl-128/w_expl.c: New file, copy from
Expand Down
8 changes: 5 additions & 3 deletions iconv/gconv_charset.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
02111-1307 USA. */

#include <ctype.h>
#include <locale.h>


static inline void
Expand All @@ -28,8 +29,9 @@ strip (char *wp, const char *s)

while (*s != '\0')
{
if (isalnum (*s) || *s == '_' || *s == '-' || *s == '.')
*wp++ = toupper (*s);
if (__isalnum_l (*s, &_nl_C_locobj)
|| *s == '_' || *s == '-' || *s == '.')
*wp++ = __toupper_l (*s, &_nl_C_locobj);
else if (*s == '/')
{
if (++slash_count == 3)
Expand All @@ -50,7 +52,7 @@ static char * __attribute__ ((unused))
upstr (char *dst, const char *str)
{
char *cp = dst;
while ((*cp++ = toupper (*str++)) != '\0')
while ((*cp++ = __toupper_l (*str++, &_nl_C_locobj)) != '\0')
/* nothing */;
return dst;
}
Expand Down
33 changes: 17 additions & 16 deletions iconv/gconv_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <search.h>
#include <stddef.h>
#include <stdio.h>
Expand Down Expand Up @@ -129,20 +130,20 @@ add_alias (char *rp, void *modules)
struct gconv_alias *new_alias;
char *from, *to, *wp;

while (isspace (*rp))
while (__isspace_l (*rp, &_nl_C_locobj))
++rp;
from = wp = rp;
while (*rp != '\0' && !isspace (*rp))
*wp++ = toupper (*rp++);
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
*wp++ = __toupper_l (*rp++, &_nl_C_locobj);
if (*rp == '\0')
/* There is no `to' string on the line. Ignore it. */
return;
*wp++ = '\0';
to = ++rp;
while (isspace (*rp))
while (__isspace_l (*rp, &_nl_C_locobj))
++rp;
while (*rp != '\0' && !isspace (*rp))
*wp++ = toupper (*rp++);
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
*wp++ = __toupper_l (*rp++, &_nl_C_locobj);
if (to == wp)
/* No `to' string, ignore the line. */
return;
Expand Down Expand Up @@ -250,30 +251,30 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules,
int need_ext;
int cost_hi;

while (isspace (*rp))
while (__isspace_l (*rp, &_nl_C_locobj))
++rp;
from = rp;
while (*rp != '\0' && !isspace (*rp))
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
{
*rp = toupper (*rp);
*rp = __toupper_l (*rp, &_nl_C_locobj);
++rp;
}
if (*rp == '\0')
return;
*rp++ = '\0';
to = wp = rp;
while (isspace (*rp))
while (__isspace_l (*rp, &_nl_C_locobj))
++rp;
while (*rp != '\0' && !isspace (*rp))
*wp++ = toupper (*rp++);
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
*wp++ = __toupper_l (*rp++, &_nl_C_locobj);
if (*rp == '\0')
return;
*wp++ = '\0';
do
++rp;
while (isspace (*rp));
while (__isspace_l (*rp, &_nl_C_locobj));
module = wp;
while (*rp != '\0' && !isspace (*rp))
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
*wp++ = *rp++;
if (*rp == '\0')
{
Expand Down Expand Up @@ -386,15 +387,15 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len,
if (rp[n - 1] == '\n')
rp[n - 1] = '\0';

while (isspace (*rp))
while (__isspace_l (*rp, &_nl_C_locobj))
++rp;

/* If this is an empty line go on with the next one. */
if (rp == endp)
continue;

word = rp;
while (*rp != '\0' && !isspace (*rp))
while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
++rp;

if (rp - word == sizeof ("alias") - 1
Expand Down
2 changes: 1 addition & 1 deletion iconv/gconv_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ extern const char *__gconv_path_envvar;
tmp = result = alloca (cp - (str) + 3 + suffix_len); \
cp = (str); \
while (*cp != '\0') \
*tmp++ = _toupper (*cp++); \
*tmp++ = __toupper_l (*cp++, &_nl_C_locobj); \
if (cnt < 2) \
{ \
*tmp++ = '/'; \
Expand Down
12 changes: 7 additions & 5 deletions iconv/gconv_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
02111-1307 USA. */

#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -64,7 +65,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
tok = __strtok_r (tok, ",", &ptr);
while (tok != NULL)
{
if (__strcasecmp (tok, "TRANSLIT") == 0)
if (__strcasecmp_l (tok, "TRANSLIT", &_nl_C_locobj) == 0)
{
/* It's the builtin transliteration handling. We only
support it for working on the internal encoding. */
Expand Down Expand Up @@ -97,7 +98,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
lastp->next = newp;
}
}
else if (__strcasecmp (tok, "IGNORE") == 0)
else if (__strcasecmp_l (tok, "IGNORE", &_nl_C_locobj) == 0)
/* Set the flag to ignore all errors. */
conv_flags |= __GCONV_IGNORE_ERRORS;
else
Expand All @@ -110,7 +111,8 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,

for (runp = trans; runp != NULL; runp = runp->next)
if (runp->name != NULL
&& __strcasecmp (tok, runp->name) == 0)
&& __strcasecmp_l (tok, runp->name,
&_nl_C_locobj) == 0)
break;
else
lastp = runp;
Expand Down Expand Up @@ -205,8 +207,8 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
modules for this step. */
for (runp = trans; runp != NULL; runp = runp->next)
for (n = 0; n < runp->ncsnames; ++n)
if (__strcasecmp (steps[cnt].__from_name,
runp->csnames[n]) == 0)
if (__strcasecmp_l (steps[cnt].__from_name,
runp->csnames[n], &_nl_C_locobj) == 0)
{
void *data = NULL;

Expand Down
3 changes: 3 additions & 0 deletions include/locale.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef _LOCALE_H
#include <locale/locale.h>

/* Locale object for C locale. */
extern struct __locale_struct _nl_C_locobj;

/* Now define the internal interfaces. */
extern struct lconv *__localeconv (void);

Expand Down
10 changes: 1 addition & 9 deletions inet/inet_ntoa.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Convert Inet number to ASCII representation.
Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Expand Down Expand Up @@ -96,11 +96,3 @@ free_key_mem (void *mem)
free (mem);
__libc_setspecific (key, NULL);
}


static void __attribute__ ((unused))
free_mem (void)
{
free (static_buf);
}
text_set_element (__libc_subfreeres, free_mem);
6 changes: 6 additions & 0 deletions linuxthreads/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2001-08-14 Jakub Jelinek <jakub@redhat.com>

* lockfile.c (__pthread_provide_lockfile): New variable.
* pthread.c (__pthread_require_lockfile): New variable.
* cancel.c (__pthread_require_lockfile): New variable.

2001-07-31 Ulrich Drepper <drepper@redhat.com>

* tst-context.c (threadfct): Initialize context before calling
Expand Down
9 changes: 6 additions & 3 deletions linuxthreads/cancel.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ void __pthread_perform_cleanup(char *currentframe)
}

#ifndef SHARED
/* We need a hook to force the cancelation wrappers to be linked in when
static libpthread is used. */
/* We need a hook to force the cancelation wrappers and file locking
to be linked in when static libpthread is used. */
extern const int __pthread_provide_wrappers;
static const int * const __pthread_require_wrappers =
static const int *const __pthread_require_wrappers =
&__pthread_provide_wrappers;
extern const int __pthread_provide_lockfile;
static const int *const __pthread_require_lockfile =
&__pthread_provide_lockfile;
#endif
6 changes: 6 additions & 0 deletions linuxthreads/lockfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
#include "../libio/libioP.h"
#endif

#ifndef SHARED
/* We need a hook to force this file to be linked in when static
libpthread is used. */
const int __pthread_provide_lockfile = 0;
#endif

void
__flockfile (FILE *stream)
{
Expand Down
7 changes: 5 additions & 2 deletions linuxthreads/pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,9 +1158,12 @@ void __pthread_message(char * fmt, ...)


#ifndef SHARED
/* We need a hook to force the cancelation wrappers to be linked in when
static libpthread is used. */
/* We need a hook to force the cancelation wrappers and file locking
to be linked in when static libpthread is used. */
extern const int __pthread_provide_wrappers;
static const int *const __pthread_require_wrappers =
&__pthread_provide_wrappers;
extern const int __pthread_provide_lockfile;
static const int *const __pthread_require_lockfile =
&__pthread_provide_lockfile;
#endif
3 changes: 2 additions & 1 deletion locale/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ routines = setlocale findlocale loadlocale localeconv nl_langinfo \
tests = tst-C-locale
categories = ctype messages monetary numeric time paper name \
address telephone measurement identification collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
xlocale
others = localedef locale
#others-static = localedef locale
install-bin = localedef locale
Expand Down
6 changes: 4 additions & 2 deletions locale/newlocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
if (result_ptr == NULL)
return NULL;

*result_ptr = result;
}
else
*(result_ptr = base) = result;
/* We modify the base structure. */
result_ptr = base;

*result_ptr = result;

/* Update the special members. */
update:
Expand Down
55 changes: 55 additions & 0 deletions locale/xlocale.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* C locale object.
Copyright (C) 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#include <locale.h>
#include "localeinfo.h"

#define DEFINE_CATEGORY(category, category_name, items, a) \
extern struct locale_data _nl_C_##category;
#include "categories.def"
#undef DEFINE_CATEGORY

/* Defined in locale/C-ctype.c. */
extern const char _nl_C_LC_CTYPE_class[];
extern const char _nl_C_LC_CTYPE_toupper[];
extern const char _nl_C_LC_CTYPE_tolower[];


struct __locale_struct _nl_C_locobj =
{
.__locales =
{
[LC_CTYPE] = &_nl_C_LC_CTYPE,
[LC_NUMERIC] = &_nl_C_LC_NUMERIC,
[LC_TIME] = &_nl_C_LC_TIME,
[LC_COLLATE] = &_nl_C_LC_COLLATE,
[LC_MONETARY] = &_nl_C_LC_MONETARY,
[LC_MESSAGES] = &_nl_C_LC_MESSAGES,
[LC_PAPER] = &_nl_C_LC_PAPER,
[LC_NAME] = &_nl_C_LC_NAME,
[LC_ADDRESS] = &_nl_C_LC_ADDRESS,
[LC_TELEPHONE] = &_nl_C_LC_TELEPHONE,
[LC_MEASUREMENT] = &_nl_C_LC_MEASUREMENT,
[LC_IDENTIFICATION] = &_nl_C_LC_IDENTIFICATION
},
.__ctype_b = (const unsigned short int *) _nl_C_LC_CTYPE_class + 128,
.__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128,
.__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128
};
2 changes: 2 additions & 0 deletions resolv/gethnamaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ static char rcsid[] = "$Id$";
#include <errno.h>
#include <syslog.h>

#define RESOLVSORT

#ifndef LOG_AUTH
# define LOG_AUTH 0
#endif
Expand Down
Loading

0 comments on commit 5db9157

Please sign in to comment.