+2002-08-04 Ulrich Drepper <drepper@redhat.com>
+
+ * stdio-common/psignal.c: Declare _sys_siglist_internal. Use USEINT
+ to access _sys_siglist.
+ * string/strsignal.c: Likewise.
+ * sysdeps/generic/siglist.c: Add _sys_siglist_internal alias.
+ * sysdeps/gnu/siglist.c: Likewise.
+ * sysdeps/unix/siglist.c: Likewise.
+ * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise.
+
+ * libio/fileops.c: Add missing INTUSEs for _IO_file_jumps.
+
+ * libio/wfileops.c: Add missing INTUSE for _IO_file_close.
+
+ * intl/dcigettext.c: Define _nl_default_dirname_internal as hidden
+ alias and use it.
+ * intl/bindtextdom.c: Use _nl_default_dirname_internal.
+
+ * include/netinet/in.h: Add declaration of in6addr_loopback_internal.
+ * inet/in6_addr.c: Add INTVARDEF for in6addr_loopback.
+ * sysdeps/posix/getaddrinfo.c: Use INTUSE for in6addr_loopback access.
+
+ * include/time.h: Add libc_hidden_proto for __gmtime_r.
+ * time/gmtime.c (__gmtime_r): Add libc_hidden_def.
+
+ * iconv/Versions: Replace __gconv_alias_db, __gconv_modules_db,
+ and __gconv_cache with __gconv_get_alias_db, __gconv_get_modules_db,
+ and __gconv_get_cache respectively.
+ * iconv/gconv_cache.c (gconv_cache): Renamed for __gconv_cache and
+ defined static. Change all users.
+ (__gconv_get_cache): New function.
+ * iconv/gconv_db.c (__gconv_get_modules_db): New function.
+ (__gconv_get_alias_db): New function.
+ * iconv/gconv_int.h (__gconv_alias_db): Declare as hidden.
+ (__conv_modules_db): Likewise.
+ Add prototypes for __gconv_get_cache, __gconv_get_modules_db,
+ and __gconv_get_alias_db.
+ * iconv/iconv_prog.c: Use the new functions instead of accessing the
+ variables.
+
+ * include/stdlib.h: Add prototype and libc_hidden_proto for
+ __default_morecore.
+ * sysdeps/generic/morecore.c: Include <stdlib.h>.
+
+ * malloc/obstack.c: Remove fputs macro.
+
+ * malloc/mtrace.c: Remove fopen macro.
+
2002-08-04 Jakub Jelinek <jakub@redhat.com>
* manual/debug.texi: Fix spelling to programmatically.
iconv_open; iconv; iconv_close;
}
GLIBC_PRIVATE {
- # variables shared with iconv program
- __gconv_alias_db; __gconv_modules_db; __gconv_cache;
+ # functions shared with iconv program
+ __gconv_get_alias_db; __gconv_get_modules_db; __gconv_get_cache;
}
}
/* Cache handling for iconv modules.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
#include "../intl/hash-string.h"
-void *__gconv_cache;
+static void *gconv_cache;
static size_t cache_size;
static int cache_malloced;
+void *
+__gconv_get_cache (void)
+{
+ return gconv_cache;
+}
+
+
int
internal_function
__gconv_load_cache (void)
/* Make the file content available. */
cache_size = st.st_size;
#ifdef _POSIX_MAPPED_FILES
- __gconv_cache = __mmap (NULL, cache_size, PROT_READ, MAP_SHARED, fd, 0);
- if (__builtin_expect (__gconv_cache == MAP_FAILED, 0))
+ gconv_cache = __mmap (NULL, cache_size, PROT_READ, MAP_SHARED, fd, 0);
+ if (__builtin_expect (gconv_cache == MAP_FAILED, 0))
#endif
{
size_t already_read;
- __gconv_cache = malloc (cache_size);
- if (__gconv_cache == NULL)
+ gconv_cache = malloc (cache_size);
+ if (gconv_cache == NULL)
goto close_and_exit;
already_read = 0;
do
{
- ssize_t n = __read (fd, (char *) __gconv_cache + already_read,
+ ssize_t n = __read (fd, (char *) gconv_cache + already_read,
cache_size - already_read);
if (__builtin_expect (n, 0) == -1)
{
- free (__gconv_cache);
- __gconv_cache = NULL;
+ free (gconv_cache);
+ gconv_cache = NULL;
goto close_and_exit;
}
__close (fd);
/* Check the consistency. */
- header = (struct gconvcache_header *) __gconv_cache;
+ header = (struct gconvcache_header *) gconv_cache;
if (__builtin_expect (header->magic, GCONVCACHE_MAGIC) != GCONVCACHE_MAGIC
|| __builtin_expect (header->string_offset >= cache_size, 0)
|| __builtin_expect (header->hash_offset >= cache_size, 0)
{
if (cache_malloced)
{
- free (__gconv_cache);
+ free (gconv_cache);
cache_malloced = 0;
}
#ifdef _POSIX_MAPPED_FILES
else
- __munmap (__gconv_cache, cache_size);
+ __munmap (gconv_cache, cache_size);
#endif
- __gconv_cache = NULL;
+ gconv_cache = NULL;
return -1;
}
const struct hash_entry *hashtab;
unsigned int limit;
- header = (const struct gconvcache_header *) __gconv_cache;
- strtab = (char *) __gconv_cache + header->string_offset;
- hashtab = (struct hash_entry *) ((char *) __gconv_cache
+ header = (const struct gconvcache_header *) gconv_cache;
+ strtab = (char *) gconv_cache + header->string_offset;
+ hashtab = (struct hash_entry *) ((char *) gconv_cache
+ header->hash_offset);
hval = hash_string (str);
size_t name1_idx;
size_t name2_idx;
- if (__gconv_cache == NULL)
+ if (gconv_cache == NULL)
return -1;
if (find_module_idx (name1, &name1_idx) != 0
const struct module_entry *to_module;
struct __gconv_step *result;
- if (__gconv_cache == NULL)
+ if (gconv_cache == NULL)
/* We have no cache available. */
return __GCONV_NODB;
- header = (const struct gconvcache_header *) __gconv_cache;
- strtab = (char *) __gconv_cache + header->string_offset;
- modtab = (const struct module_entry *) ((char *) __gconv_cache
+ header = (const struct gconvcache_header *) gconv_cache;
+ strtab = (char *) gconv_cache + header->string_offset;
+ modtab = (const struct module_entry *) ((char *) gconv_cache
+ header->module_offset);
if (find_module_idx (fromset, &fromidx) != 0
/* Note the -1. This is due to the offset added in iconvconfig.
See there for more explanations. */
- extra = (const struct extra_entry *) ((char *) __gconv_cache
+ extra = (const struct extra_entry *) ((char *) gconv_cache
+ header->otherconv_offset
+ from_module->extra_offset - 1);
while (extra->module_cnt != 0
internal_function
__gconv_release_cache (struct __gconv_step *steps, size_t nsteps)
{
- if (__gconv_cache != NULL)
+ if (gconv_cache != NULL)
/* The only thing we have to deallocate is the record with the
steps. */
free (steps);
free_mem (void)
{
if (cache_malloced)
- free (__gconv_cache);
+ free (gconv_cache);
#ifdef _POSIX_MAPPED_FILES
else
- __munmap (__gconv_cache, cache_size);
+ __munmap (gconv_cache, cache_size);
#endif
}
/* Provide access to the collection of available transformation modules.
- Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1997,98,99,2000,2001,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
__libc_lock_define_initialized (static, lock)
+/* Provide access to module database. */
+struct gconv_module *
+__gconv_get_modules_db (void)
+{
+ return __gconv_modules_db;
+}
+
+void *
+__gconv_get_alias_db (void)
+{
+ return __gconv_alias_db;
+}
+
+
/* Function for searching alias. */
int
__gconv_alias_compare (const void *p1, const void *p2)
/* Global variables. */
/* Database of alias names. */
-extern void *__gconv_alias_db;
+extern void *__gconv_alias_db attribute_hidden;
/* Array with available modules. */
extern size_t __gconv_nmodules;
-extern struct gconv_module *__gconv_modules_db;
+extern struct gconv_module *__gconv_modules_db attribute_hidden;
/* Value of the GCONV_PATH environment variable. */
extern const char *__gconv_path_envvar attribute_hidden;
/* Try to read module cache file. */
extern int __gconv_load_cache (void) internal_function;
+/* Retrieve pointer to internal cache. */
+extern void *__gconv_get_cache (void);
+
+/* Retrieve pointer to internal module database. */
+extern struct gconv_module *__gconv_get_modules_db (void);
+
+/* Retrieve pointer to internal alias database. */
+extern void *__gconv_get_alias_db (void);
+
/* Determine the directories we are looking in. */
extern void __gconv_get_path (void) internal_function;
#define PACKAGE _libc_intl_domainname
-/* Defined in gconv_cache.c. */
-extern void *__gconv_cache;
-
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
const struct hash_entry *hashtab;
size_t cnt;
- header = (const struct gconvcache_header *) __gconv_cache;
- strtab = (char *) __gconv_cache + header->string_offset;
- hashtab = (struct hash_entry *) ((char *) __gconv_cache
- + header->hash_offset);
+ header = (const struct gconvcache_header *) __gconv_get_cache ();
+ strtab = (char *) header + header->string_offset;
+ hashtab = (struct hash_entry *) ((char *) header + header->hash_offset);
for (cnt = 0; cnt < header->hash_size; ++cnt)
if (hashtab[cnt].string_offset != 0)
print_known_names (void)
{
iconv_t h;
+ void *cache;
/* We must initialize the internal databases first. */
h = iconv_open ("L1", "L1");
iconv_close (h);
/* See whether we have a cache. */
- if (__gconv_cache != NULL)
+ cache = __gconv_get_cache ();
+ if (cache != NULL)
/* Yep, use only this information. */
insert_cache ();
else
{
+ struct gconv_module *modules;
+
/* No, then use the information read from the gconv-modules file.
First add the aliases. */
- twalk (__gconv_alias_db, insert_print_list);
+ twalk (__gconv_get_alias_db (), insert_print_list);
/* Add the from- and to-names from the known modules. */
- if (__gconv_modules_db != NULL)
- add_known_names (__gconv_modules_db);
+ modules = __gconv_get_modules_db ();
+ if (modules != NULL)
+ add_known_names (modules);
}
fputs (_("\
#include <inet/netinet/in.h>
extern const struct in6_addr in6addr_any_internal attribute_hidden;
+extern const struct in6_addr in6addr_loopback_internal attribute_hidden;
/* Bind socket to a privileged IP port. */
extern int bindresvport_internal (int __sockfd,
#define __Need_M_And_C
#endif
+#include <stddef.h>
#include <stdlib/stdlib.h>
/* Now define the internal interfaces. */
# endif
#endif
+
+extern void * __default_morecore (ptrdiff_t);
+libc_hidden_proto (__default_morecore)
+
#undef __Need_M_And_C
#endif /* include/stdlib.h */
extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp);
+libc_hidden_proto (__gmtime_r)
/* Compute the `struct tm' representation of *T,
offset OFFSET seconds east of UTC,
INTVARDEF(in6addr_any)
const struct in6_addr in6addr_loopback =
{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
+INTVARDEF(in6addr_loopback)
/* Contains the default location of the message catalogs. */
extern const char _nl_default_dirname[];
+#ifdef _LIBC
+extern const char _nl_default_dirname_internal[] attribute_hidden;
+#else
+# define INTUSE(name) name
+#endif
/* List with bindings of specific domains. */
extern struct binding *_nl_domain_bindings;
char *result = binding->dirname;
if (strcmp (dirname, result) != 0)
{
- if (strcmp (dirname, _nl_default_dirname) == 0)
- result = (char *) _nl_default_dirname;
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ result = (char *) INTUSE(_nl_default_dirname);
else
{
#if defined _LIBC || defined HAVE_STRDUP
if (__builtin_expect (result != NULL, 1))
{
- if (binding->dirname != _nl_default_dirname)
+ if (binding->dirname != INTUSE(_nl_default_dirname))
free (binding->dirname);
binding->dirname = result;
{
/* Simply return the default values. */
if (dirnamep)
- *dirnamep = _nl_default_dirname;
+ *dirnamep = INTUSE(_nl_default_dirname);
if (codesetp)
*codesetp = NULL;
}
if (dirname == NULL)
/* The default value. */
- dirname = _nl_default_dirname;
+ dirname = INTUSE(_nl_default_dirname);
else
{
- if (strcmp (dirname, _nl_default_dirname) == 0)
- dirname = _nl_default_dirname;
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ dirname = INTUSE(_nl_default_dirname);
else
{
char *result;
}
else
/* The default value. */
- new_binding->dirname = (char *) _nl_default_dirname;
+ new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
new_binding->codeset_cntr = 0;
if (0)
{
failed_codeset:
- if (new_binding->dirname != _nl_default_dirname)
+ if (new_binding->dirname != INTUSE(_nl_default_dirname))
free (new_binding->dirname);
failed_dirname:
free (new_binding);
}
#endif
+#ifndef INTVARDEF
+# define INTVARDEF
+#endif
+#ifndef INTUSE
+# define INTUSE(name) name
+#endif
+
/* Name of the default domain used for gettext(3) prior any call to
textdomain(3). The default value for this is "messages". */
const char _nl_default_default_domain[] attribute_hidden = "messages";
/* Contains the default location of the message catalogs. */
const char _nl_default_dirname[] = LOCALEDIR;
+INTVARDEF (_nl_default_dirname)
/* List with bindings of specific domains created by bindtextdomain()
calls. */
}
if (binding == NULL)
- dirname = (char *) _nl_default_dirname;
+ dirname = (char *) INTUSE(_nl_default_dirname);
else if (binding->dirname[0] == '/')
dirname = binding->dirname;
else
{
struct binding *oldp = _nl_domain_bindings;
_nl_domain_bindings = _nl_domain_bindings->next;
- if (oldp->dirname != _nl_default_dirname)
+ if (oldp->dirname != INTUSE(_nl_default_dirname))
/* Yes, this is a pointer comparison. */
free (oldp->dirname);
free (oldp->codeset);
_IO_FILE *result;
/* Change the function table. */
- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
+ _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &INTUSE(_IO_file_jumps);
fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;
/* And perform the normal operation. */
fp->_IO_buf_base = fp->_IO_buf_end = NULL;
_IO_setg (fp, NULL, NULL, NULL);
if (fp->_mode <= 0)
- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
+ _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &INTUSE(_IO_file_jumps);
else
_IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_wfile_jumps;
fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;
/* We couldn't use mmap, so revert to the vanilla file operations. */
if (fp->_mode <= 0)
- _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
+ _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &INTUSE(_IO_file_jumps);
else
_IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_wfile_jumps;
fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;
JUMP_INIT(read, INTUSE(_IO_file_read)),
JUMP_INIT(write, _IO_new_file_write),
JUMP_INIT(seek, INTUSE(_IO_file_seek)),
- JUMP_INIT(close, _IO_file_close),
+ JUMP_INIT(close, INTUSE(_IO_file_close)),
JUMP_INIT(stat, INTUSE(_IO_file_stat)),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
#ifdef _LIBC
# include <libc-internal.h>
-#endif
-#ifdef USE_IN_LIBIO
# include <libio/iolibio.h>
-# define fopen(f, n) _IO_fopen64 (f, n)
# define setvbuf(s, b, f, l) INTUSE(_IO_setvbuf) (s, b, f, l)
# define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
#endif
# define _(Str) (Str)
# endif
# endif
-# if defined _LIBC && defined USE_IN_LIBIO
+# ifdef _LIBC
# include <libio/iolibio.h>
-# define fputs(s, f) _IO_fputs (s, f)
# endif
# ifndef __attribute__
-/* Copyright (C) 1991,1992,1995,1996,1997,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-1997,2001,2002 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
/* Defined in sys_siglist.c. */
extern const char *const _sys_siglist[];
+extern const char *const _sys_siglist_internal[] attribute_hidden;
/* Print out on stderr a line consisting of the test in S, a colon, a space,
else
colon = ": ";
- if (sig >= 0 && sig < NSIG && (desc = _sys_siglist[sig]) != NULL)
+ if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL)
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
-/* Copyright (C) 1991, 1994-2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994-2000, 2001, 2002 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
/* Defined in siglist.c. */
extern const char *const _sys_siglist[];
+extern const char *const _sys_siglist_internal[] attribute_hidden;
static __libc_key_t key;
/* If nonzero the key allocation failed and we should better use a
#ifdef SIGRTMIN
(signum >= SIGRTMIN && signum <= SIGRTMAX) ||
#endif
- signum < 0 || signum >= NSIG || (desc = _sys_siglist[signum]) == NULL)
+ signum < 0 || signum >= NSIG
+ || (desc = INTUSE(_sys_siglist)[signum]) == NULL)
{
char *buffer = getbuffer ();
int len;
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
static char *auth_errmsg (enum auth_stat stat) internal_function;
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
struct proglst_
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
/*
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
#define rpc_buffer(xprt) ((xprt)->xp_p1)
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
static bool_t xdrrec_getlong (XDR *, long *);
#ifdef USE_IN_LIBIO
# include <wchar.h>
# include <libio/iolibio.h>
-# define fputs(s, f) INTUSE(_IO_fputs) (s, f)
#endif
#define LASTUNSIGNED ((u_int)0-1)
-/* Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 97, 2002 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
systems with potentially hostile include files. */
#include <stddef.h>
+#include <stdlib.h>
extern __malloc_ptr_t __sbrk __P ((ptrdiff_t increment));
libc_hidden_proto (__sbrk)
#endif
/* Define list of all signal numbers and their names.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2002 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
#include <siglist.h>
#undef init_sig
};
+strong_alias (_sys_siglist, _sys_siglist_internal)
const char *const _sys_sigabbrev[NSIG] =
/* Define list of all signal numbers and their names.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2002 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
#include <siglist.h>
#undef init_sig
};
+strong_alias (__new_sys_siglist, _sys_siglist_internal)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
asm (".type __old_sys_siglist,@object\n\t.size __old_sys_siglist,"
{
at->family = AF_INET6;
if ((req->ai_flags & AI_PASSIVE) == 0)
- memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
+ memcpy (at->addr, &INTUSE(in6addr_loopback),
+ sizeof (struct in6_addr));
atr = at->next;
}
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2002 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
N_("User defined signal 2"),
NULL
};
+strong_alias (_sys_siglist, _sys_siglist_internal)
weak_alias (_sys_siglist, sys_siglist)
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2002 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
#include "siglist.h"
#undef init_sig
};
+strong_alias (__new_sys_siglist, _sys_siglist_internal)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
asm (".type __old_sys_siglist,%object;.size __old_sys_siglist,"
/* Convert `time_t' to `struct tm' in UTC.
- Copyright (C) 1991, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1991, 93, 95, 96, 97, 98, 2002 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
{
return __tz_convert (t, 0, tp);
}
+libc_hidden_def (__gmtime_r)
weak_alias (__gmtime_r, gmtime_r)