From 70e1c9303a35ca9f957244fd48058ed6206f14e4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 12 Jun 2003 02:04:20 +0000 Subject: Update. * dirent/scandir.c (SCANDIR): Reset errno after calling selector function [PR libc/5045]. --- ChangeLog | 3 + dirent/scandir.c | 72 +++-- localedata/SUPPORTED | 1 + localedata/locales/lo_LA | 782 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 829 insertions(+), 29 deletions(-) create mode 100644 localedata/locales/lo_LA diff --git a/ChangeLog b/ChangeLog index 8cf9c92529..36d854fbd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-06-11 Ulrich Drepper + * dirent/scandir.c (SCANDIR): Reset errno after calling selector + function [PR libc/5045]. + * sysdeps/i386/bits/byteswap.h (__bswap_32): Use bswap instruction also for P4. diff --git a/dirent/scandir.c b/dirent/scandir.c index 9f3cc8424f..748a490739 100644 --- a/dirent/scandir.c +++ b/dirent/scandir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-1998, 2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1992-1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,6 +27,7 @@ #define DIRENT_TYPE struct dirent #endif + int SCANDIR (dir, namelist, select, cmp) const char *dir; @@ -48,34 +49,47 @@ SCANDIR (dir, namelist, select, cmp) i = 0; while ((d = READDIR (dp)) != NULL) - if (select == NULL || (*select) (d)) - { - DIRENT_TYPE *vnew; - size_t dsize; - - /* Ignore errors from select or readdir */ - __set_errno (0); - - if (__builtin_expect (i == vsize, 0)) - { - DIRENT_TYPE **new; - if (vsize == 0) - vsize = 10; - else - vsize *= 2; - new = (DIRENT_TYPE **) realloc (v, vsize * sizeof (*v)); - if (new == NULL) - break; - v = new; - } - - dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d; - vnew = (DIRENT_TYPE *) malloc (dsize); - if (vnew == NULL) - break; - - v[i++] = (DIRENT_TYPE *) memcpy (vnew, d, dsize); - } + { + int use_it = select == NULL; + + if (! use_it) + { + use_it = select (d); + /* The select function might have changed errno. It was + zero before and it need to be again to make the latter + tests work. */ + __set_errno (0); + } + + if (use_it) + { + DIRENT_TYPE *vnew; + size_t dsize; + + /* Ignore errors from select or readdir */ + __set_errno (0); + + if (__builtin_expect (i == vsize, 0)) + { + DIRENT_TYPE **new; + if (vsize == 0) + vsize = 10; + else + vsize *= 2; + new = (DIRENT_TYPE **) realloc (v, vsize * sizeof (*v)); + if (new == NULL) + break; + v = new; + } + + dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d; + vnew = (DIRENT_TYPE *) malloc (dsize); + if (vnew == NULL) + break; + + v[i++] = (DIRENT_TYPE *) memcpy (vnew, d, dsize); + } + } if (__builtin_expect (errno, 0) != 0) { diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED index dfdd76f014..0f81f8c1fb 100644 --- a/localedata/SUPPORTED +++ b/localedata/SUPPORTED @@ -112,6 +112,7 @@ kl_GL/ISO-8859-1 \ ko_KR.EUC-KR/EUC-KR \ ko_KR.UTF-8/UTF-8 \ kw_GB/ISO-8859-1 \ +lo_LA/UTF-8 \ lt_LT/ISO-8859-13 \ lv_LV/ISO-8859-13 \ mi_NZ/ISO-8859-13 \ diff --git a/localedata/locales/lo_LA b/localedata/locales/lo_LA new file mode 100644 index 0000000000..7ebca797f9 --- /dev/null +++ b/localedata/locales/lo_LA @@ -0,0 +1,782 @@ +escape_char / +comment_char % + +% +% Lao Language Locale for Laos +% +% Name: lo_LA +% Author: Anousak Souphavanh +% Contact: +% E-mail: Anousak@muanglao.com +% Language: Lao +% Territory: Laos +% Charset: UTF-8 +% Revision: 1.0 +% Date: 2002-11-10 +% + +% +% Copyright (C) 2002 Anousak Souphavanh + +% +% Permission is hereby granted, free of charge, to any person obtaining +% a copy of this software and associated documentation files (the "Software"), +% to deal in the Software without restriction, including without limitation +% the rights to use, copy, modify, merge, publish, distribute, sublicense, +% and/or sell copies of the Software, and to permit persons to whom the +% Software is furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included +% in all copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +% OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +% ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +% OTHER DEALINGS IN THE SOFTWARE. +% +% +% +% Note: I would like to give a special Thanks to Mr. Pablo Salatxaga @ Mandrake , email "srtxg@chanae.alphanet.ch" +% & Theppitak Karoonboonyanan, email: 'thep@linux.thai.net', all had guided me in the right direction. + +LC_IDENTIFICATION +title "Lao locale for Laos" +source "" +address "" +contact "Anousak Souphavanh at: anousak@muanglao.com" +email "bug-glibc@gnu.org" +tel "" +fax "" +language "Lao" +territory "Laos" +revision "1.0" +date "2003-4-1" +% +category "lo_LA:2000";LC_IDENTIFICATION +category "lo_LA:2000";LC_CTYPE +category "lo_LA:2000";LC_COLLATE +category "lo_LA:2000";LC_TIME +category "lo_LA:2000";LC_NUMERIC +category "lo_LA:2000";LC_MONETARY +category "lo_LA:2000";LC_MESSAGES +category "lo_LA:2000";LC_PAPER +category "lo_LA:2000";LC_NAME +category "lo_LA:2000";LC_ADDRESS +category "lo_LA:2000";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_CTYPE +copy "i18n" +translit_start +include "translit_combining";"" +translit_end +END LC_CTYPE + +LC_COLLATE + +% + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + + +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol + +order_start forward;forward;forward;forward + +% definitions of extra collating symbols + + + + + + +UNDEFINED IGNORE;IGNORE;IGNORE;IGNORE + +% punctuation marks, ordered after ISO/IEC 14651 + IGNORE;IGNORE;;IGNORE % SPACE + IGNORE;IGNORE;;IGNORE % LOW LINE + IGNORE;IGNORE;;IGNORE % HYPHEN-MINUS + IGNORE;IGNORE;;IGNORE % COMMA + IGNORE;IGNORE;;IGNORE % SEMICOLON + IGNORE;IGNORE;;IGNORE % COLON + IGNORE;IGNORE;;IGNORE % EXCLAMATION MARK + IGNORE;IGNORE;;IGNORE % QUESTION MARK + IGNORE;IGNORE;;IGNORE % SOLIDUS + IGNORE;IGNORE;;IGNORE % FULL STOP + IGNORE;IGNORE;;IGNORE % Lao CHARACTER Lao Ellipse + IGNORE;IGNORE;;IGNORE % Lao CHARACTER mAI ko La + IGNORE;IGNORE;;IGNORE % GRAVE ACCENT + IGNORE;IGNORE;;IGNORE % CIRCUMFLEX + IGNORE;IGNORE;;IGNORE % TILDE + IGNORE;IGNORE;;IGNORE % APOSTROPHE + IGNORE;IGNORE;;IGNORE % QUOTATION MARK + IGNORE;IGNORE;;IGNORE % LEFT PAREN. + IGNORE;IGNORE;;IGNORE % LT BRACKET + IGNORE;IGNORE;;IGNORE % LEFT CURLY BRACKET + IGNORE;IGNORE;;IGNORE % RIGHT CURLY BRACKET + IGNORE;IGNORE;;IGNORE % RT BRACKET + IGNORE;IGNORE;;IGNORE % RIGHT PAREN. + IGNORE;IGNORE;;IGNORE % COMMERCIAL AT + IGNORE;IGNORE;;IGNORE % Lao CHARACTER SYMBOL KIP + IGNORE;IGNORE;;IGNORE % DOLLAR SIGN + IGNORE;IGNORE;;IGNORE % ASTERISK + IGNORE;IGNORE;;IGNORE % BACK SOLIDUS + IGNORE;IGNORE;;IGNORE % AMPERSAND + IGNORE;IGNORE;;IGNORE % NUMBER SIGN + IGNORE;IGNORE;;IGNORE % PERCENT + IGNORE;IGNORE;;IGNORE % PLUS + IGNORE;IGNORE;;IGNORE % LESS THAN + IGNORE;IGNORE;;IGNORE % EQUAL + IGNORE;IGNORE;;IGNORE % GREATER THAN + IGNORE;IGNORE;;IGNORE % VERTICAL LINE + +% Lao tone marks and diacritics + + IGNORE;;; % Lao CHARACTER THANTHAKHAT Or Cancellation Mark + IGNORE;;; % Lao CHARACTER MAI EK + IGNORE;;; % Lao CHARACTER MAI THO + IGNORE;;; % Lao CHARACTER MAI TI + IGNORE;;; % Lao CHARACTER MAI CHATTAWA + IGNORE;;; % Lao CHARACTER MAI Kon + IGNORE;;; % Lao CHARACTER MAI Niggahita + + +% Arabic and Lao decimal digits + ;;; % DIGIT ZERO + ;;; % Lao DIGIT ZERO + ;;; % DIGIT ONE + ;;; % Lao DIGIT ONE + ;;; % DIGIT TWO + ;;; % Lao DIGIT TWO + ;;; % DIGIT THREE + ;;; % Lao DIGIT THREE + ;;; % DIGIT FOUR + ;;; % Lao DIGIT FOUR + ;;; % DIGIT FIVE + ;;; % Lao DIGIT FIVE + ;;; % DIGIT SIX + ;;; % Lao DIGIT SIX + ;;; % DIGIT SEVEN + ;;; % Lao DIGIT SEVEN + ;;; % DIGIT EIGHT + ;;; % Lao DIGIT EIGHT + ;;; % DIGIT NINE + ;;; % Lao DIGIT NINE + +% Latin alphabet + ;;; % A + ;;; % a + ;;; % B + ;;; % b + ;;; % C + ;;; % c + ;;; % D + ;;; % d + ;;; % E + ;;; % e + ;;; % F + ;;; % f + ;;; % G + ;;; % g + ;;; % H + ;;; % h + ;;; % I + ;;; % i + ;;; % J + ;;; % j + ;;; % K + ;;; % k + ;;; % L + ;;; % l + ;;; % M + ;;; % m + ;;; % N + ;;; % n + ;;; % O + ;;; % o + ;;; % P + ;;; % p + ;;; % Q + ;;; % q + ;;; % R + ;;; % r + ;;; % S + ;;; % s + ;;; % T + ;;; % t + ;;; % U + ;;; % u + ;;; % V + ;;; % v + ;;; % W + ;;; % w + ;;; % X + ;;; % x + ;;; % Y + ;;; % y + ;;; % Z + ;;; % z + +% +% Lao consonants, with leading vowels rearrangement +% + ;;; % Lao CHARACTER KO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER KHO sung + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER KHO tam + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER NGO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER CHO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER SO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER Nyo + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER DO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER TO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER THO Sung + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER THO Tam + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER NO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER BO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER PO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER PHO sUNG + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER FO tam + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER pho tam + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER fo sung + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER MO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER YO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER RO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER LO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER WO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER SO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER HO + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER O + "";;; + "";;; + "";;; + "";;; + "";;; + + ;;; % Lao CHARACTER HOr + "";;; + "";;; + "";;; + "";;; + "";;; + + + ;;; % Lao CHARACTER NHOr + "";;; + "";;; + "";;; + "";;; + "";;; + + + ;;; % Lao CHARACTER HHOr + "";;; + "";;; + "";;; + "";;; + "";;; + + +% order of Lao vowels + ;;; % Lao CHARACTER SAlA A + ;;; % Lao CHARACTER MAI HAN-AKAT + ;;; % Lao CHARACTER SAlA AA + ;;; % Lao CHARACTER Sala AM + ;;; % Lao CHARACTER Sala I + ;;; % Lao CHARACTER Sala II + ;;; % Lao CHARACTER Sala UE + ;;; % Lao CHARACTER Sala UEE + ;;; % Lao CHARACTER Sala U + ;;; % Lao CHARACTER Sala UU + ;;; % Lao CHARACTER Sala Lo + ;;; % Lao CHARACTER Sala Oy + ;;; % Lao CHARACTER Sala E + ;;; % Lao CHARACTER Sala AE + ;;; % Lao CHARACTER Sala O + ;;; % Lao CHARACTER Sala AI MAIMUAN + ;;; % Lao CHARACTER Sala AI MAIMALAI + +order_end + +END LC_COLLATE + +LC_MONETARY + +int_curr_symbol "" + +% monetary unit: Kip +currency_symbol "" +mon_decimal_point "" +mon_thousands_sep "" +mon_grouping 3;3 +positive_sign "" +negative_sign "" +int_frac_digits 2 +frac_digits 2 +p_cs_precedes 1 +p_sep_by_space 2 +n_cs_precedes 1 +n_sep_by_space 2 +p_sign_posn 4 +n_sign_posn 4 +END LC_MONETARY + + +LC_NUMERIC + +decimal_point "" +thousands_sep "" +grouping 3 + +END LC_NUMERIC + +LC_TIME + +abday "";"";"";/ + "";"";"";/ + "" +day "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +abmon "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +mon "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +% Appropriate date & time representation "%a %e %b %Ey, %H:%M:%S" +d_t_fmt "%a%e%b%Ey%H%M%S" +% Appropriate date representation "%d/%m/%Ey" +d_fmt "%d%m%Ey" +% Appropriate time representation "%H:%M:%S" +t_fmt "%H%M%S" +% AM/PM signs +am_pm "";"" +% Appropriate 12-hour clock representation "%I:%M:%S %p" +t_fmt_ampm "%I%M%S%p" +% Era : Buddhist Era +era "+:1:-5430101:+*::%EC%Ey" +era_d_fmt "%e%b%Ey" +era_t_fmt "%H%M%S" +era_d_t_fmt "%A%e%B%EC%Ey%H%M%S" +% Appropriate date representation (date(1)) "%a %e %b %Ey %H:%M:%S %Z" +date_fmt "/ +/ +" +% ICT-7ICT-7 +timezone "" +END LC_TIME + +LC_MESSAGES + +% yesexpr : begins with "y", "Y", or mo +% noexpr : begins with "n", "N", or Bo +% yesstr = "men" = Sala ae + Mo + MAI EK + No +% nostr = "Bo Men" = Letter Bo +salo Or+ MAI EK + mo+ Ma Ek+ No + +yesexpr "" +noexpr "" +yesstr "" +nostr "" + +END LC_MESSAGES + +LC_PAPER +height 297 +width 210 +END LC_PAPER + +LC_TELEPHONE +tel_int_fmt "/ +" +tel_dom_fmt "" +int_select "" +int_prefix "" +END LC_TELEPHONE + +LC_MEASUREMENT +% FIXME +measurement 1 +END LC_MEASUREMENT + +LC_NAME +name_fmt "/ +" + +name_mr "." +name_mrs "." +END LC_NAME + +LC_ADDRESS +% "%f%N%a%N%d%N%r%t%e%t%b%N%h%t%s%N%T%N%S%N%z%c%N" +postal_fmt "/ +/ +/ +/ +" +country_name "" +%FIXME +%country_post "" +country_ab2 "" +country_ab3 "" +country_num 418 +country_car "" +%FIXME +%country_isbn "" +lang_name "" +lang_ab "" +lang_term "" +lang_lib "" +END LC_ADDRESS + + -- cgit 1.4.1