mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Tue Oct 17 01:21:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* stdio-common/psignal.c: Translate signal description strings. * string/strsignal.c: Likewise. * sysdeps/generic/_strerror.c (_strerror_internal): Translate error strings. * sysdeps/mach/_strerror.c: Likewise. * stdio-common/snprintf.c (__snprintf): Renamed from snprintf; call __vsnprintf. (snprintf): Define as weak alias. * stdio/vsnprintf.c (__vsnprintf): Renamed from vsnprintf. (vsnprintf): Define as weak alias. * libc-symbols.h [! ASSEMBLER] (_): New macro.
This commit is contained in:
16
ChangeLog
16
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
Tue Oct 17 01:21:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* stdio-common/psignal.c: Translate signal description strings.
|
||||||
|
* string/strsignal.c: Likewise.
|
||||||
|
* sysdeps/generic/_strerror.c (_strerror_internal): Translate
|
||||||
|
error strings.
|
||||||
|
* sysdeps/mach/_strerror.c: Likewise.
|
||||||
|
|
||||||
|
* stdio-common/snprintf.c (__snprintf): Renamed from snprintf;
|
||||||
|
call __vsnprintf.
|
||||||
|
(snprintf): Define as weak alias.
|
||||||
|
* stdio/vsnprintf.c (__vsnprintf): Renamed from vsnprintf.
|
||||||
|
(vsnprintf): Define as weak alias.
|
||||||
|
|
||||||
Mon Oct 16 03:22:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
Mon Oct 16 03:22:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
* Makerules (install-lib): Filter out %_pic.a; install only the
|
* Makerules (install-lib): Filter out %_pic.a; install only the
|
||||||
@ -5,7 +19,7 @@ Mon Oct 16 03:22:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
|||||||
|
|
||||||
* locale/Makefile (aux): Add SYS_libc.
|
* locale/Makefile (aux): Add SYS_libc.
|
||||||
* locale/SYS_libc.c: New file.
|
* locale/SYS_libc.c: New file.
|
||||||
* libc-symbols.h (_): New macro.
|
* libc-symbols.h [! ASSEMBLER] (_): New macro.
|
||||||
|
|
||||||
* configure.in (libc_cv_asm_set_directive): Link program into
|
* configure.in (libc_cv_asm_set_directive): Link program into
|
||||||
conftest instead of letting it default to a.out.
|
conftest instead of letting it default to a.out.
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -1302,7 +1302,7 @@ extern int glibc_conftest_frobozz;
|
|||||||
main () { printf ("%d\n", glibc_conftest_frobozz); }
|
main () { printf ("%d\n", glibc_conftest_frobozz); }
|
||||||
EOF
|
EOF
|
||||||
if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
|
if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
|
||||||
conftest.s conftest1.c 1>&5 2>&5; then
|
-o conftest conftest.s conftest1.c 1>&5 2>&5; then
|
||||||
libc_cv_asm_set_directive=yes
|
libc_cv_asm_set_directive=yes
|
||||||
else
|
else
|
||||||
libc_cv_asm_set_directive=no
|
libc_cv_asm_set_directive=no
|
||||||
|
@ -48,10 +48,11 @@ Cambridge, MA 02139, USA. */
|
|||||||
#define _LIBC 1
|
#define _LIBC 1
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
Define the macro `_' for conveniently marking translatable strings
|
#ifndef ASSEMBLER
|
||||||
in the libc source code. */
|
/* Define the macro `_' for conveniently marking translatable strings
|
||||||
|
in the libc source code. */
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
extern const char _libc_intl_domainname[];
|
extern const char _libc_intl_domainname[];
|
||||||
#ifdef dgettext
|
#ifdef dgettext
|
||||||
@ -62,6 +63,7 @@ extern const char _libc_intl_domainname[];
|
|||||||
instead of an optimizing macro. */
|
instead of an optimizing macro. */
|
||||||
#define _(msgid) __dgettext (_libc_intl_domainname, (msgid))
|
#define _(msgid) __dgettext (_libc_intl_domainname, (msgid))
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -26,10 +26,8 @@ headers := stdio_lim.h printf.h
|
|||||||
routines := \
|
routines := \
|
||||||
ctermid cuserid \
|
ctermid cuserid \
|
||||||
vfprintf vprintf printf_fp reg-printf printf-prs _itoa \
|
vfprintf vprintf printf_fp reg-printf printf-prs _itoa \
|
||||||
vsnprintf vsprintf vasprintf \
|
fprintf printf snprintf sprintf asprintf dprintf \
|
||||||
fprintf printf snprintf sprintf asprintf \
|
vfscanf vscanf \
|
||||||
dprintf vdprintf \
|
|
||||||
vfscanf vscanf vsscanf \
|
|
||||||
fscanf scanf sscanf \
|
fscanf scanf sscanf \
|
||||||
perror psignal \
|
perror psignal \
|
||||||
tmpfile tmpnam tempnam tempname \
|
tmpfile tmpnam tempnam tempname \
|
||||||
|
@ -27,9 +27,7 @@ Cambridge, MA 02139, USA. */
|
|||||||
allocated with malloc and stored in *STRING_PTR. */
|
allocated with malloc and stored in *STRING_PTR. */
|
||||||
/* VARARGS2 */
|
/* VARARGS2 */
|
||||||
int
|
int
|
||||||
asprintf (string_ptr, format)
|
asprintf (char **string_ptr, const char *format, ...)
|
||||||
char **string_ptr;
|
|
||||||
const char *format;
|
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
int done;
|
int done;
|
||||||
|
@ -26,9 +26,7 @@ Cambridge, MA 02139, USA. */
|
|||||||
/* Write formatted output to D, according to the format string FORMAT. */
|
/* Write formatted output to D, according to the format string FORMAT. */
|
||||||
/* VARARGS2 */
|
/* VARARGS2 */
|
||||||
int
|
int
|
||||||
dprintf (d, format)
|
dprintf (int d, const char *format, ...)
|
||||||
int d;
|
|
||||||
const char *format;
|
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
int done;
|
int done;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -43,7 +43,7 @@ DEFUN(psignal, (sig, s), int sig AND register CONST char *s)
|
|||||||
colon = ": ";
|
colon = ": ";
|
||||||
|
|
||||||
if (sig >= 0 && sig < NSIG)
|
if (sig >= 0 && sig < NSIG)
|
||||||
(void) fprintf(stderr, "%s%s%s\n", s, colon, _sys_siglist[sig]);
|
(void) fprintf (stderr, "%s%s%s\n", s, colon, _(_sys_siglist[sig]));
|
||||||
else
|
else
|
||||||
(void) fprintf(stderr, "%s%sUnknown signal %d\n", s, colon, sig);
|
(void) fprintf (stderr, _("%s%sUnknown signal %d\n"), s, colon, sig);
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ Cambridge, MA 02139, USA. */
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef USE_IN_LIBIO
|
#ifdef USE_IN_LIBIO
|
||||||
# define vsnprintf _IO_vsnprintf
|
# define __vsnprintf _IO_vsnprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Write formatted output into S, according to the format
|
/* Write formatted output into S, according to the format
|
||||||
string FORMAT, writing no more than MAXLEN characters. */
|
string FORMAT, writing no more than MAXLEN characters. */
|
||||||
/* VARARGS3 */
|
/* VARARGS3 */
|
||||||
int
|
int
|
||||||
snprintf (s, maxlen, format)
|
__snprintf (s, maxlen, format)
|
||||||
char *s;
|
char *s;
|
||||||
size_t maxlen;
|
size_t maxlen;
|
||||||
const char *format;
|
const char *format;
|
||||||
@ -36,8 +36,9 @@ snprintf (s, maxlen, format)
|
|||||||
int done;
|
int done;
|
||||||
|
|
||||||
va_start (arg, format);
|
va_start (arg, format);
|
||||||
done = vsnprintf (s, maxlen, format, arg);
|
done = __vsnprintf (s, maxlen, format, arg);
|
||||||
va_end (arg);
|
va_end (arg);
|
||||||
|
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
weak_alias (__snprintf, snprintf)
|
||||||
|
@ -35,6 +35,7 @@ routines := \
|
|||||||
fgets gets fputs puts \
|
fgets gets fputs puts \
|
||||||
getdelim \
|
getdelim \
|
||||||
fclose fflush \
|
fclose fflush \
|
||||||
|
vdprintf vsnprintf vsprintf vasprintf vsscanf \
|
||||||
memstream obstream \
|
memstream obstream \
|
||||||
internals sysd-stdio pipestream stdio_init libc_fatal
|
internals sysd-stdio pipestream stdio_init libc_fatal
|
||||||
aux := defs glue
|
aux := defs glue
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -28,8 +28,7 @@ Cambridge, MA 02139, USA. */
|
|||||||
* than MAXLEN characters.
|
* than MAXLEN characters.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
DEFUN(vsnprintf, (s, maxlen, format, arg),
|
__vsnprintf (char *s, size_t maxlen, const char *format, va_list arg)
|
||||||
char *s AND size_t maxlen AND CONST char *format AND va_list arg)
|
|
||||||
{
|
{
|
||||||
int done;
|
int done;
|
||||||
FILE f;
|
FILE f;
|
||||||
@ -54,3 +53,4 @@ DEFUN(vsnprintf, (s, maxlen, format, arg),
|
|||||||
|
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
weak_alias (__vsnprintf, vsnprintf)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,14 +36,14 @@ DEFUN(strsignal, (signum), int signum)
|
|||||||
{
|
{
|
||||||
if (signum < 0 || signum > NSIG)
|
if (signum < 0 || signum > NSIG)
|
||||||
{
|
{
|
||||||
static char unknown_signal[] = "Unknown signal 000000000000000000";
|
static char buf[512];
|
||||||
static char fmt[] = "Unknown signal%d";
|
static char fmt[] = ;
|
||||||
size_t len = sprintf(unknown_signal, fmt, signum);
|
int len = __snprintf (buf, sizeof buf, _("Unknown signal %d"), signum);
|
||||||
if (len < sizeof(fmt) - 2)
|
if (len < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
unknown_signal[len] = '\0';
|
buf[len - 1] = '\0';
|
||||||
return unknown_signal;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (char *) _sys_siglist[signum];
|
return (char *) _(_sys_siglist[signum]);
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,12 @@ _strerror_internal (errnum, buf, buflen)
|
|||||||
{
|
{
|
||||||
if (errnum < 0 || errnum > _sys_nerr)
|
if (errnum < 0 || errnum > _sys_nerr)
|
||||||
{
|
{
|
||||||
static char fmt[] = "Unknown error %d";
|
int len = __snprintf (buf, buflen, _("Unknown error %d"), errnum);
|
||||||
size_t len = snprintf (buf, buflen, fmt, errnum);
|
if (len < 0)
|
||||||
if (len < sizeof (fmt) - 2)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
buf[len - 1] = '\0';
|
buf[len - 1] = '\0';
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (char *) _sys_errlist[errnum];
|
return (char *) _(_sys_errlist[errnum]);
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,12 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
|
|||||||
|
|
||||||
if (system > err_max_system || ! __mach_error_systems[system].bad_sub)
|
if (system > err_max_system || ! __mach_error_systems[system].bad_sub)
|
||||||
{
|
{
|
||||||
static const char unk[] = "Error in unknown error system: ";
|
const char *unk = _("Error in unknown error system: ");
|
||||||
|
const size_t unklen = strlen (unk);
|
||||||
char *p = buf + buflen;
|
char *p = buf + buflen;
|
||||||
*p-- = '\0';
|
*p-- = '\0';
|
||||||
p = _itoa (errnum, p, 16, 1);
|
p = _itoa (errnum, p, 16, 1);
|
||||||
p -= sizeof unk - 1;
|
return memcpy (p - unklen, unk, unklen);
|
||||||
return memcpy (p, unk, sizeof unk - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
es = &__mach_error_systems[system];
|
es = &__mach_error_systems[system];
|
||||||
@ -55,15 +55,16 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
|
|||||||
|
|
||||||
if (code >= es->subsystem[sub].max_code)
|
if (code >= es->subsystem[sub].max_code)
|
||||||
{
|
{
|
||||||
static const char unk[] = "Unknown error ";
|
const char *unk = _("Unknown error ");
|
||||||
|
const size_t unklen = strlen (unk);
|
||||||
char *p = buf + buflen;
|
char *p = buf + buflen;
|
||||||
size_t len = strlen (es->subsystem[sub].subsys_name);
|
size_t len = strlen (es->subsystem[sub].subsys_name);
|
||||||
*p-- = '\0';
|
*p-- = '\0';
|
||||||
p = _itoa (errnum, p, 16, 1);
|
p = _itoa (errnum, p, 16, 1);
|
||||||
*p-- = ' ';
|
*p-- = ' ';
|
||||||
p = memcpy (p - len, es->subsystem[sub].subsys_name, len);
|
p = memcpy (p - len, es->subsystem[sub].subsys_name, len);
|
||||||
return memcpy (p - sizeof unk - 1, unk, sizeof unk - 1);
|
return memcpy (p - unklen, unk, unklen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (char *) es->subsystem[sub].codes[code];
|
return (char *) _(es->subsystem[sub].codes[code]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user