+1998-10-19 13:24 Ulrich Drepper <drepper@cygnus.com>
+
+ * locale/programs/ld-collate.c (collate_startup): Clear bit for this
+ category in copy_posix.
+ (collate_finish): Don't warn about UNDEFINED not being defined.
+ * locale/programs/ld-ctype.c (ctype_startup): Clear bit for this
+ category in copy_posix.
+ * locale/programs/ld-messages.c (messages_startup): Likewise.
+ * locale/programs/ld-monetary.c (monetary_startup): Likewise.
+ * locale/programs/ld-numeric.c (numeric_startup): Likewise.
+ * locale/programs/ld-time.c (time_startup): Likewise.
+ * locale/programs/localedef.c: Move copy_def_list_t definition into
+ locales.h. Define copy_posix variable.
+ (main): Before processing copy list add ©_posix to copy_list.
+ * locale/programs/locales.h: Add definition of copy_def_list_t.
+ * locale/programs/locfile.c: Clear bit for appropriate category in
+ case of an copy instruction.
+
1998-10-19 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/setresgid.c: Remove #include of
#include <assert.h>
#include <gconv.h>
#include <sys/param.h>
-#include <elf/ldsodefs.h>
+#ifndef STATIC_GCONV
+# include <elf/ldsodefs.h>
+#endif
int
internal_function
if (inbuf == NULL || *inbuf == NULL)
/* We just flush. */
+#ifdef _CALL_DL_FCT
result = _CALL_DL_FCT (cd->steps->fct,
(cd->steps, cd->data, NULL, NULL, converted, 1));
+#else
+ result = cd->steps->fct (cd->steps, cd->data, NULL, NULL, converted, 1);
+#endif
else
{
const char *last_start;
do
{
last_start = *inbuf;
+#ifdef _CALL_DL_FCT
result = _CALL_DL_FCT (cd->steps->fct,
(cd->steps, cd->data, inbuf, inbufend,
converted, 0));
+#else
+ result = cd->steps->fct (cd->steps, cd->data, inbuf, inbufend,
+ converted, 0);
+#endif
}
while (result == GCONV_EMPTY_INPUT && last_start != *inbuf
&& *inbuf + cd->steps->min_needed_from <= inbufend);
#include <stdlib.h>
#include <string.h>
#include <bits/libc-lock.h>
-#include <elf/ldsodefs.h>
+
+#ifndef STATIC_GCONV
+# include <elf/ldsodefs.h>
+#endif
#include <gconv_int.h>
for (cnt = 0; cnt < deriv->nsteps; ++cnt)
if (deriv->steps[cnt].end_fct)
+#ifdef _CALL_DL_FCT
_CALL_DL_FCT (deriv->steps[cnt].end_fct, (&deriv->steps[cnt]));
+#else
+ deriv->steps[cnt].end_fct (&deriv->steps[cnt]);
+#endif
free ((struct gconv_step *) deriv->steps);
free (deriv);
/* Call the init function. */
if (result[step_cnt].init_fct != NULL)
+#ifdef _CALL_DL_FCT
_CALL_DL_FCT (result[step_cnt].init_fct, (&result[step_cnt]));
+#else
+ result[step_cnt].init_fct (&result[step_cnt]);
+#endif
current = current->last;
}
while (++step_cnt < *nsteps)
{
if (result[step_cnt].end_fct != NULL)
+#ifdef _CALL_DL_FCT
_CALL_DL_FCT (result[step_cnt].end_fct, (&result[step_cnt]));
+#else
+ result[step_cnt].end_fct (&result[step_cnt]);
+#endif
#ifndef STATIC_GCONV
__gconv_release_shlib (result[step_cnt].shlib_handle);
#endif
{
struct locale_collate_t *collate;
+ /* We have a definition for LC_COLLATE. */
+ copy_posix.mask &= ~(1 << LC_COLLATE);
+
/* It is important that we always use UCS4 encoding for strings now. */
encoding_method = ENC_UCS4;
\**************************************************************/
u_int32_t weight;
- if (!be_quiet)
+ if (/* XXX Remove the 0 & */ 0 && !be_quiet)
error (0, 0, _("no definition of `UNDEFINED'"));
collate->undefined.ordering_len = collate->nrules;
unsigned int cnt;
struct locale_ctype_t *ctype;
+ /* We have a definition for LC_CTYPE. */
+ copy_posix.mask &= ~(1 << LC_CTYPE);
+
/* It is important that we always use UCS1 encoding for strings now. */
encoding_method = ENC_UCS1;
{
struct locale_messages_t *messages;
+ /* We have a definition for LC_MESSAGES. */
+ copy_posix.mask &= ~(1 << LC_MESSAGES);
+
/* It is important that we always use UCS1 encoding for strings now. */
encoding_method = ENC_UCS1;
{
struct locale_monetary_t *monetary;
+ /* We have a definition for LC_MONETARY. */
+ copy_posix.mask &= ~(1 << LC_MONETARY);
+
/* It is important that we always use UCS1 encoding for strings now. */
encoding_method = ENC_UCS1;
/* The international currency symbol must come from ISO 4217. */
if (monetary->int_curr_symbol != NULL)
{
- if (strlen (monetary->int_curr_symbol) != 4)
+ if (strlen (monetary->int_curr_symbol) != 4
+ && monetary->int_curr_symbol[0] != '\0')
{
if (!be_quiet)
error (0, 0, _("\
value of field `int_curr_symbol' in category `LC_MONETARY' has wrong length"));
}
- else if (bsearch (monetary->int_curr_symbol, valid_int_curr,
- NR_VALID_INT_CURR, sizeof (const char *),
- (comparison_fn_t) curr_strcmp) == NULL
+ else if (monetary->int_curr_symbol[0] != '\0'
+ && bsearch (monetary->int_curr_symbol, valid_int_curr,
+ NR_VALID_INT_CURR, sizeof (const char *),
+ (comparison_fn_t) curr_strcmp) == NULL
&& !be_quiet)
error (0, 0, _("\
value of field `int_curr_symbol' in category `LC_MONETARY' does \
lr_error (lr, _("\
field `%s' in category `%s' declared more than once"), \
#cat, "LC_MONETARY"); \
+ else if (code->tok == tok_minus1) \
+ monetary->cat = -1; \
else \
monetary->cat = code->val.num; \
break
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
{
struct locale_numeric_t *numeric;
+ /* We have a definition for LC_NUMERIC. */
+ copy_posix.mask &= ~(1 << LC_NUMERIC);
+
/* It is important that we always use UCS1 encoding for strings now. */
encoding_method = ENC_UCS1;
{
struct locale_time_t *time;
+ /* We have a definition for LC_TIME. */
+ copy_posix.mask &= ~(1 << LC_TIME);
+
/* It is important that we always use UCS1 encoding for strings now. */
encoding_method = ENC_UCS1;
#include "error.h"
#include "charset.h"
#include "locfile.h"
+#include "locales.h"
/* Undefine the following line in the production version. */
/* #define NDEBUG 1 */
#include <assert.h>
-/* List of locale definition files which are used in `copy' instructions. */
-struct copy_def_list_t
+/* This is a special entry of the copylist. For all categories we don't
+ have a definition we use the data for the POSIX locale. */
+struct copy_def_list_t copy_posix =
{
- struct copy_def_list_t *next;
-
- const char *name;
- int mask;
-
- struct localedef_t *locale;
-
- struct
- {
- void *data;
- size_t len;
- } binary[6];
+ next: NULL,
+ name: "POSIX",
+ mask: (1 << LC_ALL) - 1,
+ locale: NULL
};
int remaining;
/* Set initial values for global variables. */
- copy_list = NULL;
posix_conformance = getenv ("POSIXLY_CORRECT") != NULL;
error_print_progname = error_print;
if (localedef->failed != 0)
error (4, errno, _("cannot open locale definition file `%s'"), input_file);
+ /* Make sure all categories are defined. */
+ copy_posix.next = copy_list;
+ copy_list = ©_posix;
+
/* Perhaps we saw some `copy' instructions. Process the given list.
We use a very simple algorithm: we look up the list from the
beginning every time. */
int avail = 0;
if (act_add_locdef->locale == NULL)
- act_add_locdef->locale = locfile_read (act_add_locdef->name,
- charset);
+ {
+ /* Saving the mask is an ugly trick to prevent the reader
+ from modifying `copy_posix' if we currently process it. */
+ int save_mask = act_add_locdef->mask;
+ act_add_locdef->locale = locfile_read (act_add_locdef->name,
+ charset);
+ act_add_locdef->mask = save_mask;
+ }
if (! act_add_locdef->locale->failed)
{
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
#include "localeinfo.h"
+/* List of locale definition files which are used in `copy' instructions. */
+struct copy_def_list_t
+{
+ struct copy_def_list_t *next;
+
+ const char *name;
+ int mask;
+
+ struct localedef_t *locale;
+
+ struct
+ {
+ void *data;
+ size_t len;
+ } binary[6];
+};
+
+extern struct copy_def_list_t copy_posix;
+
+
/* Header of the locale data files. */
struct locale_file
{
#define HANDLE_COPY(category, token, string) \
if (nowtok == tok_copy) \
{ \
+ copy_posix.mask &= ~(1 << category); \
copy_category = category; \
expected_tok = token; \
expected_str = string; \
+1998-10-19 13:31 Ulrich Drepper <drepper@cygnus.com>
+
+ * locales/POSIX: Correct typo. Add UNDEFINED symbol.
+
1998-10-14 Ulrich Drepper <drepper@cygnus.com>
* locales/gr_GR: Renamed to...
# Distribution and use is free, also for
# commercial purposes.
-repertoire_map mnemonic.ds
+repertoiremap mnemonic.ds
LC_CTYPE
# The following is the POSIX Locale LC_CTYPE.
<right-curly-bracket>
<tilde>
<DEL>
+<UNDEFINED>
order_end
#
END LC_COLLATE
/* @r{Copy the name so it won't be clobbered by @code{setlocale}.} */
saved_locale = strdup (old_locale);
- if (old_locale == NULL)
+ if (saved_locale == NULL)
fatal ("Out of memory");
/* @r{Now change the locale and do some stuff with it.} */