Changeset 609 for branches/GNU/src/binutils/intl
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- Location:
- branches/GNU/src/binutils/intl
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/intl/ChangeLog
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 2002-08-05 Daniel Jacobowitz <drow@mvista.com> 2 3 * Makefile.in (distclean): Remove config.cache, stamp-h, 4 config.status, and config.h. 5 6 2002-01-21 Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at> 7 8 * linux-msg.sed: Comment typo fix. 9 * xopen-msg.sed: Likewise. 10 11 1998-04-29 Ulrich Drepper <drepper@cygnus.com> 12 13 * intl/localealias.c (read_alias_file): Use unsigned char for 14 local variables. Remove unused variable tp. 15 * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char * 16 for type of codeset. For loosing Solaris systems. 17 * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset. 18 * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable 19 len if not needed. 20 Patches by Jim Meyering. 21 22 1998-04-28 Ulrich Drepper <drepper@cygnus.com> 23 24 * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if 25 mmap is not supported. 26 27 * hash-string.h: Don't include <values.h>. 28 29 1998-04-27 Ulrich Drepper <drepper@cygnus.com> 30 31 * textdomain.c: Use strdup is available. 32 33 * localealias.c: Define HAVE_MEMPCPY so that we can use this 34 function. Define and use semapahores to protect modfication of 35 global objects when compiling for glibc. Add code to allow 36 freeing alias table. 37 38 * l10nflist.c: Don't assume stpcpy not being a macro. 39 40 * gettextP.h: Define internal_function macri if not already done. 41 Use glibc byte-swap macros instead of defining SWAP when compiled 42 for glibc. 43 (struct loaded_domain): Add elements to allow unloading. 44 45 * Makefile.in (distclean): Don't remove libintl.h here. 46 47 * bindtextdomain.c: Carry over changes from glibc. Use strdup if 48 available. 49 50 * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal 51 functions. Add memory freeing code for glibc. 52 53 * dgettext.c: Update copyright. 54 55 * explodename.c: Include stdlib.h and string.h only if they exist. 56 Use strings.h eventually. 57 58 * finddomain.c: Mark internal functions. Use strdup if available. 59 Add memory freeing code for glibc. 60 61 1997-10-10 20:00 Ulrich Drepper <drepper@cygnus.com> 62 63 * libgettext.h: Fix dummy textdomain and bindtextdomain macros. 64 They should return reasonable values. 65 Reported by Tom Tromey <tromey@cygnus.com>. 66 67 1997-09-16 03:33 Ulrich Drepper <drepper@cygnus.com> 68 69 * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined. 70 * intlh.inst.in: Likewise. 71 Reported by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>. 72 73 * libintl.glibc: Update from current glibc version. 74 1 75 1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com> 2 76 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/Makefile.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 174 174 distclean: clean 175 175 rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h config.log 176 rm -f config.cache stamp-h config.status config.h 176 177 177 178 maintainer-clean: distclean -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/bindtextdom.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Implementation of the bindtextdomain(3) function 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 62 62 #ifdef _LIBC 63 63 # define BINDTEXTDOMAIN __bindtextdomain 64 # define strdup(str) __strdup (str) 64 # ifndef strdup 65 # define strdup(str) __strdup (str) 66 # endif 65 67 #else 66 68 # define BINDTEXTDOMAIN bindtextdomain__ … … 134 136 { 135 137 /* We have to create a new binding. */ 138 #if !defined _LIBC && !defined HAVE_STRDUP 136 139 size_t len; 140 #endif 137 141 struct binding *new_binding = 138 142 (struct binding *) malloc (sizeof (*new_binding)); -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/dcgettext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Implementation of the dcgettext(3) function 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Implementation of the dcgettext(3) function. 2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 92 92 file and the name space must not be polluted. */ 93 93 # define getcwd __getcwd 94 # define stpcpy __stpcpy 94 # ifndef stpcpy 95 # define stpcpy __stpcpy 96 # endif 95 97 #else 96 98 # if !defined HAVE_GETCWD … … 163 165 /* Prototypes for local functions. */ 164 166 static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file, 165 const char *msgid)) ;166 static const char *category_to_name PARAMS ((int category)) ;167 const char *msgid)) internal_function; 168 static const char *category_to_name PARAMS ((int category)) internal_function; 167 169 static const char *guess_category_value PARAMS ((int category, 168 const char *categoryname)); 170 const char *categoryname)) 171 internal_function; 169 172 170 173 … … 389 392 390 393 static char * 394 internal_function 391 395 find_msg (domain_file, msgid) 392 396 struct loaded_l10nfile *domain_file; … … 477 481 /* Return string representation of locale CATEGORY. */ 478 482 static const char * 483 internal_function 479 484 category_to_name (category) 480 485 int category; … … 536 541 /* Guess value of current locale from value of the environment variables. */ 537 542 static const char * 543 internal_function 538 544 guess_category_value (category, categoryname) 539 545 int category; … … 592 598 } 593 599 #endif 600 601 602 #ifdef _LIBC 603 /* If we want to free all resources we have to do some work at 604 program's end. */ 605 static void __attribute__ ((unused)) 606 free_mem (void) 607 { 608 struct binding *runp; 609 610 for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next) 611 { 612 free (runp->domainname); 613 if (runp->dirname != _nl_default_dirname) 614 /* Yes, this is a pointer comparison. */ 615 free (runp->dirname); 616 } 617 618 if (_nl_current_default_domain != _nl_default_default_domain) 619 /* Yes, again a pointer comparison. */ 620 free ((char *) _nl_current_default_domain); 621 } 622 623 text_set_element (__libc_subfreeres, free_mem); 624 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/dgettext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* dgettext.c -- implementation of the dgettext(3) function2 Copyright (C) 1995 Software Foundation, Inc.1 /* Implementation of the dgettext(3) function 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 3 3 4 This program is free software; you can redistribute it and/or modify5 it under the terms of the GNU General Public License as published by6 the Free Software Foundation; either version 2, or (at your option)7 any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2, or (at your option) 7 any later version. 8 8 9 This program is distributed in the hope that it will be useful,10 but WITHOUT ANY WARRANTY; without even the implied warranty of11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 13 14 You should have received a copy of the GNU General Public License15 along with this program; if not, write to the Free Software 16 Foundation,Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software Foundation, 16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 17 17 18 18 #ifdef HAVE_CONFIG_H -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/explodename.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 2 2 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 3 3 … … 20 20 #endif 21 21 22 #include <stdlib.h> 23 #include <string.h> 22 #if defined STDC_HEADERS || defined _LIBC 23 # include <stdlib.h> 24 #endif 25 26 #if defined HAVE_STRING_H || defined _LIBC 27 # include <string.h> 28 #else 29 # include <strings.h> 30 #endif 24 31 #include <sys/types.h> 25 32 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/finddomain.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Handle list of needed message catalogs 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 … … 71 71 established bindings. */ 72 72 struct loaded_l10nfile * 73 internal_function 73 74 _nl_find_domain (dirname, locale, domainname) 74 75 const char *dirname; … … 96 97 language[_territory][+audience][+special][,[sponsor][_revision]] 97 98 98 Beside the first all of them are allowed to be missing. If the99 full specified locale is not found, the less specific one are100 looked for. The various part will be stripped of according to99 Beside the first part all of them are allowed to be missing. If 100 the full specified locale is not found, the less specific one are 101 looked for. The various parts will be stripped off according to 101 102 the following order: 102 103 (1) revision … … 143 144 if (alias_value != NULL) 144 145 { 146 #if defined _LIBC || defined HAVE_STRDUP 147 locale = strdup (alias_value); 148 if (locale == NULL) 149 return NULL; 150 #else 145 151 size_t len = strlen (alias_value) + 1; 146 152 locale = (char *) malloc (len); … … 149 155 150 156 memcpy (locale, alias_value, len); 157 #endif 151 158 } 152 159 … … 188 195 return retval; 189 196 } 197 198 199 #ifdef _LIBC 200 static void __attribute__ ((unused)) 201 free_mem (void) 202 { 203 struct loaded_l10nfile *runp = _nl_loaded_domains; 204 205 while (runp != NULL) 206 { 207 struct loaded_l10nfile *here = runp; 208 if (runp->data != NULL) 209 _nl_unload_domain ((struct loaded_domain *) runp->data); 210 runp = runp->next; 211 free (here); 212 } 213 } 214 215 text_set_element (__libc_subfreeres, free_mem); 216 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/gettext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Implementation of gettext(3) function 1 /* Implementation of gettext(3) function. 2 2 Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3 3 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/gettext.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Internal header for GNU gettext internationalization functions 1 /* Internal header for GNU gettext internationalization functions. 2 2 Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3 3 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/gettextP.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Header describing internals of gettext library 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 3 4 4 5 This program is free software; you can redistribute it and/or modify … … 31 32 #endif 32 33 34 #ifndef internal_function 35 # define internal_function 36 #endif 37 33 38 #ifndef W 34 39 # define W(flag, data) ((flag) ? SWAP (data) : (data)) … … 36 41 37 42 43 #ifdef _LIBC 44 # include <byteswap.h> 45 # define SWAP(i) bswap_32 (i) 46 #else 38 47 static nls_uint32 SWAP PARAMS ((nls_uint32 i)); 39 48 … … 44 53 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); 45 54 } 55 #endif 46 56 47 57 … … 49 59 { 50 60 const char *data; 61 int use_mmap; 62 size_t mmap_size; 51 63 int must_swap; 52 64 nls_uint32 nstrings; … … 66 78 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, 67 79 char *__locale, 68 const char *__domainname)); 69 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain)); 80 const char *__domainname)) 81 internal_function; 82 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain)) 83 internal_function; 84 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) 85 internal_function; 70 86 71 87 /* @@ begin of epilog @@ */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/hash-string.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 16 16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 17 Boston, MA 02111-1307, USA. */ 18 19 #ifdef HAVE_VALUES_H20 # include <values.h>21 #endif22 18 23 19 /* @@ end of prolog @@ */ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/intlh.inst.in
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 27 27 28 28 #ifndef PARAMS 29 # if __STDC__ 29 # if __STDC__ || defined __cplusplus 30 30 # define PARAMS(args) args 31 31 # else -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/l10nflist.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Handle list of needed message catalogs 2 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 3 Writtenby Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.3 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 66 66 because some ANSI C functions will require linking with this object 67 67 file and the name space must not be polluted. */ 68 # define stpcpy(dest, src) __stpcpy(dest, src) 68 # ifndef stpcpy 69 # define stpcpy(dest, src) __stpcpy(dest, src) 70 # endif 69 71 #else 70 72 # ifndef HAVE_STPCPY … … 353 355 const char * 354 356 _nl_normalize_codeset (codeset, name_len) 355 const char *codeset;357 const unsigned char *codeset; 356 358 size_t name_len; 357 359 { -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/libgettext.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Message catalogs for internationalization. 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 21 21 define _LIBINTL_H and therefore we have to protect the definition here. */ 22 22 23 #if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)24 #if !defined (_LIBINTL_H)23 #if !defined _LIBINTL_H || !defined _LIBGETTEXT_H 24 #ifndef _LIBINTL_H 25 25 # define _LIBINTL_H 1 26 26 #endif … … 45 45 46 46 #ifndef PARAMS 47 # if __STDC__ 47 # if __STDC__ || defined __cplusplus 48 48 # define PARAMS(args) args 49 49 # else … … 169 169 # define dgettext(Domainname, Msgid) (Msgid) 170 170 # define dcgettext(Domainname, Msgid, Category) (Msgid) 171 # define textdomain(Domainname) while (0) /* nothing */172 # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */171 # define textdomain(Domainname) ((char *) Domainname) 172 # define bindtextdomain(Domainname, Dirname) ((char *) Dirname) 173 173 174 174 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/libintl.glibc
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* libgettext.h -- Message catalogs for internationalization. 2 Copyright (C) 1995 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 Contributed by Ulrich Drepper. 5 This file is derived from the file libgettext.h in the GNU gettext package. 1 /* Message catalogs for internationalization. 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 3 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 This file is derived from the file libgettext.h in the GNU gettext package. 6 5 7 The GNU C Library is free software; you can redistribute it and/or 8 modify it under the terms of the GNU Library General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 6 This file is part of the GNU C Library. Its master source is NOT part of 7 the C library, however. 11 8 12 The GNU C Library is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 Library General Public License for more details.9 The GNU C Library is free software; you can redistribute it and/or 10 modify it under the terms of the GNU Library General Public License as 11 published by the Free Software Foundation; either version 2 of the 12 License, or (at your option) any later version. 16 13 17 You should have received a copy of the GNU Library General Public 18 License along with the GNU C Library; see the file COPYING.LIB. If 19 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. */ 14 The GNU C Library is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 Library General Public License for more details. 18 19 You should have received a copy of the GNU Library General Public 20 License along with the GNU C Library; see the file COPYING.LIB. If not, 21 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 Boston, MA 02111-1307, USA. */ 21 23 22 24 #ifndef _LIBINTL_H 23 25 #define _LIBINTL_H 1 26 24 27 #include <features.h> 25 26 #include <locale.h>27 28 #define __need_NULL29 #include <stddef.h>30 28 31 29 /* We define an additional symbol to signal that we use the GNU … … 71 69 72 70 /* Optimized version of the function above. */ 73 #if defined __OPTIMIZED 74 /* These must be a macro. Inlined functions are useless because the 71 #if defined __OPTIMIZE__ 72 73 /* We need NULL for `gettext'. */ 74 # define __need_NULL 75 # include <stddef.h> 76 77 /* We need LC_MESSAGES for `dgettext'. */ 78 # include <locale.h> 79 80 /* These must be macros. Inlined functions are useless because the 75 81 `__builtin_constant_p' predicate in dcgettext would always return 76 82 false. */ … … 82 88 83 89 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) 90 /* Variable defined in loadmsgcat.c which gets incremented every time a 91 new catalog is loaded. */ 92 extern int _nl_msg_cat_cntr; 93 84 94 # define dcgettext(domainname, msgid, category) \ 85 95 (__extension__ \ 86 96 ({ \ 87 char * result; \97 char *__result; \ 88 98 if (__builtin_constant_p (msgid)) \ 89 99 { \ 90 extern int _nl_msg_cat_cntr; \91 100 static char *__translation__; \ 92 101 static int __catalog_counter__; \ … … 97 106 __catalog_counter__ = _nl_msg_cat_cntr; \ 98 107 } \ 99 result = __translation__; \108 __result = __translation__; \ 100 109 } \ 101 110 else \ 102 result = __dcgettext ((domainname), (msgid), (category)); \103 result; \111 __result = __dcgettext ((domainname), (msgid), (category)); \ 112 __result; \ 104 113 })) 105 114 # endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/linux-msg.sed
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 # po2msg.sed - Convert Uniforum style .po file to Linux style .msg file 2 # Copyright (C) 1995Free Software Foundation, Inc.2 # Copyright 1995, 2002 Free Software Foundation, Inc. 3 3 # Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 # … … 69 69 } 70 70 # 71 # The .msg file contains, other th en the .po file, only the translations71 # The .msg file contains, other than the .po file, only the translations 72 72 # but each given a unique ID. Starting from 1 and incrementing by 1 for 73 73 # each message we assign them to the messages. -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/loadinfo.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Copyright (C) 1996, 1997 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software Foundation, 17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 18 1 19 #ifndef PARAMS 2 20 # if __STDC__ … … 33 51 34 52 35 extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,53 extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset, 36 54 size_t name_len)); 37 55 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/loadmsgcat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Load needed message catalogs 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Load needed message catalogs. 2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 45 45 because some ISO C functions will require linking with this object 46 46 file and the name space must not be polluted. */ 47 # define fstat __fstat48 47 # define open __open 49 48 # define close __close … … 62 61 message catalog do nothing. */ 63 62 void 63 internal_function 64 64 _nl_load_domain (domain_file) 65 65 struct loaded_l10nfile *domain_file; 66 66 { 67 67 int fd; 68 size_t size; 68 69 struct stat st; 69 70 struct mo_file_header *data = (struct mo_file_header *) -1; … … 91 92 /* We must know about the size of the file. */ 92 93 if (fstat (fd, &st) != 0 93 && st.st_size < (off_t) sizeof (struct mo_file_header)) 94 || (size = (size_t) st.st_size) != st.st_size 95 || size < sizeof (struct mo_file_header)) 94 96 { 95 97 /* Something went wrong. */ … … 102 104 /* Now we are ready to load the file. If mmap() is available we try 103 105 this first. If not available or it failed we try to load it. */ 104 data = (struct mo_file_header *) mmap (NULL, s t.st_size, PROT_READ,106 data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, 105 107 MAP_PRIVATE, fd, 0); 106 108 … … 117 119 if (data == (struct mo_file_header *) -1) 118 120 { 119 off_t to_read;121 size_t to_read; 120 122 char *read_ptr; 121 123 122 data = (struct mo_file_header *) malloc (s t.st_size);124 data = (struct mo_file_header *) malloc (size); 123 125 if (data == NULL) 124 126 return; 125 127 126 to_read = s t.st_size;128 to_read = size; 127 129 read_ptr = (char *) data; 128 130 do … … 151 153 || defined _LIBC 152 154 if (use_mmap) 153 munmap ((caddr_t) data, s t.st_size);155 munmap ((caddr_t) data, size); 154 156 else 155 157 #endif … … 165 167 domain = (struct loaded_domain *) domain_file->data; 166 168 domain->data = (char *) data; 169 #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ 170 || defined _LIBC 171 domain->use_mmap = use_mmap; 172 #endif 173 domain->mmap_size = size; 167 174 domain->must_swap = data->magic != _MAGIC; 168 175 … … 185 192 || defined _LIBC 186 193 if (use_mmap) 187 munmap ((caddr_t) data, s t.st_size);194 munmap ((caddr_t) data, size); 188 195 else 189 196 #endif … … 198 205 ++_nl_msg_cat_cntr; 199 206 } 207 208 209 #ifdef _LIBC 210 void 211 internal_function 212 _nl_unload_domain (domain) 213 struct loaded_domain *domain; 214 { 215 if (domain->use_mmap) 216 munmap ((caddr_t) domain->data, domain->mmap_size); 217 else 218 free ((void *) domain->data); 219 220 free (domain); 221 } 222 #endif -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/localealias.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Handle aliases for locale names 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Handle aliases for locale names. 2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 … … 80 80 file and the name space must not be polluted. */ 81 81 # define strcasecmp __strcasecmp 82 83 # define mempcpy __mempcpy 84 # define HAVE_MEMPCPY 1 85 86 /* We need locking here since we can be called from different places. */ 87 # include <bits/libc-lock.h> 88 89 __libc_lock_define_initialized (static, lock); 82 90 #endif 83 91 … … 126 134 127 135 136 static char *string_space = NULL; 137 static size_t string_space_act = 0; 138 static size_t string_space_max = 0; 128 139 static struct alias_map *map; 129 140 static size_t nmap = 0; … … 132 143 133 144 /* Prototypes for local functions. */ 134 static size_t read_alias_file PARAMS ((const char *fname, int fname_len)); 145 static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) 146 internal_function; 135 147 static void extend_alias_table PARAMS ((void)); 136 148 static int alias_compare PARAMS ((const struct alias_map *map1, … … 144 156 static const char *locale_alias_path = LOCALE_ALIAS_PATH; 145 157 struct alias_map *retval; 158 const char *result = NULL; 146 159 size_t added; 160 161 #ifdef _LIBC 162 __libc_lock_lock (lock); 163 #endif 147 164 148 165 do … … 163 180 /* We really found an alias. Return the value. */ 164 181 if (retval != NULL) 165 return retval->value; 182 { 183 result = retval->value; 184 break; 185 } 166 186 167 187 /* Perhaps we can find another alias file. */ … … 184 204 while (added != 0); 185 205 186 return NULL; 206 #ifdef _LIBC 207 __libc_lock_unlock (lock); 208 #endif 209 210 return result; 187 211 } 188 212 189 213 190 214 static size_t 215 internal_function 191 216 read_alias_file (fname, fname_len) 192 217 const char *fname; … … 203 228 full_fname = (char *) alloca (fname_len + sizeof aliasfile); 204 229 ADD_BLOCK (block_list, full_fname); 230 #ifdef HAVE_MEMPCPY 231 mempcpy (mempcpy (full_fname, fname, fname_len), 232 aliasfile, sizeof aliasfile); 233 #else 205 234 memcpy (full_fname, fname, fname_len); 206 235 memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); 236 #endif 207 237 208 238 fp = fopen (full_fname, "r"); … … 221 251 be that long 222 252 */ 223 char buf[BUFSIZ];224 char *alias;225 char *value;226 char *cp;227 228 if (fgets (buf, BUFSIZ, fp) == NULL)253 unsigned char buf[BUFSIZ]; 254 unsigned char *alias; 255 unsigned char *value; 256 unsigned char *cp; 257 258 if (fgets (buf, sizeof buf, fp) == NULL) 229 259 /* EOF reached. */ 230 260 break; 261 262 /* Possibly not the whole line fits into the buffer. Ignore 263 the rest of the line. */ 264 if (strchr (buf, '\n') == NULL) 265 { 266 char altbuf[BUFSIZ]; 267 do 268 if (fgets (altbuf, sizeof altbuf, fp) == NULL) 269 /* Make sure the inner loop will be left. The outer loop 270 will exit at the `feof' test. */ 271 break; 272 while (strchr (altbuf, '\n') == NULL); 273 } 231 274 232 275 cp = buf; … … 251 294 if (cp[0] != '\0') 252 295 { 253 char *tp;254 size_t len;296 size_t alias_len; 297 size_t value_len; 255 298 256 299 value = cp++; … … 272 315 extend_alias_table (); 273 316 274 /* We cannot depend on strdup available in the libc. Sigh! */275 len = strlen (alias) + 1;276 tp = (char *) malloc (len); 277 if ( tp == NULL)317 alias_len = strlen (alias) + 1; 318 value_len = strlen (value) + 1; 319 320 if (string_space_act + alias_len + value_len > string_space_max) 278 321 { 279 FREE_BLOCKS (block_list); 280 return added; 322 /* Increase size of memory pool. */ 323 size_t new_size = (string_space_max 324 + (alias_len + value_len > 1024 325 ? alias_len + value_len : 1024)); 326 char *new_pool = (char *) realloc (string_space, new_size); 327 if (new_pool == NULL) 328 { 329 FREE_BLOCKS (block_list); 330 return added; 331 } 332 string_space = new_pool; 333 string_space_max = new_size; 281 334 } 282 memcpy (tp, alias, len); 283 map[nmap].alias = tp; 284 285 len = strlen (value) + 1; 286 tp = (char *) malloc (len); 287 if (tp == NULL) 288 { 289 FREE_BLOCKS (block_list); 290 return added; 291 } 292 memcpy (tp, value, len); 293 map[nmap].value = tp; 335 336 map[nmap].alias = memcpy (&string_space[string_space_act], 337 alias, alias_len); 338 string_space_act += alias_len; 339 340 map[nmap].value = memcpy (&string_space[string_space_act], 341 value, value_len); 342 string_space_act += value_len; 294 343 295 344 ++nmap; … … 297 346 } 298 347 } 299 300 /* Possibly not the whole line fits into the buffer. Ignore301 the rest of the line. */302 while (strchr (cp, '\n') == NULL)303 {304 cp = buf;305 if (fgets (buf, BUFSIZ, fp) == NULL)306 /* Make sure the inner loop will be left. The outer loop307 will exit at the `feof' test. */308 *cp = '\n';309 }310 348 } 311 349 … … 330 368 331 369 new_size = maxmap == 0 ? 100 : 2 * maxmap; 332 new_map = (struct alias_map *) malloc(new_size333 * sizeof (struct alias_map));370 new_map = (struct alias_map *) realloc (map, (new_size 371 * sizeof (struct alias_map))); 334 372 if (new_map == NULL) 335 373 /* Simply don't extend: we don't have any more core. */ 336 374 return; 337 375 338 memcpy (new_map, map, nmap * sizeof (struct alias_map));339 340 if (maxmap != 0)341 free (map);342 343 376 map = new_map; 344 377 maxmap = new_size; 345 378 } 379 380 381 #ifdef _LIBC 382 static void __attribute__ ((unused)) 383 free_mem (void) 384 { 385 if (string_space != NULL) 386 free (string_space); 387 if (map != NULL) 388 free (map); 389 } 390 text_set_element (__libc_subfreeres, free_mem); 391 #endif 346 392 347 393 -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/textdomain.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* Implementation of the textdomain(3) function 2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.1 /* Implementation of the textdomain(3) function. 2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 3 Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 … … 55 55 #ifdef _LIBC 56 56 # define TEXTDOMAIN __textdomain 57 # define strdup(str) __strdup (str) 57 # ifndef strdup 58 # define strdup(str) __strdup (str) 59 # endif 58 60 #else 59 61 # define TEXTDOMAIN textdomain__ -
Property cvs2svn:cvs-rev
changed from
-
branches/GNU/src/binutils/intl/xopen-msg.sed
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 # po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file 2 # Copyright (C) 1995Free Software Foundation, Inc.2 # Copyright 1995, 2002 Free Software Foundation, Inc. 3 3 # Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 4 4 # … … 45 45 } 46 46 # 47 # The .msg file contains, other th en the .po file, only the translations47 # The .msg file contains, other than the .po file, only the translations 48 48 # but each given a unique ID. Starting from 1 and incrementing by 1 for 49 49 # each message we assign them to the messages. -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.