Wed Jun 19 01:27:57 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>

* math/Makefile (distribute): Add ieee-math.c.

Wed Jun 19 03:24:58 1996  Ulrich Drepper  <drepper@cygnus.com>

	* locale/codeset_name.c: New file.  Provide function for information
 	about currently used character set.
	* locale/Makefile (routines): Add codeset_name.
	* locale/langinfo.h (_NL_CTYPE_CODESET_NAME): Add new constant.
	* locale/localeinfo.h: Change magic number because of incompatible
	change.
	* locale/C-ctype.c: Add initializer for new field `codeset_name'.
	* locale/programs/ld-ctype.c: Implement handling of `codeset_name'.

	* locale/programs/locfile.c: Don't depend in pre-2.0 Linux specific
 	name `MAX_IOVEC'.  Instead use standard name `UIO_MAXIOV'.

	* locale/setlocale.c (setlocale): Initialize local variables to
	prevent warnings.
This commit is contained in:
Roland McGrath 1996-06-19 05:38:55 +00:00
parent bd1be8ec88
commit 6990326c21
10 changed files with 70 additions and 10 deletions

View File

@ -1,3 +1,24 @@
Wed Jun 19 01:27:57 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* math/Makefile (distribute): Add ieee-math.c.
Wed Jun 19 03:24:58 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/codeset_name.c: New file. Provide function for information
about currently used character set.
* locale/Makefile (routines): Add codeset_name.
* locale/langinfo.h (_NL_CTYPE_CODESET_NAME): Add new constant.
* locale/localeinfo.h: Change magic number because of incompatible
change.
* locale/C-ctype.c: Add initializer for new field `codeset_name'.
* locale/programs/ld-ctype.c: Implement handling of `codeset_name'.
* locale/programs/locfile.c: Don't depend in pre-2.0 Linux specific
name `MAX_IOVEC'. Instead use standard name `UIO_MAXIOV'.
* locale/setlocale.c (setlocale): Initialize local variables to
prevent warnings.
Tue Jun 18 17:56:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Version 1.91 test release.

View File

@ -920,6 +920,7 @@ const struct locale_data _nl_C_LC_CTYPE =
"print\0" "graph\0" "blank\0" "cntrl\0" "punct\0" "alnum\0" },
{ string: "tolower\0" "toupper\0" },
{ string: _nl_C_LC_CTYPE_width },
{ word: 2 }
{ word: 2 },
{ string: "ISO_646.IRV:1983" }
}
};

View File

@ -29,7 +29,7 @@ distribute = localeinfo.h categories.def \
locfile-kw.gperf locfile-kw.h linereader.h \
locales.h locfile.h stringtrans.h weight.h charset.h
routines = setlocale findlocale loadlocale localeconv nl_langinfo \
mb_cur_max
mb_cur_max codeset_name
categories = ctype messages monetary numeric time collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name
others = localedef locale

31
locale/codeset_name.c Normal file
View File

@ -0,0 +1,31 @@
/* Internal function to return the name of the current codeset.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <langinfo.h>
#include <locale.h>
#include <stdlib.h>
#include "localeinfo.h"
const char *
__ctype_get_codeset_name (void)
{
return _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME);
}

View File

@ -134,6 +134,7 @@ typedef enum
_NL_CTYPE_MAP_NAMES,
_NL_CTYPE_WIDTH,
_NL_CTYPE_MB_CUR_MAX,
_NL_CTYPE_CODESET_NAME,
_NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities.

View File

@ -27,7 +27,7 @@ Cambridge, MA 02139, USA. */
#include "../intl/loadinfo.h" /* For loaded_l10nfile definition. */
/* Magic number at the beginning of a locale data file for CATEGORY. */
#define LIMAGIC(category) (0x960528de ^ (category))
#define LIMAGIC(category) (0x960617de ^ (category))
/* Two special weight constants for the collation data. */
#define FORWARD_CHAR ((wchar_t) 0xfffffffd)

View File

@ -109,6 +109,7 @@ struct locale_ctype_t
u_int32_t *map_name_ptr;
unsigned char *width;
u_int32_t mb_cur_max;
const char *codeset_name;
};
@ -475,6 +476,9 @@ ctype_output (struct localedef_t *locale, struct charset_t *charset,
CTYPE_DATA (_NL_CTYPE_MB_CUR_MAX,
&ctype->mb_cur_max, sizeof (u_int32_t));
CTYPE_DATA (_NL_CTYPE_CODESET_NAME,
ctype->codeset_name, strlen (ctype->codeset_name) + 1);
default:
assert (! "unknown CTYPE element");
}
@ -1382,4 +1386,9 @@ Computing table size for character classes might take a while..."),
character representation. We compute the number of bytes used
for the UTF-8 encoded form. */
ctype->mb_cur_max = ((int []) { 2, 3, 5, 6 }) [charset->mb_cur_max - 1];
/* We need the name of the currently used 8-bit character set to
make correct conversion between this 8-bit representation and the
ISO 10646 character set used internally for wide characters. */
ctype->codeset_name = charset->code_set_name;
}

View File

@ -963,11 +963,7 @@ write_locale_data (const char *output_path, const char *category,
limitation of the implementation. */
for (cnt = 0; cnt < n_elem; cnt += step)
{
/* XXX Fixme: should be in libc header. */
#ifndef MAX_IOVEC
# define MAX_IOVEC 8
#endif
step = MIN (MAX_IOVEC, n_elem - cnt);
step = MIN (UIO_MAXIOV, n_elem - cnt);
if (writev (fd, &vec[cnt], step) < 0)
{

View File

@ -367,8 +367,8 @@ setlocale (int category, const char *locale)
}
else
{
const struct locale_data *newdata;
char *newname;
const struct locale_data *newdata = NULL;
char *newname = NULL;
if (_nl_current[category] != NULL)
{

View File

@ -66,6 +66,7 @@ distribute += $(long-c-yes:=.c)
install-lib += libieee.a
non-lib.a += libieee.a
extra-objs += libieee.a ieee-math.o
distribute += ieee-math.c
include ../Rules