From 36fe9ac901177d677c7dced4b71e5fcd8c68a32d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 19 Jan 1999 10:11:00 +0000 Subject: Update. 1999-01-19 Ulrich Drepper * math/Makefile (libm-calls): Rename s_nextafterx to s_nexttoward. * math/Versions: Likewise. * math/bits/mathcalls.h: Likewise. * manual/arith.texi: Likewise. * sysdeps/libm-ieee754/s_nextafterl.c: Likewise. * sysdeps/libm-ieee754/s_nextafterx.c: Replaced by... * sysdeps/libm-ieee754/s_nexttoward.c: New file. * sysdeps/libm-ieee754/s_nextafterxf.c: Replaced by... * sysdeps/libm-ieee754/s_nexttowardf.c: New file. * sysdeps/libm-ieee754/s_nextafterxl.c: Replaced by... * sysdeps/libm-ieee754/s_nexttowardl.c: New file. * time/Makefile (routines): Removed strfxtime. * time/Versions: Likewise. * time/strfxtime.c: Removed. * time/time.h: Remove _LOCALTIME, _NO_LEAP_SECONDS, struct tmx, mkxtime, and strfxtime. --- ChangeLog | 20 ++++++++ manual/arith.texi | 6 +-- math/Makefile | 4 +- math/Versions | 2 +- math/bits/mathcalls.h | 4 +- sysdeps/libm-ieee754/s_nextafterl.c | 4 +- sysdeps/libm-ieee754/s_nextafterx.c | 98 ------------------------------------ sysdeps/libm-ieee754/s_nextafterxf.c | 78 ---------------------------- sysdeps/libm-ieee754/s_nextafterxl.c | 1 - sysdeps/libm-ieee754/s_nexttoward.c | 98 ++++++++++++++++++++++++++++++++++++ sysdeps/libm-ieee754/s_nexttowardf.c | 78 ++++++++++++++++++++++++++++ sysdeps/libm-ieee754/s_nexttowardl.c | 1 + time/Makefile | 4 +- time/Versions | 3 -- time/strfxtime.c | 33 ------------ time/time.h | 56 +-------------------- 16 files changed, 210 insertions(+), 280 deletions(-) delete mode 100644 sysdeps/libm-ieee754/s_nextafterx.c delete mode 100644 sysdeps/libm-ieee754/s_nextafterxf.c delete mode 100644 sysdeps/libm-ieee754/s_nextafterxl.c create mode 100644 sysdeps/libm-ieee754/s_nexttoward.c create mode 100644 sysdeps/libm-ieee754/s_nexttowardf.c create mode 100644 sysdeps/libm-ieee754/s_nexttowardl.c delete mode 100644 time/strfxtime.c diff --git a/ChangeLog b/ChangeLog index 7610d57978..8d499a87db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +1999-01-19 Ulrich Drepper + + * math/Makefile (libm-calls): Rename s_nextafterx to s_nexttoward. + * math/Versions: Likewise. + * math/bits/mathcalls.h: Likewise. + * manual/arith.texi: Likewise. + * sysdeps/libm-ieee754/s_nextafterl.c: Likewise. + * sysdeps/libm-ieee754/s_nextafterx.c: Replaced by... + * sysdeps/libm-ieee754/s_nexttoward.c: New file. + * sysdeps/libm-ieee754/s_nextafterxf.c: Replaced by... + * sysdeps/libm-ieee754/s_nexttowardf.c: New file. + * sysdeps/libm-ieee754/s_nextafterxl.c: Replaced by... + * sysdeps/libm-ieee754/s_nexttowardl.c: New file. + + * time/Makefile (routines): Removed strfxtime. + * time/Versions: Likewise. + * time/strfxtime.c: Removed. + * time/time.h: Remove _LOCALTIME, _NO_LEAP_SECONDS, struct tmx, + mkxtime, and strfxtime. + 1999-01-18 Ulrich Drepper * iconv/gconv_conf.c (add_module): Complete rewrite. Use cleverer diff --git a/manual/arith.texi b/manual/arith.texi index b95946a034..3cd298b3f3 100644 --- a/manual/arith.texi +++ b/manual/arith.texi @@ -1329,13 +1329,13 @@ recommended functions in @w{IEEE 754}/@w{IEEE 854}). @comment math.h @comment ISO -@deftypefun {long long int} nextafterx (double @var{x}, long double @var{y}) +@deftypefun double nexttoward (double @var{x}, long double @var{y}) @comment math.h @comment ISO -@deftypefunx {long long int} nextafterxf (float @var{x}, long double @var{y}) +@deftypefunx float nexttowardf (float @var{x}, long double @var{y}) @comment math.h @comment ISO -@deftypefunx {long long int} nextafterxl (long double @var{x}, long double @var{y}) +@deftypefunx {long double} nexttowardl (long double @var{x}, long double @var{y}) These functions are identical to the corresponding versions of @code{nextafter} except that their second argument is a @code{long double}. diff --git a/math/Makefile b/math/Makefile index ffd7524205..56124e73fa 100644 --- a/math/Makefile +++ b/math/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999 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 @@ -46,7 +46,7 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \ k_cos k_rem_pio2 k_sin k_tan s_asinh s_atan s_cbrt \ s_ceil s_copysign s_cos s_erf s_expm1 s_fabs s_finite \ s_floor s_frexp s_ilogb s_ldexp s_log1p s_logb \ - s_modf s_nextafter s_nextafterx s_rint s_scalbn s_scalbln \ + s_modf s_nextafter s_nexttoward s_rint s_scalbn s_scalbln \ s_significand s_sin s_tan s_tanh w_acos w_acosh w_asin \ w_atan2 w_atanh w_cosh w_drem w_exp w_exp2 w_exp10 w_fmod \ w_tgamma w_hypot w_j0 w_j1 w_jn w_lgamma w_lgamma_r \ diff --git a/math/Versions b/math/Versions index 104c7e5a30..8bed0264f7 100644 --- a/math/Versions +++ b/math/Versions @@ -103,7 +103,7 @@ libm { log2; log2f; log2l; nan; nanf; nanl; nearbyint; nearbyintf; nearbyintl; - nextafterx; nextafterxf; nextafterxl; + nexttoward; nexttowardf; nexttowardl; pow10; pow10f; pow10l; remquo; remquof; remquol; lrint; lrintf; lrintl; diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 39979cf437..3f1d5b1223 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -1,5 +1,5 @@ /* Prototype declarations for math functions; helper file for . - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999 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 @@ -253,7 +253,7 @@ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); # ifdef __USE_ISOC9X -__MATHCALLX (nextafterx,, (_Mdouble_ __x, long double __y), (__const__)); +__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ diff --git a/sysdeps/libm-ieee754/s_nextafterl.c b/sysdeps/libm-ieee754/s_nextafterl.c index d7bdf026e7..aea57e3086 100644 --- a/sysdeps/libm-ieee754/s_nextafterl.c +++ b/sysdeps/libm-ieee754/s_nextafterl.c @@ -97,5 +97,5 @@ static char rcsid[] = "$NetBSD: $"; return x; } weak_alias (__nextafterl, nextafterl) -strong_alias (__nextafterl, __nextafterxl) -weak_alias (__nextafterl, nextafterxl) +strong_alias (__nextafterl, __nexttowardl) +weak_alias (__nextafterl, nexttowardl) diff --git a/sysdeps/libm-ieee754/s_nextafterx.c b/sysdeps/libm-ieee754/s_nextafterx.c deleted file mode 100644 index 745ceaf34d..0000000000 --- a/sysdeps/libm-ieee754/s_nextafterx.c +++ /dev/null @@ -1,98 +0,0 @@ -/* s_nextafterx.c - * Conversion freom s_nextafter.c by Ulrich Drepper, Cygnus Support, - * drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* IEEE functions - * nextafterx(x,y) - * return the next machine floating-point number of x in the - * direction toward y. - * Special cases: - */ - -#include "math.h" -#include "math_private.h" - -#ifdef __STDC__ - double __nextafterx(double x, long double y) -#else - double __nextafterx(x,y) - double x; - long double y; -#endif -{ - int32_t hx,ix,iy; - u_int32_t lx,hy,ly,esy; - - EXTRACT_WORDS(hx,lx,x); - GET_LDOUBLE_WORDS(esy,hy,ly,y); - ix = hx&0x7fffffff; /* |x| */ - iy = esy&0x7fff; /* |y| */ - - if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ - ((iy>=0x7fff)&&((hy|ly)|-(hy|ly))!=0)) /* y is nan */ - return x+y; - if((long double) x==y) return x; /* x=y, return x */ - if((ix|lx)==0) { /* x == 0 */ - double x2; - INSERT_WORDS(x,esy&0x8000?0x80000000:0,1);/* return +-minsub */ - x2 = x*x; - if(x2==x) return x2; else return x; /* raise underflow flag */ - } - if(hx>=0) { /* x > 0 */ - if (esy>=0x8000||((ix>>20)&0x7ff)>iy - || (((ix>>20)&0x7ff)==iy - && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) - || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) - && (lx<<11)>ly)))) { /* x > y, x -= ulp */ - if(lx==0) hx -= 1; - lx -= 1; - } else { /* x < y, x += ulp */ - lx += 1; - if(lx==0) hx += 1; - } - } else { /* x < 0 */ - if (esy<0x8000||((ix>>20)&0x7ff)>iy - || (((ix>>20)&0x7ff)==iy - && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) - || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) - && (lx<<11)>ly)))) {/* x < y, x -= ulp */ - if(lx==0) hx -= 1; - lx -= 1; - } else { /* x > y, x += ulp */ - lx += 1; - if(lx==0) hx += 1; - } - } - hy = hx&0x7ff00000; - if(hy>=0x7ff00000) return x+x; /* overflow */ - if(hy<0x00100000) { /* underflow */ - double x2 = x*x; - if(x2!=x) { /* raise underflow flag */ - INSERT_WORDS(x2,hx,lx); - return x2; - } - } - INSERT_WORDS(x,hx,lx); - return x; -} -weak_alias (__nextafterx, nextafterx) -#ifdef NO_LONG_DOUBLE -strong_alias (__nextafterx, __nextafterxl) -weak_alias (__nextafterx, nextafterxl) -#endif diff --git a/sysdeps/libm-ieee754/s_nextafterxf.c b/sysdeps/libm-ieee754/s_nextafterxf.c deleted file mode 100644 index a4726b41b8..0000000000 --- a/sysdeps/libm-ieee754/s_nextafterxf.c +++ /dev/null @@ -1,78 +0,0 @@ -/* s_nextafterxf.c -- float version of s_nextafter.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -#include "math.h" -#include "math_private.h" - -#ifdef __STDC__ - float __nextafterxf(float x, long double y) -#else - float __nextafterxf(x,y) - float x; - long double y; -#endif -{ - int32_t hx,ix,iy; - u_int32_t hy,ly,esy; - - GET_FLOAT_WORD(hx,x); - GET_LDOUBLE_WORDS(esy,hy,ly,y); - ix = hx&0x7fffffff; /* |x| */ - iy = esy&0x7fff; /* |y| */ - - if((ix>0x7f800000) || /* x is nan */ - (iy>=0x7fff&&((hy|ly)|-(hy|ly))!=0)) /* y is nan */ - return x+y; - if((long double) x==y) return y; /* x=y, return y */ - if(ix==0) { /* x == 0 */ - float x2; - SET_FLOAT_WORD(x,(esy&0x8000?0x80000000:0)|1);/* return +-minsub*/ - x2 = x*x; - if(x2==x) return x2; else return x; /* raise underflow flag */ - } - if(hx>=0) { /* x > 0 */ - if(esy>=0x8000||((ix>>23)&0xff)>iy - || (((ix>>23)&0xff)==iy - && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x > y, x -= ulp */ - hx -= 1; - } else { /* x < y, x += ulp */ - hx += 1; - } - } else { /* x < 0 */ - if(esy<0x8000||((ix>>23)&0xff)>iy - || (((ix>>23)&0xff)==iy - && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x < y, x -= ulp */ - hx -= 1; - } else { /* x > y, x += ulp */ - hx += 1; - } - } - hy = hx&0x7f800000; - if(hy>=0x7f800000) return x+x; /* overflow */ - if(hy<0x00800000) { /* underflow */ - float x2 = x*x; - if(x2!=x) { /* raise underflow flag */ - SET_FLOAT_WORD(x2,hx); - return x2; - } - } - SET_FLOAT_WORD(x,hx); - return x; -} -weak_alias (__nextafterxf, nextafterxf) diff --git a/sysdeps/libm-ieee754/s_nextafterxl.c b/sysdeps/libm-ieee754/s_nextafterxl.c deleted file mode 100644 index 73c3610fc1..0000000000 --- a/sysdeps/libm-ieee754/s_nextafterxl.c +++ /dev/null @@ -1 +0,0 @@ -/* This function is the same as nextafterl so we use an alias there. */ diff --git a/sysdeps/libm-ieee754/s_nexttoward.c b/sysdeps/libm-ieee754/s_nexttoward.c new file mode 100644 index 0000000000..0bb57d8465 --- /dev/null +++ b/sysdeps/libm-ieee754/s_nexttoward.c @@ -0,0 +1,98 @@ +/* s_nexttoward.c + * Conversion from s_nextafter.c by Ulrich Drepper, Cygnus Support, + * drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* IEEE functions + * nextafterx(x,y) + * return the next machine floating-point number of x in the + * direction toward y. + * Special cases: + */ + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + double __nexttoward(double x, long double y) +#else + double __nexttoward(x,y) + double x; + long double y; +#endif +{ + int32_t hx,ix,iy; + u_int32_t lx,hy,ly,esy; + + EXTRACT_WORDS(hx,lx,x); + GET_LDOUBLE_WORDS(esy,hy,ly,y); + ix = hx&0x7fffffff; /* |x| */ + iy = esy&0x7fff; /* |y| */ + + if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ + ((iy>=0x7fff)&&((hy|ly)|-(hy|ly))!=0)) /* y is nan */ + return x+y; + if((long double) x==y) return x; /* x=y, return x */ + if((ix|lx)==0) { /* x == 0 */ + double x2; + INSERT_WORDS(x,esy&0x8000?0x80000000:0,1);/* return +-minsub */ + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if (esy>=0x8000||((ix>>20)&0x7ff)>iy + || (((ix>>20)&0x7ff)==iy + && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) + || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) + && (lx<<11)>ly)))) { /* x > y, x -= ulp */ + if(lx==0) hx -= 1; + lx -= 1; + } else { /* x < y, x += ulp */ + lx += 1; + if(lx==0) hx += 1; + } + } else { /* x < 0 */ + if (esy<0x8000||((ix>>20)&0x7ff)>iy + || (((ix>>20)&0x7ff)==iy + && (((hx<<11)|(lx>>21))>(hy&0x7fffffff) + || (((hx<<11)|(lx>>21))==(hy&0x7fffffff) + && (lx<<11)>ly)))) {/* x < y, x -= ulp */ + if(lx==0) hx -= 1; + lx -= 1; + } else { /* x > y, x += ulp */ + lx += 1; + if(lx==0) hx += 1; + } + } + hy = hx&0x7ff00000; + if(hy>=0x7ff00000) return x+x; /* overflow */ + if(hy<0x00100000) { /* underflow */ + double x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + INSERT_WORDS(x2,hx,lx); + return x2; + } + } + INSERT_WORDS(x,hx,lx); + return x; +} +weak_alias (__nexttoward, nexttoward) +#ifdef NO_LONG_DOUBLE +strong_alias (__nexttoward, __nexttowardl) +weak_alias (__nexttoward, nexttowardl) +#endif diff --git a/sysdeps/libm-ieee754/s_nexttowardf.c b/sysdeps/libm-ieee754/s_nexttowardf.c new file mode 100644 index 0000000000..71a28987ec --- /dev/null +++ b/sysdeps/libm-ieee754/s_nexttowardf.c @@ -0,0 +1,78 @@ +/* s_nexttowardf.c -- float version of s_nextafter.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +#include "math.h" +#include "math_private.h" + +#ifdef __STDC__ + float __nexttowardf(float x, long double y) +#else + float __nexttowardf(x,y) + float x; + long double y; +#endif +{ + int32_t hx,ix,iy; + u_int32_t hy,ly,esy; + + GET_FLOAT_WORD(hx,x); + GET_LDOUBLE_WORDS(esy,hy,ly,y); + ix = hx&0x7fffffff; /* |x| */ + iy = esy&0x7fff; /* |y| */ + + if((ix>0x7f800000) || /* x is nan */ + (iy>=0x7fff&&((hy|ly)|-(hy|ly))!=0)) /* y is nan */ + return x+y; + if((long double) x==y) return y; /* x=y, return y */ + if(ix==0) { /* x == 0 */ + float x2; + SET_FLOAT_WORD(x,(esy&0x8000?0x80000000:0)|1);/* return +-minsub*/ + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ + } + if(hx>=0) { /* x > 0 */ + if(esy>=0x8000||((ix>>23)&0xff)>iy + || (((ix>>23)&0xff)==iy + && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x > y, x -= ulp */ + hx -= 1; + } else { /* x < y, x += ulp */ + hx += 1; + } + } else { /* x < 0 */ + if(esy<0x8000||((ix>>23)&0xff)>iy + || (((ix>>23)&0xff)==iy + && ((ix&0x7fffff)<<8)>(hy&0x7fffffff))) {/* x < y, x -= ulp */ + hx -= 1; + } else { /* x > y, x += ulp */ + hx += 1; + } + } + hy = hx&0x7f800000; + if(hy>=0x7f800000) return x+x; /* overflow */ + if(hy<0x00800000) { /* underflow */ + float x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + SET_FLOAT_WORD(x2,hx); + return x2; + } + } + SET_FLOAT_WORD(x,hx); + return x; +} +weak_alias (__nexttowardf, nexttowardf) diff --git a/sysdeps/libm-ieee754/s_nexttowardl.c b/sysdeps/libm-ieee754/s_nexttowardl.c new file mode 100644 index 0000000000..73c3610fc1 --- /dev/null +++ b/sysdeps/libm-ieee754/s_nexttowardl.c @@ -0,0 +1 @@ +/* This function is the same as nextafterl so we use an alias there. */ diff --git a/time/Makefile b/time/Makefile index 7e45eaa8a5..08b783fa30 100644 --- a/time/Makefile +++ b/time/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +# Copyright (C) 1991,92,93,94,95,96,97,98,99 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 @@ -28,7 +28,7 @@ routines := offtime asctime clock ctime ctime_r difftime \ gettimeofday settimeofday adjtime tzset \ tzfile getitimer setitimer \ stime dysize timegm ftime \ - strptime getdate strfxtime + strptime getdate tests := test_time clocktest tst-posixtz tst-strptime diff --git a/time/Versions b/time/Versions index 24039f9630..e117a4acd4 100644 --- a/time/Versions +++ b/time/Versions @@ -45,8 +45,5 @@ libc { # g* getdate; getdate_r; getitimer; - - # s* - strfxtime; } } diff --git a/time/strfxtime.c b/time/strfxtime.c deleted file mode 100644 index eb563ae52e..0000000000 --- a/time/strfxtime.c +++ /dev/null @@ -1,33 +0,0 @@ -/* ISO C extended string formatting. - Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include - -/* The ISO C 9X standard extended the `struct tm' structure to contain some - more information necessary for the new formats. But the struct format - we used so far already contains the information and since the `struct tm' - and `struct tmx' structures match exactly in the first part. So we can - simply use `strftime' to implement `strfxtime'. */ -size_t -strfxtime (char *s, size_t maxsize, const char *format, - const struct tmx *timeptr) -{ - return strftime (s, maxsize, format, (const struct tm *) timeptr); -} diff --git a/time/time.h b/time/time.h index 08b1da244c..234835d812 100644 --- a/time/time.h +++ b/time/time.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,94,95,96,97,98,99 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 @@ -95,14 +95,6 @@ struct timespec #undef __need_timespec -/* Value used for `tm_' field in `struct tmx' if describing the local - time. */ -#define _LOCALTIME (0x7fffffff) - -/* Value used for `tm_leapsecond' field if the number cannot be computed. */ -#define _NO_LEAP_SECONDS (0x7fffffff) - - #ifdef _TIME_H /* Used by other time functions. */ struct tm @@ -126,35 +118,6 @@ struct tm # endif }; -#ifdef __USE_ISOC9X -/* Extended form of `struct tm' defined in ISO C 9X. */ -struct tmx -{ - int tm_sec; /* Seconds. [0-60] (1 leap second) */ - int tm_min; /* Minutes. [0-59] */ - int tm_hour; /* Hours. [0-23] */ - int tm_mday; /* Day. [1-31] */ - int tm_mon; /* Month. [0-11] */ - int tm_year; /* Year - 1900. */ - int tm_wday; /* Day of week. [0-6] */ - int tm_yday; /* Days in year.[0-365] */ - int tm_isdst; /* DST. [-1/0/1]*/ - -# ifdef __USE_BSD - long int tm_gmtoff; /* Seconds east of UTC. */ -# else - long int __tm_gmtoff; /* Seconds east of UTC. */ -# endif - __const char *__tm_zonestr; /* Timezone abbreviation. */ - - int tm_version; /* Version number. */ - int tm_zone; /* Minutes offset from UTC [-1439-1439] */ - int tm_leapsecs; /* Number of leap seconds applied. */ - void *tm_ext; /* Extension block. */ - size_t tm_extlen; /* Size of the extension block. */ -}; -#endif - /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ @@ -170,12 +133,6 @@ extern double difftime __P ((time_t __time1, time_t __time0)) /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime __P ((struct tm *__tp)); -#ifdef __USE_ISOC9X -/* Return the `time_t' representation of TP and normalize TP, taking - account for the extra members in `struct tmx'. */ -extern time_t mkxtime __P ((struct tmx *__tp)); -#endif - /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number @@ -184,17 +141,6 @@ extern size_t strftime __P ((char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp)); -#ifdef __USE_ISOC9X -/* Format TP into S according to FORMAT. - Write no more than MAXSIZE characters and return the number - of characters written, or 0 if it would exceed MAXSIZE. */ -extern size_t strfxtime __P ((char *__restrict __s, size_t __maxsize, - __const char *__restrict __format, - __const struct tmx *__restrict __tp)); - - -#endif - # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ -- cgit v1.2.1