From 2ad4fab214b13af85237b9e836c525e9ce3e7fb6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 8 Apr 1998 20:27:31 +0000 Subject: [PATCH] Update. 1998-04-08 20:06 Ulrich Drepper * iconv/gconv_conf.c (__gconv_read_conf): Use __realpath not realpath. * iconv/gconv_db.c: Use __ protected regex functions. * iconv/gconv_simple.c: Use __mbsinit not mbsinit. * posix/getopt_init.c: Use __getpid not getpid. * posix/regex.c: Rename all global functions to start with __ and make old names weak aliases. * posix/regex.h: Adopt prototypes for this. * stdlib/canonicalize.c: Define __realpath, make canonicalize_file_name a weak alias and use __getcwd instead of getcwd. * stdlib/stdlib.h: Declare __realpath and __canonicalize_file_name. * stdlib/strtod.c: Use __btowc instead of btowc. * stdlib/strtol.c: Likewise. * sysdeps/libm-ieee754/s_matherr.c: Weaken definition of matherr. * sysdeps/unix/sysv/linux/errlist.c: Make sure definitions of sys_nerr and sys_errlist are weak. * wcsmbs/btowc.c: Define function as __btowc and make btowc weak alias. * wcsmbs/mbrtowc.c: Use __mbsinit not mbsinit. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/mbsinit.c: Define function as __mbsinit and make mbsinit weak alias. * wcsmbs/wchar.h: Declare __btowc and __mbsinit. * wctype/wctype.c: Define function as __wctype and make wctype weak alias. * wctype/wctype.h: Declare __wctype. --- BUGS | 6 ++- ChangeLog | 30 +++++++++++ PROJECTS | 15 +++++- iconv/gconv_conf.c | 2 +- iconv/gconv_db.c | 10 ++-- iconv/gconv_simple.c | 6 +-- posix/getopt_init.c | 4 +- posix/regex.c | 107 ++++++++++++++++++++++++++++++++++++-- posix/regex.h | 24 ++++++++- stdlib/canonicalize.c | 10 ++-- stdlib/stdlib.h | 2 + stdlib/strtod.c | 4 +- stdlib/strtol.c | 2 +- sysdeps/libm-ieee754/s_matherr.c | 10 ++-- sysdeps/unix/sysv/linux/errlist.c | 7 +-- wcsmbs/btowc.c | 3 +- wcsmbs/mbrtowc.c | 2 +- wcsmbs/mbsinit.c | 5 +- wcsmbs/mbsnrtowcs.c | 2 +- wcsmbs/mbsrtowcs.c | 2 +- wcsmbs/wchar.h | 2 + wcsmbs/wcsnrtombs.c | 2 +- wcsmbs/wcsrtombs.c | 2 +- wctype/wctype.c | 5 +- wctype/wctype.h | 1 + 25 files changed, 223 insertions(+), 42 deletions(-) diff --git a/BUGS b/BUGS index ccb6077..3a2e7e5 100644 --- a/BUGS +++ b/BUGS @@ -1,7 +1,7 @@ List of known bugs (certainly very incomplete) ---------------------------------------------- -Time-stamp: <1998-03-03T15:29:53-0800 drepper> +Time-stamp: <1998-04-08T09:29:12-0700 drepper> This following list contains those bugs which I'm aware of. Please make sure that bugs you report are not listed here. If you can fix one @@ -60,6 +60,10 @@ Severity: [ *] to [***] [ *] The libm-ieee `scalb' function gives wrong results for non-integral second parameters. +[ *] The *scanf() functions currently do not handle %l[ and %ls parameters + correctly since the parsing of the multi-byte characters does not + yet use mbsrtowcs(). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ulrich Drepper drepper@cygnus.com diff --git a/ChangeLog b/ChangeLog index 00e3057..5e9115c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +1998-04-08 20:06 Ulrich Drepper + + * iconv/gconv_conf.c (__gconv_read_conf): Use __realpath not realpath. + * iconv/gconv_db.c: Use __ protected regex functions. + * iconv/gconv_simple.c: Use __mbsinit not mbsinit. + * posix/getopt_init.c: Use __getpid not getpid. + * posix/regex.c: Rename all global functions to start with __ and + make old names weak aliases. + * posix/regex.h: Adopt prototypes for this. + * stdlib/canonicalize.c: Define __realpath, make canonicalize_file_name + a weak alias and use __getcwd instead of getcwd. + * stdlib/stdlib.h: Declare __realpath and __canonicalize_file_name. + * stdlib/strtod.c: Use __btowc instead of btowc. + * stdlib/strtol.c: Likewise. + * sysdeps/libm-ieee754/s_matherr.c: Weaken definition of matherr. + * sysdeps/unix/sysv/linux/errlist.c: Make sure definitions of sys_nerr + and sys_errlist are weak. + * wcsmbs/btowc.c: Define function as __btowc and make btowc weak alias. + * wcsmbs/mbrtowc.c: Use __mbsinit not mbsinit. + * wcsmbs/mbsnrtowcs.c: Likewise. + * wcsmbs/mbsrtowcs.c: Likewise. + * wcsmbs/wcsnrtombs.c: Likewise. + * wcsmbs/wcsrtombs.c: Likewise. + * wcsmbs/mbsinit.c: Define function as __mbsinit and make mbsinit + weak alias. + * wcsmbs/wchar.h: Declare __btowc and __mbsinit. + * wctype/wctype.c: Define function as __wctype and make wctype + weak alias. + * wctype/wctype.h: Declare __wctype. + 1998-04-08 Ulrich Drepper * stdio-common/vfscanf.c: Perform test in %l[ handling correctly. diff --git a/PROJECTS b/PROJECTS index b9bd305..f1488d3 100644 --- a/PROJECTS +++ b/PROJECTS @@ -1,6 +1,6 @@ Open jobs for finishing GNU libc: --------------------------------- -Status: March 1998 +Status: April 1998 If you have time and talent to take over any of the jobs below please contact . @@ -50,7 +50,7 @@ contact . - exp2 - each with float, double, and long double arguments. + with long double arguments. Beside this most of the complex math functions which are new in ISO C 9X should be improved. Writing some of them in assembler is @@ -101,3 +101,14 @@ contact . int foo __P ((int, int, int, int)); Blargh! + +[16] The libio stream file functions should be extended in a way to use + mmap to map the file and use it as the buffer to user sees. For + read-only streams this should be rather easy and it avoids all read() + calls. + + A more sophisticated solution would use mmap also for writing. The + standards do not demand that the file on the disk is always in the + correct form so it would be possible to enlarge it always according + to the page size and install the correct length only for fclose() and + fflush() calls. diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index 252096b..c67a0d8 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -404,7 +404,7 @@ __gconv_read_conf (void) #endif char real_elem[MAXPATHLEN]; - if (realpath (elem, real_elem) != NULL) + if (__realpath (elem, real_elem) != NULL) { size_t elem_len = strlen (real_elem); char *filename, *tmp; diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c index b3bdd7a..9f4366b 100644 --- a/iconv/gconv_db.c +++ b/iconv/gconv_db.c @@ -329,8 +329,8 @@ find_derivation (const char *toset, const char *toset_expand, { regex_t *newp = (regex_t *) malloc (sizeof (regex_t)); - if (regcomp (newp, __gconv_modules_db[cnt]->from_pattern, - REG_EXTENDED | REG_ICASE) != 0) + if (__regcomp (newp, __gconv_modules_db[cnt]->from_pattern, + REG_EXTENDED | REG_ICASE) != 0) { /* Something is wrong. Remember this. */ free (newp); @@ -345,8 +345,8 @@ find_derivation (const char *toset, const char *toset_expand, /* Try to match the from name. */ regmatch_t match[4]; - if (regexec (__gconv_modules_db[cnt]->from_regex, - current->result_set, 4, match, 0) == 0 + if (__regexec (__gconv_modules_db[cnt]->from_regex, + current->result_set, 4, match, 0) == 0 && match[0].rm_so == 0 && current->result_set[match[0].rm_eo] == '\0') { @@ -600,7 +600,7 @@ free_mem (void) for (cnt = 0; cnt < __gconv_nmodules; ++cnt) { if (__gconv_modules_db[cnt]->from_regex != NULL) - regfree ((regex_t *) __gconv_modules_db[cnt]->from_regex); + __regfree ((regex_t *) __gconv_modules_db[cnt]->from_regex); /* Modules which names do not start with a slash are builtin transformations and the memory is not allocated dynamically. */ diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index 6fe98a9..aea0e8f 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -586,7 +586,7 @@ __gconv_transform_utf8_ucs4 (struct gconv_step *step, break; } - if (*inlen == 0 && !mbsinit (data->statep)) + if (*inlen == 0 && !__mbsinit (data->statep)) { /* We have an incomplete character at the end. */ result = GCONV_INCOMPLETE_INPUT; @@ -705,7 +705,7 @@ __gconv_transform_ucs2_ucs4 (struct gconv_step *step, break; } - if (*inlen == 0 && !mbsinit (data->statep)) + if (*inlen == 0 && !__mbsinit (data->statep)) { /* We have an incomplete character at the end. */ result = GCONV_INCOMPLETE_INPUT; @@ -837,7 +837,7 @@ __gconv_transform_ucs4_ucs2 (struct gconv_step *step, break; } - if (*inlen == 0 && !mbsinit (data->statep)) + if (*inlen == 0 && !__mbsinit (data->statep)) { /* We have an incomplete character at the end. */ result = GCONV_INCOMPLETE_INPUT; diff --git a/posix/getopt_init.c b/posix/getopt_init.c index 6619f25..d78e30f 100644 --- a/posix/getopt_init.c +++ b/posix/getopt_init.c @@ -1,5 +1,5 @@ /* Perform additional initialization for getopt functions in GNU libc. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -54,7 +54,7 @@ __getopt_clean_environment (char **env) /* Generate name of the environment variable. We must know the PID and we must not use `sprintf'. */ if (__libc_pid == 0xf00baa) - __libc_pid = getpid (); + __libc_pid = __getpid (); /* Construct "__GNU_nonoption_argv_flags_=" string. */ cp = memcpy (&var[sizeof (var) - sizeof (envvar_tail)], envvar_tail, diff --git a/posix/regex.c b/posix/regex.c index 0778bb8..1051cc3 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -51,6 +51,29 @@ #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # include # include + +/* We have to keep the namespace clean. */ +# define regfree(preg) __regfree (preg) +# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) +# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) +# define regerror(errcode, preg, errbuf, errbuf_size) \ + __regerror(errcode, preg, errbuf, errbuf_size) +# define re_set_registers(bu, re, nu, st, en) \ + __re_set_registers (bu, re, nu, st, en) +# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ + __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) +# define re_match(bufp, string, size, pos, regs) \ + __re_match (bufp, string, size, pos, regs) +# define re_search(bufp, string, size, startpos, range, regs) \ + __re_search (bufp, string, size, startpos, range, regs) +# define re_compile_pattern(pattern, length, bufp) \ + __re_compile_pattern (pattern, length, bufp) +# define re_set_syntax(syntax) __re_set_syntax (syntax) +# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ + __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) +# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) + +#define btowc __btowc #endif /* This is for other GNU distributions with internationalized messages. */ @@ -104,8 +127,12 @@ char *realloc (); # ifndef INHIBIT_STRING_HEADER # if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC # include -# if !defined bzero && !defined _LIBC -# define bzero(s, n) (memset (s, '\0', n), (s)) +# ifndef bzero +# ifndef _LIBC +# define bzero(s, n) (memset (s, '\0', n), (s)) +# else +# define bzero(s, n) __bzero (s, n) +# endif # endif # else # include @@ -941,7 +968,13 @@ printchar (c) syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs become read-only after dumping. */ +#ifdef _LIBC +reg_syntax_t __re_syntax_options; +weak_alias (__re_syntax_options, re_syntax_options) +# define re_syntax_options __re_syntax_options +#else reg_syntax_t re_syntax_options; +#endif /* Specify the precise syntax of regexps for compilation. This provides @@ -966,6 +999,9 @@ re_set_syntax (syntax) #endif /* DEBUG */ return ret; } +#ifdef _LIBC +weak_alias (__re_set_syntax, re_set_syntax) +#endif /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. @@ -1053,9 +1089,17 @@ static const char *re_error_msgid[] = # if defined MATCH_MAY_ALLOCATE /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ +# ifdef _LIBC +long int __re_max_failures = 4000; +# else long int re_max_failures = 4000; +# endif # else +# ifdef _LIBC +long int __re_max_failures = 2000; +# else long int re_max_failures = 2000; +# endif # endif union fail_stack_elt @@ -1078,11 +1122,24 @@ typedef struct # if defined MATCH_MAY_ALLOCATE /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ +# ifdef _LIBC +int __re_max_failures = 20000; +# else int re_max_failures = 20000; +# endif # else +# ifdef _LIBC +int __re_max_failures = 2000; +# else int re_max_failures = 2000; +# endif # endif +#ifdef _LIBC +weak_alias (__re_max_failures, re_max_failures) +# define re_max_failures __re_max_failures +#endif + union fail_stack_elt { unsigned char *pointer; @@ -1694,7 +1751,11 @@ typedef struct # define CHAR_CLASS_MAX_LENGTH 256 # endif -# define IS_CHAR_CLASS(string) wctype (string) +# ifdef _LIBC +# define IS_CHAR_CLASS(string) __wctype (string) +# else +# define IS_CHAR_CLASS(string) wctype (string) +# endif #else # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ @@ -2189,7 +2250,7 @@ regex_compile (pattern, size, syntax, bufp) wctype_t wt; int ch; - wt = wctype (str); + wt = IS_CHAR_CLASS (str); if (wt == 0) FREE_STACK_RETURN (REG_ECTYPE); @@ -2201,8 +2262,13 @@ regex_compile (pattern, size, syntax, bufp) for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) { +# ifdef _LIBC + if (__iswctype (__btowc (ch), wt)) + SET_LIST_BIT (ch); +#else if (iswctype (btowc (ch), wt)) SET_LIST_BIT (ch); +#endif if (translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) @@ -3370,6 +3436,9 @@ re_compile_fastmap (bufp) RESET_FAIL_STACK (); return 0; } /* re_compile_fastmap */ +#ifdef _LIBC +weak_alias (__re_compile_fastmap, re_compile_fastmap) +#endif /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use @@ -3405,6 +3474,9 @@ re_set_registers (bufp, regs, num_regs, starts, ends) regs->start = regs->end = (regoff_t *) 0; } } +#ifdef _LIBC +weak_alias (__re_set_registers, re_set_registers) +#endif /* Searching routines. */ @@ -3421,6 +3493,9 @@ re_search (bufp, string, size, startpos, range, regs) return re_search_2 (bufp, NULL, 0, string, size, startpos, range, regs, size); } +#ifdef _LIBC +weak_alias (__re_search, re_search) +#endif /* Using the compiled pattern in BUFP->buffer, first tries to match the @@ -3577,6 +3652,9 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) } return -1; } /* re_search_2 */ +#ifdef _LIBC +weak_alias (__re_search_2, re_search_2) +#endif /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ @@ -3678,6 +3756,9 @@ re_match (bufp, string, size, pos, regs) # endif return result; } +# ifdef _LIBC +weak_alias (__re_match, re_match) +# endif #endif /* not emacs */ static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p, @@ -3723,6 +3804,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) #endif return result; } +#ifdef _LIBC +weak_alias (__re_match_2, re_match_2) +#endif /* This is a separate function so that we can force an alloca cleanup afterwards. */ @@ -5416,6 +5500,9 @@ re_compile_pattern (pattern, length, bufp) return NULL; return gettext (re_error_msgid[(int) ret]); } +#ifdef _LIBC +weak_alias (__re_compile_pattern, re_compile_pattern) +#endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -5586,6 +5673,9 @@ regcomp (preg, pattern, cflags) return (int) ret; } +#ifdef _LIBC +weak_alias (__regcomp, regcomp) +#endif /* regexec searches for a given pattern, specified by PREG, in the @@ -5662,6 +5752,9 @@ regexec (preg, string, nmatch, pmatch, eflags) /* We want zero return to mean success, unlike `re_search'. */ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; } +#ifdef _LIBC +weak_alias (__regexec, regexec) +#endif /* Returns a message corresponding to an error code, ERRCODE, returned @@ -5707,6 +5800,9 @@ regerror (errcode, preg, errbuf, errbuf_size) return msg_size; } +#ifdef _LIBC +weak_alias (__regerror, regerror) +#endif /* Free dynamically allocated space used by PREG. */ @@ -5731,5 +5827,8 @@ regfree (preg) free (preg->translate); preg->translate = NULL; } +#ifdef _LIBC +weak_alias (__regfree, regfree) +#endif #endif /* not emacs */ diff --git a/posix/regex.h b/posix/regex.h index 44f6b55..29e9692 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library, version 0.12. - Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc. + Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. @@ -441,11 +441,15 @@ typedef struct /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the `re_syntax_options' variable. */ +extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ +extern const char *__re_compile_pattern + _RE_ARGS ((const char *pattern, size_t length, + struct re_pattern_buffer *buffer)); extern const char *re_compile_pattern _RE_ARGS ((const char *pattern, size_t length, struct re_pattern_buffer *buffer)); @@ -454,6 +458,7 @@ extern const char *re_compile_pattern /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ +extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); @@ -462,6 +467,9 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ +extern int __re_search + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs)); extern int re_search _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs)); @@ -469,6 +477,10 @@ extern int re_search /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ +extern int __re_search_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, int range, struct re_registers *regs, int stop)); extern int re_search_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, @@ -477,12 +489,19 @@ extern int re_search_2 /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ +extern int __re_match + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs)); extern int re_match _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs)); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ +extern int __re_match_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, struct re_registers *regs, int stop)); extern int re_match_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, @@ -501,6 +520,9 @@ extern int re_match_2 Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ +extern void __re_set_registers + _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends)); extern void re_set_registers _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)); diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index 3617226..ef7311e 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file. - 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. The GNU C Library is free software; you can redistribute it and/or @@ -74,7 +74,7 @@ canonicalize (const char *name, char *resolved) if (name[0] != '/') { - if (!getcwd (rpath, path_max)) + if (!__getcwd (rpath, path_max)) goto error; dest = strchr (rpath, '\0'); } @@ -147,7 +147,7 @@ canonicalize (const char *name, char *resolved) goto error; } - n = readlink (rpath, buf, path_max); + n = __readlink (rpath, buf, path_max); if (n < 0) goto error; buf[n] = '\0'; @@ -191,11 +191,13 @@ error: free (rpath); return NULL; } +strong_alias (canonicalize, __realpath) weak_alias (canonicalize, realpath) char * -canonicalize_file_name (const char *name) +__canonicalize_file_name (const char *name) { return canonicalize (name, NULL); } +weak_alias (__canonicalize_file_name, canonicalize_file_name) diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index bf7b263..757c252 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -573,6 +573,7 @@ extern int system __P ((__const char *__command)); /* Return a malloc'd string containing the canonical absolute name of the named file. The last file name component need not exist, and may be a symlink to a nonexistent file. */ +extern char *__canonicalize_file_name __P ((__const char *__name)); extern char *canonicalize_file_name __P ((__const char *__name)); #endif @@ -583,6 +584,7 @@ extern char *canonicalize_file_name __P ((__const char *__name)); name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ +extern char *__realpath __P ((__const char *__name, char *__resolved)); extern char *realpath __P ((__const char *__name, char *__resolved)); #endif diff --git a/stdlib/strtod.c b/stdlib/strtod.c index 226b16f..ad3bcd1 100644 --- a/stdlib/strtod.c +++ b/stdlib/strtod.c @@ -459,7 +459,7 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM) else { /* Figure out the thousands separator character. */ - thousands = btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); if (thousands == WEOF) thousands = L'\0'; if (thousands == L'\0') @@ -470,7 +470,7 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM) grouping = NULL; /* Find the locale's decimal point character. */ - decimal = btowc (*_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT)); + decimal = __btowc (*_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT)); if (decimal == WEOF) decimal = L'.'; assert (decimal != L'\0'); diff --git a/stdlib/strtol.c b/stdlib/strtol.c index e4e7b4e..c467173 100644 --- a/stdlib/strtol.c +++ b/stdlib/strtol.c @@ -263,7 +263,7 @@ INTERNAL (strtol) (nptr, endptr, base, group LOCALE_PARAM) { /* Figure out the thousands separator character. */ # if defined _LIBC || defined _HAVE_BTOWC - thousands = btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); if (thousands == WEOF) thousands = L'\0'; # endif diff --git a/sysdeps/libm-ieee754/s_matherr.c b/sysdeps/libm-ieee754/s_matherr.c index 94103bc..1ad3eb3 100644 --- a/sysdeps/libm-ieee754/s_matherr.c +++ b/sysdeps/libm-ieee754/s_matherr.c @@ -5,7 +5,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -18,9 +18,13 @@ static char rcsid[] = "$NetBSD: s_matherr.c,v 1.6 1995/05/10 20:47:53 jtc Exp $" #include "math_private.h" #ifdef __STDC__ - int __matherr(struct exception *x) + int + weak_function + __matherr(struct exception *x) #else - int __matherr(x) + int + weak_function + __matherr(x) struct exception *x; #endif { diff --git a/sysdeps/unix/sysv/linux/errlist.c b/sysdeps/unix/sysv/linux/errlist.c index af28a45..4d799b1 100644 --- a/sysdeps/unix/sysv/linux/errlist.c +++ b/sysdeps/unix/sysv/linux/errlist.c @@ -38,16 +38,17 @@ extern const char *const *__old_sys_errlist; const int __old_sys_nerr = OLD_ERRLIST_SIZE; strong_alias (__old_sys_nerr, _old_sys_nerr); +weak_alias (__old_sys_nerr, _old_sys_nerr) symbol_version (__old_sys_nerr, _sys_nerr, GLIBC_2.0); symbol_version (_old_sys_nerr, sys_nerr, GLIBC_2.0); -strong_alias (__old_sys_errlist, _old_sys_errlist); +weak_alias (__old_sys_errlist, _old_sys_errlist); symbol_version (__old_sys_errlist, _sys_errlist, GLIBC_2.0); symbol_version (_old_sys_errlist, sys_errlist, GLIBC_2.0); -strong_alias (__new_sys_nerr, _new_sys_nerr) +weak_alias (__new_sys_nerr, _new_sys_nerr) default_symbol_version (__new_sys_nerr, _sys_nerr, GLIBC_2.1); default_symbol_version (_new_sys_nerr, sys_nerr, GLIBC_2.1); -strong_alias (__new_sys_errlist, _new_sys_errlist) +weak_alias (__new_sys_errlist, _new_sys_errlist) default_symbol_version (__new_sys_errlist, _sys_errlist, GLIBC_2.1); default_symbol_version (_new_sys_errlist, sys_errlist, GLIBC_2.1); diff --git a/wcsmbs/btowc.c b/wcsmbs/btowc.c index b627324..7efe62e 100644 --- a/wcsmbs/btowc.c +++ b/wcsmbs/btowc.c @@ -25,7 +25,7 @@ wint_t -btowc (c) +__btowc (c) int c; { char buf[sizeof (wchar_t)]; @@ -67,3 +67,4 @@ btowc (c) return *(wchar_t *)buf; } +weak_alias (__btowc, btowc) diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 5a52b1d..14ca0b0 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -79,7 +79,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) if (data.outbufavail > 0 && *(wchar_t *)data.outbuf == L'\0') { /* The converted character is the NUL character. */ - assert (mbsinit (data.statep)); + assert (__mbsinit (data.statep)); result = 0; } else diff --git a/wcsmbs/mbsinit.c b/wcsmbs/mbsinit.c index 4c9bde9..727a9bc 100644 --- a/wcsmbs/mbsinit.c +++ b/wcsmbs/mbsinit.c @@ -1,4 +1,4 @@ -/* 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 , 1996. @@ -29,8 +29,9 @@ value collected so far. Especially, we don't have different shift states. */ int -mbsinit (ps) +__mbsinit (ps) const mbstate_t *ps; { return ps == NULL || ps->count == 0; } +weak_alias (__mbsinit, mbsinit) diff --git a/wcsmbs/mbsnrtowcs.c b/wcsmbs/mbsnrtowcs.c index 9787e97..d408b39 100644 --- a/wcsmbs/mbsnrtowcs.c +++ b/wcsmbs/mbsnrtowcs.c @@ -110,7 +110,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps) && ((wchar_t *) dst)[result - 1] == L'\0') { assert (result > 0); - assert (mbsinit (data.statep)); + assert (__mbsinit (data.statep)); *src = NULL; --result; } diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c index 0b5af9b..8f9efb3 100644 --- a/wcsmbs/mbsrtowcs.c +++ b/wcsmbs/mbsrtowcs.c @@ -103,7 +103,7 @@ __mbsrtowcs (dst, src, len, ps) && ((wchar_t *) dst)[result - 1] == L'\0') { assert (result > 0); - assert (mbsinit (data.statep)); + assert (__mbsinit (data.statep)); *src = NULL; --result; } diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index 719de26..48ed81b 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -198,6 +198,7 @@ extern wchar_t *wmemset __P ((wchar_t *__s, wchar_t __c, size_t __n)); /* Determine whether C constitutes a valid (one-byte) multibyte character. */ +extern wint_t __btowc __P ((int __c)); extern wint_t btowc __P ((int __c)); /* Determine whether C corresponds to a member of the extended @@ -206,6 +207,7 @@ extern int wctob __P ((wint_t __c)); /* Determine whether PS points to an object representing the initial state. */ +extern int __mbsinit __P ((__const mbstate_t *__ps)); extern int mbsinit __P ((__const mbstate_t *__ps)); /* Write wide character representation of multibyte character pointed diff --git a/wcsmbs/wcsnrtombs.c b/wcsmbs/wcsnrtombs.c index 02770ce..0daf0e3 100644 --- a/wcsmbs/wcsnrtombs.c +++ b/wcsmbs/wcsnrtombs.c @@ -111,7 +111,7 @@ __wcsnrtombs (dst, src, nwc, len, ps) && dst[data.outbufavail - 1] == '\0') { assert (data.outbufavail > 0); - assert (mbsinit (data.statep)); + assert (__mbsinit (data.statep)); *src = NULL; --result; } diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index 904a003..7b59fc7 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -107,7 +107,7 @@ __wcsrtombs (dst, src, len, ps) && dst[data.outbufavail - 1] == '\0') { assert (data.outbufavail > 0); - assert (mbsinit (data.statep)); + assert (__mbsinit (data.statep)); *src = NULL; --result; } diff --git a/wctype/wctype.c b/wctype/wctype.c index 81b9ac9..6f6338c 100644 --- a/wctype/wctype.c +++ b/wctype/wctype.c @@ -1,4 +1,4 @@ -/* 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 , 1996. @@ -23,7 +23,7 @@ #include wctype_t -wctype (const char *property) +__wctype (const char *property) { const char *names; wctype_t result; @@ -51,3 +51,4 @@ wctype (const char *property) return SWAPU32 (result); #endif } +weak_alias (__wctype, wctype) diff --git a/wctype/wctype.h b/wctype/wctype.h index 2ed0fe1..43ff8e4 100644 --- a/wctype/wctype.h +++ b/wctype/wctype.h @@ -151,6 +151,7 @@ extern int iswxdigit __P ((wint_t __wc)); /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ +extern wctype_t __wctype __P ((__const char *__property)); extern wctype_t wctype __P ((__const char *__property)); /* Determine whether the wide-character WC has the property described by -- 2.7.4