Skip to content

Commit

Permalink
* locale/categories.def (LC_CTYPE): Merge CLASS_EB and CLASS_EL
Browse files Browse the repository at this point in the history
 	into just CLASS.  Add standard/optional flag to all items.

	* locale/localeinfo.h (_NL_CURRENT_DEFINE): Fix typo.

	* ctype/ctype.h [__BYTE_ORDER == __LITTLE_ENDIAN] (_ISbit):
 	Rearrange defn to satisfy compiler.

	* locale/localeinfo.h: Declare _nl_current.
  • Loading branch information
Roland McGrath committed Mar 10, 1995
1 parent ff3d7ed commit 40deae0
Show file tree
Hide file tree
Showing 11 changed files with 749 additions and 398 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Thu Mar 9 22:29:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>

* locale/categories.def (LC_CTYPE): Merge CLASS_EB and CLASS_EL
into just CLASS. Add standard/optional flag to all items.

* locale/localeinfo.h (_NL_CURRENT_DEFINE): Fix typo.

* ctype/ctype.h [__BYTE_ORDER == __LITTLE_ENDIAN] (_ISbit):
Rearrange defn to satisfy compiler.

* locale/localeinfo.h: Declare _nl_current.

* configure.in: Use AC_CHECK_TOOL for CC, AR, RANLIB. Accept args
--enable-shared, --enable-profile, --enable-omitfp; pass settings
through to config.make.
Expand Down
2 changes: 1 addition & 1 deletion ctype/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ __BEGIN_DECLS
#if __BYTE_ORDER == __BIG_ENDIAN
#define _ISbit(bit) (1 << bit)
#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
#define _ISbit(bit) ((1 << bit) << (bit < 8 ? 8 : -8))
#define _ISbit(bit) (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
#endif

enum
Expand Down
13 changes: 13 additions & 0 deletions locale/C-collate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Generated by GNU locale 0.1.
Copyright (C) 1995 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. */

#include "localeinfo.h"

const struct locale_data _nl_C_LC_COLLATE =
{
NULL, 0, /* no file mapped */
0,
};
874 changes: 597 additions & 277 deletions locale/C-ctype.c

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions locale/C-messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const struct locale_data _nl_C_LC_MESSAGES =
{
NULL, 0, /* no file mapped */
4,
"[yY][[:alpha:]]",
"[nN][[:alpha:]]",
"",
"",
{
"[yY][[:alpha:]]",
"[nN][[:alpha:]]",
"",
""
}
};
32 changes: 17 additions & 15 deletions locale/C-monetary.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ const struct locale_data _nl_C_LC_MONETARY =
{
NULL, 0, /* no file mapped */
15,
"",
"",
"",
"",
"\377",
"",
"",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377",
{
"",
"",
"",
"",
"\377",
"",
"",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377",
"\377"
}
};
8 changes: 5 additions & 3 deletions locale/C-numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const struct locale_data _nl_C_LC_NUMERIC =
{
NULL, 0, /* no file mapped */
3,
".",
"",
"\377",
{
".",
"",
"\377"
}
};
90 changes: 46 additions & 44 deletions locale/C-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,50 @@ const struct locale_data _nl_C_LC_TIME =
{
NULL, 0, /* no file mapped */
44,
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"AM",
"PM",
"%a %b %d %H:%M:%S %Y",
"%m/%d/%y",
"%H:%M:%S",
NULL,
{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"AM",
"PM",
"%a %b %d %H:%M:%S %Y",
"%m/%d/%y",
"%H:%M:%S",
NULL
}
};
101 changes: 50 additions & 51 deletions locale/categories.def
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Cambridge, MA 02139, USA. */
where items itself is an array of entries in the form
{ ID, name, value-type, min, max }
{ ID, name, standard, value-type, min, max }
The usage of the load, check, output functions depends on the individual
program code which loads this file.
The various value types for the items are `string', `stringarray', `byte'
and `bytearray'. These cover all possiblee values in the current locale
and `bytearray'. These cover all possible values in the current locale
definitions. `min' and `max' can be individually used again. */

#ifndef NO_POSTLOAD
Expand All @@ -50,67 +50,66 @@ DEFINE_CATEGORY (LC_COLLATE, "LC_COLLATE",
the functions are important. */
DEFINE_CATEGORY (LC_CTYPE, "LC_CTYPE",
(
{ _NL_CTYPE_CLASS_EB, "ctype-class-eb", string },
{ _NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", string },
{ _NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", string },
{ _NL_CTYPE_CLASS_EL, "ctype-class-el", string },
{ _NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", string },
{ _NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", string },
{ _NL_CTYPE_CLASS, "ctype-class", std, string },
{ _NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string },
{ _NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string },
{ _NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string },
{ _NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string },
{ 0 }
), _nl_postload_ctype,
ctype_input, ctype_check, ctype_output )


DEFINE_CATEGORY (LC_MONETARY, "LC_MONETARY",
(
{ INT_CURR_SYMBOL, "int_curr_symbol", string },
{ CURRENCY_SYMBOL, "currency_symbol", string },
{ MON_DECIMAL_POINT, "mon_decimal_point", string },
{ MON_THOUSANDS_SEP, "mon_thousands_sep", string },
{ MON_GROUPING, "mon_grouping", bytearray },
{ POSITIVE_SIGN, "positive_sign", string },
{ NEGATIVE_SIGN, "negative_sign", string },
{ INT_FRAC_DIGITS, "int_frac_digits", byte },
{ FRAC_DIGITS, "frac_digits", byte },
{ P_CS_PRECEDES, "p_cs_precedes", byte, 0, 1 },
{ P_SEP_BY_SPACE, "p_sep_by_space", byte, 0, 2 },
{ N_CS_PRECEDES, "n_cs_precedes", byte, 0, 1 },
{ N_SEP_BY_SPACE, "n_sep_by_space", byte, 0, 2 },
{ P_SIGN_POSN, "p_sign_posn", byte, 0, 4 },
{ N_SIGN_POSN, "n_sign_posn", byte, 0, 4 },
{ 0 }
), NO_POSTLOAD, NULL, monetary_check, NULL )
(
{ INT_CURR_SYMBOL, "int_curr_symbol", std, string },
{ CURRENCY_SYMBOL, "currency_symbol", std, string },
{ MON_DECIMAL_POINT, "mon_decimal_point", std, string },
{ MON_THOUSANDS_SEP, "mon_thousands_sep", std, string },
{ MON_GROUPING, "mon_grouping", std, bytearray },
{ POSITIVE_SIGN, "positive_sign", std, string },
{ NEGATIVE_SIGN, "negative_sign", std, string },
{ INT_FRAC_DIGITS, "int_frac_digits", std, byte },
{ FRAC_DIGITS, "frac_digits", std, byte },
{ P_CS_PRECEDES, "p_cs_precedes", std, byte, 0, 1 },
{ P_SEP_BY_SPACE, "p_sep_by_space", std, byte, 0, 2 },
{ N_CS_PRECEDES, "n_cs_precedes", std, byte, 0, 1 },
{ N_SEP_BY_SPACE, "n_sep_by_space", std, byte, 0, 2 },
{ P_SIGN_POSN, "p_sign_posn", std, byte, 0, 4 },
{ N_SIGN_POSN, "n_sign_posn", std, byte, 0, 4 },
{ 0 }
), NO_POSTLOAD, NULL, monetary_check, NULL )


DEFINE_CATEGORY (LC_NUMERIC, "LC_NUMERIC",
(
{ DECIMAL_POINT, "decimal_point", string },
{ THOUSANDS_SEP, "thousands_sep", string },
{ GROUPING, "grouping", bytearray },
{ 0 }
), NO_POSTLOAD, NULL, numeric_check, NULL)
(
{ DECIMAL_POINT, "decimal_point", std, string },
{ THOUSANDS_SEP, "thousands_sep", std, string },
{ GROUPING, "grouping", std, bytearray },
{ 0 }
), NO_POSTLOAD, NULL, numeric_check, NULL)


DEFINE_CATEGORY (LC_TIME, "LC_TIME",
(
{ ABDAY_1, "abday", stringarray, 7, 7 },
{ DAY_1, "day", stringarray, 7, 7 },
{ ABMON_1, "abmon", stringarray, 12, 12 },
{ MON_1, "mon", stringarray, 12, 12 },
{ AM_STR, "am_pm", stringarray, 2, 2 },
{ D_T_FMT, "d_t_fmt", string },
{ D_FMT, "d_fmt", string },
{ T_FMT, "t_fmt", string },
{ T_FMT_AMPM, "t_fmt_ampm", string },
{ 0 }
), NO_POSTLOAD, NULL, NULL, NULL )
(
{ ABDAY_1, "abday", std, stringarray, 7, 7 },
{ DAY_1, "day", std, stringarray, 7, 7 },
{ ABMON_1, "abmon", std, stringarray, 12, 12 },
{ MON_1, "mon", std, stringarray, 12, 12 },
{ AM_STR, "am_pm", std, stringarray, 2, 2 },
{ D_T_FMT, "d_t_fmt", std, string },
{ D_FMT, "d_fmt", std, string },
{ T_FMT, "t_fmt", std, string },
{ T_FMT_AMPM, "t_fmt_ampm", std, string },
{ 0 }
), NO_POSTLOAD, NULL, NULL, NULL )


DEFINE_CATEGORY (LC_MESSAGES, "LC_MESSAGES",
(
{ YESEXPR, "yesexpr", string },
{ NOEXPR, "noexpr", string },
{ YESSTR, "yesstr", string },
{ NOSTR, "nostr", string },
{ 0 }
), NO_POSTLOAD, NULL, messages_check, NULL )
(
{ YESEXPR, "yesexpr", std, string },
{ NOEXPR, "noexpr", std, string },
{ YESSTR, "yesstr", opt, string },
{ NOSTR, "nostr", opt, string },
{ 0 }
), NO_POSTLOAD, NULL, messages_check, NULL )
3 changes: 2 additions & 1 deletion locale/localeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extern const struct locale_data *_nl_current_##category;
#undef DEFINE_CATEGORY

extern const char *const _nl_category_names[LC_ALL];
extern const struct locale_data * *const _nl_current[LC_ALL];

/* Extract the current CATEGORY locale's string for ITEM. */
#define _NL_CURRENT(category, item) \
Expand All @@ -53,7 +54,7 @@ extern const char *const _nl_category_names[LC_ALL];
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
#define _NL_CURRENT_DEFINE(category) \
extern const struct locale_data _nl_C_##category; \
const struct locale_data *nl_current_##category = &_nl_C_##category
const struct locale_data *_nl_current_##category = &_nl_C_##category

/* Load the locale data for CATEGORY from the file specified by *NAME.
If *NAME is "", use environment variables as specified by POSIX,
Expand Down
4 changes: 2 additions & 2 deletions manual/stdio.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,8 @@ written by other people could break if you do this.
@node Conversion Specifier Options
@subsection Conversion Specifier Options

If you define a meaning for @samp{%q}, what if the template contains
@samp{%+23q} or @samp{%-#q}? To implement a sensible meaning for these,
If you define a meaning for @samp{%A}, what if the template contains
@samp{%+23A} or @samp{%-#A}? To implement a sensible meaning for these,
the handler when called needs to be able to get the options specified in
the template.

Expand Down

0 comments on commit 40deae0

Please sign in to comment.